Commit 4aa7f548 by 李伟康

commit 提交

1 parent af340573
......@@ -113,15 +113,22 @@ export default {
let { clickFlga } = this
if (clickFlga) return
this.clickFlga = true
if (!auto) uni.showLoading({
mask: true
})
this.selectItem = {
carBrand: e.brandName,
carBrandId: e.brandId,
carChildsBrandName: e.name,
carChildsBrandId: e.id
}
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open()
} else {
if (!auto) uni.showLoading({
mask: true
})
}
uni.$api.commonApi.getCarBrandsList({
brandId: e.brandId,
childBrandId: e.id
......@@ -129,19 +136,16 @@ export default {
uni.hideLoading()
this.carlist = res
uni.setStorageSync(`${e.id}_${e.brandId}_carlist`, res)
if (auto && res.length) this.handleSelect(res[0])
else this.$refs.carBoxVisible.open()
if (!carList) {
if (auto && res.length) this.handleSelect(res[0])
else this.$refs.carBoxVisible.open()
}
this.clickFlga = false
}).catch(err => {
this.clickFlga = false
uni.hideLoading()
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open()
} else this.$refs.carBoxVisible.open()
})
},
handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo,
......
......@@ -130,7 +130,7 @@ export default {
brandId: item.brandId,
childBrandId: item.id
})
uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res)
if (_res) uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res)
}
})
}
......@@ -150,8 +150,8 @@ export default {
async getSoure () {
let { moduleList, toolList } = await uni.$api.systemApi.getMockData(true);
await moduleList.map(async e => {
// if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
// if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList)
if (e.receptionSourceDetailList) e.receptionSourceDetailList = await uni.$api.systemApi.imgToBase64(e.receptionSourceDetailList, 'detailUrl')
if (e.carTypeList) e.carTypeList = await uni.$api.systemApi.imgToBase64(e.carTypeList)
})
this.moduleList = moduleList
this.toolList = toolList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!