perf: 优化页面

This commit is contained in:
richarjiang
2026-04-05 13:25:54 +08:00
parent a85270efd4
commit 9811c9a13b
31 changed files with 3135 additions and 375 deletions

View File

@@ -15,18 +15,18 @@
<view class="info-section">
<view class="info-row">
<text class="info-label">日期</text>
<text class="info-value">{{ slot?.date }}</text>
<text class="info-value">{{ timeSlot?.date }}</text>
</view>
<view class="info-row">
<text class="info-label">时间</text>
<text class="info-value" v-if="slot">
{{ slot.startTime.slice(0, 5) }} - {{ slot.endTime.slice(0, 5) }}
<text class="info-value" v-if="timeSlot">
{{ timeSlot.startTime.slice(0, 5) }} - {{ timeSlot.endTime.slice(0, 5) }}
</text>
</view>
<view class="info-row">
<text class="info-label">剩余</text>
<text class="info-value" v-if="slot">
{{ slot.capacity - slot.bookedCount }} 个名额
<text class="info-value" v-if="timeSlot">
{{ timeSlot.capacity - timeSlot.bookedCount }} 个名额
</text>
</view>
</view>
@@ -123,7 +123,7 @@ import type { TimeSlotWithBookingStatus, MembershipWithCardType } from '@mp-pila
const props = defineProps<{
visible: boolean
slot: TimeSlotWithBookingStatus | null
timeSlot: TimeSlotWithBookingStatus | null
memberships: MembershipWithCardType[]
}>()
@@ -151,9 +151,9 @@ const selectedMembership = computed(() =>
)
function handleConfirm() {
if (!props.slot || !selectedMembershipId.value) return
if (!props.timeSlot || !selectedMembershipId.value) return
emit('confirm', {
timeSlotId: props.slot.id,
timeSlotId: props.timeSlot.id,
membershipId: selectedMembershipId.value,
})
}