|
|
@@ -30,6 +30,7 @@ const menu2Items = [
|
|
|
//当前进度
|
|
|
const progress = ref(1)
|
|
|
const progress2 = ref(1)
|
|
|
+const progressStatus = ref(0)
|
|
|
const recorderManager = ref<any>()
|
|
|
const innerAudioContext = ref<any>()
|
|
|
const voicePath = ref('')
|
|
|
@@ -65,11 +66,15 @@ async function fetchCatalog() {
|
|
|
progress2.value = 1
|
|
|
data.value.videoSrc = course.value?.detailItem?.observeVideoPath || ''
|
|
|
data.value.webviewSrc = course.value?.detailItem?.observeAnimationPath || ''
|
|
|
- } else {
|
|
|
+ } else if (course.value?.courseUserProgress.status === 0) {
|
|
|
// progress.value = 1
|
|
|
// progress2.value = 1
|
|
|
progress.value = course.value?.courseUserProgress.mainProgress
|
|
|
progress2.value = course.value?.courseUserProgress.assistantProgress
|
|
|
+ } else if (course.value?.courseUserProgress.status === 1) {
|
|
|
+ progressStatus.value = 1
|
|
|
+ progress.value = 1
|
|
|
+ progress2.value = 1
|
|
|
}
|
|
|
}
|
|
|
onMounted(async () => {
|
|
|
@@ -94,6 +99,12 @@ async function handleEnded() {
|
|
|
if (progress.value === 2) {
|
|
|
return
|
|
|
}
|
|
|
+ if (progress2.value === 5) {
|
|
|
+ progress.value++
|
|
|
+ }
|
|
|
+ if (progressStatus.value === 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
await updateSubjectProgress({
|
|
|
courseId: course.value?.id,
|
|
|
mainProgress: progress.value,
|
|
|
@@ -120,7 +131,7 @@ async function handleEnded() {
|
|
|
// }
|
|
|
}
|
|
|
const status = ref('wait')
|
|
|
-onShow(() => {
|
|
|
+onShow(async () => {
|
|
|
isLoading.value = true
|
|
|
var pages = getCurrentPages();
|
|
|
const prevPage = pages[pages.length - 1];
|
|
|
@@ -134,6 +145,18 @@ onShow(() => {
|
|
|
(prevPage as any).status = 'wait'
|
|
|
}
|
|
|
if (status.value === 'success') {
|
|
|
+ if (progress.value === 2) {
|
|
|
+ if (progressStatus.value === 0) {
|
|
|
+ await updateSubjectProgress({
|
|
|
+ courseId: course.value?.id,
|
|
|
+ mainProgress: 2,
|
|
|
+ assistantProgress: 5,
|
|
|
+ status: 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ router.back()
|
|
|
+ return
|
|
|
+ }
|
|
|
progress2.value++;
|
|
|
(prevPage as any).status = 'wait'
|
|
|
}
|