perf: 完善新用户引导
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
4
packages/app/src/utils/routes.ts
Normal file
4
packages/app/src/utils/routes.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const ROUTES = {
|
||||
PROFILE_INFO: '/pages/profile/info',
|
||||
PROFILE_INFO_FIRST_LOGIN: '/pages/profile/info?from=login',
|
||||
} as const
|
||||
Reference in New Issue
Block a user