Commit f216f8c2 by 李伟康

commit 提交

1 parent aa0e9e01
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
show (n) { show (n) {
if (n) { if (n) {
const { phone, shopMerchantId } = uni.$storage.get("userInfo"), const { phone, shopMerchantId } = uni.$storage.get("userInfo"),
insuranceList = uni.getStorageSync(`insurance_list_${shopMerchantId}_${phone}`) insuranceList = uni.getStorageSync(`${shopMerchantId}_${phone}_insurance_list`)
if (insuranceList) this.insuranceList = insuranceList if (insuranceList) this.insuranceList = insuranceList
this.getMerchantInsuranceList() this.getMerchantInsuranceList()
} }
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
setItemDisabled (item, index) { setItemDisabled (item, index) {
const { phone, shopMerchantId } = uni.$storage.get("userInfo") const { phone, shopMerchantId } = uni.$storage.get("userInfo")
this.insuranceList[index].show = !item.show this.insuranceList[index].show = !item.show
uni.setStorageSync(`insurance_list_${shopMerchantId}_${phone}`, this.insuranceList); uni.setStorageSync(`${shopMerchantId}_${phone}_insurance_list`, this.insuranceList);
}, },
/** /**
* 查询门店保险权益 * 查询门店保险权益
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
list = await uni.$api.userApi.getMerchantInsuranceList({ list = await uni.$api.userApi.getMerchantInsuranceList({
merchantId: shopMerchantId, merchantId: shopMerchantId,
}), }),
insuranceList = uni.getStorageSync(`insurance_list_${shopMerchantId}_${phone}`) insuranceList = uni.getStorageSync(`${shopMerchantId}_${phone}_insurance_list`)
list?.map(e => { list?.map(e => {
e.cost = '' e.cost = ''
e.show = true e.show = true
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
}) })
if (!insuranceList) { if (!insuranceList) {
this.insuranceList = list this.insuranceList = list
uni.setStorageSync(`insurance_list_${shopMerchantId}_${phone}`, list || []); uni.setStorageSync(`${shopMerchantId}_${phone}_insurance_list`, list || []);
} }
else { else {
const combinedList = [...insuranceList, ...list] const combinedList = [...insuranceList, ...list]
...@@ -197,7 +197,7 @@ export default { ...@@ -197,7 +197,7 @@ export default {
return acc; return acc;
}, []) }, [])
this.insuranceList = deduplicatedList this.insuranceList = deduplicatedList
uni.setStorageSync(`insurance_list_${shopMerchantId}_${phone}`, deduplicatedList); uni.setStorageSync(`${shopMerchantId}_${phone}_insurance_list`, deduplicatedList);
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)
......
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
this.setAudioInfo({ endReasonType: 1 }); this.setAudioInfo({ endReasonType: 1 });
}, },
getParams() { getParams() {
const { shopMerchantId, phone, sceneType,uuid,name,merchantId } = uni.$storage.get("userInfo"), const { shopMerchantId, phone, sceneType,uuid,name,merchantId,channelType} = uni.$storage.get("userInfo"),
{ customerName, phoneNumber, salesUuid, carModel, staffName } = { customerName, phoneNumber, salesUuid, carModel, staffName } =
this.$store.state.user.customerInfo, this.$store.state.user.customerInfo,
receptionCustomerPaySourceList = this.booksList.map((item) => { receptionCustomerPaySourceList = this.booksList.map((item) => {
...@@ -113,6 +113,7 @@ export default { ...@@ -113,6 +113,7 @@ export default {
receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径 receptionCustomerPaySourceList, //1.付款凭证文件路径 2.客户购车发票文件路径 3.客户延保合同文件路径
merchantId: shopMerchantId, merchantId: shopMerchantId,
bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改 bussinessType: sceneType == 0 ? 1 : 2, // sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
channelType: channelType || 1, //1问界 2 比亚迪 3 其他
}; };
return params; return params;
}, },
......
...@@ -152,22 +152,8 @@ export default { ...@@ -152,22 +152,8 @@ export default {
this.$store.dispatch("setCarBrandsList", carBrandList); this.$store.dispatch("setCarBrandsList", carBrandList);
uni.$storage.set("carBrandList", carBrandList); uni.$storage.set("carBrandList", carBrandList);
if (carBrandList.length) { if (carBrandList.length) {
carBrandList.map(async (item) => { let index = 0
const carList = uni.getStorageSync( this.getCarBrandsList(carBrandList, index)
`${item.id}_${item.brandId}_carlist`
);
if (!carList) {
const _res = await uni.$api.commonApi.getCarBrandsList({
brandId: item.brandId,
childBrandId: item.id,
});
if (_res)
uni.setStorageSync(
`${item.id}_${item.brandId}_carlist`,
_res
);
}
});
} }
}); });
}, },
...@@ -319,6 +305,24 @@ export default { ...@@ -319,6 +305,24 @@ export default {
if (index == 0) this.init(); if (index == 0) this.init();
}, },
/**按序加载车型 */
async getCarBrandsList (carBrandList, index) {
const item = carBrandList[index]
const carList = uni.getStorageSync(
`${item.id}_${item.brandId}_carlist`
);
if (index < carBrandList.length - 1) {
index += 1
if (!carList) {
const list = await uni.$api.commonApi.getCarBrandsList({
brandId: item.brandId,
childBrandId: item.id,
});
if (list) uni.setStorageSync(`${item.id}_${item.brandId}_carlist`, list);
this.getCarBrandsList(carBrandList, ++index)
} else this.getCarBrandsList(carBrandList, ++index)
}
}
}, },
}; };
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!