Commit de2d9489 by 李伟康

commit 增加空状态

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