408249787@qq.com 2 hari lalu
induk
melakukan
d31da9c8ba

+ 19 - 3
pages/programming/progress.uvue

@@ -22,11 +22,14 @@ const visible = ref(false)
 const menuItems = [
   { id: 1, name: '视频学习', icon: 'https://oss.xiaoxiongcode.com/static/home/6419.png', x: 0, y: 21 },
   // { id: 2, name: '实战指导', icon: 'https://oss.xiaoxiongcode.com/static/home/6418.png', x: 27, y: 19 },
-  { id: 3, name: '参考答案', icon: 'https://oss.xiaoxiongcode.com/static/home/6416.png', x: 80, y: 16 },
-  { id: 4, name: '开始编程', icon: 'https://oss.xiaoxiongcode.com/static/home/6417.png', x: 38, y: 18 },
+  { id: 4, name: '开始编程', icon: 'https://oss.xiaoxiongcode.com/static/home/6417.png', x: 27, y: 19 },
+  { id: 3, name: '参考答案', icon: 'https://oss.xiaoxiongcode.com/static/home/6416.png', x: 55, y: 7 },
+
+  { id: 5, name: '效果展示', icon: 'https://oss.xiaoxiongcode.com/static/home/6417.png', x: 80, y: 16 },
 ]
 //点击事件
 function handleClick(id: number) {
+  const res = isTabletDevice()
   switch (id) {
     case 1:
       router.push({
@@ -55,7 +58,6 @@ function handleClick(id: number) {
       });
       break
     case 4:
-      const res = isTabletDevice()
       if (res) {
         router.push({
           path: "/pages/programming/web-view",
@@ -67,6 +69,20 @@ function handleClick(id: number) {
         visible.value = true
       }
       break
+    case 5:
+      if (res) {
+        router.push({
+          path: "/pages/programming/web-view",
+          query: {
+            id: router.query().id,
+            url: course.value?.sbFilePath,
+
+          }
+        });
+      } else {
+        visible.value = true
+      }
+      break
   }
 
 }

+ 8 - 1
pages/programming/web-view.uvue

@@ -3,6 +3,7 @@ import { ref, onMounted, watchEffect } from 'vue'
 import Loading from '@/components/loading.uvue'
 import { router, user } from '@/.cool'
 import Back from '@/components/back.uvue'
+// const baseUrl = ref('http://192.168.110.102:8601')
 const baseUrl = ref('https://oss.xiaoxiongcode.com/gui/index.html')
 const webviewSrc = ref('')
 
@@ -16,7 +17,13 @@ function handleMessage(e) {
 }
 
 onMounted(() => {
-  webviewSrc.value = baseUrl.value + '?token=' + user.token + '&userId=' + user.info.value?.userInfo.userId
+  const url = router.query().url
+  if (url) {
+    webviewSrc.value = baseUrl.value + '?token=' + user.token + '&userId=' + user.info.value?.userInfo.userId + '&sb3Url=' + url
+  } else {
+    webviewSrc.value = baseUrl.value + '?token=' + user.token + '&userId=' + user.info.value?.userInfo.userId
+  }
+
 })
 </script>
 <template>

+ 1 - 0
services/subject/course.ts

@@ -30,6 +30,7 @@ export interface SubjectCourseResult {
     diaryItem?: any
     payFlag?: boolean
     courseUserProgress?: any
+    sbFilePath?: string
     fileList?: FileList[]
 }