xuqiang-97 4 年之前
父節點
當前提交
791d0df0e2

+ 1 - 1
.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=http://192.168.50.120:8080
+VUE_APP_BASE_URL=https://zhuoka.izouma.com

+ 36 - 16
src/components/AllorderInfo.vue

@@ -34,9 +34,9 @@
                 <div v-if="this.status == 'PAYED'" @click="Apply" class="box-but">申请退款</div>
                 <div v-if="this.status == 'PAYED'" @click="remind" class="box-but3">提醒发货</div>
                 <div v-if="this.status == 'SEND'" @click="logistics" class="box-but">查看物流</div>
-                <div v-if="this.status == 'SEND'" class="box-but2">立即支付</div>
+                <div v-if="this.status == 'SEND'" class="box-but2">确认收货</div>
                 <div v-if="this.status == 'COMPETED'" class="box-but">申请售后</div>
-                <div v-if="this.status == 'COMPETED'" @click="remind" class="box-but3">提醒发货</div>
+                <div v-if="this.status == 'COMPETED'" @click="logistics" class="box-but3">查看物流</div>
                 <div v-if="this.status == 'CANCELED'" @click="deletes" class="box-but">删除订单</div>
                 <div v-if="this.status == 'CANCELED'" @click="again" class="box-but3">重新购买</div>
             </div>
@@ -103,7 +103,7 @@ export default {
                 return '已取消';
             }
             if (this.status === 'PAYED') {
-                return '待发货';
+                return '卖家待发货';
             }
             if (this.status === 'COMPETED') {
                 return '已完成';
@@ -119,8 +119,10 @@ export default {
             this.show = false;
         },
         logistics() {
+            this.showLoading();
             // 查看物流
             this.$http.get('/orderInfo/checkLogistic', { orderInfoId: this.id }).then(res => {
+                wx.hideLoading();
                 this.logisTics = res.logistic.result;
                 let steps = [];
                 res.logistic.result.list.forEach(item => {
@@ -143,6 +145,20 @@ export default {
         again() {
             this.navigateTo('/pages/details?id=' + this.caseId);
         },
+        logisticCopy() {
+            wx.setClipboardData({
+                data: this.logisTics.number + '',
+                success(res) {
+                    wx.getClipboardData({
+                        success(res) {
+                            wx.showToast({
+                                title: '物流单号复制成功'
+                            });
+                        }
+                    });
+                }
+            });
+        },
         cancel() {
             wx.showModal({
                 title: '提示',
@@ -155,7 +171,9 @@ export default {
                                 icon: 'none',
                                 title: '订单已取消'
                             });
-                            this.refreash();
+                            setTimeout(() => {
+                                this.refreash();
+                            }, 1000);
                         });
                     }
                 }
@@ -173,7 +191,9 @@ export default {
                                 icon: 'none',
                                 title: '订单已删除'
                             });
-                            this.refreash();
+                            setTimeout(() => {
+                                this.refreash();
+                            }, 1000);
                         });
                     }
                 }
@@ -182,17 +202,17 @@ export default {
         Apply() {
             wx.showModal({
                 title: '提示',
-                content: '确定申请退款?',
+                content: '敬请开放',
                 success: res => {
                     if (res.confirm) {
-                        this.$http.post('orderInfo/refund', { orderInfoId: this.id, remark: '' }).then(res => {
-                            wx.hideLoading();
-                            wx.showToast({
-                                icon: 'none',
-                                title: '退款成功'
-                            });
-                            this.refreash();
-                        });
+                        // this.$http.post('orderInfo/refund', { orderInfoId: this.id, remark: '' }).then(res => {
+                        //     wx.hideLoading();
+                        //     wx.showToast({
+                        //         icon: 'none',
+                        //         title: '退款成功'
+                        //     });
+                        //     this.refreash();
+                        // });
                     }
                 }
             });
@@ -202,7 +222,7 @@ export default {
                 wx.hideLoading();
                 wx.showToast({
                     icon: 'none',
-                    title: '提醒成功'
+                    title: '提醒商家成功'
                 });
             });
         }
@@ -216,7 +236,7 @@ export default {
 }
 /deep/ .van-steps {
     height: 307px;
-    width: 336px;
+    width: 334px;
     overflow: auto !important;
     border-radius: 0 0 12px 12px;
 }

二進制
src/native/imgs/kong_png_womaidaode@3x.png


+ 26 - 2
src/pages/allorder.vue

@@ -20,7 +20,10 @@
         <div v-for="(item, index) in allList" :key="index + 2">
             <allorder-info :all="item" @refreash="allFn"></allorder-info>
         </div>
-        <van-empty v-if="empty" image="/native/imgs/kong_png_xiaoxiliebiao.png" description="暂无卡包信息哦~">
+        <van-empty v-if="empty" image="/native/imgs/kong_png_womaidaode@3x.png" description="暂无相关订单哦~">
+            <van-button round type="danger" class="bottom-button" @click="Look">
+                去逛逛
+            </van-button>
         </van-empty>
     </div>
 </template>
@@ -43,6 +46,11 @@ export default {
             this.active = item;
             this.allFn();
         },
+        Look() {
+            wx.switchTab({
+                url: '/pages/Home'
+            });
+        },
         allFn() {
             this.allList = [];
             this.showLoading();
@@ -62,6 +70,13 @@ export default {
                     if (res.length === 0) {
                         this.empty = true;
                     }
+                })
+                .catch(e => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: e.error
+                    });
                 });
         },
         loginMethods() {
@@ -74,7 +89,9 @@ export default {
 .container {
     background: #f5f7fa;
     padding-top: 30px;
-    padding: 60px 0 13px 0;
+    padding: 60px 0 40px 0;
+    min-height: 610px;
+    // height: 100%;
     .box-tab {
         background: #ffffff;
         .flex();
@@ -94,5 +111,12 @@ export default {
             }
         }
     }
+    /deep/ .van-button {
+        width: 290px;
+        height: 48px;
+        background: #ff6c00;
+        border-radius: 12px;
+    }
+    // .bottom(@bottom:0.5px);
 }
 </style>

+ 20 - 0
src/pages/confirmorder.vue

@@ -118,6 +118,7 @@ export default {
                 });
                 return;
             }
+            this.showLoading();
             this.$http
                 .post('/orderInfo/createOrderInfo', {
                     caseId: this.caseId,
@@ -126,11 +127,20 @@ export default {
                     userAddressId: this.userAddressId
                 })
                 .then(res => {
+                    wx.hideLoading();
                     this.id = res.id;
                     this.navigateTo('/pages/orderdetails?id=' + this.id);
+                })
+                .catch(e => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: e.error
+                    });
                 });
         },
         getFn() {
+            this.showLoading();
             let caseId = this.$mp.query.caseId;
             let boxIds = this.$mp.query.boxIds;
             this.$http
@@ -139,12 +149,21 @@ export default {
                     boxIds
                 })
                 .then(res => {
+                    wx.hideLoading();
                     this.total = res.total;
                     this.Boxes = res.selectedBoxes;
                     this.cardCaseInfo = res.selectedCase.collection;
+                })
+                .catch(e => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: e.error
+                    });
                 });
         },
         getDefaultAddress() {
+            this.showLoading();
             this.$http
                 .postJson('/address/all', {
                     query: {
@@ -153,6 +172,7 @@ export default {
                     }
                 })
                 .then(res => {
+                    this.showLoading();
                     if (!res.empty) {
                         this.userAddressId = res.content[0].id;
                         this.addressList = res.content[0];

+ 14 - 5
src/pages/details.vue

@@ -129,11 +129,20 @@ export default {
     methods: {
         details() {
             this.showLoading();
-            this.$http.get('/cardCase/showInfoMA?caseId=' + this.$mp.options.id).then(res => {
-                this.hideLoading();
-                this.detailsList = res.groupBoxMap;
-                this.cardCaseInfo = res.cardCaseInfo || {};
-            });
+            this.$http
+                .get('/cardCase/showInfoMA?caseId=' + this.$mp.options.id)
+                .then(res => {
+                    this.hideLoading();
+                    this.detailsList = res.groupBoxMap;
+                    this.cardCaseInfo = res.cardCaseInfo || {};
+                })
+                .catch(e => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: e.error
+                    });
+                });
         },
         // 确认订单
         purchase() {

+ 113 - 62
src/pages/orderdetails.vue

@@ -93,7 +93,7 @@
         <div class="box-buttom">
             <div class="box-buttom-con">
                 <p>订单留言</p>
-                <div class="box-buttom-p2">选填,备注对本次交易的说明</div>
+                <div class="box-buttom-p2">{{ status.remark }}</div>
             </div>
         </div>
         <div class="box-border-but"></div>
@@ -131,6 +131,7 @@
             <van-notice-bar
                 v-if="this.status.orderStatus === 'SEND'"
                 color="#FF6C00"
+                background="#ff6c0016"
                 text="为了保障您的售后服务,收货时请拍摄完整的快递开封视频避免纠纷"
             />
             <div class="box-btn">
@@ -171,10 +172,10 @@
                 <div
                     v-if="this.status.orderStatus === 'PAYED'"
                     class="box-btn-left2"
-                    @click="cancel"
+                    @click="Apply"
                     :style="{ backgroundImage: `url(/native/imgs/btn_03@3x.png)` }"
                 >
-                    取消订单
+                    申请退款
                 </div>
                 <div
                     v-if="this.status.orderStatus === 'PAYED'"
@@ -271,39 +272,55 @@ export default {
             this.show = false;
         },
         getFn() {
-            this.$http.get('/orderInfo/get/' + this.$mp.query.id).then(res => {
-                this.caseId = res.caseId;
-                this.status = res;
-                this.addressList = res.address;
-                this.total = res.total;
-                this.Boxes = res.cardBoxList;
-                this.orderInfoId = res.id;
-                this.cardCaseInfo = res.cardCase.collection;
-                if (this.status.orderStatus === 'CREATED') {
-                    this.status.label = '待支付';
-                    this.status.name = '请尽快支付,04分56秒 后未支付将自动取消订单';
-                }
-                if (this.status.orderStatus === 'CANCELED') {
-                    this.status.label = '已取消';
-                    this.status.name = '很遗憾,订单已取消';
-                }
-                if (this.status.orderStatus === 'PAYED') {
-                    this.status.label = '待发货';
-                    this.status.name = '很快就发货了,请耐心等待哦!';
-                    this.showTimeTab = true;
-                }
-                if (this.status.orderStatus === 'COMPETED') {
-                    this.status.label = '已完成';
-                    this.status.name = '交易成功啦!快去把好物分享给小伙伴吧';
-                    this.showTimeTab = true;
-                }
-                if (this.status.orderStatus === 'SEND') {
-                    this.status.label = '卖家已发货';
-                    this.status.name = '宝贝正在飞奔到你的怀中!';
-                    this.showTimeTab = true;
-                }
-            });
+            this.showLoading();
+            this.$http
+                .get('/orderInfo/get/' + this.$mp.query.id)
+                .then(res => {
+                    console.log(res);
+                    wx.hideLoading();
+                    this.caseId = res.caseId;
+                    this.status = res;
+                    this.addressList = res.address;
+                    this.total = res.total;
+                    this.Boxes = res.cardBoxList;
+                    this.orderInfoId = res.id;
+                    this.cardCaseInfo = res.cardCase.collection;
+                    if (this.status.orderStatus === 'CREATED') {
+                        this.status.label = '待支付';
+                        this.status.name = '请尽快支付,04分56秒 后未支付将自动取消订单';
+                    }
+                    if (this.status.orderStatus === 'CANCELED') {
+                        this.status.label = '已取消';
+                        this.status.name = '很遗憾,订单已取消';
+                    }
+                    if (this.status.orderStatus === 'PAYED') {
+                        this.status.label = '待发货';
+                        this.status.name = '很快就发货了,请耐心等待哦!';
+                        this.showTimeTab = true;
+                    }
+                    if (this.status.orderStatus === 'COMPETED') {
+                        this.status.label = '已完成';
+                        this.status.name = '交易成功啦!快去把好物分享给小伙伴吧';
+                        this.showTimeTab = true;
+                    }
+                    if (this.status.orderStatus === 'SEND') {
+                        this.status.label = '卖家已发货';
+                        this.status.name = '宝贝正在飞奔到你的怀中!';
+                        this.showTimeTab = true;
+                    }
+                })
+                .catch(e => {
+                    wx.hideLoading();
+                    wx.showToast({
+                        icon: 'none',
+                        title: '请返回首页操作'
+                    });
+                });
+            // setTimeout(() => {
+            // 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 => {
+                wx.hideLoading();
                 this.logisTics = res.logistic.result;
                 let steps = [];
                 res.logistic.result.list.forEach(item => {
@@ -316,13 +333,17 @@ export default {
                 this.stepsList = steps;
                 this.stepsShow = res.logistic.result.list[0];
             });
+            // }
+            // }, 1000);
         },
         again() {
             this.navigateTo('/pages/details?id=' + this.caseId);
         },
         logistics() {
+            this.showLoading();
             // 查看物流
             this.$http.get('/orderInfo/checkLogistic', { orderInfoId: this.$mp.query.id }).then(res => {
+                wx.hideLoading();
                 this.logisTics = res.logistic.result;
                 let steps = [];
                 res.logistic.result.list.forEach(item => {
@@ -348,37 +369,62 @@ export default {
                                 icon: 'none',
                                 title: '收货成功'
                             });
-                            this.getFn();
+                            setTimeout(() => {
+                                this.getFn();
+                            }, 1000);
                         });
                     }
                 }
             });
         },
+        Apply() {
+            wx.showModal({
+                title: '提示',
+                content: '敬请开放',
+                success: res => {
+                    if (res.confirm) {
+                        // this.$http.post('orderInfo/refund', { orderInfoId: this.id, remark: '' }).then(res => {
+                        //     wx.hideLoading();
+                        //     wx.showToast({
+                        //         icon: 'none',
+                        //         title: '退款成功'
+                        //     });
+                        //     setTimeout(() => {
+                        //     this.getFn();
+                        // }, 1000);
+                        // });
+                    }
+                }
+            });
+        },
         pay() {
             wx.showLoading({
                 title: '加载中'
             });
             this.$http
-                .post('/orderInfo/pay', { orderInfoId: this.$mp.query.id, transactionId: '111' })
+                .get('/payDelegation/wxPay', {
+                    orderId: this.$mp.query.id
+                })
                 .then(res => {
-                    console.log(res);
+                    res.package = res.packageValue;
+                    // console.log(res);
                     wx.requestPayment({
-                        // ...res,
-                        // success: () => {
-                        //     wx.hideLoading();
-                        //     wx.showToast({
-                        //         title: '支付成功'
-                        //     });
-                        //     // this.$set(this.orderInfo, 'status', 'PAID');
-                        // },
-                        // fail: e => {
-                        //     console.log(e);
-                        //     wx.hideLoading();
-                        //     wx.showToast({
-                        //         icon: 'none',
-                        //         title: '支付失败'
-                        //     });
-                        // }
+                        ...res,
+                        success: () => {
+                            wx.hideLoading();
+                            wx.showToast({
+                                title: '支付成功'
+                            });
+                            this.getFn();
+                        },
+                        fail: e => {
+                            console.log(e);
+                            wx.hideLoading();
+                            wx.showToast({
+                                icon: 'none',
+                                title: '支付失败'
+                            });
+                        }
                     });
                 })
                 .catch(e => {
@@ -401,7 +447,9 @@ export default {
                                 icon: 'none',
                                 title: '订单已取消'
                             });
-                            this.getFn();
+                            setTimeout(() => {
+                                this.getFn();
+                            }, 1000);
                         });
                     }
                 }
@@ -419,7 +467,9 @@ export default {
                                 icon: 'none',
                                 title: '订单已删除'
                             });
-                            this.navigateTo('/pages/details?id=' + this.caseId);
+                            setTimeout(() => {
+                                this.navigateTo('/pages/allorder');
+                            }, 1000);
                         });
                     }
                 }
@@ -466,7 +516,7 @@ export default {
     }
     /deep/ .van-steps {
         height: 307px;
-        width: 336px;
+        width: 334px;
         overflow: auto !important;
         border-radius: 0 0 12px 12px;
     }
@@ -678,7 +728,7 @@ export default {
             .box-buttom-p2 {
                 height: 22px;
                 font-size: 13px;
-                font-weight: 400;
+                font-weight: bold;
                 color: #c8c9cc;
             }
         }
@@ -692,15 +742,16 @@ export default {
             .box-footer-cr {
                 display: flex;
                 span {
-                    width: 40px;
-                    height: 20px;
+                    width: 38px;
+                    height: 18px;
                     border-radius: 2px;
-                    border: 1px solid #c8c9cc;
+                    border: 2px solid #c8c9cc;
                     font-size: 12px;
                     font-weight: 400;
                     color: #c8c9cc;
-                    line-height: 20px;
+                    line-height: 18px;
                     text-align: center;
+                    margin-right: 3px;
                 }
             }
             p {