Ver Fonte

bugfix:之前代码被覆盖的问题

YunaiV há 1 ano atrás
pai
commit
ce389efdae

+ 10 - 0
sheep/api/trade/order.js

@@ -102,6 +102,16 @@ const OrderApi = {
       },
     });
   },
+  // 获得交易订单的物流轨迹
+  getOrderExpressTrackList: (id) => {
+    return request({
+      url: `/app-api/trade/order/get-express-track-list`,
+      method: 'GET',
+      params: {
+        id,
+      },
+    });
+  },
   // 获得交易订单数量
   getOrderCount: () => {
     return request({

+ 17 - 7
sheep/components/s-coupon-select/s-coupon-select.vue

@@ -1,3 +1,4 @@
+<!-- 订单确认的优惠劵选择弹窗 -->
 <template>
   <su-popup
     :show="show"
@@ -16,20 +17,21 @@
         :enable-back-to-top="true"
       >
         <view class="subtitle ss-m-l-20">可使用优惠券</view>
-        <view v-for="(item, index) in state.couponInfo.can_use" :key="index">
+        <view v-for="(item, index) in state.couponInfo" :key="index">
           <s-coupon-list :data="item" type="user" :disabled="false">
             <template #default>
               <label class="ss-flex ss-col-center" @tap="radioChange(item.id)">
                 <radio
                   color="var(--ui-BG-Main)"
                   style="transform: scale(0.8)"
-                  :checked="state.couponId == item.id"
+                  :checked="state.couponId === item.id"
                   @tap.stop="radioChange(item.id)"
                 />
               </label>
             </template>
           </s-coupon-list>
         </view>
+        <!-- TODO 芋艿:未来接口需要支持下
         <view class="subtitle ss-m-t-40 ss-m-l-20">不可使用优惠券</view>
         <view v-for="item in state.couponInfo.cannot_use" :key="item.id">
           <s-coupon-list :data="item" type="user" :disabled="true">
@@ -41,6 +43,7 @@
             </template>
           </s-coupon-list>
         </view>
+      -->
       </scroll-view>
     </view>
     <view class="modal-footer ss-flex">
@@ -50,8 +53,9 @@
 </template>
 <script setup>
   import { computed, reactive } from 'vue';
+
   const props = defineProps({
-    modelValue: {
+    modelValue: { // 优惠劵列表
       type: Object,
       default() {},
     },
@@ -60,21 +64,27 @@
       default: false,
     },
   });
+
   const emits = defineEmits(['confirm', 'close']);
+
   const state = reactive({
-    couponInfo: computed(() => props.modelValue),
-    couponId: 0,
+    couponInfo: computed(() => props.modelValue), // 优惠劵列表
+    couponId: 0, // 选中的优惠劵编号
   });
+
+  // 选中优惠劵
   function radioChange(couponId) {
-    if (state.couponId == couponId) {
+    if (state.couponId === couponId) {
       state.couponId = 0;
     } else {
       state.couponId = couponId;
     }
   }
+
+  // 确认优惠劵
   const onConfirm = () => {
     emits('confirm', state.couponId);
-  };
+  }
 </script>
 <style lang="scss" scoped>
   :deep() {