2026-02-13 17:34:32 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="mobile-container">
|
2026-02-24 16:07:09 +08:00
|
|
|
<div class="header-bg"></div>
|
2026-02-13 17:34:32 +08:00
|
|
|
<header class="header">
|
|
|
|
|
<h1>个人中心</h1>
|
|
|
|
|
<a-button class="settings-btn" type="text" @click="handleSettingsClick">
|
|
|
|
|
<SettingOutlined :style="{ fontSize: '20px' }" />
|
|
|
|
|
</a-button>
|
|
|
|
|
</header>
|
|
|
|
|
<div class="profile-info">
|
|
|
|
|
<a-card :bordered="false" class="profile-card">
|
|
|
|
|
<div class="avatar-section">
|
|
|
|
|
<a-badge :dot="hasNotification" :offset="[-5, 5]">
|
2026-02-24 16:07:09 +08:00
|
|
|
<a-avatar :size="90" :src="userInfo.avatar || DEFAULT_AVATAR" class="user-avatar" />
|
2026-02-13 17:34:32 +08:00
|
|
|
</a-badge>
|
|
|
|
|
<div class="user-details">
|
2026-02-24 16:07:09 +08:00
|
|
|
<h2 class="username">{{ userInfo.nickname || '用户' }}</h2>
|
|
|
|
|
<p class="email">{{ userInfo.account }}</p>
|
|
|
|
|
<p class="signature" v-if="userInfo.signature">{{ userInfo.signature }}</p>
|
2026-02-13 17:34:32 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-24 16:07:09 +08:00
|
|
|
<div class="shop-section" v-if="userInfo.shopName">
|
2026-02-26 14:20:35 +08:00
|
|
|
<div class="shop-card" @click="handleShopClick">
|
2026-02-24 16:07:09 +08:00
|
|
|
<div class="shop-icon-wrapper">
|
|
|
|
|
<ShopOutlined class="shop-icon" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="shop-content">
|
|
|
|
|
<p class="shop-label">所属店铺</p>
|
|
|
|
|
<h3 class="shop-name">{{ userInfo.shopName }}</h3>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="shop-arrow">
|
|
|
|
|
<RightOutlined />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-03-03 14:39:02 +08:00
|
|
|
<!-- 密码设置提示 -->
|
|
|
|
|
<div v-if="needSetPassword" class="password-tip">
|
|
|
|
|
<a-alert
|
|
|
|
|
type="warning"
|
|
|
|
|
message="请尽快设置密码"
|
|
|
|
|
description="为了账户安全,建议您设置一个安全的密码"
|
|
|
|
|
show-icon
|
|
|
|
|
:closable="false"
|
|
|
|
|
>
|
|
|
|
|
<template #action>
|
|
|
|
|
<a-button size="small" type="primary" @click="handleSetPassword">去设置</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-alert>
|
|
|
|
|
</div>
|
2026-02-24 16:07:09 +08:00
|
|
|
<a-button type="primary" block @click="handleEditProfile" class="edit-btn">
|
2026-02-13 17:34:32 +08:00
|
|
|
编辑资料
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="stats-section">
|
2026-02-24 16:07:09 +08:00
|
|
|
<a-card :bordered="false" class="stats-card">
|
|
|
|
|
<a-row :gutter="16">
|
|
|
|
|
<a-col :span="8">
|
2026-02-27 16:44:41 +08:00
|
|
|
<div class="stat-item" @click="router.push('/orders')" style="cursor: pointer;">
|
2026-02-24 16:07:09 +08:00
|
|
|
<div class="stat-icon" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
|
|
|
|
<ShoppingOutlined />
|
|
|
|
|
</div>
|
2026-02-27 16:44:41 +08:00
|
|
|
<a-statistic title="订单" :value="orderCount" />
|
2026-02-24 16:07:09 +08:00
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<div class="stat-item">
|
|
|
|
|
<div class="stat-icon" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
|
|
|
|
|
<HeartOutlined />
|
|
|
|
|
</div>
|
2026-03-03 17:50:10 +08:00
|
|
|
<a-statistic title="收藏" :value="wishlistCount" />
|
2026-02-24 16:07:09 +08:00
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
2026-02-28 14:32:28 +08:00
|
|
|
<div class="stat-item" @click="handleCouponClick" style="cursor: pointer;">
|
2026-02-24 16:07:09 +08:00
|
|
|
<div class="stat-icon" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
|
|
|
|
|
<CreditCardOutlined />
|
|
|
|
|
</div>
|
2026-02-28 14:32:28 +08:00
|
|
|
<a-statistic title="优惠券" :value="couponCount" />
|
2026-02-24 16:07:09 +08:00
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-card>
|
2026-02-13 17:34:32 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="menu-section">
|
|
|
|
|
<a-card :bordered="false" class="menu-card">
|
|
|
|
|
<a-list :data-source="menuItems" :split="false">
|
|
|
|
|
<template #renderItem="{ item }">
|
2026-02-24 16:07:09 +08:00
|
|
|
<a-list-item class="menu-item" @click="handleMenuClick(item.key)">
|
2026-02-13 17:34:32 +08:00
|
|
|
<template #actions>
|
|
|
|
|
<RightOutlined />
|
|
|
|
|
</template>
|
|
|
|
|
<a-list-item-meta>
|
|
|
|
|
<template #avatar>
|
|
|
|
|
<div class="menu-icon" :style="{ backgroundColor: item.bgColor }">
|
|
|
|
|
<component :is="item.icon" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template #title>
|
|
|
|
|
<span>{{ item.title }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
<template #description v-if="item.desc">
|
|
|
|
|
<span>{{ item.desc }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</a-list-item-meta>
|
|
|
|
|
</a-list-item>
|
|
|
|
|
</template>
|
|
|
|
|
</a-list>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
2026-02-27 15:57:14 +08:00
|
|
|
|
|
|
|
|
<!-- 订单列表 -->
|
|
|
|
|
<a-card v-if="activeTab === 'orders'" :bordered="false" class="content-card">
|
|
|
|
|
<h3>我的订单</h3>
|
|
|
|
|
<a-empty v-if="orders.length === 0" description="暂无订单">
|
|
|
|
|
<a-button type="primary" @click="router.push('/products')">去购物</a-button>
|
|
|
|
|
</a-empty>
|
|
|
|
|
<div v-else class="order-list">
|
|
|
|
|
<a-card v-for="order in orders" :key="order.id" class="order-card">
|
|
|
|
|
<div class="order-header">
|
|
|
|
|
<span class="order-no">订单号: {{ order.orderNo }}</span>
|
|
|
|
|
<span :class="['order-status', order.status === 1 ? 'pending' : order.status === 2 ? 'completed' : 'cancelled']">
|
|
|
|
|
{{ order.statusText }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="order-items">
|
|
|
|
|
<div v-for="item in order.items" :key="item.id" class="order-item">
|
|
|
|
|
<div class="item-image" v-if="item.productImage">
|
|
|
|
|
<img :src="item.productImage" :alt="item.productTitle" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-image" v-else :style="{ backgroundColor: getRandomColor() }">
|
|
|
|
|
<span>{{ item.productTitle[0] }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-info">
|
|
|
|
|
<div class="item-title">{{ item.productTitle }}</div>
|
|
|
|
|
<div class="item-price">¥{{ item.price.toFixed(2) }} x {{ item.quantity }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="order-footer">
|
|
|
|
|
<div class="order-total">
|
|
|
|
|
总计: <span class="total-price">¥{{ order.actualAmount.toFixed(2) }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="order-actions">
|
|
|
|
|
<a-button v-if="order.status === 1" size="small" danger @click="handleCancelOrder(order.id)">
|
|
|
|
|
取消订单
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card>
|
|
|
|
|
|
2026-02-28 15:45:16 +08:00
|
|
|
|
2026-02-27 15:57:14 +08:00
|
|
|
|
2026-02-13 17:34:32 +08:00
|
|
|
<div class="logout-section">
|
|
|
|
|
<a-button danger block @click="handleLogout">
|
|
|
|
|
退出登录
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
2026-02-24 16:07:09 +08:00
|
|
|
<a-modal
|
|
|
|
|
v-model:visible="editModalVisible"
|
|
|
|
|
title="编辑资料"
|
|
|
|
|
@ok="handleSaveProfile"
|
|
|
|
|
@cancel="handleCancelEdit"
|
|
|
|
|
:confirmLoading="saving"
|
|
|
|
|
>
|
|
|
|
|
<a-form layout="vertical">
|
|
|
|
|
<a-form-item label="头像">
|
|
|
|
|
<div class="avatar-upload-section">
|
|
|
|
|
<a-upload
|
|
|
|
|
name="file"
|
|
|
|
|
:show-upload-list="false"
|
|
|
|
|
:before-upload="beforeUploadAvatar"
|
|
|
|
|
:custom-request="handleAvatarUpload"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
>
|
|
|
|
|
<a-avatar :size="80" :src="editForm.avatar || DEFAULT_AVATAR" />
|
|
|
|
|
<div class="upload-hint">点击更换头像</div>
|
|
|
|
|
</a-upload>
|
|
|
|
|
<a-button v-if="editForm.avatar" type="text" danger size="small" @click="handleDeleteAvatar">
|
|
|
|
|
删除头像
|
|
|
|
|
</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="昵称">
|
|
|
|
|
<a-input v-model:value="editForm.nickname" placeholder="请输入昵称" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="个性签名">
|
|
|
|
|
<a-textarea v-model:value="editForm.signature" placeholder="请输入个性签名" :rows="3" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-modal>
|
2026-02-13 17:34:32 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-02-27 09:17:17 +08:00
|
|
|
import { ref, onMounted } from 'vue'
|
2026-02-13 17:34:32 +08:00
|
|
|
import { useRouter } from 'vue-router'
|
2026-02-24 16:07:09 +08:00
|
|
|
import {
|
|
|
|
|
SettingOutlined,
|
2026-02-13 17:34:32 +08:00
|
|
|
RightOutlined,
|
|
|
|
|
ShoppingOutlined,
|
|
|
|
|
HeartOutlined,
|
|
|
|
|
EnvironmentOutlined,
|
|
|
|
|
CreditCardOutlined,
|
|
|
|
|
BellOutlined,
|
2026-02-24 16:07:09 +08:00
|
|
|
QuestionCircleOutlined,
|
2026-02-27 09:17:17 +08:00
|
|
|
ShopOutlined
|
2026-02-13 17:34:32 +08:00
|
|
|
} from '@ant-design/icons-vue'
|
2026-02-25 09:13:45 +08:00
|
|
|
import { message, Modal } from 'ant-design-vue'
|
|
|
|
|
import type { UploadProps } from 'ant-design-vue'
|
2026-02-24 14:12:27 +08:00
|
|
|
import { authApi } from '@/api/auth'
|
2026-02-24 16:07:09 +08:00
|
|
|
import { userApi, type UserVO } from '@/api/user'
|
|
|
|
|
import { fileApi } from '@/api/file'
|
2026-02-27 15:57:14 +08:00
|
|
|
import { orderApi } from '@/api/order'
|
|
|
|
|
import { couponApi } from '@/api/coupon'
|
2026-03-03 17:50:10 +08:00
|
|
|
import { wishlistApi } from '@/api/wishlist'
|
2026-02-24 16:07:09 +08:00
|
|
|
import { DEFAULT_AVATAR } from '@/constants'
|
2026-02-13 17:34:32 +08:00
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
const userInfo = ref<UserVO>({
|
|
|
|
|
id: 0,
|
|
|
|
|
nickname: '',
|
|
|
|
|
account: '',
|
2026-03-02 10:13:20 +08:00
|
|
|
avatar: '',
|
|
|
|
|
type: 0,
|
|
|
|
|
status: 0,
|
2026-02-24 16:07:09 +08:00
|
|
|
createTime: '',
|
|
|
|
|
updateTime: ''
|
|
|
|
|
})
|
|
|
|
|
|
2026-02-13 17:34:32 +08:00
|
|
|
const hasNotification = ref(true)
|
2026-03-03 14:39:02 +08:00
|
|
|
const needSetPassword = ref(false)
|
2026-02-25 10:37:16 +08:00
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
const editModalVisible = ref(false)
|
|
|
|
|
const saving = ref(false)
|
|
|
|
|
const uploading = ref(false)
|
|
|
|
|
|
2026-02-28 15:45:16 +08:00
|
|
|
// 订单相关状态
|
2026-02-27 15:57:14 +08:00
|
|
|
const activeTab = ref('')
|
|
|
|
|
const orders = ref<any[]>([])
|
|
|
|
|
const loading = ref(false)
|
2026-02-27 16:44:41 +08:00
|
|
|
const orderCount = ref(0)
|
2026-02-28 14:32:28 +08:00
|
|
|
const couponCount = ref(0)
|
2026-03-03 17:50:10 +08:00
|
|
|
const wishlistCount = ref(0)
|
2026-02-27 15:57:14 +08:00
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
const editForm = ref({
|
|
|
|
|
nickname: '',
|
|
|
|
|
avatar: '',
|
|
|
|
|
signature: ''
|
|
|
|
|
})
|
2026-02-13 17:34:32 +08:00
|
|
|
|
|
|
|
|
const menuItems = ref([
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'orders',
|
|
|
|
|
title: '我的订单',
|
2026-02-13 17:34:32 +08:00
|
|
|
icon: ShoppingOutlined,
|
|
|
|
|
bgColor: '#e6f7ff'
|
|
|
|
|
},
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'wishlist',
|
|
|
|
|
title: '我的收藏',
|
2026-02-13 17:34:32 +08:00
|
|
|
icon: HeartOutlined,
|
|
|
|
|
bgColor: '#fff1f0'
|
|
|
|
|
},
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'address',
|
|
|
|
|
title: '收货地址',
|
2026-02-13 17:34:32 +08:00
|
|
|
icon: EnvironmentOutlined,
|
|
|
|
|
bgColor: '#f6ffed'
|
|
|
|
|
},
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'payment',
|
|
|
|
|
title: '支付方式',
|
2026-02-13 17:34:32 +08:00
|
|
|
icon: CreditCardOutlined,
|
|
|
|
|
bgColor: '#fff7e6'
|
|
|
|
|
},
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'notifications',
|
|
|
|
|
title: '消息通知',
|
2026-02-13 17:34:32 +08:00
|
|
|
desc: '3条未读',
|
|
|
|
|
icon: BellOutlined,
|
|
|
|
|
bgColor: '#f9f0ff'
|
|
|
|
|
},
|
2026-02-24 16:07:09 +08:00
|
|
|
{
|
|
|
|
|
key: 'help',
|
|
|
|
|
title: '帮助与支持',
|
2026-02-13 17:34:32 +08:00
|
|
|
icon: QuestionCircleOutlined,
|
|
|
|
|
bgColor: '#e6f7ff'
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
const fetchUserInfo = async () => {
|
|
|
|
|
try {
|
|
|
|
|
console.log('开始获取用户信息...')
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await userApi.getUserInfo() as any
|
|
|
|
|
console.log('获取到的用户信息:', response)
|
|
|
|
|
userInfo.value = response
|
2026-02-24 16:07:09 +08:00
|
|
|
console.log('设置后的 userInfo:', userInfo.value)
|
2026-03-03 14:39:02 +08:00
|
|
|
// 检查是否需要设置密码
|
|
|
|
|
needSetPassword.value = localStorage.getItem('needSetPassword') === 'true'
|
2026-02-24 16:07:09 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取用户信息失败:', error)
|
|
|
|
|
message.error('获取用户信息失败')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-13 17:34:32 +08:00
|
|
|
const handleEditProfile = () => {
|
2026-02-24 16:07:09 +08:00
|
|
|
editForm.value = {
|
|
|
|
|
nickname: userInfo.value.nickname || '',
|
|
|
|
|
avatar: userInfo.value.avatar || '',
|
|
|
|
|
signature: userInfo.value.signature || ''
|
|
|
|
|
}
|
|
|
|
|
editModalVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const beforeUploadAvatar: UploadProps['beforeUpload'] = (file) => {
|
|
|
|
|
const isImage = file.type.startsWith('image/')
|
2026-02-27 11:05:15 +08:00
|
|
|
const isLt20M = file.size / 1024 / 1024 < 20
|
2026-02-24 16:07:09 +08:00
|
|
|
|
|
|
|
|
if (!isImage) {
|
|
|
|
|
message.error('只能上传图片文件!')
|
|
|
|
|
}
|
2026-02-27 11:05:15 +08:00
|
|
|
if (!isLt20M) {
|
|
|
|
|
message.error('图片大小不能超过 20MB!')
|
2026-02-24 16:07:09 +08:00
|
|
|
}
|
2026-02-27 11:05:15 +08:00
|
|
|
return isImage && isLt20M
|
2026-02-24 16:07:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleAvatarUpload = async (options: any) => {
|
|
|
|
|
const { file } = options
|
|
|
|
|
uploading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const res = await fileApi.uploadAvatar(file)
|
2026-02-25 09:13:45 +08:00
|
|
|
editForm.value.avatar = res as unknown as string
|
2026-02-24 16:07:09 +08:00
|
|
|
message.success('头像上传成功')
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('头像上传失败:', error)
|
|
|
|
|
message.error('头像上传失败')
|
|
|
|
|
} finally {
|
|
|
|
|
uploading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleDeleteAvatar = () => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '确认删除',
|
|
|
|
|
content: '确定要删除头像吗?',
|
2026-02-25 09:13:45 +08:00
|
|
|
onOk: async () => {
|
2026-02-24 16:07:09 +08:00
|
|
|
editForm.value.avatar = ''
|
2026-02-25 09:13:45 +08:00
|
|
|
userInfo.value.avatar = ''
|
|
|
|
|
try {
|
|
|
|
|
await userApi.updateUserInfo({ avatar: '' })
|
|
|
|
|
message.success('头像删除成功')
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('删除头像失败:', error)
|
|
|
|
|
message.error('删除头像失败')
|
|
|
|
|
}
|
2026-02-24 16:07:09 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSaveProfile = async () => {
|
|
|
|
|
if (!editForm.value.nickname) {
|
|
|
|
|
message.error('请输入昵称')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saving.value = true
|
|
|
|
|
try {
|
|
|
|
|
await userApi.updateUserInfo(editForm.value)
|
|
|
|
|
message.success('资料更新成功')
|
|
|
|
|
editModalVisible.value = false
|
|
|
|
|
await fetchUserInfo()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('保存资料失败:', error)
|
|
|
|
|
message.error('保存资料失败')
|
|
|
|
|
} finally {
|
|
|
|
|
saving.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleCancelEdit = () => {
|
|
|
|
|
editModalVisible.value = false
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-27 15:57:14 +08:00
|
|
|
// 加载订单列表
|
|
|
|
|
const loadOrders = async () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await orderApi.getOrderList() as any
|
|
|
|
|
orders.value = response
|
|
|
|
|
orderCount.value = response.length
|
2026-02-27 15:57:14 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
message.error('获取订单列表失败')
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-28 15:45:16 +08:00
|
|
|
|
2026-02-27 15:57:14 +08:00
|
|
|
|
2026-02-28 14:32:28 +08:00
|
|
|
// 处理优惠券点击
|
|
|
|
|
const handleCouponClick = () => {
|
2026-02-28 15:45:16 +08:00
|
|
|
router.push('/coupons')
|
2026-02-28 14:32:28 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-27 15:57:14 +08:00
|
|
|
// 处理取消订单
|
|
|
|
|
const handleCancelOrder = async (orderId: number) => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: '确认取消订单',
|
|
|
|
|
content: '确定要取消这个订单吗?',
|
|
|
|
|
onOk: async () => {
|
|
|
|
|
try {
|
|
|
|
|
await orderApi.cancelOrder(orderId)
|
|
|
|
|
message.success('订单已取消')
|
|
|
|
|
loadOrders()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
message.error('取消订单失败')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-13 17:34:32 +08:00
|
|
|
const handleMenuClick = (key: string) => {
|
|
|
|
|
console.log('菜单项被点击:', key)
|
|
|
|
|
if (key === 'wishlist') {
|
|
|
|
|
router.push('/wishlist')
|
|
|
|
|
} else if (key === 'orders') {
|
2026-02-27 15:57:14 +08:00
|
|
|
router.push('/orders')
|
|
|
|
|
} else if (key === 'coupons') {
|
2026-02-28 15:45:16 +08:00
|
|
|
router.push('/coupons')
|
2026-02-13 17:34:32 +08:00
|
|
|
} else if (key === 'address') {
|
|
|
|
|
message.info('地址管理功能开发中...')
|
|
|
|
|
} else if (key === 'payment') {
|
|
|
|
|
message.info('支付方式功能开发中...')
|
|
|
|
|
} else if (key === 'notifications') {
|
|
|
|
|
message.info('消息通知功能开发中...')
|
|
|
|
|
} else if (key === 'help') {
|
|
|
|
|
message.info('帮助中心功能开发中...')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleLogout = () => {
|
2026-02-24 14:12:27 +08:00
|
|
|
Modal.confirm({
|
|
|
|
|
title: '确认退出登录',
|
|
|
|
|
content: '确定要退出登录吗?',
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk: async () => {
|
|
|
|
|
try {
|
|
|
|
|
await authApi.logout()
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('登出接口调用失败:', error)
|
|
|
|
|
} finally {
|
|
|
|
|
localStorage.removeItem('accessToken')
|
|
|
|
|
localStorage.removeItem('refreshToken')
|
2026-03-03 14:39:02 +08:00
|
|
|
localStorage.removeItem('userInfo')
|
|
|
|
|
localStorage.removeItem('needSetPassword')
|
2026-02-24 14:12:27 +08:00
|
|
|
sessionStorage.removeItem('accessToken')
|
|
|
|
|
message.success('已退出登录')
|
2026-02-27 22:20:25 +08:00
|
|
|
router.push('/')
|
2026-02-24 14:12:27 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleSettingsClick = () => {
|
|
|
|
|
console.log('设置图标被点击')
|
|
|
|
|
router.push('/settings')
|
|
|
|
|
}
|
2026-02-24 16:07:09 +08:00
|
|
|
|
2026-03-03 14:39:02 +08:00
|
|
|
const handleSetPassword = () => {
|
|
|
|
|
console.log('去设置密码')
|
|
|
|
|
router.push('/settings/password')
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 14:20:35 +08:00
|
|
|
const handleShopClick = () => {
|
|
|
|
|
console.log('店铺信息被点击')
|
|
|
|
|
if (userInfo.value.shopId) {
|
|
|
|
|
router.push(`/shop/${userInfo.value.shopId}`)
|
|
|
|
|
} else {
|
|
|
|
|
message.error('店铺信息不完整')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-27 15:57:14 +08:00
|
|
|
// 生成随机颜色
|
|
|
|
|
const getRandomColor = () => {
|
|
|
|
|
const colors = ['#ffe4d6', '#d6eaff', '#e2ffd6', '#fff2d6', '#d6ffe4', '#e4d6ff']
|
|
|
|
|
return colors[Math.floor(Math.random() * colors.length)]
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
fetchUserInfo()
|
2026-02-27 16:44:41 +08:00
|
|
|
loadOrders()
|
2026-02-28 15:45:16 +08:00
|
|
|
// 异步加载优惠券数量
|
|
|
|
|
loadCouponCount()
|
2026-03-03 17:50:10 +08:00
|
|
|
// 异步加载收藏数量
|
|
|
|
|
loadWishlistCount()
|
2026-02-24 16:07:09 +08:00
|
|
|
})
|
2026-02-28 15:45:16 +08:00
|
|
|
|
|
|
|
|
// 加载优惠券数量
|
|
|
|
|
const loadCouponCount = async () => {
|
|
|
|
|
try {
|
2026-03-02 10:13:20 +08:00
|
|
|
const response = await couponApi.listUserCoupons() as any
|
|
|
|
|
couponCount.value = response.length
|
2026-02-28 15:45:16 +08:00
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取优惠券数量失败:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-03 17:50:10 +08:00
|
|
|
|
|
|
|
|
// 加载收藏数量
|
|
|
|
|
const loadWishlistCount = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const response = await wishlistApi.getWishlist() as any
|
|
|
|
|
wishlistCount.value = response.length
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取收藏数量失败:', error)
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-13 17:34:32 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.mobile-container {
|
|
|
|
|
padding-top: 60px;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
background: #f5f5f5;
|
2026-02-24 16:07:09 +08:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-bg {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
height: 180px;
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
|
|
|
|
|
z-index: 0;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
z-index: 100;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 10px 15px;
|
2026-02-24 16:07:09 +08:00
|
|
|
background: transparent;
|
|
|
|
|
color: white;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header h1 {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.settings-btn {
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-02-24 16:07:09 +08:00
|
|
|
color: white;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.profile-info {
|
|
|
|
|
padding: 15px;
|
2026-02-24 16:07:09 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.profile-card {
|
2026-02-24 16:07:09 +08:00
|
|
|
border-radius: 20px;
|
2026-02-13 17:34:32 +08:00
|
|
|
overflow: hidden;
|
2026-02-24 16:07:09 +08:00
|
|
|
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.profile-card :deep(.ant-card-body) {
|
2026-02-24 16:07:09 +08:00
|
|
|
padding: 28px 24px 24px;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.avatar-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-02-24 16:07:09 +08:00
|
|
|
gap: 18px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-avatar {
|
|
|
|
|
border: 4px solid white;
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-details {
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.username {
|
2026-02-24 16:07:09 +08:00
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
margin: 0 0 6px 0;
|
|
|
|
|
color: #1a1a2e;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.email {
|
2026-02-24 16:07:09 +08:00
|
|
|
color: #8b8b9a;
|
2026-02-13 17:34:32 +08:00
|
|
|
font-size: 14px;
|
2026-02-24 16:07:09 +08:00
|
|
|
margin: 0 0 6px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.signature {
|
|
|
|
|
color: #6b6b7a;
|
|
|
|
|
font-size: 13px;
|
2026-02-13 17:34:32 +08:00
|
|
|
margin: 0;
|
2026-02-24 16:07:09 +08:00
|
|
|
line-height: 1.6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-section {
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 14px;
|
|
|
|
|
padding: 18px;
|
|
|
|
|
background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-card:hover {
|
|
|
|
|
transform: translateY(-2px);
|
|
|
|
|
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-icon-wrapper {
|
|
|
|
|
width: 52px;
|
|
|
|
|
height: 52px;
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border-radius: 14px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-icon {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-content {
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-label {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #8b8b9a;
|
|
|
|
|
margin: 0 0 4px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-name {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a2e;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.shop-arrow {
|
|
|
|
|
color: #c4c4d0;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.edit-btn {
|
|
|
|
|
height: 48px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
border: none;
|
|
|
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.avatar-upload-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.upload-hint {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #667eea;
|
|
|
|
|
margin-top: 4px;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-section {
|
|
|
|
|
padding: 0 15px 15px;
|
2026-02-24 16:07:09 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
2026-02-24 16:07:09 +08:00
|
|
|
.stats-card {
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-card :deep(.ant-card-body) {
|
|
|
|
|
padding: 20px 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stat-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stat-icon {
|
|
|
|
|
width: 52px;
|
|
|
|
|
height: 52px;
|
|
|
|
|
border-radius: 14px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
color: white;
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-section :deep(.ant-statistic-title) {
|
2026-02-24 16:07:09 +08:00
|
|
|
font-size: 13px;
|
|
|
|
|
color: #8b8b9a;
|
|
|
|
|
font-weight: 500;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-section :deep(.ant-statistic-content) {
|
2026-02-24 16:07:09 +08:00
|
|
|
font-size: 22px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: #1a1a2e;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-section {
|
|
|
|
|
padding: 0 15px 15px;
|
2026-02-24 16:07:09 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-card {
|
2026-02-24 16:07:09 +08:00
|
|
|
border-radius: 20px;
|
2026-02-13 17:34:32 +08:00
|
|
|
overflow: hidden;
|
2026-02-24 16:07:09 +08:00
|
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-card :deep(.ant-card-body) {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item {
|
2026-02-24 16:07:09 +08:00
|
|
|
padding: 18px 16px;
|
2026-02-13 17:34:32 +08:00
|
|
|
cursor: pointer;
|
2026-02-24 16:07:09 +08:00
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
border-bottom: 1px solid #f5f5f7;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item:hover {
|
2026-02-24 16:07:09 +08:00
|
|
|
background: #f8f9ff;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item:last-child {
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item :deep(.ant-list-item-action) {
|
|
|
|
|
margin-left: 8px;
|
2026-02-24 16:07:09 +08:00
|
|
|
color: #c4c4d0;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon {
|
2026-02-24 16:07:09 +08:00
|
|
|
width: 44px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
border-radius: 12px;
|
2026-02-13 17:34:32 +08:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-02-24 16:07:09 +08:00
|
|
|
font-size: 20px;
|
|
|
|
|
color: white;
|
2026-02-25 10:37:16 +08:00
|
|
|
opacity: 1;
|
|
|
|
|
filter: none;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item :deep(.ant-list-item-meta-title) {
|
|
|
|
|
font-size: 15px;
|
2026-02-24 16:07:09 +08:00
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a2e;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item :deep(.ant-list-item-meta-description) {
|
|
|
|
|
font-size: 12px;
|
2026-02-24 16:07:09 +08:00
|
|
|
color: #8b8b9a;
|
|
|
|
|
margin-top: 4px;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.logout-section {
|
2026-02-24 16:07:09 +08:00
|
|
|
padding: 0 15px 25px;
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.logout-section :deep(.ant-btn-dangerous) {
|
2026-02-24 16:07:09 +08:00
|
|
|
height: 50px;
|
|
|
|
|
border-radius: 25px;
|
2026-02-25 10:37:16 +08:00
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 17px;
|
2026-02-24 16:07:09 +08:00
|
|
|
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
|
|
|
|
|
border: none;
|
|
|
|
|
box-shadow: 0 4px 15px rgba(238, 90, 111, 0.3);
|
2026-02-25 10:37:16 +08:00
|
|
|
color: white !important;
|
|
|
|
|
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
2026-02-13 17:34:32 +08:00
|
|
|
}
|
2026-02-27 15:57:14 +08:00
|
|
|
|
|
|
|
|
.content-card {
|
|
|
|
|
margin: 0 15px 15px;
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content-card :deep(.ant-card-body) {
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content-card h3 {
|
|
|
|
|
margin: 0 0 20px 0;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a2e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-card {
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
border-bottom: 1px solid #f0f0f0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-no {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-status {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
padding: 4px 12px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-status.pending {
|
|
|
|
|
background: #fff7e6;
|
|
|
|
|
color: #fa8c16;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-status.completed {
|
|
|
|
|
background: #f6ffed;
|
|
|
|
|
color: #52c41a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-status.cancelled {
|
|
|
|
|
background: #fff1f0;
|
|
|
|
|
color: #ff4d4f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-items {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-image {
|
|
|
|
|
width: 60px;
|
|
|
|
|
height: 60px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: rgba(0,0,0,0.1);
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-image img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
object-fit: cover;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-info {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-title {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a2e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-price {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding-top: 10px;
|
|
|
|
|
border-top: 1px solid #f0f0f0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-total {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #666;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.total-price {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: #ff4d4f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.order-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-card {
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-value {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
color: #667eea;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
background: rgba(102, 126, 234, 0.1);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
min-width: 100px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-info {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-name {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #1a1a2e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-condition {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #667eea;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-time {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: #8b8b9a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-status {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
align-self: flex-start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-status.available {
|
|
|
|
|
background: #f6ffed;
|
|
|
|
|
color: #52c41a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.coupon-status.used {
|
|
|
|
|
background: #f5f5f5;
|
|
|
|
|
color: #8b8b9a;
|
|
|
|
|
}
|
2026-02-27 09:17:17 +08:00
|
|
|
</style>
|