Commit 1419d097 authored by spc's avatar spc

fixed

parent 3ce4dae8
......@@ -97,56 +97,7 @@ export default {
orderList: [],
nextId: null,
loading: false,
hasMore: true,
// 模拟数据(用于测试)
mockData: [
{
orderId: '1782993789',
status: 'pending_shipment',
productType: 'physical',
productName: '商品名称—实物',
description: '商品描述文案占位',
points: 200,
creditsTypeName: '积分',
exchangeTime: '2025.09.10 23:23:23',
productImage: ''
},
{
orderId: '1782993790',
status: 'pending_payment',
productType: 'physical',
productName: '商品名称—实物',
description: '商品描述文案占位',
points: 300,
creditsTypeName: '积分',
exchangeTime: '2025.09.10 23:23:23',
countdown: '23:59:59',
productImage: ''
},
{
orderId: '1782993791',
status: 'completed',
productType: 'physical',
productName: '商品名称—实物',
description: '商品描述文案占位',
points: 150,
creditsTypeName: '积分',
exchangeTime: '2025.09.10 23:23:23',
productImage: ''
},
{
orderId: '1782993792',
status: 'completed',
productType: 'coupon',
productName: '商品名称—卡券',
description: '商品描述文案占位',
points: 100,
creditsTypeName: '积分',
exchangeTime: '2025.09.10 23:23:23',
validUntil: '2025.09.10 23:23:23',
productImage: ''
}
]
hasMore: true
}
},
onLoad() {
......@@ -190,15 +141,14 @@ export default {
this.nextId = response.data.nextId || null;
this.hasMore = !!this.nextId;
} else {
// API调用失败时使用模拟数据
console.warn('API调用失败,使用模拟数据:', response.msg);
this.orderList = this.mockData;
}
// API调用失败
console.warn('API调用失败:', response.msg);
this.orderList = [];
}
} catch (error) {
console.error('加载兑换记录失败:', error);
// 网络错误时使用模拟数据
this.orderList = this.mockData;
} finally {
console.error('加载兑换记录失败:', error);
this.orderList = [];
} finally {
this.loading = false;
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment