This commit is contained in:
weipengfei 2023-11-14 11:12:17 +08:00
parent 4b0dbfddc4
commit e19212c632
2 changed files with 34 additions and 13 deletions

View File

@ -4,14 +4,18 @@
<view class="pop"> <view class="pop">
<scroll-view scroll-y class="scroll"> <scroll-view scroll-y class="scroll">
<view class="image"> <view class="image">
<swiper v-if="product.slider_image && product.slider_image.length>0" autoplay style="width: 100%;height: 100%;"> <swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;" @change="changeCurrent">
<block v-if="product.slider_image && product.slider_image.length>0">
<swiper-item v-for="(item,index) in product.slider_image" :key="index"> <swiper-item v-for="(item,index) in product.slider_image" :key="index">
<image class="img" :src="item"></image> <image class="img" :src="item"></image>
</swiper-item> </swiper-item>
</block>
<swiper-item v-else>
<image class="img" :src="datas.image||defualtImg"></image>
</swiper-item>
</swiper> </swiper>
<image v-else class="img" :src="datas.image||defualtImg"></image> <view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}</view>
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image> <image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
<view class="current"></view>
<view class="border"></view> <view class="border"></view>
</view> </view>
<view class="white_card"> <view class="white_card">
@ -86,6 +90,7 @@
}, },
cart_num: 1, // cart_num: 1, //
goodsNum: 0, // goodsNum: 0, //
current: 0, //
}; };
}, },
mounted() {}, mounted() {},
@ -106,7 +111,7 @@
this.attrValue = datas.product?.attrValue; this.attrValue = datas.product?.attrValue;
this.change = this.attrValue[0]; this.change = this.attrValue[0];
this.cart_num = 1; this.cart_num = 1;
this.sku = datas.sku; this.sku = datas.sku||{};
this.sku_key_list = Object.keys(this.sku); this.sku_key_list = Object.keys(this.sku);
this.sku_key = this.sku_key_list[0]; this.sku_key = this.sku_key_list[0];
}, },
@ -157,7 +162,7 @@
title: '不能超出库存哦' title: '不能超出库存哦'
}) })
} }
else this.cart_num++; this.cart_num++;
}, },
// //
addcart() { addcart() {
@ -199,6 +204,10 @@
}) })
} }
}, },
//
changeCurrent(e){
this.current = e.detail.current;
},
navgo(url) { navgo(url) {
uni.navigateTo({ uni.navigateTo({
url url
@ -232,11 +241,27 @@
align-items: flex-end; align-items: flex-end;
} }
.image { .image {
height: 750rpx; height: 750rpx;
width: 750rpx; width: 750rpx;
position: relative; position: relative;
.current{
position: absolute;
bottom: 70rpx;
left: 30rpx;
width: 67rpx;
height: 37rpx;
background: rgba(#333, 0.2);
border-radius: 11rpx 11rpx 11rpx 11rpx;
text-align: center;
color: #fff;
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
.img { .img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -252,10 +277,6 @@
height: 50.82rpx; height: 50.82rpx;
} }
.current{
}
.border { .border {
position: absolute; position: absolute;
bottom: -1rpx; bottom: -1rpx;

View File

@ -721,7 +721,7 @@
} }
townCloud({ townCloud({
street_code: this.street_id, street_code: this.street_id,
// category_id: this.storeParam.category_id, category_id: this.storeParam.category_id,
order: this.storeParam.order, order: this.storeParam.order,
keyword: this.storeParam.keyword, keyword: this.storeParam.keyword,
page: this.storeParam.page, page: this.storeParam.page,