|
|
@@ -67,6 +67,25 @@
|
|
|
<driver />
|
|
|
|
|
|
<div class="goods">
|
|
|
+ <template v-if="boxs.length > 0">
|
|
|
+ <div class="page-title">盲盒详情</div>
|
|
|
+ <swiper
|
|
|
+ :slidesPerView="'auto'"
|
|
|
+ :spaceBetween="20"
|
|
|
+ class="detail-swiper"
|
|
|
+ >
|
|
|
+ <swiper-slide v-for="(item, index) in boxs" :key="index">
|
|
|
+ <van-image
|
|
|
+ width="100%"
|
|
|
+ height="170"
|
|
|
+ :src="item"
|
|
|
+ fit="cover"
|
|
|
+ radius="12"
|
|
|
+ @click="preview(index)"
|
|
|
+ />
|
|
|
+ </swiper-slide>
|
|
|
+ </swiper>
|
|
|
+ </template>
|
|
|
<template v-if="properties.length > 0">
|
|
|
<div class="page-title">商品特性</div>
|
|
|
<div class="specific-list">
|
|
|
@@ -80,12 +99,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <!-- <div class="page-title">链上信息</div>
|
|
|
- <div class="page-text">
|
|
|
- 创世“由艺术大师天野喜孝为游戏”百分之一“倾情绘制,天野喜孝是日本知名画家,插画师,角色设计师,普任”最终幻想“系列多部作品的角色设计
|
|
|
- </div> -->
|
|
|
- <div class="page-title">作品描述</div>
|
|
|
- <div class="page-text" v-html="info.detail"></div>
|
|
|
+ <template v-if="info.detail">
|
|
|
+ <div class="page-title">作品描述</div>
|
|
|
+ <div class="page-text" v-html="info.detail"></div
|
|
|
+ ></template>
|
|
|
</div>
|
|
|
|
|
|
<div class="btn van-safe-area-bottom" ref="btn" v-if="isBuy">
|
|
|
@@ -118,6 +135,7 @@ import "swiper/swiper-bundle.min.css";
|
|
|
|
|
|
import SwiperCore, { Pagination } from "swiper";
|
|
|
import Post from "../../components/Post.vue";
|
|
|
+import { ImagePreview } from "vant";
|
|
|
|
|
|
// install Swiper modules
|
|
|
SwiperCore.use([Pagination]);
|
|
|
@@ -135,6 +153,7 @@ export default {
|
|
|
info: {},
|
|
|
liked: false,
|
|
|
btn: null,
|
|
|
+ blindBoxItems: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -147,6 +166,12 @@ export default {
|
|
|
isBuy() {
|
|
|
return this.info.stock && this.info.onShelf && this.info.salable;
|
|
|
},
|
|
|
+ boxs() {
|
|
|
+ let list = [...this.blindBoxItems];
|
|
|
+ return list.map((item) => {
|
|
|
+ return this.getImg(item.pics);
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getProduct();
|
|
|
@@ -157,22 +182,49 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ preview(index = 0) {
|
|
|
+ ImagePreview({
|
|
|
+ images: [...this.boxs],
|
|
|
+ startPosition: index,
|
|
|
+ });
|
|
|
+ },
|
|
|
getProduct() {
|
|
|
this.$toast.loading({
|
|
|
message: "加载中...",
|
|
|
forbidClick: true,
|
|
|
});
|
|
|
- this.$http.get("/collection/get/" + this.$route.query.id).then((res) => {
|
|
|
- this.info = res;
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.isBuy) {
|
|
|
- this.btn = this.$refs.btn;
|
|
|
+ this.$http
|
|
|
+ .get("/collection/get/" + this.$route.query.id)
|
|
|
+ .then((res) => {
|
|
|
+ this.info = res;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.isBuy) {
|
|
|
+ this.btn = this.$refs.btn;
|
|
|
+ }
|
|
|
+ document.body.appendChild(this.$refs.btn);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.type === "BLIND_BOX") {
|
|
|
+ return this.$http.post(
|
|
|
+ "/blindBoxItem/all",
|
|
|
+ {
|
|
|
+ query: {
|
|
|
+ blindBoxId: res.id,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ { body: "json" }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return Promise.resolve();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ this.blindBoxItems = res.content;
|
|
|
}
|
|
|
- document.body.appendChild(this.$refs.btn);
|
|
|
- });
|
|
|
|
|
|
- this.scrollRefreash();
|
|
|
- });
|
|
|
+ this.scrollRefreash();
|
|
|
+ });
|
|
|
},
|
|
|
likeProduct() {
|
|
|
if (!this.info.liked) {
|
|
|
@@ -413,4 +465,13 @@ export default {
|
|
|
border-width: 0px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.detail-swiper {
|
|
|
+ height: 170px;
|
|
|
+ margin-top: 12px;
|
|
|
+}
|
|
|
+
|
|
|
+.swiper-slide {
|
|
|
+ width: 35.2vw;
|
|
|
+}
|
|
|
</style>
|