Commit de2d9489 by 李伟康

commit 增加空状态

1 parent 4401f9de
const target = ["ip", "dev", "uat", "prod", "beta"];
const index = 2;
const index = 1;
/**
*
0本地
......
......@@ -22,17 +22,27 @@
<view class="sprite-icon icon-info_shield"></view>
</view>
<view class="content-box flex">
<view
class="left-content"
:key="updateViewKey"
@click="showPicture(currentItem.detailImgUrl)"
>
<image
:src="currentItem.poster"
class="poster"
/>
<view class="tips">* 点击图片查看详情 &gt;</view>
</view>
<template v-if="currentItem.poster">
<view
class="left-content"
:key="updateViewKey"
@click="showPicture(currentItem.detailImgUrl)"
>
<image
:src="currentItem.poster"
class="poster"
/>
<view class="tips">* 点击图片查看详情 &gt;</view>
</view>
</template>
<template v-else>
<view class="left-content">
<image
class="default"
:src="defaultImg"
/>
</view>
</template>
<view class="right-content">
<view :class="['sku-box',isPreview ? 'preview' : '']">
<sku-box
......@@ -71,6 +81,9 @@ import CarBrands from '@/components/CarBrands.vue'
import CouponPop from './CouponPop.vue'
import PictureBox from './Picture.vue'
import RiskInformedBox from './RiskInformedBox.vue'
const m5 = require("@/assets/images/boutique/index/m5.webp")
const m7 = require("@/assets/images/boutique/index/m7.webp")
const m9 = require("@/assets/images/boutique/index/m9.webp")
export default {
name: 'Reception',
components: { SkuBox, CarBrands, CouponPop, PictureBox, RiskInformedBox },
......@@ -115,6 +128,11 @@ export default {
currentCarString: {
immediate: true,
handler (newval) {
this.defaultImg = {
'M5': m5,
'M7': m7,
'M9': m9,
}[newval]
if (this.show && newval && !this.isPreview && this.customerType == 1) this.$refs.carBrandRef.autoSelect(this.carList.findIndex(e => e == newval))
}
}
......@@ -251,6 +269,14 @@ export default {
transform: scale(1);
}
}
.default {
width: 100%;
height: 664rpx;
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
}
}
.right-content {
width: calc(100% - 1362rpx);
......
......@@ -49,26 +49,38 @@
</scroll-view>
<view class="sub-title">部位</view>
</template>
<scroll-view
scroll-y
class="content-scroll-box"
id="content-scroll"
:style="{height:contentHeight}"
>
<template v-for="(i,index) in 20">
<view
:class="['goods-item',goodsId == index ? 'active' : '']"
:key="index"
@click="changeGoods(index)"
<template v-if="flagObject.goodsFlag">
<template v-if="goodsList.length">
<scroll-view
scroll-y
class="content-scroll-box"
id="content-scroll"
:style="{height:contentHeight}"
>
<view class="goods-title">一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五一二三四五</view>
<view class="goods-description">
<rich-text :nodes="test"></rich-text>
</view>
<template v-for="(i,index) in goodsList">
<view
:class="['goods-item',goodsId == index ? 'active' : '']"
:key="index"
@click="changeGoods(index)"
>
<view class="goods-title">{{index}}</view>
<view class="goods-description">
<rich-text :nodes="i.text"></rich-text>
</view>
</view>
</template>
</scroll-view>
</template>
<template v-else>
<view class="nothing flex">
<image
src="@/assets/images/boutique/nothing.png"
class="icon"
/>
暂无产品内容
</view>
</template>
</scroll-view>
</template>
</view>
</template>
......@@ -91,10 +103,13 @@ export default {
contentHeight: '0',
requested: false,
currentItem: {
poster: 'https://img02.glsx.com.cn/weapp/resource/app-tape/common/default-cover.webp',
// 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'
},
test: '·AITO汽车专享 3M车窗膜(全车)\n·M7专享天窗冰甲\n·AITO汽车专享 挡泥板(适配M7)\n·AITO汽车专享 底盘护板(适配M7)\n·AITO汽车专享 挡泥板(适配M7)\n·AITO汽车专享 M7中控屏钢化保护膜\n·M7专享后备箱垫'
goodsList: [],
flagObject: {
goodsFlag: false
},
}
},
watch: {
......@@ -109,8 +124,10 @@ export default {
immediate: true,
handler (newval) {
if (this.show && this.requested) {
console.log(newval)
let [item] = this.boutiqueMediaConfig[newval]
this.changeTabId(item.tabId, 0)
console.log(item)
this.changeTabId(item.tabId, 0, false)
}
}
},
......@@ -118,7 +135,8 @@ export default {
immediate: true,
handler (newval) {
if (newval && !this.requested) {
this.changeTabId(this.tabId, this.boutiqueMediaConfig[this.currentCar].findIndex(e => e.tabId == this.tabId))
let index = this.boutiqueMediaConfig[this.currentCar].findIndex(e => e.tabId == this.tabId)
this.changeTabId(this.tabId, index, false)
this.requested = true
}
}
......@@ -144,15 +162,14 @@ export default {
mounted () {
},
methods: {
changeTabId (tabId, index) {
changeTabId (tabId, index, filter = true) {
if (filter && tabId == this.tabId && index == this.blockIndex) return
this.tabId = tabId
this.blockIndex = index
this.getSkuConfig()
},
async getSkuConfig () {
this.test = this.test.replace(/<\/?br\s*\/?>|\n/g, '<br>')
// this.$forceUpdate()
this.secondClick(0)
this.secondClick(0, false)
},
setScrollHeight () {
this.$nextTick(() => {
......@@ -162,7 +179,8 @@ export default {
}).exec()
})
},
secondClick (index) {
secondClick (index, filter = true) {
if (filter && this.secondIndex == index) return
this.secondIndex = index
if (this.tabId == 2) {
/**获取品牌 */
......@@ -171,6 +189,7 @@ export default {
} else this.getGoodsList()
},
thirdlyClick (index) {
if(this.thirdlyIndex == index) return
this.thirdlyIndex = index
this.getGoodsList()
},
......@@ -179,9 +198,22 @@ export default {
this.changePreView()
},
getGoodsList () {
console.log('获取商品列表')
this.setScrollHeight()
this.changeGoods(0)
// 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>')
})
this.flagObject.goodsFlag = true
this.setScrollHeight()
this.changeGoods(0)
}, 100)
},
changePreView () {
this.$emit('changePreView', this.currentItem)
......@@ -247,6 +279,7 @@ export default {
}
.second-type-scroll {
width: 100%;
animation: show-view-opacity 0.15s forwards;
.second-type-box {
width: 100%;
gap: 24rpx;
......@@ -274,6 +307,7 @@ export default {
}
.thirdly-type-scroll {
width: 100%;
animation: show-view-opacity 0.15s forwards;
.thirdly-type-box {
width: 100%;
......@@ -336,5 +370,26 @@ export default {
}
}
}
.nothing {
flex-direction: column;
padding-top: 136rpx;
font-size: 28rpx;
color: #999999;
line-height: 40rpx;
.icon {
width: 676rpx;
height: 284rpx;
margin-bottom: 24rpx;
}
}
}
@keyframes show-view-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
\ No newline at end of file
......@@ -141,7 +141,6 @@ export default {
},
data() {
return {
imageUrl: require('@/assets/images/noviceGuide/step1-1.webp'),
groupIndex:1,
goodsList:[],
name: '',
......
......@@ -44,7 +44,7 @@
<swiper
class="swiper"
circular
:autoplay="bannerAutoplay"
:autoplay="bannerAutoplay && !previewOff"
interval="3000"
previous-margin="380rpx"
next-margin="448rpx"
......@@ -82,7 +82,7 @@
</template>
</swiper>
<view class="tips">
* 窗膜精品,更有整车搭配套餐火爆售卖。
窗膜精品,更有整车搭配套餐火爆售卖。
<view>点击了解更多&gt;</view>
</view>
</view>
......@@ -171,6 +171,7 @@ export default {
currentCar: '',
currentIndex: 0,
bannerAutoplay: true,
previewOff: false,
mediaConfigList: []
}
},
......@@ -253,11 +254,11 @@ export default {
toDetail (item) {
this.chooseItem = item
this.$refs.home.previewRef.open();
this.bannerAutoplay = false
this.previewOff = true
},
cancel () {
this.$refs.home.previewRef.close();
this.bannerAutoplay = true
this.previewOff = false
},
preview () {
let { id, tabId } = this.chooseItem;
......@@ -345,6 +346,12 @@ export default {
this.customerType = 0
this.jumpPage()
this.$nextTick(() => this.$store.dispatch('setCustomerInfo', customer))
let { carBannerList } = this,
currentCar = carBannerList[1].title
carBannerList.map(i => {
if (customer.carModel.includes(i.title)) currentCar = i.title
})
this.currentCar = currentCar
},
swiperChange (e) {
this.currentIndex = e.detail.current
......@@ -387,13 +394,13 @@ export default {
border: 2rpx solid #ffffff;
border-radius: 8rpx;
backdrop-filter: blur(4rpx);
padding: 0 20rpx;
padding: 0 20rpx 0 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #333333;
line-height: 40rpx;
.icon {
margin-right: 8rpx;
margin-right: 4rpx;
flex-shrink: 0;
width: 56rpx;
height: 56rpx;
......@@ -510,7 +517,6 @@ export default {
}
.config-name {
position: relative;
width: fit-content;
height: 56rpx;
background: #ffffff66;
border: 2rpx solid #ffffff;
......@@ -595,11 +601,18 @@ export default {
.tips {
position: absolute;
left: 32rpx;
bottom: 144rpx;
bottom: 128rpx;
font-size: 24rpx;
color: #999999;
line-height: 36rpx;
z-index: 2;
padding-left: 16rpx;
&::after {
content: '* ';
position: absolute;
top: 4rpx;
left: 0;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!