Преглед изворни кода

优化:已发货的订单商品不允许申请售后

萤火科技 пре 1 година
родитељ
комит
cbfd32ef33
2 измењених фајлова са 8 додато и 3 уклоњено
  1. 2 1
      common/enum/order/DeliveryStatus.js
  2. 6 2
      pages/order/detail.vue

+ 2 - 1
common/enum/order/DeliveryStatus.js

@@ -6,5 +6,6 @@ import Enum from '../enum'
  */
 export default new Enum([
   { key: 'NOT_DELIVERED', name: '未发货', value: 10 },
-  { key: 'DELIVERED', name: '已发货', value: 20 }
+  { key: 'DELIVERED', name: '已发货', value: 20 },
+  { key: 'PART_DELIVERED', name: '部分发货', value: 30 }
 ])

+ 6 - 2
pages/order/detail.vue

@@ -131,7 +131,8 @@
           <!-- 商品售后 -->
           <view class="goods-refund">
             <text v-if="goods.refund" class="stata-text">已申请售后</text>
-            <view v-else-if="order.isAllowRefund" class="action-btn" @click.stop="handleApplyRefund(goods.order_goods_id)">申请售后</view>
+            <view v-else-if="order.isAllowRefund && goods.delivery_status == DeliveryStatusEnum.DELIVERED.value" class="action-btn"
+              @click.stop="handleApplyRefund(goods.order_goods_id)">申请售后</view>
           </view>
         </view>
       </view>
@@ -240,6 +241,7 @@
 </template>
 
 <script>
+  import { inArray } from '@/utils/util'
   import {
     OrderTypeEnum,
     DeliveryStatusEnum,
@@ -258,7 +260,9 @@
 
   export default {
     data() {
-      return {
+      return {    
+        // 外部方法
+        inArray,
         // 枚举类
         OrderTypeEnum,
         DeliveryStatusEnum,