فهرست منبع

Merge branch 'dev' of xiongzhu/raex_front into master

panhui 4 سال پیش
والد
کامیت
272c7b9b6e

+ 5 - 1
src/components/Post.vue

@@ -124,8 +124,12 @@ export default {
             let pageUrl = this.pageUrl;
             let id = this.info.id;
             if (pageUrl === 'assetDetail') {
-                pageUrl = 'productDetail';
                 id = this.info.publicCollectionId;
+                pageUrl = 'productDetail';
+            }
+
+            if (pageUrl === 'productDetail' && !this.assignment) {
+                pageUrl = 'productDetail/' + id;
             }
             if (this.isLogin && this.assignment && pageUrl === 'productDetail') {
                 return resolveUrl(

+ 1 - 4
src/components/product/productInfo.vue

@@ -100,10 +100,7 @@ export default {
                 this.$toast('该通道暂且关闭');
             } else {
                 this.$router.push({
-                    path: '/productDetail',
-                    query: {
-                        id: this.info.id
-                    }
+                    path: '/productDetail/' + this.info.id
                 });
             }
         }

+ 1 - 1
src/components/product/productLarge.vue

@@ -1,7 +1,7 @@
 <template>
     <router-link
         :to="{
-            path: type === 'collection' ? '/productDetail' : '/newsDetail',
+            path: type === 'collection' ? '/productDetail/' + info.id : '/newsDetail',
             query: {
                 id: info.id
             }

+ 1 - 1
src/mixins/banner.js

@@ -2,7 +2,7 @@ export default {
     methods: {
         goNext(info, props = '') {
             if (info.link && info.linkType === 'collection') {
-                this.$router.push(`/productDetail?id=${info.linkContent}${props}`);
+                this.$router.push(`/productDetail/${info.linkContent}${props}`);
             } else if (info.link && info.linkType === 'user') {
                 this.$router.push(`/creatorDetail?id=${info.linkContent}${props}`);
             } else if (info.link && info.linkType === 'activity') {

+ 1 - 1
src/router/index.js

@@ -241,7 +241,7 @@ const routes = [
         component: () => import('../views/account/TradingPassword.vue')
     },
     {
-        path: '/productDetail',
+        path: '/productDetail/:id',
         name: 'productDetail',
         component: () => import('../views/product/Detail.vue'),
         meta: {

+ 14 - 8
src/views/product/Detail.vue

@@ -373,7 +373,8 @@ export default {
             limit: {},
             couponList: [],
             assignments: [],
-            noPay: false
+            noPay: false,
+            collectionId: 0
         };
     },
     computed: {
@@ -398,10 +399,15 @@ export default {
         this.$store.dispatch('getUsedBuy');
         this.$store.dispatch('getTime');
         this.$store.dispatch('getUserInfo');
-        this.getProduct();
-        this.$http.get('/order/checkLimit', { collectionId: this.$route.query.id }).then(res => {
+        console.log(this.$route.params);
+        if (this.$route.params.id) {
+            this.collectionId = this.$route.params.id;
+        }
+        this.$http.get('/order/checkLimit', { collectionId: this.collectionId }).then(res => {
             this.limit = res;
         });
+
+        this.getProduct();
         // if (this.isLogin) {
         //     this.$http
         //         .post(
@@ -409,7 +415,7 @@ export default {
         //             {
         //                 query: {
         //                     userId: this.$store.state.userInfo.id,
-        //                     collectionId: this.$route.query.id,
+        //                     collectionId: this.collectionId,
         //                     status: 'NOT_PAID'
         //                 }
         //             },
@@ -453,7 +459,7 @@ export default {
                 forbidClick: true
             });
             this.$http
-                .get('/collection/get/' + this.$route.query.id)
+                .get('/collection/get/' + this.collectionId)
                 .then(res => {
                     if (this.$store.state.from === 'scanCode') {
                         res.onShelf = true;
@@ -469,12 +475,12 @@ export default {
                         wx.updateAppMessageShareData({
                             title: '第九空间-' + res.name,
                             desc: '全球首个基于区块链的游戏资产集换中心',
-                            link: location.origin + '/9th/productDetail?id=' + res.id,
+                            link: location.origin + '/9th/productDetail/' + res.id,
                             imgUrl: this.getImg(this.changeImgs(this.banners), '', 300)
                         });
                         wx.updateTimelineShareData({
                             title: '第九空间-' + res.name,
-                            link: location.origin + '/9th/productDetail?id=' + res.id,
+                            link: location.origin + '/9th/productDetail/' + res.id,
                             imgUrl: this.getImg(this.changeImgs(this.banners), '', 300)
                         });
                         console.log(wx);
@@ -601,7 +607,7 @@ export default {
                     this.$router.push({
                         path: '/submit',
                         query: {
-                            id: this.$route.query.id,
+                            id: this.collectionId,
                             invitor: this.$route.query.invitor
                         }
                     });