整合api请求、添加购买会员卡页面、登陆页面

This commit is contained in:
future
2026-06-23 22:17:53 +08:00
parent 1c547a717e
commit 8d8c823616
70 changed files with 7666 additions and 2656 deletions
@@ -57,6 +57,14 @@ export function canCancelBooking(item) {
return diff >= 2 * 3600000
}
export function canSigninCourse(item) {
if (!item?.courseDate || !item?.startTime) return false
if (item.status !== 'booked' && item.status !== 0) return false
const start = new Date(`${item.courseDate} ${item.startTime}`.replace(/-/g, '/'))
const diff = start - Date.now()
return diff <= 2 * 3600000 && diff >= -2 * 3600000
}
export function bookCourse(store, courseId) {
const course = store.courseCatalog.find((c) => c.id === Number(courseId))
if (!course) return { ok: false, message: '课程不存在' }