xuqiang-97 il y a 4 ans
Parent
commit
f5073eff75
3 fichiers modifiés avec 35 ajouts et 17 suppressions
  1. 1 0
      src/pages/add.vue
  2. 24 6
      src/pages/address.vue
  3. 10 11
      src/pages/details.vue

+ 1 - 0
src/pages/add.vue

@@ -102,6 +102,7 @@ export default {
                     margin-left: 14px;
                 }
                 .box-con-sp {
+                    width: 235px;
                     height: 24px;
                     font-size: 14px;
                     font-weight: bold;

+ 24 - 6
src/pages/address.vue

@@ -88,7 +88,8 @@
 export default {
     data() {
         return {
-            addressList: undefined
+            addressList: undefined,
+            userAddressId: ''
         };
     },
     methods: {
@@ -98,15 +99,33 @@ export default {
             });
         },
         order() {
-            wx.redirectTo({
-                url: './order'
-            });
+            let caseId = this.$mp.query.caseId;
+            let boxIds = this.$mp.query.boxIds;
+            console.log(caseId);
+            console.log('===========');
+            console.log(boxIds);
+            console.log('===========');
+            console.log(this.userAddressId);
+            this.$http
+                .post('/orderInfo/createOrderInfo', {
+                    caseId,
+                    remark: '',
+                    boxIds,
+                    userAddressId: this.userAddressId
+                })
+                .then(res => {
+                    console.log(res);
+                });
+            // wx.redirectTo({
+            //     url: './order'
+            // });
         }
     },
     onLoad(option) {
         if (option.address) {
             let data = JSON.parse(option.address);
             this.addressList = data;
+            this.userAddressId = data.id;
         }
     }
 };
@@ -142,7 +161,6 @@ export default {
         }
     }
     .box-address {
-        // height: 120px;
         .box-lr {
             display: flex;
             align-items: center;
@@ -150,7 +168,6 @@ export default {
             margin: 0 23px;
             height: 120px;
             .box-con2 {
-                margin-top: 30px;
                 .box-con-top {
                     display: flex;
                     margin-bottom: 8px;
@@ -178,6 +195,7 @@ export default {
                         margin-left: 14px;
                     }
                     .box-con-sp {
+                        width: 235px;
                         height: 24px;
                         font-size: 14px;
                         font-weight: bold;

+ 10 - 11
src/pages/details.vue

@@ -103,7 +103,6 @@ export default {
             name: '',
             list: [],
             cardCaseInfo: {},
-            id: '',
             chooseIds: []
         };
     },
@@ -119,22 +118,22 @@ export default {
         }
     },
     methods: {
+        // 确认订单
         address() {
-            wx.redirectTo({
-                url: './address'
-            });
+            if (!this.chooseIds) {
+                wx.showToast({
+                    icon: 'none',
+                    title: '请选择卡包'
+                });
+                return;
+            }
+            this.navigateTo('/pages/address?caseId=' + this.cardCaseInfo.cardCaseId + '&boxIds=' + this.chooseIds);
         },
-        // follows() {
-        //     wx.redirectTo({
-        //         url: './follow'
-        //     });
-        // },
         details() {
-            this.$http.get('/cardCase/showInfoMA?caseId=' + this.$mp.query.id).then(res => {
+            this.$http.get('/cardCase/showInfoMA?id=' + this.$mp.query.id).then(res => {
                 console.log(res);
                 this.detailsList = res.groupBoxMap;
                 this.cardCaseInfo = res.cardCaseInfo || {};
-                this.id = this.cardCaseInfo.cardCaseId;
             });
         }
     },