Commit 571ec856 by 李伟康

commit 三包可配置

1 parent d62d440d
......@@ -171,7 +171,7 @@ const imgTransformBase64 = async (imgList = [], keyList = []) => {
await Promise.all(
Object.keys(i).map(async k => {
// i[`original_${k}`] = JSON.parse(JSON.stringify(i[k]))
i[k] = await getBase64(i[k])
if (k == 'detailUrl') i[k] = await getBase64(i[k])
})
)
})
......
......@@ -6,10 +6,13 @@
* @LastEditTime: 2024-07-04 16:02:54
-->
<template>
<view class="layout">
<view
class="layout"
:style="detail.pageStyle"
>
<image
class="icon-car"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/icon-car.webp"
:src="detail.carIcon"
/>
<wnCanvas
:drawStatus="penSwitch"
......@@ -26,7 +29,7 @@
<view class="left-tab">
<view
class="tab-item"
v-for="item in list"
v-for="item in detail.tabList"
:key="item.id"
@click="tabChange(item)"
:class="[item.id == activeIndex ? 'active' : '']"
......@@ -34,22 +37,22 @@
</view>
<div class="content-bg"></div>
<view class="content">
<template v-if="activeIndex == 2">
<template v-if="detail.viewActiveIndex.includes(activeIndex)">
<image
:key="imgKey"
:class="direction"
class="content-image"
:src="viewsImg()"
/>
<view class="content-tab">
<view
class="tab-item"
@click="tabSwitch(1)"
></view>
<view
class="tab-item"
@click="tabSwitch(2)"
></view>
<template v-for="(item,index) in imgIdList">
<view
:key="index"
class="tab-item"
@click="tabSwitch(item)"
></view>
</template>
</view>
</template>
<template v-else>
......@@ -71,72 +74,56 @@
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
views: Object,
penSwitch: Boolean,
title: String,
madiaId: Number,
detail: Object,
},
name: 'MediaComponent',
data () {
return {
activeIndex: 1,
list: [
{
id: 1,
name: '整车质保',
urlName: '5-1'
},
{
id: 2,
name: '零部件范围及质保期',
urlName: '5-2'
},
{
id: 3,
name: '三包凭证',
urlName: '5-3'
}
],
direction: 'bottom',
imgKey: Date.now(),
tabIndex: 1
tabIndex: 2
}
},
computed: {
watchStatus () {
return this.$store.state.user.historyStatus
},
imgIdList () {
return this.detail.tabList.find(item => item.id == this.activeIndex).imgIdList
}
},
watch: {
watchStatus () {
this.activeIndex = 1
this.tabIndex = 1
this.activeIndex = this.detail.defultActiveId || 0
this.tabIndex = this.detail.defultTabId
}
},
mounted () {
},
methods: {
tabChange (item) {
if (this.activeIndex === id) return
const { id } = item
if (this.activeIndex === id) return
this.direction = ''
console.log(id, this.activeIndex, ' !!!!!!!!!!')
this.direction = id > this.activeIndex ? 'bottom' : 'top'
this.activeIndex = id
this.imgKey = Date.now()
this.$refs.threeGuarantees.clearBoard()
},
tabSwitch (val) {
console.log(val)
if (val == this.tabIndex) return
this.tabIndex = val
this.$refs.threeGuarantees.clearBoard()
},
viewsImg () {
let { activeIndex, tabIndex } = this
if (activeIndex == 3) activeIndex = 4
if (activeIndex == 2) return this.views[tabIndex].detailUrl
return this.views[activeIndex - 1].detailUrl
let { activeIndex, tabIndex, detail, views } = this
if (detail.viewActiveIndex.includes(activeIndex)) return views[tabIndex]
return views[activeIndex]
}
}
}
......@@ -147,7 +134,7 @@ export default {
width: 100%;
height: 100%;
position: relative;
background-image: url('@/assets/images/media/media-bg.webp');
// background-image: url('@/assets/images/media/media-bg.webp');
background-size: 100%;
&-content {
margin: $margin;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!