Commit af340573 by 李伟康

commit 修改车型离线加载

1 parent 254faa5c
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
this.carlist = carList this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0]) if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open() else this.$refs.carBoxVisible.open()
} } else this.$refs.carBoxVisible.open()
}) })
}, },
handleSelect (item) { handleSelect (item) {
......
...@@ -124,13 +124,15 @@ export default { ...@@ -124,13 +124,15 @@ export default {
uni.$storage.set('carBrandList', carBrandList) uni.$storage.set('carBrandList', carBrandList)
if (carBrandList.length) { if (carBrandList.length) {
carBrandList.map(async item => { carBrandList.map(async item => {
const _res = await uni.$api.commonApi.getCarBrandsList({ const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
brandId: item.brandId, if (!carList) {
childBrandId: item.id const _res = await uni.$api.commonApi.getCarBrandsList({
}) brandId: item.brandId,
uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res) childBrandId: item.id
})
uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res)
}
}) })
// let [defaultItem] = carBrandList
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!