|
|
@@ -50,11 +50,12 @@ function initOnlibeRecord() {
|
|
|
}
|
|
|
|
|
|
const course = ref<SubjectCourseResult>()
|
|
|
+const nextCourse = ref<SubjectCourseResult>()
|
|
|
//通过路由参数获取课程id
|
|
|
-async function fetchCatalog(isRefresh = false) {
|
|
|
+async function fetchCatalog() {
|
|
|
course.value = await fetchSubjectCourseApp({ id: user.courseId.value })
|
|
|
progressStatus.value = course.value?.courseUserProgress.status
|
|
|
- progress2.value = isRefresh ? 1 : Number(router.query().progress)
|
|
|
+ progress2.value = Number(router.query().progress)
|
|
|
console.log(progress2.value);
|
|
|
// if (!course.value?.courseUserProgress) {
|
|
|
// await updateSubjectProgress({
|
|
|
@@ -72,6 +73,10 @@ async function fetchCatalog(isRefresh = false) {
|
|
|
// progress2.value = 1
|
|
|
// }
|
|
|
}
|
|
|
+async function fetchNextCatalog(id: string) {
|
|
|
+ nextCourse.value = await fetchSubjectCourseApp({ id })
|
|
|
+
|
|
|
+}
|
|
|
onMounted(async () => {
|
|
|
isLoading.value = true
|
|
|
await fetchCatalog()
|
|
|
@@ -103,7 +108,7 @@ onShow(async () => {
|
|
|
})
|
|
|
console.log(nextCourseId);
|
|
|
user.setCourseId(nextCourseId)
|
|
|
- await fetchCatalog(true)
|
|
|
+ await fetchNextCatalog(nextCourseId)
|
|
|
uni.createVideoContext('video1').pause()
|
|
|
console.log(222);
|
|
|
isLoading.value = false
|
|
|
@@ -114,7 +119,7 @@ onShow(async () => {
|
|
|
})
|
|
|
console.log(nextCourseId);
|
|
|
user.setCourseId(nextCourseId)
|
|
|
- await fetchCatalog(true)
|
|
|
+ await fetchNextCatalog(nextCourseId)
|
|
|
uni.createVideoContext('video1').pause()
|
|
|
console.log(222);
|
|
|
isLoading.value = false
|
|
|
@@ -184,6 +189,7 @@ watch(() => progress2.value, (newVal, oldVal) => {
|
|
|
}, 2000)
|
|
|
break
|
|
|
case 6:
|
|
|
+ console.log(course.value?.testItem?.animationPath);
|
|
|
data.value.webviewSrc = course.value?.testItem?.animationPath
|
|
|
router.push({
|
|
|
path: "/pages/catalog/web-view",
|
|
|
@@ -229,6 +235,8 @@ function handleLoadedMetadata() {
|
|
|
}
|
|
|
function playNext() {
|
|
|
visible.value = false
|
|
|
+ course.value = nextCourse.value
|
|
|
+ progressStatus.value = nextCourse.value?.courseUserProgress.status
|
|
|
progress2.value = 1
|
|
|
}
|
|
|
|
|
|
@@ -355,13 +363,13 @@ onUnmounted(() => {
|
|
|
</view>
|
|
|
|
|
|
</cl-page>
|
|
|
- <cl-popup v-model="visible" direction="center" title="诗词欣赏" :show-header="false" :maskClosable="false">
|
|
|
+ <cl-popup v-model="visible" direction="center" :show-header="false" :maskClosable="false">
|
|
|
<view class="p-2">
|
|
|
- <cl-image lazy-load :src="course?.ossIconPath" mode="heightFix"
|
|
|
+ <cl-image lazy-load :src="nextCourse?.ossIconPath" mode="heightFix"
|
|
|
class="!w-full !h-[28vh] mb-[2vh] rounded-xl"></cl-image>
|
|
|
<cl-row :gutter="12">
|
|
|
- <cl-col :span="12"> <cl-button type="info" @click="router.back()">返回</cl-button></cl-col>
|
|
|
- <cl-col :span="12"> <cl-button type="success" @click="playNext">播放下集</cl-button></cl-col>
|
|
|
+ <cl-col :span="12"> <cl-button size="small" type="info" @click="router.back()">返回</cl-button></cl-col>
|
|
|
+ <cl-col :span="12"> <cl-button size="small" type="success" @click="playNext">播放下集</cl-button></cl-col>
|
|
|
</cl-row>
|
|
|
</view>
|
|
|
</cl-popup>
|