panhui 4 years ago
parent
commit
ce2459fe1a

+ 1 - 1
src/main/nine-space/.env.development

@@ -1,4 +1,4 @@
-VUE_APP_BASE_URL=https://nfttest.9space.vip/
+VUE_APP_BASE_URL=http://localhost:8080/
 NODE_ENV=development
 PUBLIC_PATH=/
 ASSETS_PATH=9th

+ 7 - 1
src/main/nine-space/src/mixins/product.js

@@ -40,7 +40,13 @@ export default {
                     value: 'video/mp4'
                 }
             ],
-            startTime: ''
+            startTime: '',
+            sortOptions: {
+                精选盲盒: 'soldOut;sort,desc',
+                本期推荐: 'soldOut;sale,desc;sort,desc',
+                最HOT收藏品: 'soldOut;likes,desc;sort,desc;createdAt,desc',
+                更多藏品: 'soldOut;source,asc;sale,desc;likes,desc'
+            }
         };
     },
     computed: {

+ 15 - 11
src/main/nine-space/src/views/Discover.vue

@@ -51,7 +51,10 @@
         </van-grid>
 
         <div class="box" v-if="box.length > 0">
-            <page-title title="精选盲盒" :to="{ path: '/productList', query: { type: 'BLIND_BOX' } }"></page-title>
+            <page-title
+                title="精选盲盒"
+                :to="{ path: '/productList', query: { type: 'BLIND_BOX', title: '精选盲盒' } }"
+            ></page-title>
             <!-- <div class="box-list"></div> -->
 
             <swiper
@@ -71,7 +74,7 @@
         <div class="box" v-if="products.length > 0">
             <page-title
                 title="本期推荐"
-                :to="{ path: '/productList', query: { type: 'DEFAULT', source: 'OFFICIAL' } }"
+                :to="{ path: '/productList', query: { type: 'DEFAULT', title: '本期推荐' } }"
             ></page-title>
             <div class="box-list">
                 <template v-for="(item, index) in products" :key="item.id">
@@ -82,7 +85,7 @@
         <div class="box" v-if="hots.length > 0">
             <page-title
                 title="最HOT收藏品"
-                :to="{ path: '/productList', query: { type: 'DEFAULT', source: 'OFFICIAL' } }"
+                :to="{ path: '/productList', query: { type: 'DEFAULT', source: 'TRANSFER', title: '最HOT收藏品' } }"
             ></page-title>
             <div class="box-list">
                 <template v-for="(item, index) in hots" :key="item.id">
@@ -131,12 +134,13 @@ SwiperCore.use([Pagination, Autoplay]);
 
 import ProductInfo from '../components/product/productInfo.vue';
 import banner from '../mixins/banner';
+import product from '../mixins/product';
 import CreatorInfo from '../components/creator/CreatorInfo.vue';
 
 export default {
     name: 'discover',
     inject: ['bar'],
-    mixins: [banner],
+    mixins: [banner, product],
     components: {
         Swiper,
         SwiperSlide,
@@ -168,24 +172,24 @@ export default {
                 forbidClick: true
             });
             this.getBanner();
-            this.getProduct('BLIND_BOX', 'stock,desc;sort,desc').then(res => {
+            this.getProduct('BLIND_BOX', this.sortOptions['精选盲盒']).then(res => {
                 this.box = res;
             });
-            this.getProduct('DEFAULT', 'likes,desc;sort,desc;createdAt,desc').then(res => {
+            this.getProduct('DEFAULT', this.sortOptions['最HOT收藏品'], 'TRANSFER', 4).then(res => {
                 this.hots = res;
             });
-            this.getProduct().then(res => {
+            this.getProduct('DEFAULT', this.sortOptions['本期推荐']).then(res => {
                 this.products = res;
             });
             this.getMiner();
         },
-        getProduct(type = '', sort = 'sort,desc') {
+        getProduct(type = '', sort = 'sort,desc', source = 'OFFICIAL', size = 4) {
             return this.$http
                 .post(
                     '/collection/all',
                     {
                         page: 0,
-                        size: 4,
+                        size: size,
                         query: {
                             type: type,
                             onShelf: true,
@@ -233,9 +237,9 @@ export default {
                         query: {
                             onShelf: true,
                             del: false,
-                            source: 'OFFICIAL'
+                            source: 'OFFICIAL,TRANSFER'
                         },
-                        sort: 'sort,desc'
+                        sort: this.sortOptions['更多藏品']
                     },
                     { body: 'json' }
                 )

+ 2 - 2
src/main/nine-space/src/views/creator/Detail.vue

@@ -204,7 +204,7 @@ export default {
                         del: false,
                         source: this.sourceType
                     },
-                    sort: this.sort
+                    sort: 'soldOut;' + this.sort
                 };
             } else {
                 return {
@@ -215,7 +215,7 @@ export default {
                         del: false,
                         source: this.sourceType
                     },
-                    sort: this.sort
+                    sort: 'soldOut;' + this.sort
                 };
             }
         },

+ 18 - 6
src/main/nine-space/src/views/product/List.vue

@@ -2,10 +2,17 @@
     <div class="follow">
         <van-sticky ref="top" :offset-top="bar.value.show ? 46 : 0">
             <div class="top" v-if="!minterId">
-                <div class="name">{{ pageName }}</div>
-                <img src="@assets/icon-sosuo.png" alt="" @click="goSearch" class="search" />
+                <div class="name">{{ title || pageName }}</div>
+                <img v-if="!title" src="@assets/icon-sosuo.png" alt="" @click="goSearch" class="search" />
             </div>
-            <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getData(true)">
+            <van-tabs
+                v-if="!title"
+                v-model:active="sort"
+                :ellipsis="false"
+                line-width="16"
+                line-height="2"
+                @change="getData(true)"
+            >
                 <van-tab
                     :title="item.label"
                     :name="
@@ -75,7 +82,8 @@ export default {
                     type: 'select'
                 }
             ],
-            url: '/collection/all'
+            url: '/collection/all',
+            title: ''
         };
     },
     computed: {
@@ -95,6 +103,10 @@ export default {
         if (this.$route.query.minterId) {
             this.minterId = this.$route.query.minterId;
         }
+
+        if (this.$route.query.title) {
+            this.title = this.$route.query.title;
+        }
     },
     methods: {
         beforeData() {
@@ -106,7 +118,7 @@ export default {
                     del: false,
                     minterId: this.minterId
                 },
-                sort: this.sort
+                sort: this.sortOptions[this.title] || this.sort
             };
         },
         goSearch() {
@@ -154,7 +166,7 @@ export default {
     }
 }
 
-/deep/.van-tabs__nav--line.van-tabs__nav--complete{
+/deep/.van-tabs__nav--line.van-tabs__nav--complete {
     border-color: @tabBorder;
 }
 // /deep/.van-tab {