lex 2 vuotta sitten
vanhempi
commit
bb367ff62b

+ 1 - 1
src/school/approval-manage/components/end-approval.tsx

@@ -69,7 +69,7 @@ export default defineComponent({
           loading={loading.value}
           loading-text=" "
           finished={finished.value}
-          finished-text="没有更多了"
+          finished-text=" "
           onLoad={getList}
         >
           <TransitionGroup name="van-fade">

+ 1 - 1
src/school/attendance/components/attend-student.tsx

@@ -230,7 +230,7 @@ export default defineComponent({
               loading-text=" "
               // v-model:loading={loading.value}
               finished={finished.value}
-              finished-text="没有更多了"
+              finished-text=" "
               onLoad={getList}
             >
               {list.value.map((item: any) => (

+ 12 - 6
src/school/attendance/index.tsx

@@ -20,22 +20,28 @@ export default defineComponent({
     const getHeight = (dataHeight: number) => {
       state.heightV = dataHeight
       console.log(state.heightV, '获取高度')
+      document.documentElement.style.setProperty('--header-height', dataHeight + 'px')
     }
     return () => (
       <>
         <OSticky position="top" background="#F8F8F8" onGetHeight={getHeight} ref={stickyRef}>
           <OHeader></OHeader>
-          <Tabs v-model:active={activeName.value}>
-            <Tab name="student" title="学生考勤"></Tab>
-            <Tab name="teacher" title="伴学指导考勤"></Tab>
-          </Tabs>
         </OSticky>
 
-        {activeName.value == 'student' ? (
+        <Tabs v-model:active={activeName.value} sticky swipeable offsetTop={state.heightV}>
+          <Tab name="student" title="学生考勤">
+            <AttendStudent toHeight={state.heightV} />
+          </Tab>
+          <Tab name="teacher" title="伴学指导考勤">
+            <AttendTeacher toHeight={state.heightV} />
+          </Tab>
+        </Tabs>
+
+        {/* {activeName.value == 'student' ? (
           <AttendStudent toHeight={state.heightV}></AttendStudent>
         ) : (
           <AttendTeacher toHeight={state.heightV}></AttendTeacher>
-        )}
+        )} */}
       </>
     )
   }

+ 82 - 75
src/views/unit-test/index.tsx

@@ -3,7 +3,7 @@ import OHeader from '@/components/o-header'
 import OSearch from '@/components/o-search'
 import OSticky from '@/components/o-sticky'
 import { ActionSheet, Button, Cell, CellGroup, Icon, Image, List, Popup } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import { defineComponent, onMounted, reactive, TransitionGroup } from 'vue'
 import styles from './index.module.less'
 import iconEdit from './images/icon-edit.png'
 import { useRouter } from 'vue-router'
@@ -214,88 +214,95 @@ export default defineComponent({
                 <source src="horse.ogg" type="audio/ogg" />
                 您的浏览器不支持该音频格式。
               </audio> */}
-              {form.list.map((item: any) => (
-                <CellGroup inset class={styles.cellGroup} border={false}>
-                  <Cell
-                    center
-                    // isLink
-                    clickable={false}
-                    titleStyle={{ flex: '1 auto' }}
-                    valueClass={[
-                      styles['no-start'],
-                      item.status === 'A_PASS' && styles.pass,
-                      item.status === 'B_NO_PASS' && styles['no-pass']
-                    ]}
-                  >
-                    {{
-                      icon: () => <Image src={iconEdit} class={styles.img} />,
-                      title: () => (
-                        <div class={[styles.unitTitle, 'van-ellipsis']}>{item.name}</div>
-                      ),
-                      value: () => unitTestStatus[item.status]
-                    }}
-                  </Cell>
-                  <Cell center class={styles.unitSection}>
-                    {{
-                      title: () => (
-                        <div class={styles.unitInformation}>
-                          <div>
-                            <div class={styles.name}>{item.orchestraName}</div>
-                            <div class={styles.endTime}>
-                              截止时间:
-                              {dayjs(item.expiryDate || new Date()).format('YYYY-MM-DD HH:mm')}
+              <TransitionGroup name="van-fade">
+                {form.list.map((item: any) => (
+                  <CellGroup inset class={styles.cellGroup} border={false}>
+                    <Cell
+                      center
+                      // isLink
+                      clickable={false}
+                      titleStyle={{ flex: '1 auto' }}
+                      valueClass={[
+                        styles['no-start'],
+                        item.status === 'A_PASS' && styles.pass,
+                        item.status === 'B_NO_PASS' && styles['no-pass']
+                      ]}
+                    >
+                      {{
+                        icon: () => <Image src={iconEdit} class={styles.img} />,
+                        title: () => (
+                          <div class={[styles.unitTitle, 'van-ellipsis']}>{item.name}</div>
+                        ),
+                        value: () => unitTestStatus[item.status]
+                      }}
+                    </Cell>
+                    <Cell center class={styles.unitSection}>
+                      {{
+                        title: () => (
+                          <div class={styles.unitInformation}>
+                            <div>
+                              <div class={styles.name}>{item.orchestraName}</div>
+                              <div class={styles.endTime}>
+                                截止时间:
+                                {dayjs(item.expiryDate || new Date()).format('YYYY-MM-DD HH:mm')}
+                              </div>
                             </div>
+                            {item.status === 'A_PASS' || item.status === 'B_NO_PASS' ? (
+                              <span>
+                                {item.score || 0}
+                                <i>分</i>
+                              </span>
+                            ) : (
+                              ''
+                            )}
                           </div>
-                          {item.status === 'A_PASS' || item.status === 'B_NO_PASS' ? (
-                            <span>
-                              {item.score || 0}
-                              <i>分</i>
-                            </span>
-                          ) : (
-                            ''
-                          )}
-                        </div>
-                      ),
+                        ),
 
-                      label: () => (
-                        <div class={styles.unitBtnGroup}>
-                          <Button
-                            color="#FFF0E6"
-                            round
-                            block
-                            style={{ color: '#F67146' }}
-                            onClick={() => {
-                              router.push({
-                                path: '/test-exercise',
-                                query: {
-                                  id: item.unitExaminationId
-                                }
-                              })
-                            }}
-                          >
-                            练习模式
-                          </Button>
-                          {item.status === 'A_PASS' || item.status === 'B_NO_PASS' ? (
-                            <Button type="primary" round block onClick={() => onUnitTestLook(item)}>
-                              查看测验
-                            </Button>
-                          ) : (
+                        label: () => (
+                          <div class={styles.unitBtnGroup}>
                             <Button
-                              type="primary"
+                              color="#FFF0E6"
                               round
                               block
-                              disabled={dayjs().isAfter(dayjs(item.expiryDate))}
-                              onClick={() => onUnitTestStart(item)}
+                              style={{ color: '#F67146' }}
+                              onClick={() => {
+                                router.push({
+                                  path: '/test-exercise',
+                                  query: {
+                                    id: item.unitExaminationId
+                                  }
+                                })
+                              }}
                             >
-                              {item.status === 'C_ING' ? '继续测验' : '开始测验'}
+                              练习模式
                             </Button>
-                          )}
-                        </div>
-                      )
-                    }}
-                  </Cell>
-                </CellGroup>
-              ))}
+                            {item.status === 'A_PASS' || item.status === 'B_NO_PASS' ? (
+                              <Button
+                                type="primary"
+                                round
+                                block
+                                onClick={() => onUnitTestLook(item)}
+                              >
+                                查看测验
+                              </Button>
+                            ) : (
+                              <Button
+                                type="primary"
+                                round
+                                block
+                                disabled={dayjs().isAfter(dayjs(item.expiryDate))}
+                                onClick={() => onUnitTestStart(item)}
+                              >
+                                {item.status === 'C_ING' ? '继续测验' : '开始测验'}
+                              </Button>
+                            )}
+                          </div>
+                        )
+                      }}
+                    </Cell>
+                  </CellGroup>
+                ))}
+              </TransitionGroup>
             </List>
           </OFullRefresh>
         ) : (

+ 7 - 0
src/views/unit-test/unit-detail/index.tsx

@@ -214,6 +214,9 @@ export default defineComponent({
       try {
         state.nextStatus = true
         if (state.questionList.length === state.currentIndex + 1) {
+          // 关闭所有音频
+          eventUnit.emit('unitAudioStop')
+
           router.back()
         }
         swipeRef.value?.next()
@@ -235,6 +238,10 @@ export default defineComponent({
       resizeSwipeItemHeight()
     })
 
+    onUnmounted(() => {
+      // 关闭所有音频
+      eventUnit.emit('unitAudioStop')
+    })
     return () => (
       <div class={styles.unitDetail}>
         <Cell center class={styles.unitSection} border={false}>