Explorar o código

feat:订单列表添加待自提状态,已发货订单展示物流信息

DaMoWang %!s(int64=2) %!d(string=hai) anos
pai
achega
13dae1d903

+ 8 - 0
src/pages/my/index.vue

@@ -292,6 +292,14 @@
             <image class="fun_img" src="/static/my/payment.png" mode=""></image>
             <view class="fun_text">待付款</view>
           </navigator>
+          <navigator
+            class="fun_list flex_c flex_ac"
+            url="/pages/szw-order-list/index?status=5"
+            hover-class="none"
+          >
+            <image class="fun_img" src="/static/my/pickInStore.png" mode=""></image>
+            <view class="fun_text">待自提</view>
+          </navigator>
           <navigator
             class="fun_list flex_c flex_ac"
             url="/pages/szw-order-list/index?status=2"

+ 7 - 8
src/pages/szw-order-details/index.vue

@@ -25,10 +25,9 @@
                     <view class="addr-text">{{ orderInfo.address }}</view>
                 </view>
             </view>
-            <!-- <view class="logistics_btn" v-if="orderInfo.logistics && orderInfo.logistics.logistics_no && orderInfo.logistics.logistics_business" @tap="goLogistics">
-                <view class="l_box" v-if="orderInfo.logistics.statusMsg && orderInfo.logistics.statusMsg != ''">{{ orderInfo.logistics.statusMsg }}</view>
-                <view class="l_box" v-else>已发货:{{ orderInfo.logistics.logistics_business }},快递单号:{{ orderInfo.logistics.logistics_no }}</view>
-            </view> -->
+            <view class="logistics_btn" v-if="[1].includes(orderInfo.order_status)" @tap="goLogistics">
+                <view class="l_box">已发货:{{ orderInfo.shipping_name }},快递单号:{{ orderInfo.shipping_code }}</view>
+            </view>
 
             <view class="goods-list">
                 <view class="goods-info_box">
@@ -262,10 +261,10 @@ export default {
 
         // 跳转物流详情
         goLogistics() {
-            uni.navigateTo({
-                url: "/pages/logistics/index?id=" +
-                    this.orderInfo.orderDetail.orderDetaillId,
-            });
+            // uni.navigateTo({
+            //     url: "/pages/logistics/index?id=" +
+            //         this.orderInfo.orderDetail.orderDetaillId,
+            // });
         },
     },
     computed: {

+ 19 - 64
src/pages/szw-order-list/index.vue

@@ -2,91 +2,41 @@
   <view class="container">
     <view class="status-box">
       <view class="status_tap_box" style="position: relative">
-        <view
-          @tap="statusTap"
-          class="status-label"
-          v-for="(item, index) in statusType"
-          :key="index"
-          :class="item[0] == currentType ? 'active' : ''"
-          :data-index="item[0]"
-        >
-          {{ item[1] }}
-        </view>
+        <view @tap="statusTap" class="status-label" v-for="(item, index) in statusType" :key="index" :class="item[0] == currentType ? 'active' : ''" :data-index="item[0]">{{ item[1] }}</view>
       </view>
     </view>
     <not-goods v-if="haveGoods" textStr="抱歉!暂无相关订单" />
     <view class="order-list" v-if="orderList && orderList.length > 0">
       <view v-for="(li, index) in orderList" :key="index">
-        <!-- 未付款 -->
         <view class="a-order">
           <view class="overflow" :data-id="li.id">
             <view class="list-title flex_r flex_ac flex_jb ellipsis">
-              <view :class="['fz_text', 'typetag', 'tagcolor' + li.type]">{{
-                tidyTpye(li.type)
-              }}</view>
-              <view class="fz_text">{{
-                tidyStatus([li.pay_status, li.order_status])
-              }}</view>
+              <view :class="['fz_text', 'typetag', 'tagcolor' + li.type]">{{ tidyTpye(li.type) }}</view>
+              <view class="fz_text">{{ tidyStatus([li.pay_status, li.order_status]) }}</view>
             </view>
-            <view
-              class="goods-info flex_r flex_ac flex_jb"
-              :data-type="li.type"
-              @tap="toDetails(li)"
-            >
+            <view class="goods-info flex_r flex_ac flex_jb" :data-type="li.type" @tap="toDetails(li)">
               <view class="goods-info-bar overflow flex_r flex_ac">
                 <view class="imgs_bar img-box">
-                  <image
-                    :src="li.original_img"
-                    mode="cover"
-                    class="goods-img"
-                  ></image>
+                  <image :src="li.original_img" mode="cover" class="goods-img"></image>
                 </view>
-                <view class="goods_name ellipsis2">{{
-                  li.goods_name || ""
-                }}</view>
+                <view class="goods_name ellipsis2">{{ li.goods_name || "" }}</view>
               </view>
               <view class="goodsDetail_info">
-                <view class="goods_price r_color"
-                  >¥<text class="r_color">{{ li.total_amount }}</text></view
-                >
+                <view class="goods_price r_color">¥<text class="r_color">{{ li.total_amount }}</text></view>
                 <view class="unimport">共{{ li.goods_num }}件</view>
               </view>
             </view>
           </view>
           <view class="price-box flex_r flex_ac">
             <template v-if="li.order_status != 5">
-              <view
-                class="btn cancel-btn"
-                v-if="[0, 1].includes(li.order_status)"
-                @tap="toCancel(li)"
-                >取消订单</view
-              >
-              <view
-                class="btn topay-btn"
-                v-if="[0, 2].includes(li.pay_status)"
-                @tap="toPay(li)"
-                >立即支付</view
-              >
-              <view
-                class="btn topay-btn"
-                @tap="toTake(li)"
-                v-if="
-                  [0, 1, 7].includes(li.order_status) &&
-                  [1].includes(li.pay_status)
-                "
-                >确认收货</view>
-                <view
-                class="btn topay-btn"
-                @tap="toCode(li)"
-                v-if="
-                  [8].includes(li.order_status)
-                "
-                >待自提</view>
+              <view class="btn cancel-btn" v-if="[0].includes(li.order_status)" @tap="toCancel(li)">取消订单</view>
+              <view class="btn topay-btn" v-if="[0, 2].includes(li.pay_status)" @tap="toPay(li)">立即支付</view>
+              <view class="btn topay-btn" @tap="toTake(li)" v-if="[0, 1, 7].includes(li.order_status) && [1].includes(li.pay_status)">确认收货</view>
+              <view class="btn topay-btn" @tap="toCode(li)" v-if="[8].includes(li.order_status)">待自提</view>
             </template>
             <view class="btn cancel-btn" @click="toDetails(li)">查看订单</view>
           </view>
         </view>
-        <!-- 未付款 end -->
       </view>
     </view>
     <view class="loading-indicator opacity">{{ loadingTip }}</view>
@@ -110,6 +60,7 @@ export default {
       statusType: [
         ["0", "全部"],
         ["1", "待付款"],
+        ["5", "待自提"],
         ["2", "待发货"],
         ["3", "待收货"],
         ["4", "已收货"],
@@ -232,8 +183,7 @@ export default {
     toTake(e) {
       let that = this;
       uni.showModal({
-        content:
-          "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
+        content: "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
         confirmText: "确认收货",
         confirmColor: "#fa2f2e",
         cancelText: "取消",
@@ -252,7 +202,7 @@ export default {
         },
       });
     },
-    toCode(e){
+    toCode(e) {
       this.goto("/pagesB/order/verificationCode", { id: e.order_id });
     },
     //菜单切换
@@ -599,22 +549,27 @@ page {
   font-size: 22rpx;
   font-weight: 500;
 }
+
 .tagcolor1 {
   border-color: #007aff;
   color: #007aff;
 }
+
 .tagcolor2 {
   border-color: #4cd964;
   color: #4cd964;
 }
+
 .tagcolor3 {
   border-color: #f0ad4e;
   color: #f0ad4e;
 }
+
 .tagcolor4 {
   border-color: #dd524d;
   color: #dd524d;
 }
+
 .tagcolor5 {
   border-color: #4335d6;
   color: #4335d6;

BIN=BIN
src/static/my/pickInStore.png