perf: 个人中心支持展示约课数量
This commit is contained in:
@@ -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,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user