fix: 资产套餐历史,设备换货
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 47s

This commit is contained in:
sexygoat
2026-04-14 11:11:24 +08:00
parent 5fa2b6dacf
commit 4ce6b8ddc1
4 changed files with 129 additions and 49 deletions

View File

@@ -8,34 +8,34 @@
<view v-else-if="exchangeData" class="card exchange-card">
<view class="exchange-header flex-row-sb">
<view class="exchange-no">{{ exchangeData.exchange_no }}</view>
<view class="tag-apple" :class="getStatusClass(exchangeData.status)">{{ exchangeData.status_text }}</view>
<view class="exchange-no">{{ exchangeData?.exchange_no }}</view>
<view class="tag-apple" :class="getStatusClass(exchangeData?.status)">{{ exchangeData?.status_text }}</view>
</view>
<view class="exchange-info">
<view class="info-row flex-row-sb">
<view class="info-label">换货原因</view>
<view class="info-value">{{ exchangeData.exchange_reason }}</view>
<view class="info-value">{{ exchangeData?.exchange_reason }}</view>
</view>
<view class="info-row flex-row-sb">
<view class="info-label">申请时间</view>
<view class="info-value">{{ formatTime(exchangeData.created_at) }}</view>
<view class="info-value">{{ formatTime(exchangeData?.created_at) }}</view>
</view>
<view class="info-row flex-row-sb" v-if="exchangeData.recipient_name">
<view class="info-row flex-row-sb" v-if="exchangeData?.recipient_name">
<view class="info-label">收件人</view>
<view class="info-value">{{ exchangeData.recipient_name }}</view>
<view class="info-value">{{ exchangeData?.recipient_name }}</view>
</view>
<view class="info-row flex-row-sb" v-if="exchangeData.recipient_phone">
<view class="info-row flex-row-sb" v-if="exchangeData?.recipient_phone">
<view class="info-label">联系电话</view>
<view class="info-value">{{ exchangeData.recipient_phone }}</view>
<view class="info-value">{{ exchangeData?.recipient_phone }}</view>
</view>
<view class="info-row flex-row-sb" v-if="exchangeData.recipient_address">
<view class="info-row flex-row-sb" v-if="exchangeData?.recipient_address">
<view class="info-label">收货地址</view>
<view class="info-value address-value">{{ exchangeData.recipient_address }}</view>
<view class="info-value address-value">{{ exchangeData?.recipient_address }}</view>
</view>
</view>
<view class="exchange-actions" v-if="exchangeData.status === 1">
<view class="exchange-actions" v-if="exchangeData?.status === 1">
<button class="btn-apple btn-primary" @tap="openPopup">填写信息</button>
</view>
</view>
@@ -71,7 +71,7 @@
const userStore = useUserStore();
let exchangeData = reactive(null);
let exchangeData = ref(null);
let loading = ref(false);
let showPopup = ref(false);
let form = reactive({
@@ -100,11 +100,11 @@
loading.value = true;
try {
const data = await exchangeApi.getPending(userStore.state.identifier);
if (data) {
exchangeData.splice(0, exchangeData.length, data);
}
// 接口返回的是单个对象,不是数组
exchangeData.value = data || null;
} catch (e) {
console.error('加载换货记录失败', e);
exchangeData.value = null;
}
loading.value = false;
};
@@ -132,7 +132,7 @@
try {
await exchangeApi.submitShippingInfo(
exchangeData.id,
exchangeData.value.id,
form.recipient_name,
form.recipient_phone,
form.recipient_address