's'
This commit is contained in:
19
app/digital/lib/course-payment.ts
Normal file
19
app/digital/lib/course-payment.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 课程解锁 - 校验登录态 + VIP(/api/digital/vip/check)
|
||||
* 与 join 报名支付分离,课程解锁用 VIP 状态
|
||||
*/
|
||||
|
||||
/** 前 2 章试看(暂时关闭,全部需 VIP 解锁) */
|
||||
export function isFreeTrial(_moduleIndex: number, _lessonIndex: number): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 章节是否可观看(需传入 vip 状态,来自 useAuthAndVip 或 /api/digital/vip/check) */
|
||||
export function canWatchLesson(
|
||||
moduleIndex: number,
|
||||
lessonIndex: number,
|
||||
vip: boolean
|
||||
): boolean {
|
||||
if (isFreeTrial(moduleIndex, lessonIndex)) return true;
|
||||
return vip;
|
||||
}
|
||||
Reference in New Issue
Block a user