瀏覽代碼

【功能优化】确认收货添加提示确认

Xiao_123 9 月之前
父節點
當前提交
82f803e767
共有 1 個文件被更改,包括 17 次插入8 次删除
  1. 17 8
      pages/order/list.vue

+ 17 - 8
pages/order/list.vue

@@ -9,8 +9,8 @@
         :current="state.currentTab"
       />
     </su-sticky>
-    <s-empty v-if="!state.pagination.list.length" icon="/static/order-empty.png" text="暂无订单" />
-    <view v-else>
+    <s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单" />
+    <view v-if="state.pagination.total > 0">
       <view
         class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20"
         v-for="order in state.pagination.list"
@@ -223,12 +223,21 @@
       return;
     }
 
-    // 正常的确认收货流程
-    const { code } = await OrderApi.receiveOrder(order.id);
-    if (code === 0) {
-      resetPagination(state.pagination);
-      await getOrderList();
-    }
+    uni.showModal({
+      title: '提示',
+      content: '确认收货吗?',
+      success: async function (res) {
+        if (!res.confirm) {
+          return;
+        }
+        // 正常的确认收货流程
+        const { code } = await OrderApi.receiveOrder(order.id);
+        if (code === 0) {
+          resetPagination(state.pagination);
+          await getOrderList();
+        }
+      },
+    });
   }
 
   // #ifdef MP-WEIXIN