Commit af340573 by 李伟康

commit 修改车型离线加载

1 parent 254faa5c
......@@ -140,7 +140,7 @@ export default {
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[0])
else this.$refs.carBoxVisible.open()
}
} else this.$refs.carBoxVisible.open()
})
},
handleSelect (item) {
......
......@@ -124,13 +124,15 @@ export default {
uni.$storage.set('carBrandList', carBrandList)
if (carBrandList.length) {
carBrandList.map(async item => {
const _res = await uni.$api.commonApi.getCarBrandsList({
brandId: item.brandId,
childBrandId: item.id
})
uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, _res)
const carList = uni.getStorageSync(`${item.id}_${item.brandId}_carlist`)
if (!carList) {
const _res = await uni.$api.commonApi.getCarBrandsList({
brandId: item.brandId,
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!