panhui 4 years ago
parent
commit
83480bb97e

+ 1 - 1
src/components/creator/CreatorSmall.vue

@@ -106,7 +106,7 @@ export default {
         display: flex;
         flex-direction: column;
         overflow: hidden;
-        height: 80px;
+        height: 90px;
         background: #373b3e;
         padding: 25px 10px 10px;
         align-items: center;

+ 13 - 1
src/components/product/SaleInfo.vue

@@ -51,6 +51,12 @@ export default {
             default: () => {
                 return {};
             }
+        },
+        blindBoxItems: {
+            type: Array,
+            default: () => {
+                return [];
+            }
         }
     },
     data() {
@@ -73,6 +79,12 @@ export default {
                     price: 0
                 };
             }
+        },
+        search() {
+            if (this.info.type === 'BLIND_BOX') {
+                return this.blindBoxItems.length > 0 ? this.blindBoxItems[0].name.split('#')[0] : '';
+            }
+            return this.info.name;
         }
     },
     methods: {
@@ -82,7 +94,7 @@ export default {
                     source: 'TRANSFER',
                     salable: true
                 },
-                search: this.info.name,
+                search: this.search,
                 sort: 'price,asc'
             };
         },

+ 24 - 1
src/views/Discover.vue

@@ -108,7 +108,14 @@
         </van-grid>
 
         <div class="box">
-            <van-tabs v-model:active="sort" shrink line-width="16" line-height="2" @change="getList(true)">
+            <van-tabs
+                v-model:active="sort"
+                shrink
+                line-width="16"
+                :before-change="beforeChange"
+                line-height="2"
+                @change="getList(true)"
+            >
                 <van-tab
                     v-for="(item, index) in selectOptions"
                     :key="index"
@@ -173,6 +180,10 @@ export default {
                 {
                     label: '艺术机构',
                     value: 'creator'
+                },
+                {
+                    label: '热力展览',
+                    value: 'hot'
                 }
             ],
             icons: [
@@ -255,7 +266,19 @@ export default {
                     }
                 });
         },
+        beforeChange(index) {
+            if (index === 'hot') {
+                this.wait();
+                return false;
+            }
+            return true;
+        },
         getList(isFirst = false) {
+            if (this.sort === 'hot') {
+                this.wait();
+                this.sort = 'creator';
+                return;
+            }
             if (isFirst) {
                 this.page = 0;
                 this.list = [];

+ 6 - 4
src/views/product/Detail.vue

@@ -35,7 +35,7 @@
                 <div class="text" v-if="info.couponPayment">优惠券藏品</div>
             </div>
 
-            <sale-info ref="sale" v-if="canSale" :info="info"></sale-info>
+            <sale-info ref="sale" v-if="canSale" :info="info" :blindBoxItems="blindBoxItems"></sale-info>
 
             <tasks v-if="assignment && info.totalQuota" :info="info" v-model:assignments="assignments"></tasks>
             <!-- <div class="title">{{ info.name }}</div> -->
@@ -600,9 +600,11 @@ export default {
                     if (res) {
                         this.blindBoxItems = res.content;
                     }
-                    if (this.canSale) {
-                        this.$refs.sale.getData(true);
-                    }
+                    this.$nextTick(() => {
+                        if (this.canSale) {
+                            this.$refs.sale.getData(true);
+                        }
+                    });
                 })
                 .catch(e => {
                     this.$toast.clear();