Browse Source

支付方式

xuqiang 4 năm trước cách đây
mục cha
commit
06bf175314

+ 0 - 10
src/components/AllorderInfo.vue

@@ -187,14 +187,7 @@ export default {
         again() {
             this.navigateTo('/pages/details?id=' + this.caseId);
         },
-        // userIds() {
-        //     this.$http.get('/store/get/' + this.storeId).then(res => {
-        //         // console.log(res);
-        //         this.userId = res.userId;
-        //     });
-        // },
         sales() {
-            // console.log(this.all.storeUserId);
             let userId = this.$store.state.userInfo.id;
             if (userId == this.all.storeUserId) {
                 this.toast('此商品是你店铺所有');
@@ -311,7 +304,6 @@ export default {
                     .get('/orderInfo/get/' + this.id)
                     .then(res => {
                         this.refundId = res.refundId;
-                        // console.log(this.refundId);
                         this.hideLoading();
                     })
                     .catch(e => {
@@ -405,9 +397,7 @@ export default {
         }
     },
     created() {
-        // console.log(this.all);
         this.rufundApply();
-        // this.userIds();
     }
 };
 </script>

+ 3 - 18
src/components/AllselloutInfo.vue

@@ -53,7 +53,7 @@
                 <div v-if="status == 'CREATED'" @click="cancel" class="box-but">取消订单</div>
                 <div v-if="status == 'CREATED'" @click="Buyers" class="box-but2">联系买家</div>
                 <div v-if="status == 'PAYED'" @click="cancel" class="box-but">取消订单</div>
-                <div v-if="status == 'PAYED'" @click="deliver" class="box-but2">立即发货</div>
+                <div v-if="status == 'PAYED'" @click="newShow = true" class="box-but2">立即发货</div>
                 <div v-if="status == 'SEND'" @click="logistics" class="box-but">查看物流</div>
                 <div v-if="status == 'SEND'" @click="Buyers" class="box-but3">联系买家</div>
                 <div v-if="status == 'COMPETED'" @click="Buyers" class="box-but">联系买家</div>
@@ -93,9 +93,9 @@
             description="物流类型"
             cancel-text="取消"
             :actions="actions"
-            @close="onClose"
+            @close="newShow = false"
             @select="select"
-            @cancel="cancels"
+            @cancel="newShow = false"
         >
             <van-field
                 required="true"
@@ -187,9 +187,6 @@ export default {
             if (this.status === 'REFUNDED') {
                 return '退款成功';
             }
-            // if (this.status === 'group') {
-            //     return '系统自动退款';
-            // }
             return '';
         }
     },
@@ -245,10 +242,8 @@ export default {
             });
         },
         Buyers() {
-            // console.log(this.all);
             let userId = this.$store.state.userInfo.id;
             if (userId == this.all.userId) {
-                // console.log('===');
                 this.toast('此商品是你店铺所有');
             } else {
                 this.navigateTo('/pages/chat?toUserId=' + this.all.userId + '&toName=' + this.userNickName);
@@ -319,7 +314,6 @@ export default {
             this.time = e.detail;
             this.value = this.time.value;
             this.logisticNo = this.order;
-            // console.log(this.value);
             this.showLoading();
             this.$http
                 .post('orderInfo/send', {
@@ -346,15 +340,6 @@ export default {
                         duration: 2000
                     });
                 });
-        },
-        onClose() {
-            this.newShow = false;
-        },
-        cancels() {
-            this.newShow = false;
-        },
-        deliver() {
-            this.newShow = true;
         }
     }
 };

+ 15 - 14
src/pages/allselldetails.vue

@@ -1,7 +1,7 @@
 <config>
 {
     "navigationBarBackgroundColor": "#ff6c00",
-    "navigationBarTextStyle": "black",
+    "navigationBarTextStyle": "white",
     "backgroundTextStyle":"light"
 }
 </config>
@@ -93,7 +93,7 @@
         <div class="box-buttom">
             <div class="box-buttom-con">
                 <p>商品价格</p>
-                <p class="box-buttom-p">¥{{ total }}</p>
+                <p class="box-buttom-p">¥{{ allPrice }}</p>
             </div>
         </div>
         <div class="box-buttom">
@@ -188,7 +188,7 @@
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>取消订单</span>
                 </div>
-                <div v-if="status.orderStatus === 'PAYED'" class="box-btn-right" @click="deliver">
+                <div v-if="status.orderStatus === 'PAYED'" class="box-btn-right" @click="newShow = true">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>立即发货</span>
                 </div>
@@ -240,9 +240,9 @@
             description="物流类型"
             cancel-text="取消"
             :actions="actions"
-            @close="onClose"
+            @close="newShow = false"
             @select="select"
-            @cancel="cancels"
+            @cancel="newShow = false"
         >
             <van-field
                 required="true"
@@ -274,6 +274,7 @@ export default {
             addressList: [],
             name: '',
             orderInfoId: '',
+            allPrice: 0,
             records: [],
             status: [],
             logisTics: [],
@@ -378,6 +379,15 @@ export default {
                     this.Boxes = res.cardBoxList;
                     this.orderInfoId = res.id;
                     this.postage = res.cardCase.postage;
+                    let countArr = [];
+                    countArr = res.cardBoxList.map(item => {
+                        return item.boxPrice;
+                    });
+                    if (countArr.length > 0) {
+                        this.allPrice = countArr.reduce((total, item) => {
+                            return total + item;
+                        }, 0);
+                    }
                     if (res.cardCase.customName) {
                         this.cardCaseInfo = res.cardCase;
                         this.cardCaseInfo.name = res.cardCase.customName;
@@ -551,15 +561,6 @@ export default {
                     });
                 });
         },
-        onClose() {
-            this.newShow = false;
-        },
-        cancels() {
-            this.newShow = false;
-        },
-        deliver() {
-            this.newShow = true;
-        },
         deletes() {
             wx.showModal({
                 title: '提示',

+ 13 - 4
src/pages/confirmorder.vue

@@ -57,7 +57,7 @@
         <div class="box-buttom">
             <div class="box-buttom-con">
                 <p>商品价格</p>
-                <p class="box-buttom-p">¥{{ total }}</p>
+                <p class="box-buttom-p">¥{{ allPrice }}</p>
             </div>
         </div>
         <div class="box-buttom">
@@ -102,6 +102,7 @@ export default {
             userAddressId: '',
             caseId: 0,
             boxIds: [],
+            allPrice: 0,
             Boxes: [],
             store: {},
             cardCaseInfo: {},
@@ -140,7 +141,7 @@ export default {
                     userAddressId: this.userAddressId
                 })
                 .then(res => {
-                    console.log(res);
+                    // console.log(res);
                     this.hideLoading();
                     this.id = res.id;
                     wx.redirectTo({
@@ -166,11 +167,19 @@ export default {
                 })
                 .then(res => {
                     this.hideLoading();
-                    console.log(res);
+                    // console.log(res);
                     this.total = res.total;
                     this.store = res.store;
-                    // console.log(this.store);
                     this.Boxes = res.selectedBoxes;
+                    let countArr = [];
+                    countArr = res.selectedBoxes.map(item => {
+                        return item.boxPrice;
+                    });
+                    if (countArr.length > 0) {
+                        this.allPrice = countArr.reduce((total, item) => {
+                            return total + item;
+                        }, 0);
+                    }
                     this.postage = res.selectedCase.postage;
                     this.cardCaseInfo = res.selectedCase;
                     if (this.cardCaseInfo.customName) {

+ 43 - 15
src/pages/orderdetails.vue

@@ -76,7 +76,7 @@
         <div class="box-buttom">
             <div class="box-buttom-con">
                 <p>商品价格</p>
-                <p class="box-buttom-p">¥{{ total }}</p>
+                <p class="box-buttom-p">¥{{ allPrice }}</p>
             </div>
         </div>
         <div class="box-buttom">
@@ -174,7 +174,7 @@
                     <img src="/native/imgs/btn_04@3x.png" alt="" />
                     <span>取消订单</span>
                 </div>
-                <div v-if="status.orderStatus === 'CREATED'" class="box-btn-right" @click="pay">
+                <div v-if="status.orderStatus === 'CREATED'" class="box-btn-right" @click="newShow = true">
                     <img src="/native/imgs/btn_01@3x.png" alt="" />
                     <span>立即支付</span>
                 </div>
@@ -211,6 +211,16 @@
                 alt=""
             />
         </van-popup>
+        <van-action-sheet
+            :show="newShow"
+            description="支付方式"
+            cancel-text="取消"
+            :actions="actions"
+            @close="newShow = false"
+            @select="select"
+            @cancel="newShow = false"
+        >
+        </van-action-sheet>
     </div>
 </template>
 
@@ -218,6 +228,7 @@
 import store from '../mixins/store';
 export default {
     mixins: [store],
+    newShow: false,
     name: '',
     data() {
         return {
@@ -234,14 +245,27 @@ export default {
             logisTics: [],
             stepsList: [],
             stepsShow: [],
+            allPrice: 0,
             caseId: '',
             minters: 0,
             seconds: 0,
             allTime: 5 * 60 - 1,
             closeTime: '',
-            store: {}
+            store: {},
+            payOptions: [{ label: '微信支付', value: 'WECHAT' }, { label: '余额支付', value: 'BALANCE' }]
         };
     },
+    computed: {
+        actions() {
+            let list = [...this.payOptions];
+            return list.map(item => {
+                return {
+                    name: item.label,
+                    value: item.value
+                };
+            });
+        }
+    },
     methods: {
         logisticShow() {
             this.show = false;
@@ -302,18 +326,24 @@ export default {
             this.$http
                 .get('/orderInfo/get/' + this.$mp.query.id)
                 .then(res => {
-                    console.log(res);
                     this.hideLoading();
                     this.caseId = res.caseId;
                     this.status = res;
                     this.store = res.store;
-                    // console.log(this.store);
                     this.addressList = res.address;
                     this.total = res.total;
                     this.Boxes = res.cardBoxList;
                     this.orderInfoId = res.id;
                     this.postage = res.cardCase.postage;
-                    // this.cardCaseInfo = res.cardCase;
+                    let countArr = [];
+                    countArr = res.cardBoxList.map(item => {
+                        return item.boxPrice;
+                    });
+                    if (countArr.length > 0) {
+                        this.allPrice = countArr.reduce((total, item) => {
+                            return total + item;
+                        }, 0);
+                    }
                     if (res.cardCase.customName) {
                         this.cardCaseInfo = res.cardCase;
                         this.cardCaseInfo.name = res.cardCase.customName;
@@ -347,7 +377,6 @@ export default {
                         this.showTimeTab = true;
                     }
                     if (this.status.orderStatus == 'COMPETED' || this.status.orderStatus == 'SEND') {
-                        // console.log(this.status.orderStatus);
                         this.$http.get('/orderInfo/checkLogistic', { orderInfoId: this.$mp.query.id }).then(res => {
                             this.hideLoading();
                             this.logisTics = res.logistic.result;
@@ -435,14 +464,13 @@ export default {
         },
         Apply() {
             this.navigateTo('/pages/Apply?id=' + this.orderInfoId);
-            // if (this.status.orderStatus == 'PAYED') {
-            //     this.navigateTo('/pages/Apply?id=' + this.orderInfoId);
-            // } else {
-            //     wx.showToast({
-            //         icon: 'none',
-            //         title: '卡包已开箱,无法申请退款'
-            //     });
-            // }
+        },
+        select(e) {
+            if (e.detail.value == 'WECHAT') {
+                this.pay();
+            } else {
+                console.log('余额支付');
+            }
         },
         pay() {
             wx.showLoading({

+ 0 - 1
src/pages/store/homePage.vue

@@ -292,7 +292,6 @@ export default {
                     this.empty = true;
                 }
                 this.hideLoading();
-
                 this.$nextTick(() => {
                     if (this.needChange) {
                         wx.pageScrollTo({

+ 1 - 1
src/pages/wallet.vue

@@ -153,7 +153,7 @@ export default {
                 .then(res => {
                     this.hideLoading();
                     this.recordList = res;
-                    console.log(this.recordList);
+                    // console.log(this.recordList);
                     let countArr = [],
                         TXCount = [];
                     if (res.length === 0) {