Commit 5b4a9e71 by 李伟康

commit 兼容

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