yuanyuan 3 years ago
parent
commit
0fbfc8e03b
5 changed files with 68 additions and 36 deletions
  1. 1 1
      .env.development
  2. 31 3
      src/mixins/order.js
  3. 8 8
      src/views/Mine.vue
  4. 26 21
      src/views/product/Detail.vue
  5. 2 3
      src/views/user/ShoppingCartSubmit.vue

+ 1 - 1
.env.development

@@ -1,4 +1,4 @@
-VUE_APP_BASE_URL=https://www.raex.vip/
+VUE_APP_BASE_URL=https://test.raex.vip/
 NODE_ENV=development
 NODE_ENV=development
 VUE_APP_PUBLIC_PATH=/
 VUE_APP_PUBLIC_PATH=/
 ASSETS_PATH=raex
 ASSETS_PATH=raex

+ 31 - 3
src/mixins/order.js

@@ -39,12 +39,40 @@ export default {
             ],
             ],
             payMethodOptions: [
             payMethodOptions: [
                 {
                 {
-                    label: '微信',
-                    value: 'WEIXIN'
+                    label: '首信易快捷支付',
+                    value: 'SYXPAY'
                 },
                 },
                 {
                 {
                     label: '支付宝',
                     label: '支付宝',
-                    value: 'ALIPAY'
+                    value: 'ALI'
+                },
+                {
+                    label: '余额',
+                    value: 'BALANCE'
+                },
+                {
+                    label: '银联',
+                    value: 'UNION'
+                },
+                {
+                    label: '衫德快捷绑卡',
+                    value: 'QUICK_BIND'
+                },
+                {
+                    label: '数字人民币',
+                    value: 'DECP'
+                },
+                {
+                    label: '绿洲灵气',
+                    value: 'LINGQI'
+                },
+                {
+                    label: '积分',
+                    value: 'POINT'
+                },
+                {
+                    label: '绿洲石',
+                    value: 'STONE'
                 }
                 }
             ]
             ]
         };
         };

+ 8 - 8
src/views/Mine.vue

@@ -428,18 +428,18 @@ export default {
             this.$http.get('/userDetail/light/' + this.userInfo.id).then(res => {
             this.$http.get('/userDetail/light/' + this.userInfo.id).then(res => {
                 this.light = res;
                 this.light = res;
             });
             });
+            this.$http
+                .post('/cart/myStatus')
+                .then(res => {
+                    this.cartNum = res.count;
+                })
+                .catch(e => {
+                    this.$toast(e.error);
+                });
         }
         }
         this.$http.get('/sysConfig/get/chatGPT_show').then(res => {
         this.$http.get('/sysConfig/get/chatGPT_show').then(res => {
             this.showGPT = res.value === true || res.value === '1';
             this.showGPT = res.value === true || res.value === '1';
         });
         });
-        this.$http
-            .post('/cart/myStatus')
-            .then(res => {
-                this.cartNum = res.count;
-            })
-            .catch(e => {
-                this.$toast(e.error);
-            });
     },
     },
     methods: {
     methods: {
         goAi() {
         goAi() {

+ 26 - 21
src/views/product/Detail.vue

@@ -1061,6 +1061,9 @@ export default {
                 });
                 });
         },
         },
         getCartNum() {
         getCartNum() {
+            if (!this.isLogin) {
+                return;
+            }
             let id = this.info.id;
             let id = this.info.id;
             let data = {
             let data = {
                 collectionId: id
                 collectionId: id
@@ -1075,27 +1078,29 @@ export default {
                 });
                 });
         },
         },
         addCart() {
         addCart() {
-            if (this.info.source == 'OFFICIAL') {
-                this.$toast('官方藏品不能加入购物车');
-                return;
-            }
-            if (this.userInfo.id == this.info.ownerId) {
-                this.$toast('不能把自己的藏品加入购物车');
-                return;
-            }
-            let id = this.info.id;
-            let data = {
-                collectionId: id
-            };
-            this.$http
-                .post('/cart/create', data)
-                .then(res => {
-                    this.$toast.success('恭喜加入购物车');
-                    this.getCartNum();
-                })
-                .catch(e => {
-                    this.$toast(e.error);
-                });
+            this.checkLogin().then(() => {
+                if (this.info.source == 'OFFICIAL') {
+                    this.$toast('官方藏品不能加入购物车');
+                    return;
+                }
+                if (this.userInfo.id == this.info.ownerId) {
+                    this.$toast('不能把自己的藏品加入购物车');
+                    return;
+                }
+                let id = this.info.id;
+                let data = {
+                    collectionId: id
+                };
+                this.$http
+                    .post('/cart/create', data)
+                    .then(res => {
+                        this.$toast.success('恭喜加入购物车');
+                        this.getCartNum();
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
+            });
         },
         },
         checkBuy() {
         checkBuy() {
             this.checkLogin()
             this.checkLogin()

+ 2 - 3
src/views/user/ShoppingCartSubmit.vue

@@ -187,7 +187,6 @@ export default {
                 vip: this.$store.state.userInfo.vipPurchase > 0 ? true : false
                 vip: this.$store.state.userInfo.vipPurchase > 0 ? true : false
             };
             };
             params.sign = encryptUtil.encrypt(qs.stringify({ ...params, ts: new Date().getTime() }));
             params.sign = encryptUtil.encrypt(qs.stringify({ ...params, ts: new Date().getTime() }));
-            console.log('ahagadg', typeof this.collectionIds);
             return this.$http.post('/order/mqCreate', params).then(res => {
             return this.$http.post('/order/mqCreate', params).then(res => {
                 return new Promise((resolve, reject) => {
                 return new Promise((resolve, reject) => {
                     let checkOrder = () => {
                     let checkOrder = () => {
@@ -265,13 +264,13 @@ export default {
                         this.$toast(e.error || '购买失败');
                         this.$toast(e.error || '购买失败');
                         this.payName = '1';
                         this.payName = '1';
                     });
                     });
-            } else if (this.payType == 'ALIPAY') {
+            } else if (this.payType == 'ALI') {
                 this.$toast.loading({
                 this.$toast.loading({
                     message: '支付中',
                     message: '支付中',
                     forbidClick: true
                     forbidClick: true
                 });
                 });
                 this.$http
                 this.$http
-                    .get('/payOrder/v2/alipay', { id: this.id })
+                    .get('/payOrder/v2/ali', { id: this.id })
                     .then(res => {
                     .then(res => {
                         this.$toast.clear();
                         this.$toast.clear();
                         document.location.href = res;
                         document.location.href = res;