Browse Source

Merge branch 'master' into online

lex 2 years ago
parent
commit
0bf755bec4

+ 2 - 2
src/components/o-full-refresh/index.module.less

@@ -1,6 +1,6 @@
 .animateWrap {
-  width: 40px;
-  height: 40px;
+  width: 55px;
+  height: 55px;
 }
 
 .pullRefresh {

+ 1 - 1
src/components/o-header/index.module.less

@@ -8,7 +8,7 @@
     .van-nav-bar__title {
       font-size: 18px;
       font-weight: 500;
-      color: #333;
+      // color: #333;
     }
     .van-nav-bar__right {
       & > div {

+ 1 - 1
src/school/approval-manage/index.module.less

@@ -254,7 +254,7 @@
     .startTimeBottom {
       padding-top: 5px;
       font-size: 18px;
-      font-weight: bold;
+      // font-weight: bold;
       display: flex;
       align-items: center;
     }

+ 7 - 2
src/school/school-detail/eidt-school.tsx

@@ -3,7 +3,7 @@ import OSticky from '@/components/o-sticky'
 import { Form, Field, CellGroup, showToast, Icon, Popup, Picker, Button, Image } from 'vant'
 import { defineComponent, reactive, ref, onMounted } from 'vue'
 import styles from './index.module.less'
-import { useRouter } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import { state as globalState } from '@/state'
 import logoIcon from './images/logo.png'
 import locIcon from './images/loc-icon.png'
@@ -15,6 +15,7 @@ export default defineComponent({
   name: 'school-detail',
   setup() {
     const router = useRouter()
+    const route = useRoute()
     const state = reactive({
       list: [],
       info: {} as any,
@@ -80,7 +81,11 @@ export default defineComponent({
             ...forms
           }
         })
-        router.go(-1)
+        if (route.query.page === 'type') {
+          router.go(-1)
+        } else {
+          postMessage({ api: 'back' })
+        }
       } catch (e: any) {
         showToast(e.message)
       }

+ 6 - 1
src/school/school-detail/index.tsx

@@ -37,7 +37,12 @@ export default defineComponent({
     }
     const gotoEidt = () => {
       // /school-eidt
-      router.push({ path: '/school-eidt' })
+      router.push({
+        path: '/school-eidt',
+        query: {
+          page: 'type'
+        }
+      })
     }
     const getTeacherList = async () => {
       // const schoolId = (globalState.user.data.schoolInfos || [])

+ 3 - 3
src/student/download/index.tsx

@@ -35,15 +35,15 @@ export default defineComponent({
         if (state.type === 'student') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-student-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-student.apk'
         } else if (state.type === 'teacher') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-teacher-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-teacher.apk'
         } else if (state.type === 'manage') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-teacher-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-manager.apk'
         }
       } else {
         if (state.type === 'student') {

+ 3 - 3
src/student/download/transfer.tsx

@@ -95,15 +95,15 @@ export default defineComponent({
         if (this.type === 'student') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-student-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-student.apk'
         } else if (this.type === 'teacher') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E4%BC%B4%E5%AD%A6%E7%AB%AF/id1670584741?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-teacher-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-teacher.apk'
         } else if (this.type === 'manage') {
           urlIos =
             'https://apps.apple.com/cn/app/%E7%AE%A1%E4%B9%90%E5%9B%A2%E7%AE%A1%E7%90%86%E7%AB%AF/id1671473981?uo=4'
-          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/clx-teacher-domain.apk'
+          urlAndroid = 'https://appstore.ks3-cn-beijing.ksyuncs.com/gyt-manager.apk'
         }
       } else {
         if (this.type === 'student') {

+ 0 - 1
src/student/trade-record/index.module.less

@@ -58,7 +58,6 @@
 
   .price {
     font-size: 20px;
-    font-weight: bold;
     color: #fc1a19;
     span {
       font-size: 14px;

+ 1 - 1
src/views/mine-orchestra/index.module.less

@@ -40,7 +40,7 @@
 }
 .content {
   height: calc(
-    100vh - 57px - var(--van-tabs-line-height) - var(--header-height) - var(--footer-height)
+    100vh - 57px - var(--van-tabs-line-height) - var(--header-height)
   );
   overflow: hidden;
   overflow-y: auto;

+ 51 - 76
src/views/mine-orchestra/index.tsx

@@ -22,7 +22,8 @@ export default defineComponent({
     const data = reactive({
       orchestraList: [] as any[],
       loading: true,
-      reshLoading: false
+      reshLoading: false,
+      dataShow: true
     })
     const modelData = reactive({
       orchestra: {} as any,
@@ -50,6 +51,7 @@ export default defineComponent({
         .finally(() => {
           setTimeout(() => {
             data.loading = false
+            data.reshLoading = false
           }, 300)
         })
     }
@@ -74,6 +76,7 @@ export default defineComponent({
         .finally(() => {
           setTimeout(() => {
             data.loading = false
+            data.reshLoading = false
           }, 300)
         })
     }
@@ -113,7 +116,7 @@ export default defineComponent({
             </Cell>
           </CellGroup>
         )}
-        <OFullRefresh
+        {/* <OFullRefresh
           v-model:modelValue={data.loading}
           onRefresh={() => {
             data.reshLoading = true
@@ -122,93 +125,65 @@ export default defineComponent({
               data.reshLoading = false
               data.loading = false
             }, 500)
-            // data.orchestraList = []
-            // nextTick(() => {
-            //   getData()
-            // })
           }}
-          style={`min-height: calc(100vh - var(--van-nav-bar-height) - var(--header-height) - var(--footer-height) - ${
+          style={`min-height: calc(100vh - var(--van-nav-bar-height) - var(--header-height)  - ${
             data.orchestraList.length ? '1.2rem' : ''
           })`}
-        >
-          {!data.loading && !!data.orchestraList.length && (
-            <>
-              <Tabs
-                v-model:active={tabActive.value}
-                class={styles.tabs}
-                lazyRender={true}
-                background="transparent"
-                animated
-                swipeable
-                lineWidth={16}
-                lineHeight={4}
-              >
-                <Tab name="course" title="我的班级">
+        > */}
+        {!!data.orchestraList.length && (
+          <>
+            <Tabs
+              v-model:active={tabActive.value}
+              class={styles.tabs}
+              lazyRender={true}
+              background="transparent"
+              animated
+              swipeable
+              lineWidth={16}
+              lineHeight={4}
+            >
+              <Tab name="course" title="我的班级">
+                <OFullRefresh
+                  v-model:modelValue={data.reshLoading}
+                  onRefresh={() => {
+                    data.reshLoading = true
+                    getData()
+                  }}
+                  style={`min-height: calc(100vh - var(--van-nav-bar-height) - var(--header-height)  - ${
+                    data.orchestraList.length ? '1.2rem' : ''
+                  })`}
+                >
                   <div class={styles.content}>
                     <MyClass
                       orchestraName={modelData.orchestra?.name || ''}
                       list={modelData.orchestra?.classGroupIdList || []}
+                      orchestraData={modelData.orchestra}
                     />
                   </div>
-                </Tab>
-                {/* <Tab name="photo" title="乐团相册">
+                </OFullRefresh>
+              </Tab>
+              {/* <Tab name="photo" title="乐团相册">
                   <div class={styles.content}>
                     <MyPhoto orchestraId={modelData.orchestra?.id || ''} />
                   </div>
                 </Tab> */}
-                <Tab name="deeds" title="乐团事迹">
-                  <div class={styles.content}>
-                    <OrchestraDeeds orchestraId={modelData.orchestra?.id || ''} />
-                  </div>
-                </Tab>
-              </Tabs>
-            </>
-          )}
-          {!data.loading && !data.orchestraList.length && (
-            <div
-              class={!data.orchestraList.length && 'emptyRootContainer'}
-              style={{ minHeight: 'calc(100vh - var(--header-height))' }}
-            >
-              <OEmpty btnStatus={false} tips="暂无乐团" />
-            </div>
-          )}
-        </OFullRefresh>
-
-        {state.platformType == 'STUDENT' &&
-          ['REGISTER', 'LEARNING', 'AUTH'].includes(modelData.orchestra?.status) && (
-            <OSticky
-              position="bottom"
-              onGetHeight={(height: any) => {
-                document.documentElement.style.setProperty('--footer-height', height + 'px')
-              }}
-            >
-              <div class="btnGroup" style="padding-top: 12px">
-                {(modelData.orchestra?.status === 'REGISTER' ||
-                  modelData.orchestra?.status === 'LEARNING') && (
-                  <Button
-                    type="primary"
-                    round
-                    block
-                    onClick={() => {
-                      router.push({
-                        path: '/apply-withdrawal',
-                        query: {
-                          id: modelData.orchestra?.orchestraId
-                        }
-                      })
-                    }}
-                  >
-                    申请退团
-                  </Button>
-                )}
-                {modelData.orchestra?.status === 'AUTH' && (
-                  <Button type="primary" round block disabled>
-                    申请退团中
-                  </Button>
-                )}
-              </div>
-            </OSticky>
-          )}
+              <Tab name="deeds" title="乐团事迹">
+                <div class={styles.content}>
+                  <OrchestraDeeds orchestraId={modelData.orchestra?.id || ''} />
+                </div>
+              </Tab>
+            </Tabs>
+          </>
+        )}
+        {!data.loading && !data.orchestraList.length && (
+          <div
+            class={!data.orchestraList.length && 'emptyRootContainer'}
+            style={{ minHeight: 'calc(100vh - var(--header-height))' }}
+          >
+            <OEmpty btnStatus={false} tips="暂无乐团" />
+          </div>
+        )}
+        {/* </OFullRefresh> */}
 
         <Popup
           v-model:show={modelData.orchestraStatus}

+ 7 - 0
src/views/mine-orchestra/my-class/index.module.less

@@ -83,3 +83,10 @@
     }
   }
 }
+
+.returnOrchestra {
+  font-size: 13px;
+    font-weight: 400;
+    color: #AAAAAA;
+    line-height: 18px;
+}

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

@@ -1,14 +1,19 @@
-import { Cell, Grid, GridItem, Image } from 'vant'
+import { Button, Cell, Grid, GridItem, Image } from 'vant'
 import { defineComponent, toRefs } from 'vue'
 import styles from './index.module.less'
 import iconTeacher from '@common/images/icon_teacher.png'
 import iconMessage from '@common/images/icon-muit-message.png'
 import { postMessage } from '@/helpers/native-message'
 import { openDefaultWebView, state } from '../../../state'
+import { useRouter } from 'vue-router'
 
 export default defineComponent({
   name: 'my-orchestra',
   props: {
+    orchestraData: {
+      type: Object,
+      default: () => ({})
+    },
     orchestraName: {
       type: String,
       default: ''
@@ -19,6 +24,7 @@ export default defineComponent({
     }
   },
   setup(props) {
+    const router = useRouter()
     const { orchestraName } = toRefs(props)
     console.log('🚀 ~ orchestraName', orchestraName.value)
     const onMessage = async (item: any) => {
@@ -116,6 +122,30 @@ export default defineComponent({
               </Grid>
             </div>
           ))}
+
+        {state.platformType == 'STUDENT' && (
+          <div class="btnGroup" style="padding-top: 12px; text-align: center;">
+            {(props.orchestraData?.status === 'REGISTER' ||
+              props.orchestraData?.status === 'LEARNING') && (
+              <span
+                class={styles.returnOrchestra}
+                onClick={() => {
+                  router.push({
+                    path: '/apply-withdrawal',
+                    query: {
+                      id: props.orchestraData?.orchestraId
+                    }
+                  })
+                }}
+              >
+                申请退团
+              </span>
+            )}
+            {props.orchestraData?.status === 'AUTH' && (
+              <span class={styles.returnOrchestra}>申请退团中</span>
+            )}
+          </div>
+        )}
       </div>
     )
   }

+ 3 - 0
src/views/mine-orchestra/orchestra-deeds/index.module.less

@@ -1,3 +1,6 @@
+.orchestraStory {
+  padding-bottom: calc(10px + env(safe-area-inset-bottom));
+}
 .cellGroup {
   margin: 12px 13px 0;
   overflow: hidden;

+ 97 - 77
src/views/mine-orchestra/orchestra-deeds/index.tsx

@@ -22,6 +22,7 @@ import OEmpty from '@/components/o-empty'
 import dayjs from 'dayjs'
 import OVideo from '@/components/o-video'
 import { state as globalState } from '@/state'
+import OFullRefresh from '@/components/o-full-refresh'
 
 export default defineComponent({
   name: 'orchestra-story',
@@ -36,6 +37,7 @@ export default defineComponent({
       isClick: false,
       list: [] as any,
       listState: {
+        reshLoading: false,
         dataShow: true, // 判断是否有数据
         loading: false,
         finished: false,
@@ -101,86 +103,104 @@ export default defineComponent({
     })
     const swipeRef = ref([] as any)
     return () => (
-      <div
-        class={[styles.orchestraStory, !state.listState.dataShow && 'emptyRootContainer']}
-        style={{ overflowY: 'auto' }}
+      <OFullRefresh
+        v-model:modelValue={state.listState.refreshing}
+        onRefresh={() => {
+          state.params.page = 1
+          state.listState.refreshing = true
+          state.list = []
+          getList()
+        }}
+        style={`min-height: calc(100vh - var(--van-nav-bar-height) - var(--header-height)  - ${
+          props.orchestraId ? '1.2rem' : ''
+        })`}
       >
-        {state.listState.dataShow ? (
-          <List
-            // v-model:loading={state.listState.loading}
-            finished={state.listState.finished}
-            finishedText=" "
-            class={[styles.liveList]}
-            onLoad={getList}
-            immediateCheck={false}
-          >
-            <Steps direction="vertical" class={[styles.storySteps, 'storyStepContainer']}>
-              {state.list.map((item: any, index: number) => (
-                <Step
-                  v-slots={{
-                    'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
-                    'active-icon': () => <Image src={iconStepCalendar} class={styles.iconActive} />
-                  }}
-                >
-                  <div class={styles.stepTimes}>
-                    <div class={styles.stepTime}>
-                      {dayjs(item.createTime).format('YYYY年MM月DD日')}
+        <div
+          class={[styles.orchestraStory, !state.listState.dataShow && 'emptyRootContainer']}
+          style={{ overflowY: 'auto' }}
+        >
+          {state.listState.dataShow ? (
+            <List
+              // v-model:loading={state.listState.loading}
+              finished={state.listState.finished}
+              finishedText=" "
+              class={[styles.liveList]}
+              onLoad={getList}
+              immediateCheck={false}
+            >
+              <Steps direction="vertical" class={[styles.storySteps, 'storyStepContainer']}>
+                {state.list.map((item: any, index: number) => (
+                  <Step
+                    v-slots={{
+                      'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
+                      'active-icon': () => (
+                        <Image src={iconStepCalendar} class={styles.iconActive} />
+                      )
+                    }}
+                  >
+                    <div class={styles.stepTimes}>
+                      <div class={styles.stepTime}>
+                        {dayjs(item.createTime).format('YYYY年MM月DD日')}
+                      </div>
                     </div>
-                  </div>
-                  <p class={[styles.content, 'van-multi-ellipsis--l2']}>{item.content}</p>
+                    <p class={[styles.content, 'van-multi-ellipsis--l2']}>{item.content}</p>
 
-                  <Swipe ref={(el: any) => (swipeRef.value[index] = el)} class={styles.storySwipe}>
-                    {item.attachments &&
-                      item.attachments.map((child: any) => (
-                        <SwipeItem>
-                          {item.type === 'IMAGE' && (
-                            <div
-                              class={styles.swipeImg}
-                              style={
-                                child.url
-                                  ? {
-                                      backgroundImage: `url(${child.url})`,
-                                      backgroundSize: 'cover'
-                                    }
-                                  : ''
-                              }
-                            ></div>
-                          )}
-                          {item.type === 'VIDEO' && (
-                            <OVideo
-                              src={child.url}
-                              height={'100%'}
-                              poster={child.coverImage}
-                              class={styles.swipeImg}
-                              ref={(el: any) => (videoRef.value[index] = el)}
-                              onPlay={() => onPlay(index)}
-                              onExitfullscreen={() => {
-                                console.group('重新resize', swipeRef.value)
-                                console.time('开始')
-                                nextTick(() => {
-                                  setTimeout(() => {
-                                    console.time('结束')
-                                    console.groupEnd()
-                                    // swipeRef.value?.resize()
-                                    swipeRef.value.forEach((item: any) => {
-                                      item.resize()
-                                    })
-                                  }, 600)
-                                })
-                              }}
-                            />
-                          )}
-                        </SwipeItem>
-                      ))}
-                  </Swipe>
-                </Step>
-              ))}
-            </Steps>
-          </List>
-        ) : (
-          <OEmpty btnStatus={false} tips="暂无事迹" style={{ paddingBottom: '30px' }} />
-        )}
-      </div>
+                    <Swipe
+                      ref={(el: any) => (swipeRef.value[index] = el)}
+                      class={styles.storySwipe}
+                    >
+                      {item.attachments &&
+                        item.attachments.map((child: any) => (
+                          <SwipeItem>
+                            {item.type === 'IMAGE' && (
+                              <div
+                                class={styles.swipeImg}
+                                style={
+                                  child.url
+                                    ? {
+                                        backgroundImage: `url(${child.url})`,
+                                        backgroundSize: 'cover'
+                                      }
+                                    : ''
+                                }
+                              ></div>
+                            )}
+                            {item.type === 'VIDEO' && (
+                              <OVideo
+                                src={child.url}
+                                height={'100%'}
+                                poster={child.coverImage}
+                                class={styles.swipeImg}
+                                ref={(el: any) => (videoRef.value[index] = el)}
+                                onPlay={() => onPlay(index)}
+                                onExitfullscreen={() => {
+                                  // console.group('重新resize', swipeRef.value)
+                                  // console.time('开始')
+                                  nextTick(() => {
+                                    setTimeout(() => {
+                                      // console.time('结束')
+                                      // console.groupEnd()
+                                      // swipeRef.value?.resize()
+                                      swipeRef.value.forEach((item: any) => {
+                                        item.resize()
+                                      })
+                                    }, 600)
+                                  })
+                                }}
+                              />
+                            )}
+                          </SwipeItem>
+                        ))}
+                    </Swipe>
+                  </Step>
+                ))}
+              </Steps>
+            </List>
+          ) : (
+            <OEmpty btnStatus={false} tips="暂无事迹" style={{ paddingBottom: '30px' }} />
+          )}
+        </div>
+      </OFullRefresh>
     )
   }
 })

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

@@ -14,7 +14,7 @@
   align-items: center;
   width: 100%;
   height: calc(100vw / 2);
-  border-radius: 10px;
+  border-radius: 2px;
   overflow: hidden;
   position: relative;
   background-color: #eaeaea;

+ 32 - 23
src/views/unit-test/examination-mode/index.tsx

@@ -56,21 +56,21 @@ export default defineComponent({
     })
 
     // 计时
-    const { counter, resume, pause } = useInterval(1000, { controls: true })
+    // const { counter, resume, pause } = useInterval(1000, { controls: true })
 
-    watch(
-      () => counter.value,
-      async () => {
-        console.log(counter.value, state.time / 1000, dayjs().format('HH:mm:ss'))
-        // 秒
-        if (counter.value >= state.time / 1000) {
-          pause()
-          eventUnit.emit('unitAudioStop')
-          await onConfirmExam()
-          state.visiableExam = true
-        }
-      }
-    )
+    // watch(
+    //   () => counter.value,
+    //   async () => {
+    //     console.log(counter.value, state.time / 1000, dayjs().format('HH:mm:ss'))
+    //     // 秒
+    //     if (counter.value >= state.time / 1000) {
+    //       pause()
+    //       eventUnit.emit('unitAudioStop')
+    //       await onConfirmExam()
+    //       state.visiableExam = true
+    //     }
+    //   }
+    // )
 
     const getExamDetails = async () => {
       try {
@@ -111,14 +111,14 @@ export default defineComponent({
       // 时间到了考试结束
       if (minu <= 0) {
         eventUnit.emit('unitAudioStop')
-        await onConfirmExam()
+        await afterQuestion()
         state.visiableExam = true
       } else {
+        // pause()
         state.time = Math.ceil(minu / 1000) * 1000
-        pause()
         setTimeout(() => {
           countDownRef.value?.start()
-          resume()
+          // resume()
         }, 10)
       }
     }
@@ -221,6 +221,18 @@ export default defineComponent({
      */
     const onConfirmExam = async () => {
       try {
+        await afterQuestion()
+        onAfter()
+        // if (status) {
+        state.visiableResult = true
+        // }
+      } catch {
+        //
+      }
+    }
+
+    const afterQuestion = async () => {
+      try {
         const questionList = state.questionList || []
         const userAnswerList: any = [] // 所有题目的答案
         questionList.forEach((question: any) => {
@@ -257,8 +269,6 @@ export default defineComponent({
             examName: state.examDetail.unitExaminationName
           }
         }
-        onAfter()
-        state.visiableResult = true
       } catch {
         //
       }
@@ -285,7 +295,6 @@ export default defineComponent({
     }
 
     onMounted(async () => {
-      pause()
       await getExamDetails()
 
       // 初始化高度
@@ -323,9 +332,9 @@ export default defineComponent({
                     format={'mm:ss'}
                     autoStart={false}
                     onFinish={async () => {
-                      // eventUnit.emit('unitAudioStop')
-                      // await onConfirmExam()
-                      // state.visiableExam = true
+                      eventUnit.emit('unitAudioStop')
+                      await afterQuestion()
+                      state.visiableExam = true
                     }}
                   />
                 </div>

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

@@ -38,7 +38,7 @@ import ErrorMode from '../model/error-mode'
 import ResultFinish from '../model/result-finish'
 import { eventUnit, QuestionType } from '../unit'
 import request from '@/helpers/request'
-import { useRect } from '@vant/use'
+import { useCountDown, useRect } from '@vant/use'
 import OHeader from '@/components/o-header'
 import { useInterval } from '@vueuse/core'