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: () => {
return request({

View File

@ -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() {