Commit 4aa7f548 by 李伟康

commit 提交

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