11wqe1 2 недель назад
Родитель
Сommit
e3d1e3332e

+ 3 - 21
src/components/dialog/selectTeachingClassDialog.vue

@@ -87,15 +87,14 @@
 			:courseDetail="courseDetail"
 			@success="getCourseList"
 		/>
-  <iframe :src="courseUrl" class="courseIframe" v-if="courseUrl"></iframe>
 
 </template>
 
 <script setup>
-import { ref, inject ,onMounted } from "vue";
+import { ref, inject } from "vue";
 import { userInfoStore } from "../../stores/counter";
 import addClassDialog from "./addClassDialog.vue";
-const emit = defineEmits(["success", "changeClassList"]);
+const emit = defineEmits(["success", "changeClassList", "openCourse"]);
 import axios from '@/services/config'
 import { addOp3 } from '@/mixins/mixin'
 const lang = inject('lang')
@@ -109,11 +108,6 @@ const selectId = ref("");
 const userInfo = userInfoStore();
 console.log('userInfo',userInfo.user)
 const addClassDialogRef = ref(null);
-onMounted(() => {
-  window.setCourseUrl = function () {
-    courseUrl.value = ''
-  }
-})
 
 const getClasslist = (options) => {
 	courseDetail.value = JSON.parse(JSON.stringify(options));
@@ -385,11 +379,8 @@ const gotoCourse = (id) => {
           console.error(err);
         });
 }
-const courseUrl = ref('')
 const goto = (val) => {
-  console.log('val',val)
-  courseUrl.value = val
-  // top.U.MD.D.I.openInApplication('setUrl',{url:val,title:'课程详情',id:new Date().getTime()})
+  emit('openCourse', val)
 }
 
 const insertMemorandum = (_html,tcid="") => {//保存行为操作
@@ -641,13 +632,4 @@ defineExpose({
   color: #D4D4D4;
   border-color: #1A1A1A;
 }
-.courseIframe{
-  width: 100vw;
-  height: 100vh;
-  position: fixed;
-  z-index: 99999;
-  top: 0;
-  left: 0;
-  border: none;
-}
 </style>

+ 8 - 3
src/components/main/courseSelect.vue

@@ -272,7 +272,8 @@
   </el-dialog>
 
   <selectTeachingClassDialog 
-  ref="DialogRef" />
+  ref="DialogRef"
+  @openCourse="openCourseIframe" />
   <iframe :src="courseUrl" class="courseIframe" v-if="courseUrl"></iframe>
 
 </template>
@@ -359,6 +360,11 @@ const AI6TwoData = ref(courseDataJson.AI6Two)
 const activegrade = ref(lang.lang != 'hk' ? '3' : '4')
 const activeterm = ref('1')
 const activeCurrentData = ref([])
+const courseUrl = ref('')
+
+const openCourseIframe = (url) => {
+  courseUrl.value = url
+}
 
 onMounted(() => {
   currentData.value = courseData.value["三年级"]
@@ -511,8 +517,7 @@ const openCourseDetail = (id) => {
 }
 
 
-const courseUrl = ref('')
- const getCourseUrl = (item) => {
+const getCourseUrl = (item) => {
   // return console.log(item);
   
       let _str = ""