whj 1 день назад
Родитель
Сommit
e003922867
3 измененных файлов с 11 добавлено и 20 удалено
  1. 3 2
      pages/catalog/detail.uvue
  2. 5 2
      pages/catalog/index.uvue
  3. 3 16
      pages/catalog/web-view.uvue

+ 3 - 2
pages/catalog/detail.uvue

@@ -27,8 +27,8 @@ const menu2Items = [
   { id: '6', name: '实验', icon: 'https://oss.xiaoxiongcode.com/static/home/shiyan.png' },
 ]
 //当前进度
-const progress = ref(1)
-const progress2 = ref(1)
+const progress = ref(0)
+const progress2 = ref(0)
 const progressStatus = ref(0)
 const recorderManager = ref<any>()
 const innerAudioContext = ref<any>()
@@ -118,6 +118,7 @@ watch(() => progress2.value, (newVal, oldVal) => {
       status: progressStatus.value
     })
   }
+  console.log(progress2.value);
   switch (progress2.value) {
     case 1:
       setTimeout(() => {

+ 5 - 2
pages/catalog/index.uvue

@@ -23,10 +23,13 @@ async function getDataList() {
   catalog.value = res?.catalogList?.[0]
   courseList.value = res?.courseList || []
 }
-onMounted(async () => {
+onShow(async () => {
+  isLoading.value = true
   try {
     await getDataList()
-    isLoading.value = false
+    setTimeout(() => {
+      isLoading.value = false
+    }, 1000)
   } catch (err) {
     console.log(err);
     isLoading.value = false

+ 3 - 16
pages/catalog/web-view.uvue

@@ -2,23 +2,10 @@
 import { ref, onMounted, watchEffect } from 'vue'
 import Loading from '@/components/loading.uvue'
 import { router } from '@/.cool'
-const menu2Items = [
-  { id: '1', name: '观察', icon: 'https://oss.xiaoxiongcode.com/static/home/kanke.png' },
-  { id: '2', name: '提问', icon: 'https://oss.xiaoxiongcode.com/static/home/lianxi.png' },
-  { id: '3', name: '假设', icon: 'https://oss.xiaoxiongcode.com/static/home/shiyan.png' },
-  { id: '4', name: '实验', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
-  { id: '5', name: '总结', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
-  { id: '6', name: '拓展', icon: 'https://oss.xiaoxiongcode.com/static/home/riji.png' },
-]
-const progress = ref(1)
 const webviewSrc = ref('')
 var isLoading = ref(true)
 onMounted(() => {
   webviewSrc.value = router.query().src
-  progress.value = router.query().progress
-  setTimeout(() => {
-      isLoading.value = false
-    }, 20000) // 6000毫秒 = 6秒
 })
 function handleMessage(e) {
   var pages = getCurrentPages();
@@ -26,6 +13,7 @@ function handleMessage(e) {
   (prevPage as any).status = "success"
 }
 function handleLoad() {
+  isLoading.value = false
   console.log('handleLoad')
 }
 onShow(() => {
@@ -35,9 +23,8 @@ onShow(() => {
 })
 </script>
 <template>
-  <!-- <Loading v-show="isLoading"/> -->
+  <Loading v-show="isLoading" />
   <web-view :src="webviewSrc + '?' + Math.random()" class="w-full h-full" @message="handleMessage"
     @load="handleLoad"></web-view>
 </template>
-<style lang="less" scoped>
-</style>
+<style lang="less" scoped></style>