Commit 48020d94 by 胡悦

Merge branch 'SAAS+V4.45' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.45

2 parents 6cacf1d0 93a53115
......@@ -82,6 +82,7 @@ export default {
methods: {
autoSelect (index = 0) {
const { carBrandList } = this
if (index < 0) index = 0
if (carBrandList.length) this.selectCar(carBrandList[0], true, index)
},
open () {
......
......@@ -19,14 +19,14 @@
<view class="sprite-icon icon-info_shield"></view>
</view>
<view class="content-box flex">
<template v-if="currentItem.poster">
<template v-if="currentItem.modelDisplayPicurl">
<view
class="left-content"
:key="updateViewKey"
@click="showPicture(currentItem.detailImgUrl)"
@click="showPicture(currentItem.detailPicurl)"
>
<image
:src="currentItem.poster"
:src="currentItem.modelDisplayPicurl"
class="poster"
/>
<view class="tips">* 点击图片查看详情 &gt;</view>
......
......@@ -19,12 +19,12 @@
enable-flex
>
<view class="second-type-box flex">
<template v-for="(i,index) in 20">
<template v-for="(i,index) in secondList">
<view
:class="['second-type-item flex',secondIndex == index ? 'active' : '']"
:key="index"
@click="secondClick(index)"
>{{i}}一二三四五一二三四</view>
>{{i.category}}</view>
</template>
<view class="padding-right"></view>
</view>
......@@ -37,12 +37,12 @@
enable-flex
>
<view class="thirdly-type-box flex">
<template v-for="(i,index) in 3">
<template v-for="(i,index) in brandList">
<view
:class="['thirdly-type-item flex',thirdlyIndex == index ? 'active' : '']"
:key="index"
@click="thirdlyClick(index)"
>{{i}}</view>
>{{i.brandName}}</view>
</template>
<view class="padding-right"></view>
</view>
......@@ -59,13 +59,13 @@
>
<template v-for="(i,index) in goodsList">
<view
:class="['goods-item',goodsId == index ? 'active' : '']"
:class="['goods-item',goodsIndex == index ? 'active' : '']"
:key="index"
@click="changeGoods(index)"
@click="changeGoods(i,index)"
>
<view class="goods-title">{{index}}</view>
<view class="goods-title">{{i.goodsName}}</view>
<view class="goods-description">
<rich-text :nodes="i.text"></rich-text>
<rich-text :nodes="i.descriptionText"></rich-text>
</view>
</view>
</template>
......@@ -99,17 +99,15 @@ export default {
blockIndex: 0,
secondIndex: 0,
thirdlyIndex: 0,
goodsId: '',
goodsIndex: 0,
contentHeight: '0',
requested: false,
currentItem: {
// poster: 'https:// img02.glsx.com.cn/weapp/resource/app-tape/common/default-cover.webp',
detailImgUrl: 'https://wx.glsx.com.cn/upload/biz/d3c64724-3e0c-4401-aabe-56dc0060f6d6.png'
},
currentItem: {},
goodsList: [],
flagObject: {
goodsFlag: false
},
secondList: [],
}
},
watch: {
......@@ -166,9 +164,11 @@ export default {
if (filter && tabId == this.tabId && index == this.blockIndex) return
this.tabId = tabId
this.blockIndex = index
this.getSkuConfig()
this.setSecondList()
},
async getSkuConfig () {
async setSecondList () {
let { list } = this.boutiqueMediaConfig[this.currentCar].find(e => e.tabId == this.tabId)
this.secondList = list
this.secondClick(0, false)
},
setScrollHeight () {
......@@ -184,35 +184,74 @@ export default {
this.secondIndex = index
if (this.tabId == 2) {
/**获取品牌 */
this.thirdlyIndex = 0
this.getGoodsList()
if (index == 0) {
let { filmInfoList } = this.secondList[0],
arr = Array.from(new Set([...filmInfoList.map((e) => e.brand)])),
brandList = []
arr.map(e => {
let obj = {
brandName: e,
list: []
}
filmInfoList.map(i => {
if (i.brand == e) obj.list.push(i)
})
brandList.push(obj)
})
this.brandList = brandList
this.thirdlyClick(0, false)
}
else this.getGoodsList()
} else this.getGoodsList()
},
thirdlyClick (index) {
if(this.thirdlyIndex == index) return
thirdlyClick (index, filter = true) {
if (filter && this.thirdlyIndex == index) return
this.thirdlyIndex = index
this.getGoodsList()
},
changeGoods (index) {
this.goodsId = index
changeGoods (item, index) {
this.goodsIndex = index
this.currentItem = item
this.changePreView()
},
getGoodsList () {
// console.log('获取商品列表')
this.goodsList = []
this.flagObject.goodsFlag = false
uni.showLoading({
mask: true
})
setTimeout(() => {
uni.hideLoading()
this.goodsList = new Array(Math.floor(Math.random() * 21)).fill({
text: '·AITO汽车专享 3M车窗膜(全车)\n·M7专享天窗冰甲\n·AITO汽车专享 挡泥板(适配M7)\n·AITO汽车专享 底盘护板(适配M7)\n·AITO汽车专享 挡泥板(适配M7)\n·AITO汽车专享 M7中控屏钢化保护膜\n·M7专享后备箱垫'.replace(/<\/?br\s*\/?>|\n/g, '<br>')
let { secondIndex, secondList, tabId, brandList, thirdlyIndex } = this,
target = {
1: 'packageInfoList',
2: 'filmInfoList',
3: 'productInfoList'
}[tabId],
goodsNameKey = {
1: 'packageName',
2: 'filmName',
3: 'productName'
}[tabId]
uni.hideLoading()
let goodsList = []
if (tabId == 2 && secondIndex == 0) {
brandList[thirdlyIndex].list.map(e => {
e.goodsName = e[goodsNameKey]
if (e.description) e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
goodsList.push(e)
})
this.flagObject.goodsFlag = true
this.setScrollHeight()
this.changeGoods(0)
}, 100)
} else {
secondList[secondIndex][target].map(e => {
e.goodsName = e[goodsNameKey]
if (e.description) e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
goodsList.push(e)
})
}
this.goodsList = goodsList
this.flagObject.goodsFlag = true
this.setScrollHeight()
this.changeGoods(goodsList[0], 0)
},
changePreView () {
......
......@@ -134,7 +134,7 @@ export default {
// this.$emit("back");
if (this.id == 1) {
let [reception] = this.$refs.media1
if (reception.currentImgUrl) reception.showPicture('')
if (reception.detailPicurl) reception.showPicture('')
else this.$emit("back");
} else this.$emit("back");
},
......
......@@ -237,18 +237,33 @@ export default {
/**获取车型素材配置 */
uni.$api.boutiqueApi.getBoutiqueMaterialConfig({
merchantId: shopMerchantId
}).then(res =>{
console.log(res,'===========')
})
let boutiqueMediaConfig = {
M5: [defaultConfig[0], defaultConfig[1], defaultConfig[2]],
M7: [defaultConfig[0], defaultConfig[1]],
M9: [defaultConfig[1], defaultConfig[2]]
}
this.carBannerList.map(e => {
e.configList = boutiqueMediaConfig[e.title]
}).then(({ materials }) => {
let boutiqueMediaConfig = {
M5: [],
M7: [],
M9: [],
}
materials.map(e => {
const configItems = [
{ key: 'packages', configIndex: 0 },
{ key: 'films', configIndex: 1 },
{ key: 'products', configIndex: 2 }
];
configItems.map(item =>{
if (e[item.key]?.length) {
boutiqueMediaConfig[e.carModelName].push({
...defaultConfig[item.configIndex],
list: e[item.key]
})
}
})
})
this.carBannerList.map(e => {
e.configList = boutiqueMediaConfig[e.title]
})
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
})
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
},
// 查询素材
async getSoure () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!