Browse Source

售后商品展示

Xiao_123 1 năm trước cách đây
mục cha
commit
de58dd9d00

+ 1 - 1
pages/coupon/list.vue

@@ -10,7 +10,7 @@
       />
     </su-sticky>
     <s-empty
-      v-if="state.pagination.total === 0"
+      v-if="!state.pagination.list.length"
       icon="/static/coupon-empty.png"
       text="暂无优惠券"
     />

+ 11 - 8
pages/order/aftersale/apply.vue

@@ -42,7 +42,7 @@
         </view>
       </view>
       <!-- 申请原因 -->
-      <view class="refund-item ss-flex ss-col-center ss-row-between" @tap="state.showModal = true">
+      <view class="refund-item ss-flex ss-col-center ss-row-between" @tap="handleShowModal">
         <text class="item-title">申请原因</text>
         <view class="ss-flex refund-cause ss-col-center">
           <text class="ss-m-r-20" v-if="formData.applyReason">{{ formData.applyReason }}</text>
@@ -179,14 +179,19 @@
   function onRefundChange(e) {
     formData.way = e.detail.value;
     // 清理理由
-    state.reasonList =
-      formData.way === '10'
-        ? state.config.afterSaleRefundReasons || []
-        : state.config.afterSaleReturnReasons || [];
+    state.reasonList = formData.way === '10' ? state.config.afterSaleRefundReasons || [] : state.config.afterSaleReturnReasons || [];
     formData.applyReason = '';
     state.currentValue = '';
   }
 
+  function handleShowModal () {
+    if (!formData.way) {
+      sheep.$helper.toast('请先选择售后类型');
+      return;
+    }
+    state.showModal = true
+  }
+
   // 选择申请原因
   function onChange(e) {
     state.currentValue = e.detail.value;
@@ -213,13 +218,11 @@
       return;
     }
     state.order = data;
-    state.item = data.items.find((item) => item.id === state.itemId) || {};
-
+    state.item = data.items.find((item) => parseInt(item.id) === state.itemId) || {};
     // 设置选项
     if (state.order.status === 10) {
       state.wayList.splice(1, 1);
     }
-
     // 读取配置
     state.config = (await TradeConfigApi.getTradeConfig()).data;
   });

+ 6 - 0
sheep/components/s-order-card/s-order-card.vue

@@ -26,6 +26,7 @@
    */
   import sheep from '@/sheep';
   import { computed } from 'vue';
+   import { onLoad } from '@dcloudio/uni-app';
 
   const orderMap = [
     {
@@ -93,6 +94,11 @@
   			: bgColor
   	};
   });
+
+  onLoad(() => {
+    // 获取订单数量
+    sheep.$store('user').getNumData()
+  })
 </script>
 
 <style lang="scss" scoped>