Bläddra i källkod

Merge branch 'master' into online

liushengqiang 2 år sedan
förälder
incheckning
d09c149b9f

+ 8 - 0
src/router/routes-school.ts

@@ -166,6 +166,14 @@ export default [
         }
       },
       {
+        path: '/add-information',
+        name: 'add-information',
+        component: () => import('@/school/orchestra/modal/add-information'),
+        meta: {
+          title: '添加资讯'
+        }
+      },
+      {
         path: '/exercise-record',
         name: 'exercise-record',
         component: () => import('@/views/exercise-record'),

+ 33 - 14
src/school/orchestra/modal/add-information.tsx

@@ -3,8 +3,11 @@ import OSticky from '@/components/o-sticky'
 import OUpload from '@/components/o-upload'
 import request from '@/helpers/request'
 import { verifyUrl } from '@/helpers/toolsValidate'
-import { Button, Field, showNotify, showToast } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import router from '@/router'
+import { state } from '@/state'
+import { Button, Field, Form, showNotify, showToast } from 'vant'
+import { defineComponent, onMounted, reactive, ref, watch } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
 import styles from './add-information.module.less'
 
 export default defineComponent({
@@ -20,7 +23,10 @@ export default defineComponent({
     }
   },
   emits: ['close', 'getList'],
-  setup(props, { slots, attrs, emit }) {
+  setup(props, { emit }) {
+    const route = useRoute()
+    const router = useRouter()
+    const header = ref('添加资讯')
     const forms = reactive({
       type: 'HOT_CONSULTATION',
       clientType: 'SCHOOL',
@@ -65,26 +71,33 @@ export default defineComponent({
           // showNotify({ type: 'primary', message: '修改成功' })
         }
 
-        emit('close')
-        emit('getList')
+        // emit('close')
+        // emit('getList')
+        router.back()
       } catch {
         //
       }
     }
 
-    onMounted(() => {
-      if (props.selectType === 'update') {
-        const selectItem = props.selectItem
-        forms.coverImage = selectItem.coverImage
-        forms.title = selectItem.title
-        forms.linkUrl = selectItem.linkUrl
-        forms.summary = selectItem.summary
+    onMounted(async () => {
+      if (route.query.id) {
+        header.value = '编辑资讯'
+
+        const { data } = await request.get(
+          '/api-school/sysNewsInformation/detail/' + route.query.id
+        )
+        console.log(data)
+        forms.linkUrl = data.linkUrl
+        forms.coverImage = data.coverImage
+        forms.summary = data.summary
+        forms.title = data.title
       }
     })
 
     return () => (
       <div class={styles.addInformation}>
-        <OHeader title="添加资讯" desotry={false} />
+        <OHeader title={header.value} desotry={false} />
+
         <div class={styles.title}>
           <i class={[styles.icon, styles.icon1]}></i>请上传封面图片
         </div>
@@ -93,7 +106,12 @@ export default defineComponent({
         <div class={styles.title}>
           <i class={[styles.icon, styles.icon2]}></i>资讯标题
         </div>
-        <Field placeholder="请输入资讯标题" class={styles.field} v-model={forms.title} />
+        <Field
+          placeholder="请输入资讯标题"
+          class={styles.field}
+          v-model={forms.title}
+          autofocus={false}
+        />
 
         <div class={styles.title}>
           <i class={[styles.icon, styles.icon3]}></i>内容简介
@@ -104,6 +122,7 @@ export default defineComponent({
           rows={2}
           class={styles.field}
           v-model={forms.summary}
+          autofocus={false}
         />
 
         <div class={styles.title}>

+ 14 - 6
src/school/orchestra/orchestra-information.tsx

@@ -100,8 +100,14 @@ export default defineComponent({
     }
 
     const onUpdate = async () => {
-      state.selectType = 'update'
-      state.addStatus = true
+      // state.selectType = 'update'
+      // state.addStatus = true
+      router.push({
+        name: 'add-information',
+        query: {
+          id: state.selectItem.id
+        }
+      })
     }
 
     const onRemove = async () => {
@@ -145,8 +151,9 @@ export default defineComponent({
                 <span
                   class={styles.addPhone}
                   onClick={() => {
-                    state.selectType = 'add'
-                    state.addStatus = true
+                    // state.selectType = 'add'
+                    // state.addStatus = true
+                    router.push('/add-information')
                   }}
                 >
                   添加资讯
@@ -226,14 +233,14 @@ export default defineComponent({
           <OEmpty btnStatus={false} tips="暂无资讯" />
         )}
 
-        <OPopup v-model:modelValue={state.addStatus} style={{ background: '#f8f8f8' }} destroy>
+        {/* <OPopup v-model:modelValue={state.addStatus} style={{ background: '#f8f8f8' }} destroy>
           <AddInformation
             selectType={state.selectType}
             selectItem={state.selectItem}
             onClose={() => (state.addStatus = false)}
             onGetList={onSearch}
           />
-        </OPopup>
+        </OPopup> */}
 
         <ActionSheet
           cancelText="取消"
@@ -256,6 +263,7 @@ export default defineComponent({
           title="删除资讯"
           message="是否删除该资讯?确认后学生端、伴学端将同步删除"
           messageAlign="left"
+          dialogMarginTop="env(safe-area-inset-top)"
           showCancelButton
           onConfirm={onRemove}
         />

+ 2 - 0
src/student/music-group/pre-apply/order-detail.module.less

@@ -54,6 +54,8 @@
   padding-right: 12px;
   padding-bottom: calc(20px + env(safe-area-inset-bottom));
   box-shadow: none !important;
+  background: #fff;
+  padding-top: 12px;
   .needPrice {
     display: flex;
     align-items: center;

+ 1 - 1
src/student/music-group/pre-apply/order-detail.tsx

@@ -457,7 +457,7 @@ export default defineComponent({
           )}
         </div>
 
-        <OSticky position="bottom" background="white">
+        <OSticky position="bottom">
           <div class={styles.protocol}>
             <OProtocol
               v-model:modelValue={state.agreeStatus}

+ 22 - 22
src/views/coursewarePlay/index.tsx

@@ -244,7 +244,7 @@ export default defineComponent({
           }
         })
         //检测是否录屏
-        handleLimitScreenRecord()
+        // handleLimitScreenRecord()
       })
     }
     const getDetail = async () => {
@@ -336,30 +336,30 @@ export default defineComponent({
       getCourseSchedule()
       window.addEventListener('message', iframeHandle)
 
-      //禁止录屏 ios
-      listenerMessage('setVideoPlayer', (result) => {
-        if (result?.content?.status == 'pause'){
-          handleLimitScreenRecord()
-        }
-      })
+      // //禁止录屏 ios
+      // listenerMessage('setVideoPlayer', (result) => {
+      //   if (result?.content?.status == 'pause'){
+      //     handleLimitScreenRecord()
+      //   }
+      // })
 
-      // 安卓
-      postMessage({
-        api: 'limitScreenRecord',
-        content: {
-          type: 1
-        }
-      })
+      // // 安卓
+      // postMessage({
+      //   api: 'limitScreenRecord',
+      //   content: {
+      //     type: 1
+      //   }
+      // })
     })
 
-    onBeforeUnmount(() => {
-      postMessage({
-        api: 'limitScreenRecord',
-        content: {
-          type: 0
-        }
-      })
-    })
+    // onBeforeUnmount(() => {
+    //   postMessage({
+    //     api: 'limitScreenRecord',
+    //     content: {
+    //       type: 0
+    //     }
+    //   })
+    // })
 
     const playRef = ref()
     // 返回

+ 10 - 10
src/views/mine-orchestra/index.tsx

@@ -143,7 +143,7 @@ export default defineComponent({
               lineHeight={4}
             >
               <Tab name="course" title="我的班级">
-                <OFullRefresh
+                {/* <OFullRefresh
                   v-model:modelValue={data.reshLoading}
                   onRefresh={() => {
                     data.reshLoading = true
@@ -152,15 +152,15 @@ export default defineComponent({
                   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>
-                </OFullRefresh>
+                > */}
+                <div class={styles.content}>
+                  <MyClass
+                    orchestraName={modelData.orchestra?.name || ''}
+                    list={modelData.orchestra?.classGroupIdList || []}
+                    orchestraData={modelData.orchestra}
+                  />
+                </div>
+                {/* </OFullRefresh> */}
               </Tab>
               {/* <Tab name="photo" title="乐团相册">
                   <div class={styles.content}>

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

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

+ 90 - 95
src/views/mine-orchestra/orchestra-deeds/index.tsx

@@ -103,104 +103,99 @@ export default defineComponent({
     })
     const swipeRef = ref([] as any)
     return () => (
-      <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' : ''
-        })`}
+      // <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' : ''
+      //   })`}
+      // >
+      <div
+        class={[styles.orchestraStory]}
+        style={{ overflowY: 'auto', height: !state.listState.dataShow ? '100%' : 'auto' }}
       >
-        <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>
+        {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>
-                    <p class={[styles.content, 'van-multi-ellipsis--l2']}>{item.content}</p>
+                  </div>
+                  <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>
-      </OFullRefresh>
+                  <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>
     )
   }
 })

+ 16 - 28
src/views/unit-test/index.tsx

@@ -211,11 +211,6 @@ export default defineComponent({
             }}
           />
         </OSticky>
-
-        {/* <audio controls>
-          <source src="https://daya.ks3-cn-beijing.ksyuncs.com/02/1675838010711.mp3" />
-          您的浏览器不支持该音频格式。
-        </audio> */}
         {form.listState.dataShow ? (
           <OFullRefresh
             v-model:modelValue={form.listState.refreshing}
@@ -235,12 +230,6 @@ export default defineComponent({
               onLoad={getList}
               immediateCheck={false}
             >
-              {/* <audio controls>
-                <source src="horse.mp3" type="audio/mpeg" />
-                <source src="horse.ogg" type="audio/ogg" />
-                您的浏览器不支持该音频格式。
-              </audio> */}
-
               {form.list.map((item: any) => (
                 <CellGroup inset class={styles.cellGroup} border={false}>
                   <Cell
@@ -331,23 +320,6 @@ export default defineComponent({
           <OEmpty tips="暂无阶段自测" />
         )}
 
-        <OActionSheet
-          v-model:show={form.oPopover}
-          actions={form.searchList}
-          onSelect={(val: any) => {
-            form.searchList.forEach((child: any) => {
-              child.selected = false
-            })
-            val.selected = true
-            form.statusText = val.name
-            form.params.status = val.id === 'ALL' ? null : val.id
-            form.oPopover = false
-
-            sessionStorage.setItem('unit-test-search-type', val.id)
-            onSearch()
-          }}
-        />
-
         {/* 测验须知 */}
         <Popup
           v-model:show={form.visiableNotice}
@@ -374,6 +346,22 @@ export default defineComponent({
             router.push('/memberCenter')
           }}
         />
+
+        <OActionSheet
+          v-model:show={form.oPopover}
+          actions={form.searchList}
+          onSelect={(val: any) => {
+            form.searchList.forEach((child: any) => {
+              child.selected = false
+            })
+            val.selected = true
+            form.statusText = val.name
+            form.params.status = val.id === 'ALL' ? null : val.id
+            sessionStorage.setItem('unit-test-search-type', val.id)
+            form.oPopover = false
+            onSearch()
+          }}
+        />
       </div>
     )
   }