perf: 个人中心支持展示约课数量

This commit is contained in:
richarjiang
2026-04-12 22:27:36 +08:00
parent 6cee28bf66
commit 1f45c3dc3f
3 changed files with 107 additions and 4 deletions

View File

@@ -48,6 +48,7 @@ const props = defineProps<{
isAdmin: boolean
requireAuth?: boolean
activeMembershipCount?: number
upcomingBookingCount?: number
}>()
const emit = defineEmits<{
@@ -60,6 +61,9 @@ const menuItems = computed<MenuItem[]>(() => {
const membershipBadge = props.activeMembershipCount && props.activeMembershipCount > 0
? `${props.activeMembershipCount}`
: undefined
const bookingBadge = props.upcomingBookingCount && props.upcomingBookingCount > 0
? `${props.upcomingBookingCount}`
: undefined
const items: MenuItem[] = [
{
@@ -75,6 +79,7 @@ const menuItems = computed<MenuItem[]>(() => {
type: 'item',
title: '我的预约',
path: '/pages/profile/bookings',
badge: bookingBadge,
requireAuth: true,
},
{