ソースを参照

Merge branch 'master' of http://git.dayaedu.com/lex/orchestra-app

mo 2 年 前
コミット
6f2177b6e8

+ 10 - 1
src/views/mine-orchestra/my-class/index.tsx

@@ -32,7 +32,16 @@ export default defineComponent({
       })
     }
     const openClassDetail = (item: any) => {
-      openDefaultWebView(`/classDetail?classId=${item.id}`)
+      console.log("🚀 ~ item", item)
+      postMessage({
+        api: 'open_app_page',
+        content: {
+          action: 'app',
+          pageTag: 'classDetail',
+          url: '',
+          params: JSON.stringify({ classId: item.classGroupId })
+        }
+      })
     }
     const { list } = toRefs(props)
     return () => (

+ 1 - 1
src/views/mine-orchestra/photo-list/index.tsx

@@ -36,7 +36,7 @@ export default defineComponent({
         const res = await request.post(`${state.platformApi}/orchestraPhotoAlbum/page`, {
           data: {
             ...data.pages,
-            orchestraId: props.orchestraId,
+            orchestraId: props.orchestraId || route.query.orchestraId,
             parentId: route.query.id
           }
         })

+ 3 - 0
src/views/unit-test/model/choice-question/index.tsx

@@ -52,6 +52,7 @@ export default defineComponent({
   emits: ['update:value'],
   setup(props, { emit }) {
     const onSelect = (item: any) => {
+      console.log(item, 'onSelect')
       if (props.readOnly) return
       const value: any = props.value || []
       const result = {
@@ -59,6 +60,8 @@ export default defineComponent({
         answer: item.questionAnswer,
         answerExtra: item.questionExtra
       }
+
+      console.log(result, 'onSelect')
       if (props.type === 'checkbox') {
         const tempIndex = value.findIndex(
           (c: any) => c.answerId === item.examinationQuestionAnswerId

+ 19 - 10
src/views/unit-test/model/keep-look-question/index.tsx

@@ -104,9 +104,9 @@ export default defineComponent({
         item.left = !item.left
         if (item.left) {
           // 为true时添加定位
-          const obj: any = useRect(e.target)
-          obj.index = item.index
-          state.selectItem[0] = obj
+          state.selectItem[0] = {
+            index: item.index
+          }
         } else {
           state.selectItem[0] = null
         }
@@ -170,9 +170,9 @@ export default defineComponent({
 
         if (item.right) {
           // 为true时添加定位
-          const obj: any = useRect(e.target)
-          obj.index = item.index
-          state.selectItem[1] = obj
+          state.selectItem[1] = {
+            index: item.index
+          }
         } else {
           state.selectItem[1] = null
         }
@@ -218,14 +218,23 @@ export default defineComponent({
     }
 
     /**
-     * @description 计算连线坐标位置及左右关联编号
+     * @description 计算连线坐标位置及左右关联编号,每次计算坐标的时候都取元素最新位置定位
      * @returns 连线的坐标
      */
     const calcPoint = () => {
       const canvasPostion = useRect(canvasRef.value)
-      const firstPostion = state.selectItem[0]
-      const secondPostion = state.selectItem[1]
-
+      const leftSectionItem = state.selectItem[0]
+      const firstPostion: any = useRect(
+        document.getElementById(leftSectionItem.index + '-left') as any
+      )
+      firstPostion.index = leftSectionItem.index
+      // console.log('🚀 ~ calcPoint ~ leftObj', leftObj)
+      const rightSectionItem = state.selectItem[1]
+      const secondPostion: any = useRect(
+        document.getElementById(rightSectionItem.index + '-right') as any
+      )
+      secondPostion.index = rightSectionItem.index
+      console.log(state.selectItem, firstPostion, secondPostion)
       const startPoint = {
         x: firstPostion.width,
         y: firstPostion.top + firstPostion.height / 2 - canvasPostion.top

+ 19 - 15
src/views/unit-test/practice-mode/index.tsx

@@ -193,6 +193,7 @@ export default defineComponent({
         setTimeout(() => {
           // const currentItemDom: Element =
           //   document.querySelectorAll('.swipe-item-question')[state.currentIndex]
+          // console.log(document.querySelectorAll('.van-swipe-item'), state.currentIndex)
           const currentItemDom: any = document
             .querySelectorAll('.van-swipe-item')
             [state.currentIndex].querySelector('.swipe-item-question')
@@ -230,21 +231,23 @@ export default defineComponent({
     const onCloseResult = async () => {
       state.questionList = []
       await getExamDetails()
-      swipeRef.value?.swipeTo(0, {
-        immediate: true
-      })
-      state.swipeHeight = 'auto'
-      state.answerAnalysis = ''
-      state.overResult = {
-        time: '00:00', // 时长
-        questionLength: 0, // 答题数
-        errorLength: 0, // 错题数
-        rate: 0 // 正确率
-      }
-      state.visiableResult = false
-      // 恢复计时
-      resume()
-      resizeSwipeItemHeight()
+      setTimeout(async () => {
+        swipeRef.value?.swipeTo(0, {
+          immediate: true
+        })
+        state.swipeHeight = 'auto'
+        state.answerAnalysis = ''
+        state.overResult = {
+          time: '00:00', // 时长
+          questionLength: 0, // 答题数
+          errorLength: 0, // 错题数
+          rate: 0 // 正确率
+        }
+        state.visiableResult = false
+        // 恢复计时
+        resume()
+        resizeSwipeItemHeight()
+      }, 100)
     }
 
     // 下一个考点
@@ -266,6 +269,7 @@ export default defineComponent({
       state.id = currentKnowle.id
 
       state.visiableResult = false
+      state.currentIndex = 0
       // 重置
       onCloseResult()
     }