shish 11 miesięcy temu
rodzic
commit
f671ef1c47
1 zmienionych plików z 18 dodań i 55 usunięć
  1. 18 55
      hdApp/src/admin/order/detail.vue

+ 18 - 55
hdApp/src/admin/order/detail.vue

@@ -9,54 +9,27 @@
         </view>
       </view>
 
-      <view class="module-com order-msg" v-if="orderInfo.sendStatus == 3">
+      <view class="module-com order-msg" v-if="Number(orderInfo.sendStatus)>-1">
         <view class="module-tit">
           <text class="module-tit__text">配送进度</text>
         </view>
         <view class="module-det">
           <view class="order-msg-blo">
+            <view class="msg-list">
+              <view class="label">配送平台:</view>
+              <view class="value">{{getExpressPlatformText(orderInfo.deliveryId)}}</view>
+            </view>
             <view class="msg-list express-progress-row">
               <view class="label">配送进度:</view>
-              <view class="value">已取消</view>
+              <view class="value">{{getProgressText(orderInfo.sendStatus)}}</view>
               <view class="express-actions">
-                <button 
-                  class="admin-button-com mini-btn" 
-                  v-if="orderInfo.sendStatus == '3'" 
-                  @click.stop="openExpressPage(orderInfo.id, false)">
-                  重叫跑腿
-                </button>
+                <button class="admin-button-com mini-btn btn-danger" v-if="orderInfo.sendStatus == '0' || orderInfo.sendStatus == '1'" @click.stop="cancelMyExpress(orderInfo.id)">取消跑腿</button>
+                <button class="admin-button-com mini-btn" v-if="orderInfo.sendStatus == '3'" @click.stop="openExpressPage(orderInfo.id, false)">重叫跑腿</button>
               </view>
             </view>
           </view>
         </view>
       </view>
-      <block v-else>
-        <view class="module-com order-msg" v-if="!$util.isEmpty(expressData)">
-          <view class="module-tit">
-            <text class="module-tit__text">配送进度</text>
-          </view>
-          <view class="module-det">
-            <view class="order-msg-blo">
-              <view class="msg-list">
-                <view class="label">配送平台:</view>
-                <view class="value">{{getExpressPlatformText(expressData.deliveryId)}}</view>
-              </view>
-              <view class="msg-list express-progress-row">
-                <view class="label">配送进度:</view>
-                <view class="value">{{getExpressStatusText(expressData.orderStatus)}}</view>
-                <view class="express-actions" v-if="orderInfo.payStatus == 1">
-                  <button 
-                    class="admin-button-com mini-btn btn-danger" 
-                    v-if="orderInfo.sendStatus == '1'" 
-                    @click.stop="cancelMyExpress(orderInfo.id)">
-                    取消跑腿
-                  </button>
-                </view>
-              </view>
-            </view>
-          </view>
-        </view>
-      </block>
 
       <!-- 商品信息模块 -->
       <view class="module-com goods-info-module">
@@ -456,7 +429,6 @@ export default {
       constant: this.$constant,
       orderInfo: {},
       refreshPage: 0,
-      expressData: {},
       showModal: false,
       inputValue:0,
       thisYear: new Date().getFullYear()
@@ -491,17 +463,14 @@ export default {
     /**
      * 转换配送状态为中文显示
      */
-    getExpressStatusText(status) {
+    getProgressText(status) {
       const statusMap = {
-        1: '已叫跑腿,等跑腿接单',
-        2: '商家取消订单',
-        3: '配送方取消订单',
-        4: '跑腿接单',
-        5: '跑腿到店',
-        6: '配送中',
-        7: '跑腿撤单',
-        8: '配送完成',
-        9: '配送异常'
+        0: '已叫跑腿,等跑腿接单',
+        1: '跑腿已接单',
+        2:'已送达',
+        3:'已取消',
+        4:'跑腿已到店',
+        5:'跑腿配送中'
       }
       return statusMap[status] || status
     },
@@ -655,14 +624,6 @@ export default {
         query: { orderId: orderId }
       })
     },
-    /**
-     * 获取配送详情
-     */
-    getExpressDetail() {
-      expressDetail({ orderId: this.option.id }).then(res => {
-        this.expressData = res.data;
-      })
-    },
     showGoodsModal() {
       this.showModal = true
     },
@@ -671,7 +632,9 @@ export default {
     },
     confirmInput() {
       this.hideGoodsModal()
-      mockNotify({orderStatus:this.inputValue,wxOrderId:this.expressData.wxOrderId})
+      expressDetail({ orderId: this.option.id }).then(res => {
+        mockNotify({orderStatus:this.inputValue,wxOrderId:res.data.wxOrderId})
+      })
     }
   }
 };