Commit 5b4a9e71 by 李伟康

commit 兼容

1 parent e18b699f
......@@ -93,17 +93,20 @@ export default {
},
boutiqueDefaultCarBrandId () {
return this.$store.state.user.boutiqueDefaultCarBrandId
},
defaultCarId () {
return this.$store.state.user.defaultCarId || ''
}
},
mounted () {
},
methods: {
autoSelect () {
const { carBrandList, boutiqueDefaultCarBrandId } = this
const { carBrandList, boutiqueDefaultCarBrandId, defaultCarId } = this
let carIndex = 0
if (boutiqueDefaultCarBrandId) carIndex = carBrandList.findIndex(e => e.id == boutiqueDefaultCarBrandId)
if (carIndex < 0) carIndex = 0
if (carBrandList.length) this.selectCar(carBrandList[carIndex], true)
if (carBrandList.length) this.selectCar(carBrandList[carIndex], true, defaultCarId)
},
open () {
const userInfo = uni.$storage.get("userInfo"),
......
......@@ -69,11 +69,11 @@
<template v-else>
<image
class="content-image"
:src="views[customerInfo.carModelId] || views[0].detailUrl || require('@/assets/images/media/nothing.webp')"
:src="contentUrl()"
/>
<image
class="content-bg"
:src="receptionBg(customerInfo.carModelId, views[0].bgUrl)"
:src="receptionBg(customerInfo.carModelId)"
/>
</template>
</view>
......@@ -186,12 +186,18 @@ export default {
}
this.inputCustomer()
},
receptionBg (carModelId, _bgUrl) {
receptionBg (carModelId) {
let { views } = this
const isAito = this.aitoCarModelIds.findIndex(e => e == carModelId)
let bgUrl = require('@/assets/images/common/aito-bg.webp')
if (isAito == -1) bgUrl = require('@/assets/images/common/zj-xj-bg.webp')
if(_bgUrl) bgUrl = _bgUrl
if (isAito == -1) bgUrl = require('@/assets/images/common/zj-xj-bg.webp')
if (Array.isArray(views)) { bgUrl = views[0]?.bgUrl || '' }
return bgUrl
},
contentUrl () {
let { views, customerInfo } = this
let isArray = Array.isArray(views)
return (isArray ? views[0].detailUrl : views[customerInfo.carModelId]) || require('@/assets/images/media/nothing.webp')
}
}
}
......
......@@ -426,7 +426,7 @@ export default {
}
},
async getJihuMockData () {
let { moduleList, toolList } = await uni.$api.systemApi.getJihuMockData(true)
let { moduleList, toolList, boutiqueDefaultCarBrandId, defaultCarId } = await uni.$api.systemApi.getJihuMockData(true)
moduleList = await Promise.all(
moduleList.map(async e => {
const receptionSourceDetailListType = Array.isArray(e.receptionSourceDetailList)
......@@ -445,8 +445,10 @@ export default {
toolList
},
['moduleList', 'toolList'],
'byd_mock_data'
'jihu_mock_data'
)
this.$store.state.user.boutiqueDefaultCarBrandId = boutiqueDefaultCarBrandId
this.$store.state.user.defaultCarId = defaultCarId
this.setViewInfo(moduleList, toolList)
}
}
......
......@@ -32,6 +32,7 @@ export default {
viewKey: Date.now(),
boutiqueCarList:[],
receptionKey:Date.now(), //接待记录埋点KEY
defaultCarId:''
};
},
mutations: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!