lex 2 年之前
父节点
当前提交
4b897153a0

+ 6 - 10
src/school/companion-teacher/companion-teacher-register.tsx

@@ -197,22 +197,18 @@ export default defineComponent({
         })
         state.columns = tempareas || []
 
-        const { data } = await request.post(
-          '/api-school/open/orchestraSubjectConfig/pageByOrchestraId',
-          {
-            data: {
-              orchestraId: state.id,
-              page: 1,
-              rows: 50
-            }
+        const { data } = await request.post('/api-school/open/subjectBasicConfig/page', {
+          data: {
+            page: 1,
+            rows: 50
           }
-        )
+        })
 
         const rows = data.rows || []
         const tempSubjects: any = []
         rows.forEach((item: any) => {
           tempSubjects.push({
-            text: item.name,
+            text: item.subjectName,
             value: item.subjectId
           })
         })

+ 1 - 0
src/school/manage-teacher/manage-teacher-register.tsx

@@ -130,6 +130,7 @@ export default defineComponent({
           '/api-school/open/orchestraSubjectConfig/pageByOrchestraId',
           {
             data: {
+              orchestraId: state.id,
               page: 1,
               rows: 50
             }

+ 16 - 2
src/views/unit-test/model/answer-list/index.module.less

@@ -39,11 +39,25 @@
       justify-content: center;
       width: 45px;
       height: 45px;
-      background: #ff8057;
+      background: #eaeaea;
       font-size: 18px;
       font-weight: 500;
-      color: #ffffff;
+      color: #777777;
       border-radius: 50%;
     }
+
+    .answered {
+      background: #ff8057;
+      color: #fff;
+    }
+
+    .yes {
+      background-color: #71b0ff;
+      color: #fff;
+    }
+    .no {
+      background-color: #ff8486;
+      color: #fff;
+    }
   }
 }

+ 15 - 7
src/views/unit-test/model/answer-list/index.tsx

@@ -1,10 +1,14 @@
 import { Grid, GridItem } from 'vant'
-import { defineComponent } from 'vue'
+import { defineComponent, PropType } from 'vue'
 import styles from './index.module.less'
 
 export default defineComponent({
   name: 'answer-list',
   props: {
+    value: {
+      type: Array,
+      default: []
+    },
     answerList: {
       type: Array,
       default: () => []
@@ -23,7 +27,8 @@ export default defineComponent({
       ]
     }
   },
-  setup(props) {
+  emits: ['select', 'update:value'],
+  setup(props, { emit }) {
     return () => (
       <div class={styles.anserList}>
         <div class={styles.status}>
@@ -36,11 +41,14 @@ export default defineComponent({
         </div>
 
         <Grid class={styles.aList} columnNum={6} border={false}>
-          {[1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 0, 10].map((item: any) => (
-            <GridItem>
-              <span>1</span>
-            </GridItem>
-          ))}
+          {[1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 0, 10].map((item: any) => {
+            // console.log(props.keys)
+            return (
+              <GridItem onClick={() => emit('select', item)}>
+                <span class={props.value.includes(item) && styles.active}>{item}</span>
+              </GridItem>
+            )
+          })}
         </Grid>
       </div>
     )

+ 27 - 4
src/views/unit-test/unit-detail/index.tsx

@@ -31,7 +31,7 @@ export default defineComponent({
     const swipeRef = ref()
     const state = reactive({
       visiableNotice: false,
-      visiableAnswer: true,
+      visiableAnswer: false,
       answerList: {},
       time: 30 * 60 * 1000
     })
@@ -76,6 +76,18 @@ export default defineComponent({
           <SwipeItem>
             <ChoiceQuestion />
           </SwipeItem>
+          <SwipeItem>
+            <ChoiceQuestion />
+          </SwipeItem>
+          <SwipeItem>
+            <ChoiceQuestion />
+          </SwipeItem>
+          <SwipeItem>
+            <ChoiceQuestion />
+          </SwipeItem>
+          <SwipeItem>
+            <ChoiceQuestion />
+          </SwipeItem>
         </Swipe>
 
         <OSticky position="bottom" background="white">
@@ -90,14 +102,25 @@ export default defineComponent({
             >
               下一题
             </Button>
-            <Image src={iconButtonList} class={[styles.wapList, 'van-haptics-feedback']} />
+            <Image
+              src={iconButtonList}
+              class={[styles.wapList, 'van-haptics-feedback']}
+              onClick={() => (state.visiableAnswer = true)}
+            />
           </div>
         </OSticky>
 
         {/* 题目集合 */}
-        {/* <Popup v-model:show={state.visiableAnswer}></Popup> */}
         <ActionSheet v-model:show={state.visiableAnswer} title="题目列表" safeAreaInsetBottom>
-          <AnswerList />
+          <AnswerList
+            value={[1, 3, 4]}
+            onSelect={(item: any) => {
+              // 跳转,并且跳过动画
+              swipeRef.value.swipeTo(item, {
+                immediate: true
+              })
+            }}
+          />
         </ActionSheet>
 
         {/* 测验须知 */}