Quellcode durchsuchen

fix:订单列表相关优化

DaMowang vor 3 Jahren
Ursprung
Commit
928ae9e6f5
3 geänderte Dateien mit 54 neuen und 31 gelöschten Zeilen
  1. 1 1
      src/pages/product/p_details.vue
  2. 41 23
      src/pages/szw-order-list/index.vue
  3. 12 7
      src/pages/to-pay-list/index.vue

+ 1 - 1
src/pages/product/p_details.vue

@@ -199,7 +199,7 @@ export default {
       }, // 商品详情
       checked: false, //是否选中协议
       buyNum: 1, //购买数量
-      pfway: "0", // 批发
+      pfway: "1", // 批发
       showAuth: false,
 
       userinfo: {},

+ 41 - 23
src/pages/szw-order-list/index.vue

@@ -14,19 +14,7 @@
                 <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">{{
-                                li.type == 1
-                                ? "零售专区"
-                                : li.type == 2
-                                ? "批发专区"
-                                : li.type == 3
-                                ? "精品专区"
-                                : li.type == 4
-                                ? "今日值得买"
-                                : li.type == 5
-                                ? "茶宝兑换"
-                                : ""
-                                }}</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)">
@@ -121,8 +109,8 @@ export default {
                     uni.stopPullDownRefresh();
                     let da = res.data.data.data;
 
-                    if (page == 1) this.orderList = []
-                    this.orderList = [...da, ...this.orderList]
+                    if (page <= 1) this.orderList = []
+                    this.orderList = [ ...this.orderList, ...da]
 
                 } else {
                     appEv.errTips(res.msg || "");
@@ -230,14 +218,18 @@ export default {
                 if (da[1] == 5) return "已作废";
             };
         },
-        // tidyTpye() {
-        //     return (da) => {
-        //         switch(da) {
-        //             1: return "待支付";
-        //             break;
-        //         }
-        //     };
-        // },
+        tidyTpye() {
+            return (da) => {
+                switch(da) {
+                    case 1: return "零售专区";
+                    case 2: return "批发专区";
+                    case 3: return "精品专区";
+                    case 4: return "今日值得买";
+                    case 5: return "茶宝兑换";
+                    default: return ""
+                }
+            };
+        },
     },
     //上拉加载事件
     onReachBottom() {
@@ -529,4 +521,30 @@ page {
     position: absolute;
     left: 30rpx;
 }
+
+.typetag{
+    border: 2px solid #ccc;
+    border-radius: 10rpx;
+    padding: 1px 18rpx;
+}
+.tagcolor1{
+    border-color: #7986ca;
+    color: #7986ca;
+}
+.tagcolor2{
+    border-color: #afd7f7;
+    color: #afd7f7;
+}
+.tagcolor3{
+    border-color: #c8b4e1;
+    color: #c8b4e1;
+}
+.tagcolor4{
+    border-color: #e6c9e1;
+    color: #e6c9e1;
+}
+.tagcolor5{
+    border-color: #f4e68a;
+    color: #f4e68a;
+}
 </style>

+ 12 - 7
src/pages/to-pay-list/index.vue

@@ -41,19 +41,19 @@
         <!-- 订单信息 -->
         <view class="order mar_t20">
             <view class="order_list flex_r flex_ac flex_jb">
-                <view class="list_name flex_r flex_jb"><text>数</text><text></text></view>
+                <view class="list_name">数量</view>
                 <view class="list_con">{{Data.num}}</view>
             </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.is_sell != 1">
                 <view class="flex_r flex_ac">
-                    <view class="list_name flex_r flex_jb"><text>运</text><text></text></view>
+                    <view class="list_name">运费</view>
                     <view class="list_con p_color">({{freight}}元/每套)</view>
                 </view>
                 <view class="list_con">¥{{freight * Data.num}}</view>
             </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2 || Data.type == 5">
                 <view class="flex_r flex_ac">
-                    <view class="list_name flex_r flex_jb"><text>茶</text><text></text></view>
+                    <view class="list_name">茶宝</view>
                     <view class="list_con p_color">(可用{{userinfo.cha_bao}})</view>
                 </view>
                 <view class="list_con" v-if="Data.type != 5">{{goodsInfo.treasure_price }} 茶宝</view>
@@ -61,17 +61,17 @@
             </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2">
                 <view class="flex_r flex_ac">
-                    <view class="list_name flex_r flex_jb"><text></text><text></text><text></text><text></text></view>
+                    <view class="list_name">批发积分</view>
                     <view class="list_con p_color">(可用{{userinfo.integral}})</view>
                 </view>
                 <view class="list_con">{{goodsInfo.trade_num * Data.num}} 批发积分</view>
             </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 5">
-                <view class="list_name flex_r flex_jb"><text></text><text></text><text></text><text></text></view>
+                <view class="list_name">商品金额</view>
                 <view class="list_con">¥{{(Data.type == 2 ? goodsInfo.trade_price : goodsInfo.cost_price) * Data.num || 0}}</view>
             </view>
             <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 4 && Data.type != 5">
-                <view class="list_name flex_r flex_jb"><text></text><text></text><text></text><text></text></view>
+                <view class="list_name">可用余额</view>
                 <view class="list_con p_color">¥{{userinfo.user_money}}</view>
             </view>
         </view>
@@ -378,7 +378,12 @@ page {
 
 // 订单信息
 .list_name {
-    width: 102rpx;
+    width: 112rpx;
+    text-align-last: justify;
+    font-size: 26rpx;
+    color: rgba(0,0,0,.8);
+    font-family: SourceHanSansCN-Medium;
+    font-weight: 700;
 }
 
 .order_list:nth-last-child(1) {