购物车和订单中心以及优惠券相关功能初版
This commit is contained in:
@@ -42,11 +42,11 @@
|
||||
<a-card :bordered="false" class="stats-card">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="8">
|
||||
<div class="stat-item">
|
||||
<div class="stat-item" @click="router.push('/orders')" style="cursor: pointer;">
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
||||
<ShoppingOutlined />
|
||||
</div>
|
||||
<a-statistic title="订单" :value="12" />
|
||||
<a-statistic title="订单" :value="orderCount" />
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@@ -251,6 +251,7 @@ const activeTab = ref('')
|
||||
const orders = ref<any[]>([])
|
||||
const coupons = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const orderCount = ref(0)
|
||||
|
||||
const editForm = ref({
|
||||
nickname: '',
|
||||
@@ -396,6 +397,7 @@ const loadOrders = async () => {
|
||||
try {
|
||||
const data = await orderApi.getOrderList()
|
||||
orders.value = data
|
||||
orderCount.value = data.length
|
||||
} catch (error) {
|
||||
message.error('获取订单列表失败')
|
||||
} finally {
|
||||
@@ -497,6 +499,7 @@ const getRandomColor = () => {
|
||||
|
||||
onMounted(() => {
|
||||
fetchUserInfo()
|
||||
loadOrders()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user