Commit 6dccce26 by 李伟康

commit 修复

1 parent 96a6ab4d
......@@ -173,11 +173,12 @@ const getSoureData = async (shopMerchantId, sceneType, params = {}) => {
data.moduleList = await imgTransformBase64(materialInfoList, ['thumbnail', 'receptionSourceDetailList', 'screenList'])
uni.setStorageSync(storageName, {
moduleList: data.moduleList,
toolList: data.toolList
toolList: data.toolList,
id: res.id
})
return Promise.resolve(data)
}
} else throw '该场景尚未配置素材,请联系总部人员'
}
} catch (error) {
console.log(error)
uni.showToast({
......
......@@ -60,7 +60,11 @@ export default {
type: Object,
default: () => ({})
},
customBoolean: Boolean
customBoolean: Boolean,
linkage: {
type: Boolean,
default: true
}
},
data () {
return {
......@@ -194,12 +198,14 @@ export default {
},
handleSelect (item) {
const customerInfo = this.$store.state.user.customerInfo,
{ selectItem } = this
{ selectItem, linkage } = this
customerInfo.carBrand = selectItem.carChildsBrandName
this.$store.dispatch('setCustomerInfo', customerInfo)
if (linkage) {
this.$store.dispatch('setCustomerInfo', customerInfo)
this.$store.dispatch('updateViewKey')
this.$store.dispatch('setCurrentCarInfo', selectItem)
}
this.$refs.carBoxVisible?.close();
this.$store.dispatch('updateViewKey')
this.$store.dispatch('setCurrentCarInfo', selectItem)
this.$emit('select', {
...item,
...selectItem
......
......@@ -3,22 +3,28 @@ export default {
id: {
immediate: true,
handler (key) {
if (!key || this.type == 'preview') return
let item = this.media.find(e => e.id == key),
value = this.receptionTrack[key]
if (value) {
value.openCount += 1
value.entryTime = Date.now()
} else {
value = {
openCount: 1,
materialName: item.detailTitle,
materialId: item.id,
stayDuration: 0,
entryTime: Date.now()
try {
if (!key || this.type == 'preview') return
let { useCarConfig, moduleList, media } = this,
array = useCarConfig ? moduleList : media
let item = array.find(e => e.id == key),
value = this.receptionTrack[key]
if (value) {
value.openCount += 1
value.entryTime = Date.now()
} else {
value = {
openCount: 1,
materialName: item.detailTitle || '',
materialId: item.id,
stayDuration: 0,
entryTime: Date.now()
}
}
this.$store.dispatch("setReceptionTrack", { key, value })
} catch (error) {
console.log(error)
}
this.$store.dispatch("setReceptionTrack", { key, value })
}
}
},
......@@ -34,11 +40,10 @@ export default {
value = this.receptionTrack[key]
value.stayDuration += Number(Date.now() - value.entryTime)
this.$store.dispatch("setReceptionTrack", { key, value })
if (keyName == 'id' && key == 1) {
if (keyName == 'id' && key == 1) { //轻改才会触发
let [receptionRef] = this.$refs.media1
receptionRef.previewLeave && receptionRef.previewLeave(receptionRef.currentItem)
}
}
}
}
\ No newline at end of file
......@@ -86,7 +86,7 @@
</view>
</template>
</view>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" @close="resetFocusIndex" />
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" @close="resetFocusIndex" :linkage="false" />
</view>
</template>
......@@ -276,7 +276,7 @@ export default {
this.customerInfo.carModel = item.name
this.customerInfo.carModelId = item.id
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
// this.$store.dispatch('setCustomerInfo', this.customerInfo)
this.list = []
this.pageNum = 1
this.getQuotationList()
......
......@@ -6,7 +6,7 @@
v-if="hasCarBrand"
@click="$refs.carBrandListVisible.open()"
>
{{customerInfo.carModel}}
{{customerInfo.carModel||'请选择'}}
<view class="sprite-icon icon-arrow-bottom"></view>
</view>
<car-brands
......@@ -36,9 +36,9 @@ export default {
show: {
immediate: true,
handler (newval) {
setTimeout(() => {
if (newval && this.hasCarBrand && !this.customerInfo.carModel && this.watchChannelType != 2) this.$refs.carBrandListVisible.autoSelect()
}, 1e3)
// setTimeout(() => {
// if (newval && this.hasCarBrand && !this.customerInfo.carModel && this.watchChannelType != 2) this.$refs.carBrandListVisible.autoSelect()
// }, 1e3)
}
},
watchCustomerInfo: {
......
......@@ -138,9 +138,9 @@ export default {
}
},
show (n) {
setTimeout(()=>{
if (n && !this.customerInfo.carModel && !this.isByd) this.$refs.carBrandListVisible.autoSelect()
},1e3)
// setTimeout(()=>{
// if (n && !this.customerInfo.carModel && !this.isByd) this.$refs.carBrandListVisible.autoSelect()
// },1e3)
}
},
computed: {
......
......@@ -124,7 +124,8 @@ export default {
default: 'preview'
},
toolList: Array,
aitoCarModelIds: Array
aitoCarModelIds: Array,
mediaId: [String, Number]
},
mixins: [receptionTrackMixin],
data () {
......@@ -198,6 +199,7 @@ export default {
handler (newval) {
this.useCarConfig = false
this.dateilKey = Date.now()
this.pageToolList = this.toolList
if (newval) this.drawStatus = false
}
},
......@@ -207,13 +209,12 @@ export default {
if (this.id) this.setPageData()
}
},
toolList: {
immediate: true,
handler (newval) {
this.pageToolList = this.toolList
// this.setPageToolList()
}
},
// toolList: {
// immediate: true,
// handler (newval) {
// this.setPageToolList()
// }
// },
},
mounted () {
const systemInfo = uni.getSystemInfoSync()
......@@ -327,14 +328,27 @@ export default {
}
let storageName = `source_${sceneType}_${shopMerchantId}_${carBrandId}_${carChildsBrandId}`
let data = uni.getStorageSync(storageName)
if (data) this.setViewInfo(data)
let requestData = await uni.$api.systemApi.getSoureData(shopMerchantId, sceneType, params)
if (requestData) this.setViewInfo(requestData)
try {
let requestData = await uni.$api.systemApi.getSoureData(shopMerchantId, sceneType, params)
if (requestData) this.setViewInfo(requestData)
} catch (error) {
if (data) this.setViewInfo(data)
}
},
setViewInfo (data) {
this.moduleList = data.moduleList
this.pageToolList = data.toolList
this.useCarConfig = true
let { mediaId, id: pageId } = this,
{ id, moduleList, toolList } = data
if (id != mediaId) {
let { useCarConfig, moduleList: pageModuleList, media: pageMedia } = this,
array = useCarConfig ? pageModuleList : pageMedia,
{ detailTitle } = array.find(item => item.id == pageId)
this.receptionTrackLeave()
this.moduleList = moduleList
this.pageToolList = toolList
this.useCarConfig = true
let jumpItem = moduleList.find(e => e.detailTitle == detailTitle)
this.$emit('update:id', jumpItem ? jumpItem.id : moduleList[0].id)
}
}
}
}
......
......@@ -17,9 +17,8 @@
<view
:key="index"
:class="['item landscape', i.class]"
:style="i.style"
@click="toDetail(i)"
v-if="i.thumbnail"
v-if="!i.hide"
>
<template v-if="i.showAlt">
<view class="item-text flex">{{ i.title }}</view>
......@@ -45,6 +44,7 @@
@back="back"
@done="done"
ref="detail"
:mediaId="mediaId"
/>
</template>
<template slot="content">
......@@ -82,7 +82,8 @@ export default {
chooseItem: {},
tabIndex: 0,
recording: false,
aitoCarModelIds: []
aitoCarModelIds: [],
mediaId: ''
}
},
computed: {
......@@ -307,10 +308,11 @@ export default {
},
/**素材内容 */
setViewInfo (data) {
let { moduleList, toolList, aitoCarModelIds } = data
if (this.channelType == 1) this.aitoCarModelIds = aitoCarModelIds || []
let { moduleList, toolList, id } = data
// if (this.channelType == 1) this.aitoCarModelIds = aitoCarModelIds || []
this.moduleList = moduleList
this.toolList = toolList
this.mediaId = id
this.$store.state.user = {
...this.$store.state.user,
...data
......@@ -322,16 +324,22 @@ export default {
<style scoped lang="scss">
.module-box {
padding-top: toRpx(44);
height: calc(100% - #{toRpx(94)});
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
gap: toRpx(48);
&::after {
content: '';
display: block;
clear: both;
}
.item {
float: left;
// float: left;
width: calc(50% - #{toRpx(48)});
height: calc(50% - #{toRpx(48)});
border-radius: toRpx(48);
overflow: hidden;
margin: 0 toRpx(48) toRpx(48) 0;
&-img {
width: 100%;
height: 100%;
......@@ -345,17 +353,6 @@ export default {
color: #3773f8;
}
}
.landscape {
height: toRpx(312);
}
.square {
width: toRpx(318);
height: toRpx(312);
}
.vertical {
width: toRpx(712);
height: toRpx(624);
}
}
.webview-container {
width: toRpx(100);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!