's'
This commit is contained in:
@@ -6,7 +6,7 @@ import { Link, useTranslation } from "@/i18n/navigation";
|
||||
import { VideoPlayer } from "@/app/components/course/VideoPlayer";
|
||||
import { LessonMarkdown } from "./LessonMarkdown";
|
||||
import { getLesson } from "@/config/lessons";
|
||||
import { canWatchLesson } from "@/app/lib/course-payment";
|
||||
import { canWatchLesson, isFreeTrial } from "@/app/lib/course-payment";
|
||||
import { useAuthAndVip } from "@/app/lib/useAuthAndVip";
|
||||
import { getStoredToken, getStoredUser } from "@/app/lib/pocketbase";
|
||||
import { setLastWatched, markCompleted } from "@/app/lib/learning";
|
||||
@@ -31,7 +31,6 @@ export default function LessonPage() {
|
||||
|
||||
const lesson = getLesson(moduleIndex, lessonIndex);
|
||||
const unlocked = canWatchLesson(moduleIndex, lessonIndex, vip);
|
||||
const isFreeTrial = moduleIndex === 0 && lessonIndex < 2;
|
||||
|
||||
useEffect(() => {
|
||||
if (lesson && unlocked) setLastWatched(moduleIndex, lessonIndex, lesson.name);
|
||||
@@ -146,7 +145,7 @@ export default function LessonPage() {
|
||||
|
||||
<h1 className="mb-2 flex items-center gap-2 text-xl font-bold sm:text-2xl md:text-3xl">
|
||||
{lesson.name}
|
||||
{isFreeTrial && (
|
||||
{isFreeTrial(moduleIndex, lessonIndex) && (
|
||||
<span className="rounded bg-[var(--accent)]/20 px-2 py-0.5 text-sm font-normal text-[var(--accent)]">
|
||||
试看
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user