Browse Source

Merge branch 'master' of git.huaml.com:zhh/front-end

shizhongqi 11 months ago
parent
commit
63ded429ef
3 changed files with 178 additions and 42 deletions
  1. 2 3
      hdApp/src/admin/home/order.vue
  2. 171 39
      hdApp/src/admin/order/detail.vue
  3. 5 0
      hdApp/src/api/shop-express/index.js

+ 2 - 3
hdApp/src/admin/home/order.vue

@@ -72,9 +72,9 @@
               </block>
               <block v-else>
                 <view class="admin-button-com middle" v-if="item.sendStatus == '0' && item.payStatus == 1" @click.stop="openExpressPage(item.id, true)">呼叫跑腿</view>
-                <view class="admin-button-com default" v-if="item.sendStatus == '1' && item.payStatus == 1" @click.stop="cancelExpress(item.id)" style="background-color: #ff6b6b;">取消跑腿</view>
+                <view class="admin-button-com default" v-if="item.sendStatus == '1' && item.payStatus == 1">已发跑腿</view>
                 <view class="admin-button-com middle" v-if="item.sendStatus == '3' && item.payStatus == 1" @click.stop="openExpressPage(item.id, false)">重叫跑腿</view>
-                <view class="admin-button-com middle" v-if="item.sendStatus == '2' && item.payStatus == 1" @click.stop="selectExpress(item.id)">跑腿完成</view>
+                <view class="admin-button-com default" v-if="item.sendStatus == '2' && item.payStatus == 1">跑腿完成</view>
               </block>
 
             </view>
@@ -322,7 +322,6 @@ export default {
         }
       })
     },
-    
     /**
      * 查看配送成功详情
      */

+ 171 - 39
hdApp/src/admin/order/detail.vue

@@ -1,6 +1,7 @@
 <template>
   <view class="app-content">
     <view class="page-det">
+
       <!-- 售后付款单提示 -->
       <view class="after-sale-tip" v-if="orderInfo.forward == 1" @click="goPreOrder(orderInfo)">
         <view class="tip-content">
@@ -8,55 +9,58 @@
         </view>
       </view>
 
-      <!-- 配送进度模块 -->
-      <view class="module-com order-msg">
+      <view class="module-com order-msg" v-if="orderInfo.sendStatus == 3">
         <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" 
-                  v-if="orderInfo.sendStatus == '0'" 
-                  @click.stop="openExpressPage(orderInfo.id, true)">
-                  呼叫跑腿
-                </button>
-                <button 
-                  class="admin-button-com mini-btn btn-danger" 
-                  v-if="orderInfo.sendStatus == '1'" 
-                  @click.stop="cancelExpress(orderInfo.id)">
-                  取消跑腿
-                </button>
+              <view class="value">已取消</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" 
-                  v-if="orderInfo.sendStatus == '2'" 
-                  @click.stop="selectExpress(orderInfo.id)">
-                  跑腿完成
-                </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="cancelExpress(orderInfo.id)">
+                    取消跑腿
+                  </button>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+      </block>
+
       <!-- 商品信息模块 -->
       <view class="module-com">
-        <view class="module-tit">商品信息</view>
+        <view class="module-tit" @click="showGoodsModal">商品信息</view>
         <view class="module-det">
           <block v-if="!$util.isEmpty(orderInfo.goodsInfoList)">
             <detailGoods 
@@ -387,9 +391,6 @@
           扫码收款
         </button>
         <button class="admin-button-com middle" v-if="orderInfo.sendStatus == '0' && orderInfo.payStatus == 1" @click.stop="openExpressPage(orderInfo.id, true)">呼叫跑腿</button>
-        <button class="admin-button-com default" v-if="orderInfo.sendStatus == '1' && orderInfo.payStatus == 1" @click.stop="cancelExpress(orderInfo.id)" style="background-color: #ff6b6b;">取消跑腿</button>
-        <button class="admin-button-com middle" v-if="orderInfo.sendStatus == '3' && orderInfo.payStatus == 1" @click.stop="openExpressPage(item.id, false)">重叫跑腿</button>
-        <button class="admin-button-com middle" v-if="orderInfo.sendStatus == '2' && orderInfo.payStatus == 1" @click.stop="selectExpress(item.id)">跑腿完成</button>
         <button 
           class="admin-button-com middle" 
           @click.stop="printOrder(orderInfo)" 
@@ -398,6 +399,23 @@
         </button>
       </view>
     </view>
+
+    <!-- 模拟接口使用 -->
+    <view class="goods-modal-mask" v-if="showModal" @click="hideGoodsModal">
+      <view class="goods-modal" @click.stop>
+        <view class="modal-header">
+          <text class="modal-title">输入数值</text>
+          <text class="modal-close" @click="hideGoodsModal">×</text>
+        </view>
+        <view class="modal-body">
+          <input class="modal-input" type="number" v-model="inputValue" @focus="inputValue=''" placeholder="请输入数值" />
+        </view>
+        <view class="modal-footer">
+          <button class="modal-btn cancel-btn" @click="hideGoodsModal">取消</button>
+          <button class="modal-btn confirm-btn" @click="confirmInput">确认</button>
+        </view>
+      </view>
+    </view>
   </view>
 </template>
 
@@ -414,7 +432,7 @@ const commonUtil = require("@/utils/common.js");
 import { confirmSettle } from "@/api/settle/index"
 import { refundAmount } from "@/api/refund";
 import { expressDetail } from "@/api/express";
-
+import { cancelExpressOrder,mockNotify } from '@/api/shop-express'
 export default {
   name: "detail",
   components: { 
@@ -431,7 +449,9 @@ export default {
       constant: this.$constant,
       orderInfo: {},
       refreshPage: 0,
-      expressData: {}
+      expressData: {},
+      showModal: false,
+      inputValue:0
     };
   },
   
@@ -465,7 +485,8 @@ export default {
      */
     getExpressStatusText(status) {
       const statusMap = {
-        1: '订单创建成功',
+        0: '已呼叫,待配送平台确认',
+        1: '等待小哥接单',
         2: '商家取消订单',
         3: '配送方取消订单',
         4: '配送员接单',
@@ -614,16 +635,15 @@ export default {
         try {
           const res = await cancelExpressOrder({orderId: orderId})
           if (res.code === 1) {
-            this.$msg('配送订单已取消')
+            this.$msg('已取消')
             // 刷新订单列表
             this.resetList()
             this.getOrderList()
           } else {
-            this.$msg(res.msg || '取消配送订单失败')
+            this.$msg('取消失败')
           }
         } catch (error) {
-          this.$msg('取消配送订单失败,请重试')
-          console.error('取消配送订单错误:', error)
+          this.$msg('取消失败')
         }
       })
     },
@@ -644,6 +664,16 @@ export default {
       expressDetail({ orderId: this.option.id }).then(res => {
         this.expressData = res.data;
       })
+    },
+    showGoodsModal() {
+      this.showModal = true
+    },
+    hideGoodsModal() {
+      this.showModal = false
+    },
+    confirmInput() {
+      this.hideGoodsModal()
+      mockNotify({orderStatus:this.inputValue,wxOrderId:this.expressData.wxOrderId})
     }
   }
 };
@@ -832,4 +862,106 @@ export default {
     }
   }
 }
+
+/* 商品信息弹框样式 */
+.goods-modal-mask {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  z-index: 9999;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.goods-modal {
+  width: 80%;
+  max-width: 600upx;
+  background-color: #fff;
+  border-radius: 12upx;
+  overflow: hidden;
+  box-shadow: 0 10upx 30upx rgba(0, 0, 0, 0.3);
+}
+
+.modal-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 30upx 40upx;
+  background-color: #f8f9fa;
+  border-bottom: 1px solid #e9ecef;
+}
+
+.modal-title {
+  font-size: 32upx;
+  font-weight: 600;
+  color: #333;
+}
+
+.modal-close {
+  font-size: 40upx;
+  color: #999;
+  cursor: pointer;
+  line-height: 1;
+  padding: 10upx;
+}
+
+.modal-body {
+  padding: 40upx;
+}
+
+.modal-input {
+  width: 100%;
+  height: 80upx;
+  border: 1px solid #ddd;
+  border-radius: 8upx;
+  padding: 0 20upx;
+  font-size: 28upx;
+  box-sizing: border-box;
+  
+  &:focus {
+    border-color: #3385ff;
+    outline: none;
+  }
+}
+
+.modal-footer {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  gap: 20upx;
+  padding: 30upx 40upx;
+  background-color: #f8f9fa;
+  border-top: 1px solid #e9ecef;
+}
+
+.modal-btn {
+  padding: 20upx 40upx;
+  border-radius: 8upx;
+  font-size: 28upx;
+  border: none;
+  cursor: pointer;
+  min-width: 120upx;
+  
+  &.cancel-btn {
+    background-color: #f5f5f5;
+    color: #666;
+    
+    &:hover {
+      background-color: #e9ecef;
+    }
+  }
+  
+  &.confirm-btn {
+    background-color: #3385ff;
+    color: #fff;
+    
+    &:hover {
+      background-color: #2d74e7;
+    }
+  }
+}
 </style>

+ 5 - 0
hdApp/src/api/shop-express/index.js

@@ -61,4 +61,9 @@ export const cancelExpressOrder = data => {
  */
 export const getExpressOrder = data => {
 	return https.post('/intra-city/get-order', data)
+}
+
+//模拟
+export const mockNotify = data => {
+	return https.post('/intra-city/mock-notify', data)
 }