perf: 完善新用户引导

This commit is contained in:
richarjiang
2026-04-06 15:50:22 +08:00
parent 66d47ec162
commit f8268cb6f6
15 changed files with 483 additions and 119 deletions

View File

@@ -4,6 +4,7 @@ import type { UserProfileResponse } from '@mp-pilates/shared'
interface LoginResponse {
readonly token: string
readonly user: UserProfileResponse
readonly isNewUser: boolean
}
export async function wxLogin(): Promise<LoginResponse> {

View File

@@ -64,3 +64,9 @@ export function getCardCoverClass(type: CardTypeCategory): string {
if (type === CardTypeCategory.DURATION) return 'cover--duration'
return 'cover--times'
}
/** 判断课程时段是否已过期(当前时间 > 课程开始时间) */
export function isSlotPast(date: string, startTime: string): boolean {
const slotDateTime = new Date(`${date}T${startTime}:00`)
return new Date() > slotDateTime
}

View File

@@ -0,0 +1,4 @@
export const ROUTES = {
PROFILE_INFO: '/pages/profile/info',
PROFILE_INFO_FIRST_LOGIN: '/pages/profile/info?from=login',
} as const