|
|
@@ -3,7 +3,24 @@
|
|
|
<swiper pagination class="mySwiper" v-if="banners.length > 0">
|
|
|
<swiper-slide v-for="(item, index) in banners" :key="index">
|
|
|
<!-- <img :src="item" /> -->
|
|
|
- <van-image @click="preview(index, banners)" :src="item" width="100vw" height="100vw" fit="scale-down" />
|
|
|
+
|
|
|
+ <video
|
|
|
+ class="swiper-video"
|
|
|
+ v-if="isVideo(item)"
|
|
|
+ :src="item.url"
|
|
|
+ :poster="getImg(changeImgs([item]))"
|
|
|
+ controls="controls"
|
|
|
+ >
|
|
|
+ 您的浏览器不支持 video 标签。
|
|
|
+ </video>
|
|
|
+ <van-image
|
|
|
+ v-else
|
|
|
+ @click="preview(index, changeImgs(banners))"
|
|
|
+ :src="item.url"
|
|
|
+ width="100vw"
|
|
|
+ height="100vw"
|
|
|
+ fit="scale-down"
|
|
|
+ />
|
|
|
</swiper-slide>
|
|
|
</swiper>
|
|
|
|
|
|
@@ -122,6 +139,7 @@ import { ImagePreview } from 'vant';
|
|
|
|
|
|
// install Swiper modules
|
|
|
SwiperCore.use([Pagination]);
|
|
|
+import product from '../../mixins/product';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -129,7 +147,7 @@ export default {
|
|
|
SwiperSlide,
|
|
|
Post
|
|
|
},
|
|
|
-
|
|
|
+ mixins: [product],
|
|
|
data() {
|
|
|
return {
|
|
|
activeName: '1',
|
|
|
@@ -152,7 +170,7 @@ export default {
|
|
|
boxs() {
|
|
|
let list = [...this.blindBoxItems];
|
|
|
return list.map(item => {
|
|
|
- return this.getImg(item.pics);
|
|
|
+ return this.getImg(this.changeImgs(item.pics));
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -180,6 +198,7 @@ export default {
|
|
|
this.btn = this.$refs.btn;
|
|
|
}
|
|
|
});
|
|
|
+ this.$toast.clear();
|
|
|
|
|
|
if (res.type === 'BLIND_BOX') {
|
|
|
return this.$http.post(
|
|
|
@@ -199,8 +218,6 @@ export default {
|
|
|
if (res) {
|
|
|
this.blindBoxItems = res.content;
|
|
|
}
|
|
|
-
|
|
|
- this.$toast.clear();
|
|
|
});
|
|
|
},
|
|
|
likeProduct() {
|
|
|
@@ -458,4 +475,8 @@ export default {
|
|
|
height: auto;
|
|
|
}
|
|
|
}
|
|
|
+.swiper-video {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vw;
|
|
|
+}
|
|
|
</style>
|