Browse Source

多图预览

master
Enzo 4 years ago
parent
commit
8413ed16f6
  1. 9
      pages/order/apply-details.vue
  2. 11
      pages/order/apply-refund.vue

9
pages/order/apply-details.vue

@ -90,7 +90,7 @@
<view class="cu-form-group solid-bottom" style="padding-bottom: 20rpx;" v-if="images.length != 0"> <view class="cu-form-group solid-bottom" style="padding-bottom: 20rpx;" v-if="images.length != 0">
<view class="grid col-4 grid-square flex-sub"> <view class="grid col-4 grid-square flex-sub">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) of images" :key="index"> <view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) of images" :key="index">
<image :src="item.path" @tap="showImg(item.path)" style="width: 216rpx;height: 216rpx;" mode="aspectFill"></image>
<image :src="item.path" @tap="showImg(index)" style="width: 216rpx;height: 216rpx;" mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
@ -149,10 +149,13 @@
}); });
}, },
// //
showImg(image) {
showImg(index) {
this.$u.throttle(() => { this.$u.throttle(() => {
let goods_banner = this.images || [];
let banners = goods_banner.map(item => item.path);
uni.previewImage({ uni.previewImage({
urls: [image]
urls: banners,
current: index
}) })
}, 200); }, 200);
}, },

11
pages/order/apply-refund.vue

@ -90,7 +90,7 @@
</view> --> </view> -->
<view class="cu-form-group"> <view class="cu-form-group">
<view class="grid col-4 grid-square flex-sub"> <view class="grid col-4 grid-square flex-sub">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(item)" :data-url="img_list[index]">
<view style="width: 212rpx;height: 212rpx;border-radius: 10rpx;" class="bg-img" v-for="(item,index) in img_list" :key="index" @tap="showImg(index)" :data-url="img_list[index]">
<image :src="img_list[index]" mode="aspectFill"></image> <image :src="img_list[index]" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index"> <view class="cu-tag bg-red" @tap.stop="DelImg(index)" :data-index="index">
<text class='cuIcon-close'></text> <text class='cuIcon-close'></text>
@ -322,11 +322,14 @@
}); });
}, },
// //
showImg(image) {
showImg(index) {
this.$u.throttle(() => { this.$u.throttle(() => {
let goods_banner = this.img_list || [];
let banners = goods_banner.map(item => item);
uni.previewImage({ uni.previewImage({
urls: [image],
});
urls: banners,
current: index
})
}, 200); }, 200);
// let image = this.img_list[index]; // let image = this.img_list[index];
}, },

Loading…
Cancel
Save