xuqiang-97 4 سال پیش
والد
کامیت
c07b694ebe
5فایلهای تغییر یافته به همراه116 افزوده شده و 22 حذف شده
  1. 1 1
      project.config.json
  2. 45 8
      src/components/AllorderInfo.vue
  3. 1 1
      src/mixins/allPage.js
  4. 2 1
      src/pages/allorder.vue
  5. 67 11
      src/pages/orderdetails.vue

+ 1 - 1
project.config.json

@@ -124,7 +124,7 @@
                     "id": -1,
                     "name": "订单详情",
                     "pathName": "/pages/orderdetails",
-                    "scene": null
+                    "query": "id=779"
                 },
                 {
                     "id": -1,

+ 45 - 8
src/components/AllorderInfo.vue

@@ -6,7 +6,7 @@
                     <img src="/native/tabbar/icon_kapai_shangjia_da.png" alt="" />
                     <p>光之城卡牌</p>
                 </div>
-                <!-- <div class="box-tit-seller" v-for="(item, index) in tabs" :key="index">{{ item }}</div> -->
+                <!-- <div class="box-tit-seller">{{ this.name }}</div> -->
             </div>
             <div class="box-con-Cards" v-for="(item, index) in orderList" :key="index.id" @click="allorder">
                 <img :src="item.images" alt="" />
@@ -29,9 +29,9 @@
             </div>
             <div class="box-bor"></div>
             <div class="box-butm">
-                <div v-if="this.status == 'CREATED'" class="box-but">取消订单</div>
+                <div v-if="this.status == 'CREATED'" @click="cancel" class="box-but">取消订单</div>
                 <div v-if="this.status == 'CREATED'" class="box-but2">立即支付</div>
-                <div v-if="this.status == 'PAYED'" class="box-but">申请退款</div>
+                <div v-if="this.status == 'PAYED'" @click="Apply" class="box-but">申请退款</div>
                 <div v-if="this.status == 'PAYED'" class="box-but3">提醒发货</div>
                 <div v-if="this.status == 'SEND'" class="box-but">查看物流</div>
                 <div v-if="this.status == 'SEND'" class="box-but2">立即支付</div>
@@ -47,16 +47,13 @@ export default {
         all: {
             type: Object,
             default: () => {
-                return {
-                    orderList: []
-                };
+                return {};
             }
         }
     },
     data() {
         return {
-            active: '待支付',
-            tabs: ['待支付', '待发货', '待发货', '已完成']
+            orderList: []
         };
     },
     methods: {
@@ -64,9 +61,49 @@ export default {
             this.orderList = this.all.orderBoxDTOS;
             this.status = this.all.status;
             this.id = this.all.orderInfoId;
+            // if (this.all.status === 'CREATED') {
+            //     this.name = '待支付';
+            // }
+            // if (this.status === 'CANCELED') {
+            //     this.name = '已取消';
+            // }
+            // if (this.status === 'PAYED') {
+            //     this.name = '待发货';
+            // }
+            // if (this.status === 'COMPETED') {
+            //     this.name = '已完成';
+            // }
+            // if (this.status === 'SEND') {
+            //     this.name = '待收货';
+            // }
         },
         allorder() {
             this.navigateTo('/pages/orderdetails?id=' + this.id);
+        },
+        cancel() {
+            wx.showModal({
+                title: '提示',
+                content: '确定取消订单?',
+                success: res => {
+                    if (res.confirm) {
+                        this.$http.post('/orderInfo/cancel', { orderInfoId: this.id }).then(res => {
+                            wx.hideLoading();
+                            wx.showToast({
+                                icon: 'none',
+                                title: '订单已取消'
+                            });
+                            this.status = 'CANCELED';
+                        });
+                        console.log('=====');
+                        this.allFn();
+                    }
+                }
+            });
+        },
+        Apply() {
+            this.$http.post('orderInfo/refund', { orderInfoId: this.id, remark: '' }).then(res => {
+                console.log(res);
+            });
         }
     },
     created() {

+ 1 - 1
src/mixins/allPage.js

@@ -35,7 +35,7 @@ export default {
                     label: '已完成'
                 },
                 {
-                    value: '',
+                    value: 'ALL',
                     label: '全部'
                 }
             ]

+ 2 - 1
src/pages/allorder.vue

@@ -33,7 +33,7 @@ export default {
     data() {
         return {
             active: '全部',
-            tabs: ['全部', '待支付', '待发货', '待收', '已完成'],
+            tabs: ['全部', '待支付', '待发货', '待收', '已完成'],
             empty: false,
             allList: []
         };
@@ -78,6 +78,7 @@ export default {
         padding-left: 16px;
         .tab-item {
             font-size: 14px;
+            font-weight: bold;
             color: #000;
             line-height: 24px;
             padding: 18px 30px 18px 0;

+ 67 - 11
src/pages/orderdetails.vue

@@ -13,13 +13,13 @@
         </div>
         <div class="box-adderss">
             <div v-if="this.status.orderStatus !== 'CREATED' && this.status.orderStatus !== 'PAYED'">
-                <div class="box-adderss-con">
+                <div class="box-adderss-con" @click="logistics">
                     <img src="../static/imgs/dingdan_icon_wuliu@3x.png" alt="" />
                     <div class="box-con-top">
                         <p>{{ this.stepsShow.status }}</p>
                         <p class="box-adderss-span">{{ this.stepsShow.time }}</p>
                     </div>
-                    <div class="box-adderss-right" @click="logistics">></div>
+                    <div class="box-adderss-right">></div>
                 </div>
                 <div class="box-border"></div>
             </div>
@@ -75,7 +75,7 @@
         <div class="box-buttom">
             <div class="box-buttom-con">
                 <p>实际支付</p>
-                <p class="box-buttom-p">¥{{ total }}</p>
+                <p class="box-buttom-p3">¥{{ total }}</p>
             </div>
         </div>
         <div class="box-buttom">
@@ -97,7 +97,7 @@
                 <div class="box-footer-con">
                     <p>订单编号</p>
                     <div class="box-footer-cr">
-                        <span @click="copy">复制</span>
+                        <span @click="orderCopy">复制</span>
                         <p class="box-footer-p">2019052035464</p>
                     </div>
                 </div>
@@ -147,6 +147,7 @@
                 <div
                     v-if="this.status.orderStatus === 'SEND'"
                     class="box-btn-left"
+                    @click="logistics"
                     :style="{ backgroundImage: `url(/native/imgs/btn_02@3x.png)` }"
                 >
                     查看物流
@@ -158,10 +159,27 @@
                 >
                     确认收货
                 </div>
+                <!-- 待发货 -->
+                <div
+                    v-if="this.status.orderStatus === 'PAYED'"
+                    class="box-btn-left2"
+                    @click="cancel"
+                    :style="{ backgroundImage: `url(/native/imgs/btn_03@3x.png)` }"
+                >
+                    取消订单
+                </div>
+                <div
+                    v-if="this.status.orderStatus === 'PAYED'"
+                    class="box-btn-right"
+                    :style="{ backgroundImage: `url(/native/imgs/btn_01@3x.png)` }"
+                >
+                    确认收货
+                </div>
                 <!-- 待支付 -->
                 <div
                     v-if="this.status.orderStatus === 'CREATED'"
                     class="box-btn-left2"
+                    @click="cancel"
                     :style="{ backgroundImage: `url(/native/imgs/btn_03@3x.png)` }"
                 >
                     取消订单
@@ -195,8 +213,8 @@
             custom-style="height:450px;overflow-y: auto;"
             use-slot
             title="快递详情"
-            :showConfirmButton="false"
             :show="show"
+            :showConfirmButton="false"
         >
             <div class="dialog-con">
                 <div>
@@ -204,7 +222,7 @@
                 </div>
                 <div>
                     <span>物流单号:{{ this.logisTics.number }}</span>
-                    <span class="dialog-cv">复制</span>
+                    <span class="dialog-cv" @click="logisticCopy">复制</span>
                 </div>
                 <div class="dialog-border"></div>
             </div>
@@ -247,7 +265,6 @@ export default {
                 this.total = res.total;
                 this.Boxes = res.cardBoxList;
                 this.orderInfoId = res.id;
-                console.log(this.orderInfoId);
                 this.cardCaseInfo = res.cardCase.collection;
                 if (this.status.orderStatus === 'CREATED') {
                     this.status.label = '待支付';
@@ -258,7 +275,7 @@ export default {
                     this.status.name = '很遗憾,订单已取消';
                 }
                 if (this.status.orderStatus === 'PAYED') {
-                    this.status.label = '发货';
+                    this.status.label = '发货';
                     this.status.name = '很快就发货了,请耐心等待哦!';
                     this.showTimeTab = true;
                 }
@@ -287,19 +304,51 @@ export default {
                 this.stepsShow = res.logistic.result.list[0];
             });
         },
-        copy() {
+        cancel() {
+            wx.showModal({
+                title: '提示',
+                content: '确定取消订单?',
+                success: res => {
+                    if (res.confirm) {
+                        this.$http.post('/orderInfo/cancel', { orderInfoId: this.$mp.query.id }).then(res => {
+                            wx.hideLoading();
+                            wx.showToast({
+                                icon: 'none',
+                                title: '订单已取消'
+                            });
+                            this.status.orderStatus = 'CANCELED';
+                        });
+                    }
+                }
+            });
+        },
+        orderCopy() {
             // wx.setClipboardData({
-            //     data: this.orderInfo.id + '',
+            //     data: this.orderInfoId + '',
             //     success(res) {
             //         wx.getClipboardData({
             //             success(res) {
             //                 wx.showToast({
-            //                     title: '复制成功'
+            //                     title: '订单单号复制成功'
             //                 });
             //             }
             //         });
             //     }
             // });
+        },
+        logisticCopy() {
+            wx.setClipboardData({
+                data: this.logisTics.number + '',
+                success(res) {
+                    wx.getClipboardData({
+                        success(res) {
+                            wx.showToast({
+                                title: '物流单号复制成功'
+                            });
+                        }
+                    });
+                }
+            });
         }
     },
     created() {
@@ -506,6 +555,13 @@ export default {
                 color: #000000;
                 line-height: 22px;
             }
+            .box-buttom-p3 {
+                height: 22px;
+                font-size: 16px;
+                font-weight: bold;
+                color: #f42202;
+                line-height: 22px;
+            }
             .box-buttom-p2 {
                 height: 22px;
                 font-size: 13px;