修复一些问题,个人账号功能完善,注册功能完善,收藏,购物车功能完善,初版基本完成,投入测试
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
|
||||
<HeartOutlined />
|
||||
</div>
|
||||
<a-statistic title="收藏" :value="5" />
|
||||
<a-statistic title="收藏" :value="wishlistCount" />
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@@ -215,6 +215,7 @@ import { userApi, type UserVO } from '@/api/user'
|
||||
import { fileApi } from '@/api/file'
|
||||
import { orderApi } from '@/api/order'
|
||||
import { couponApi } from '@/api/coupon'
|
||||
import { wishlistApi } from '@/api/wishlist'
|
||||
import { DEFAULT_AVATAR } from '@/constants'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -243,6 +244,7 @@ const orders = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const orderCount = ref(0)
|
||||
const couponCount = ref(0)
|
||||
const wishlistCount = ref(0)
|
||||
|
||||
const editForm = ref({
|
||||
nickname: '',
|
||||
@@ -495,6 +497,8 @@ onMounted(() => {
|
||||
loadOrders()
|
||||
// 异步加载优惠券数量
|
||||
loadCouponCount()
|
||||
// 异步加载收藏数量
|
||||
loadWishlistCount()
|
||||
})
|
||||
|
||||
// 加载优惠券数量
|
||||
@@ -506,6 +510,16 @@ const loadCouponCount = async () => {
|
||||
console.error('获取优惠券数量失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 加载收藏数量
|
||||
const loadWishlistCount = async () => {
|
||||
try {
|
||||
const response = await wishlistApi.getWishlist() as any
|
||||
wishlistCount.value = response.length
|
||||
} catch (error) {
|
||||
console.error('获取收藏数量失败:', error)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user