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

pull/37/head
YunaiV 2024-01-16 09:32:52 +08:00
parent 39ccc983e0
commit ce389efdae
2 changed files with 27 additions and 7 deletions

View File

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

View File

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