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 { ...@@ -82,6 +82,7 @@ export default {
methods: { methods: {
autoSelect (index = 0) { autoSelect (index = 0) {
const { carBrandList } = this const { carBrandList } = this
if (index < 0) index = 0
if (carBrandList.length) this.selectCar(carBrandList[0], true, index) if (carBrandList.length) this.selectCar(carBrandList[0], true, index)
}, },
open () { open () {
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
<view class="sprite-icon icon-info_shield"></view> <view class="sprite-icon icon-info_shield"></view>
</view> </view>
<view class="content-box flex"> <view class="content-box flex">
<template v-if="currentItem.poster"> <template v-if="currentItem.modelDisplayPicurl">
<view <view
class="left-content" class="left-content"
:key="updateViewKey" :key="updateViewKey"
@click="showPicture(currentItem.detailImgUrl)" @click="showPicture(currentItem.detailPicurl)"
> >
<image <image
:src="currentItem.poster" :src="currentItem.modelDisplayPicurl"
class="poster" class="poster"
/> />
<view class="tips">* 点击图片查看详情 &gt;</view> <view class="tips">* 点击图片查看详情 &gt;</view>
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
enable-flex enable-flex
> >
<view class="second-type-box flex"> <view class="second-type-box flex">
<template v-for="(i,index) in 20"> <template v-for="(i,index) in secondList">
<view <view
:class="['second-type-item flex',secondIndex == index ? 'active' : '']" :class="['second-type-item flex',secondIndex == index ? 'active' : '']"
:key="index" :key="index"
@click="secondClick(index)" @click="secondClick(index)"
>{{i}}一二三四五一二三四</view> >{{i.category}}</view>
</template> </template>
<view class="padding-right"></view> <view class="padding-right"></view>
</view> </view>
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
enable-flex enable-flex
> >
<view class="thirdly-type-box flex"> <view class="thirdly-type-box flex">
<template v-for="(i,index) in 3"> <template v-for="(i,index) in brandList">
<view <view
:class="['thirdly-type-item flex',thirdlyIndex == index ? 'active' : '']" :class="['thirdly-type-item flex',thirdlyIndex == index ? 'active' : '']"
:key="index" :key="index"
@click="thirdlyClick(index)" @click="thirdlyClick(index)"
>{{i}}</view> >{{i.brandName}}</view>
</template> </template>
<view class="padding-right"></view> <view class="padding-right"></view>
</view> </view>
...@@ -59,13 +59,13 @@ ...@@ -59,13 +59,13 @@
> >
<template v-for="(i,index) in goodsList"> <template v-for="(i,index) in goodsList">
<view <view
:class="['goods-item',goodsId == index ? 'active' : '']" :class="['goods-item',goodsIndex == index ? 'active' : '']"
:key="index" :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"> <view class="goods-description">
<rich-text :nodes="i.text"></rich-text> <rich-text :nodes="i.descriptionText"></rich-text>
</view> </view>
</view> </view>
</template> </template>
...@@ -99,17 +99,15 @@ export default { ...@@ -99,17 +99,15 @@ export default {
blockIndex: 0, blockIndex: 0,
secondIndex: 0, secondIndex: 0,
thirdlyIndex: 0, thirdlyIndex: 0,
goodsId: '', goodsIndex: 0,
contentHeight: '0', contentHeight: '0',
requested: false, requested: false,
currentItem: { 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'
},
goodsList: [], goodsList: [],
flagObject: { flagObject: {
goodsFlag: false goodsFlag: false
}, },
secondList: [],
} }
}, },
watch: { watch: {
...@@ -166,9 +164,11 @@ export default { ...@@ -166,9 +164,11 @@ export default {
if (filter && tabId == this.tabId && index == this.blockIndex) return if (filter && tabId == this.tabId && index == this.blockIndex) return
this.tabId = tabId this.tabId = tabId
this.blockIndex = index 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) this.secondClick(0, false)
}, },
setScrollHeight () { setScrollHeight () {
...@@ -184,35 +184,74 @@ export default { ...@@ -184,35 +184,74 @@ export default {
this.secondIndex = index this.secondIndex = index
if (this.tabId == 2) { if (this.tabId == 2) {
/**获取品牌 */ /**获取品牌 */
this.thirdlyIndex = 0 if (index == 0) {
this.getGoodsList() 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() } else this.getGoodsList()
}, },
thirdlyClick (index) { thirdlyClick (index, filter = true) {
if(this.thirdlyIndex == index) return if (filter && this.thirdlyIndex == index) return
this.thirdlyIndex = index this.thirdlyIndex = index
this.getGoodsList() this.getGoodsList()
}, },
changeGoods (index) { changeGoods (item, index) {
this.goodsId = index this.goodsIndex = index
this.currentItem = item
this.changePreView() this.changePreView()
}, },
getGoodsList () { getGoodsList () {
// console.log('获取商品列表')
this.goodsList = [] this.goodsList = []
this.flagObject.goodsFlag = false this.flagObject.goodsFlag = false
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
setTimeout(() => { 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() uni.hideLoading()
this.goodsList = new Array(Math.floor(Math.random() * 21)).fill({ let goodsList = []
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>') 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)
})
} 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.flagObject.goodsFlag = true
this.setScrollHeight() this.setScrollHeight()
this.changeGoods(0) this.changeGoods(goodsList[0], 0)
}, 100)
}, },
changePreView () { changePreView () {
......
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
// this.$emit("back"); // this.$emit("back");
if (this.id == 1) { if (this.id == 1) {
let [reception] = this.$refs.media1 let [reception] = this.$refs.media1
if (reception.currentImgUrl) reception.showPicture('') if (reception.detailPicurl) reception.showPicture('')
else this.$emit("back"); else this.$emit("back");
} else this.$emit("back"); } else this.$emit("back");
}, },
......
...@@ -237,18 +237,33 @@ export default { ...@@ -237,18 +237,33 @@ export default {
/**获取车型素材配置 */ /**获取车型素材配置 */
uni.$api.boutiqueApi.getBoutiqueMaterialConfig({ uni.$api.boutiqueApi.getBoutiqueMaterialConfig({
merchantId: shopMerchantId merchantId: shopMerchantId
}).then(res =>{ }).then(({ materials }) => {
console.log(res,'===========')
})
let boutiqueMediaConfig = { let boutiqueMediaConfig = {
M5: [defaultConfig[0], defaultConfig[1], defaultConfig[2]], M5: [],
M7: [defaultConfig[0], defaultConfig[1]], M7: [],
M9: [defaultConfig[1], defaultConfig[2]] 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 => { this.carBannerList.map(e => {
e.configList = boutiqueMediaConfig[e.title] e.configList = boutiqueMediaConfig[e.title]
}) })
this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig this.$store.state.user.boutiqueMediaConfig = boutiqueMediaConfig
})
}, },
// 查询素材 // 查询素材
async getSoure () { async getSoure () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!