轮播图预览: uni.previewImage({ urls, current })

This commit is contained in:
jqtmviyu@gmail.com 2021-02-26 23:33:22 +08:00
parent 1acc16c247
commit eaaaeec4c9

View File

@ -3,7 +3,7 @@
<!-- 1.0 轮播图模块 -->
<swiper class="swiper" indicator-dots indicator-active-color="#EB4450" autoplay>
<swiper-item v-for="item in pics" :key="item.pics_id" class="swiper_item">
<image class="swiper_image" :src="item.pics_big"></image>
<image class="swiper_image" :src="item.pics_big" @tap="showBigImgHandle(item.pics_big)"></image>
</swiper-item>
</swiper>
@ -27,6 +27,11 @@ export default {
async getGoodsDetail(){
const { pics } = (await this.$u.api.getGoodsDetail({ goods_id: this.goods_id })).message
this.pics = pics
},
showBigImgHandle(current){
const urls = this.pics.map(item => item.pics_big)
uni.previewImage({ urls, current })
//Array.<string>
}
},