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

@@ -1,5 +1,6 @@
<template>
<view class="bookings-page">
<view class="bookings-page" :style="{ paddingTop: navBarHeight }">
<CustomNavBar title="我的预约" show-back />
<!-- Tab bar -->
<view class="tab-bar">
<view
@@ -134,9 +135,13 @@ import type { BookingWithDetails } from '@mp-pilates/shared'
import { BookingStatus } from '@mp-pilates/shared'
import { useBookingStore } from '../../stores/booking'
import { formatDate, getWeekdayLabel } from '../../utils/format'
import CustomNavBar from '../../components/CustomNavBar.vue'
const bookingStore = useBookingStore()
// ─── Nav bar height ──────────────────────────────────────
const navBarHeight = ref('64px')
// ─── Tab state ────────────────────────────────────────────
type TabKey = 'upcoming' | 'history'
@@ -273,7 +278,11 @@ async function handleCancel(booking: BookingWithDetails) {
}
// ─── Lifecycle ────────────────────────────────────────────
onMounted(() => bookingStore.fetchMyBookings())
onMounted(() => {
const sys = uni.getSystemInfoSync()
navBarHeight.value = `${(sys.statusBarHeight ?? 20) + Math.round(88 * sys.windowWidth / 750)}px`
bookingStore.fetchMyBookings()
})
</script>
<style lang="scss" scoped>