Browse Source

Merge branch 'master' into jenkins

skyblued 2 years ago
parent
commit
c4e9aeab9d

BIN
src/common/images/404.png


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

@@ -135,13 +135,13 @@ export default defineComponent({
 
     const getSubjects = async () => {
       try {
-        const res = await request.post('/api-school/subject/page', {
+        const res = await request.post('/api-school/subjectBasicConfig/page', {
           data: { page: 1, rows: 9999 }
         })
         state.subjects = res.data.rows.map((item) => {
           return {
-            name: item.name,
-            value: item.id as string
+            name: item.subjectName,
+            value: item.subjectId as string
           }
         })
         state.subjects.unshift({ name: '全部声部', value: '' })

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

@@ -197,19 +197,22 @@ export default defineComponent({
         })
         state.columns = tempareas || []
 
-        const { data } = await request.post('/api-school/open/subject/page', {
-          data: {
-            page: 1,
-            rows: 50
+        const { data } = await request.post(
+          '/api-school/open/orchestraSubjectConfig/pageByOrchestraId',
+          {
+            data: {
+              page: 1,
+              rows: 50
+            }
           }
-        })
+        )
 
         const rows = data.rows || []
         const tempSubjects: any = []
-        rows.forEach((item) => {
+        rows.forEach((item: any) => {
           tempSubjects.push({
             text: item.name,
-            value: item.id
+            value: item.subjectId
           })
         })
         state.columnSubject = tempSubjects
@@ -522,14 +525,6 @@ export default defineComponent({
             onConfirm={onConfirmSubject}
           />
         </Popup>
-        <Popup v-model:show={state.showSubject} position="bottom" round>
-          <Picker
-            showToolbar
-            columns={state.columnSubject}
-            onCancel={() => (state.showSubject = false)}
-            onConfirm={onConfirmSubject}
-          />
-        </Popup>
         {/* 学历 */}
         {/* 学历分为专科、本科、硕士、博士、其他 */}
         <Popup v-model:show={state.showEducation} position="bottom" round>

+ 3 - 3
src/school/companion-teacher/index.tsx

@@ -70,7 +70,7 @@ export default defineComponent({
 
     const getSubjects = async () => {
       try {
-        const { data } = await request.post('/api-school/subject/page', {
+        const { data } = await request.post('/api-school/subjectBasicConfig/page', {
           data: {
             page: 1,
             rows: 50
@@ -80,8 +80,8 @@ export default defineComponent({
         const temp = data.rows || []
         temp.forEach((row: any) => {
           form.subjectList.push({
-            text: row.name,
-            value: row.id
+            text: row.subjectName,
+            value: row.subjectId
           })
         })
       } catch {

+ 9 - 6
src/school/manage-teacher/manage-teacher-register.tsx

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

+ 3 - 3
src/school/orchestra/create-orchestra/index.tsx

@@ -29,7 +29,7 @@ export default defineComponent({
     // 获取声部
     const getSubjects = async () => {
       try {
-        const { data } = await request.post('/api-school/subject/page', {
+        const { data } = await request.post('/api-school/subjectBasicConfig/page', {
           data: {
             page: 1,
             rows: 50
@@ -75,8 +75,8 @@ export default defineComponent({
           // 判断是否在数据里,如果在则直接添加,不能重置数据
           if (index < 0) {
             temps.push({
-              id: item.id,
-              name: item.name,
+              id: item.subjectId,
+              name: item.subjectName,
               code: item.code,
               type: null,
               teacher: {}, // 老师信息

+ 5 - 5
src/school/orchestra/modal/subject-list.tsx

@@ -55,11 +55,11 @@ export default defineComponent({
           style={{ paddingBottom: '24px' }}
         >
           {props.subjectList.map((item: any) => (
-            <div class={styles.subject} onClick={() => onSelect(item.id)}>
+            <div class={styles.subject} onClick={() => onSelect(item.subjectId)}>
               <Checkbox
-                name={item.id}
+                name={item.subjectId}
                 class={styles.checkbox}
-                ref={(el: any) => (state.checkboxRefs[item.id] = el)}
+                ref={(el: any) => (state.checkboxRefs[item.subjectId] = el)}
                 onClick={(e: any) => {
                   e.stopPropagation()
                 }}
@@ -72,8 +72,8 @@ export default defineComponent({
                   )
                 }}
               />
-              <Image class={styles.img} src={item.img} />
-              <p class={styles.name}>{item.name}</p>
+              <Image class={styles.img} src={item.subjectImg} />
+              <p class={styles.name}>{item.subjectName}</p>
             </div>
           ))}
         </CheckboxGroup>

+ 3 - 3
src/school/ranking-list/components/day-bang.tsx

@@ -142,13 +142,13 @@ export default defineComponent({
 
     const getSubjects = async () => {
       try {
-        const res = await request.post('/api-school/subject/page', {
+        const res = await request.post('/api-school/subjectBasicConfig/page', {
           data: { page: 1, rows: 9999 }
         })
         state.subjects = res.data.rows.map((item) => {
           return {
-            name: item.name,
-            value: item.id as string
+            name: item.subjectName,
+            value: item.subjectId as string
           }
         })
         state.subjects.unshift({ name: '全部声部', value: '' })

+ 3 - 3
src/school/ranking-list/components/timer-bang.tsx

@@ -142,13 +142,13 @@ export default defineComponent({
 
     const getSubjects = async () => {
       try {
-        const res = await request.post('/api-school/subject/page', {
+        const res = await request.post('/api-school/subjectBasicConfig/page', {
           data: { page: 1, rows: 9999 }
         })
         state.subjects = res.data.rows.map((item) => {
           return {
-            name: item.name,
-            value: item.id as string
+            name: item.subjectName,
+            value: item.subjectId as string
           }
         })
         state.subjects.unshift({ name: '全部声部', value: '' })

BIN
src/student/music-group/pre-apply/images/banner.png


+ 16 - 4
src/student/music-group/pre-apply/index.module.less

@@ -49,16 +49,28 @@
     display: flex;
     align-items: center;
     justify-content: center;
-    span {
+    flex-direction: column;
+    .orchestraName {
       display: block;
-      padding: 0 35px;
-      font-size: 30px;
-      font-weight: bold;
+      padding: 0 25px;
+      font-size: 24px;
+      font-weight: 600;
       color: #ffffff;
       line-height: 38px;
       letter-spacing: 1px;
+      text-shadow: 2px 2px 0px #d83d00;
+      text-align: justify;
       text-align: center;
     }
+    .tips {
+      margin-top: 24px;
+      padding: 5px 11px;
+      background-color: #fff;
+      border-radius: 16px 0 16px 0;
+      font-size: 15px;
+      font-weight: 600;
+      color: #e45729;
+    }
   }
 }
 

+ 34 - 16
src/student/music-group/pre-apply/index.tsx

@@ -43,6 +43,20 @@ export default defineComponent({
           '/api-student/orchestraRegister/registerStatus/' + route.query.id
         )
         state.registerInfo = data || {}
+        const name = data.orchestraName
+        // const name = '华中科技大学大学同济医学院附'
+        // console.log(name.length)
+        if (name.length > 12 && name.length / 12 > 1 && name.length / 12 <= 2) {
+          const len = name.substring(12, 24)
+          if (len.length < 5) {
+            const splitLen = Math.ceil(name.length / 2)
+            const first = name.substring(0, splitLen)
+            const last = name.substring(splitLen, name.length)
+            state.registerInfo.orchestraName = first + '<br />' + last
+          } else {
+            state.registerInfo.orchestraName = name
+          }
+        }
 
         // 判断是否报名注册过
         state.register = data.register
@@ -107,18 +121,18 @@ export default defineComponent({
         }
 
         // 判断是否有openId 并且 purchase
-        // if (!data.openId && !data.purchase) {
-        //   if (browser().weixin) {
-        //     // 微信公众号支付
-        //     //授权
-        //     const code = getUrlCode()
-        //     if (!code) {
-        //       goAuth(data.wxAppId)
-        //     } else {
-        //       state.code = code
-        //     }
-        //   }
-        // }
+        if (!data.openId && !data.purchase) {
+          if (browser().weixin) {
+            // 微信公众号支付
+            //授权
+            const code = getUrlCode()
+            if (!code) {
+              goAuth(data.wxAppId)
+            } else {
+              state.code = code
+            }
+          }
+        }
       } catch {
         //
       }
@@ -191,11 +205,15 @@ export default defineComponent({
     return () => (
       <div class={styles.preApply}>
         <div class={styles.banner} ref={bannerRef}>
-          <span>
-            {state.registerInfo.orchestraName} <br />
-            乐团报名
-          </span>
+          {state.registerInfo.orchestraName && (
+            <>
+              <p class={styles.orchestraName} v-html={state.registerInfo.orchestraName}></p>
+
+              <div class={styles.tips}>快来参加乐团报名吧!</div>
+            </>
+          )}
         </div>
+
         <Sticky position="top">
           <Tabs
             lineWidth={20}

+ 2 - 2
src/views/accompany/music-list.tsx

@@ -204,7 +204,7 @@ export default defineComponent({
           </div>
         </div>
         {headerData.height && <div style={{height: headerData.height + 'px'}}></div>}
-        <Cell
+        {/* <Cell
           center
           title="胜强测试"
           isLink
@@ -226,7 +226,7 @@ export default defineComponent({
                 location.href = src
             }
           }}
-        ></Cell>
+        ></Cell> */}
         <PullRefresh v-model:modelValue={data.refreshing} onRefresh={onRefresh}>
           <List
             immediateCheck={false}

+ 0 - 113
src/views/exercise-after-class/index copy.tsx

@@ -1,113 +0,0 @@
-import request from '@/helpers/request'
-import { browser } from '@/helpers/utils'
-import { state } from '@/state'
-import Plyr from 'plyr'
-import 'plyr/dist/plyr.css'
-import { NoticeBar } from 'vant'
-import { defineComponent, onMounted, reactive, nextTick, computed } from 'vue'
-import { useRoute } from 'vue-router'
-import styles from './index.module.less'
-export default defineComponent({
-  name: 'exercise-after-class',
-  setup() {
-    const route = useRoute()
-    const data = reactive({
-      loading: true,
-      recordLoading: false,
-      currentTime: 0,
-      duration: 0,
-      video: '',
-    })
-    console.log(route.query)
-    const getLessonTraining = async () => {
-      let details = []
-      try {
-        const res: any = await request.get(
-          state.platformApi + `/lessonTraining/courseSchedule/${route.query.courseScheduleId}`
-        )
-        if (Array.isArray(res?.data)) {
-          const studentLevel = state.user?.data?.studentLevel || 1
-          details = res.data.find((n: any) => n.studentLevel === studentLevel)?.details || []
-          console.log('🚀 ~ details', details)
-        }
-      } catch (error) {
-        console.log('error')
-      }
-      if (details.length) {
-        data.video =
-          (details.find((n: any) => n.materialId == route.query.materialId) as any)?.content || ''
-        console.log('🚀 ~ data.video', data.video)
-        nextTick(() => {
-          initVideo()
-        })
-      }
-    }
-    const initVideo = () => {
-      const player = new Plyr('#player', {
-        clickToPlay: true,
-        invertTime: true,
-        controls: ['play-large', 'play', 'current-time', 'restart', 'fullscreen']
-      })
-      player.on('loadeddata', () => {
-        data.duration = player.duration
-        console.log('🚀 ~ player', player.duration)
-        data.loading = false
-      })
-      player.on('timeupdate', () => {
-        data.currentTime = player.currentTime
-        // console.log(timeRemaining.value)
-        if (timeRemaining.value === 0) {
-          if (data.recordLoading || data.currentTime === 0) return
-          console.log('完成观看次数')
-          addTrainingRecord()
-        }
-      })
-    }
-    const timeRemaining = computed(() => {
-      return Math.ceil(data.duration - data.currentTime)
-    })
-    onMounted(() => {
-      getLessonTraining()
-    })
-    // 达到指标,记录
-    const addTrainingRecord = async () => {
-      data.recordLoading = true
-      const browserInfo = browser()
-      const body = {
-        materialType: 'VIDEO',
-        record: {
-          sourceTime: data.duration,
-          clientType: state.platformType,
-          feature: 'LESSON_TRAINING',
-          deviceType: browserInfo.android ? 'ANDROID' : browserInfo.isApp ? 'IOS' : 'WEB'
-        },
-        courseScheduleId: route.query.courseScheduleId,
-        lessonTrainingId: route.query.lessonTrainingId,
-        materialId: route.query.materialId
-      }
-      try {
-        const res: any = await request.post(
-          state.platformApi + '/studentLessonTraining/lessonTrainingRecord',
-          {
-            data: body
-          }
-        )
-      } catch (error) {}
-      data.recordLoading = false
-    }
-    return () => (
-      <div class={styles['exercise-after-class']}>
-        <video id="player" src={data.video}></video>
-        {!data.loading && (
-          <>
-            {timeRemaining.value === 0 ? (
-              <NoticeBar background="green" color="#fff" text={`已完成本次训练`} />
-            ) : (
-              <NoticeBar text={`还需要观看 ${timeRemaining.value} 秒,就可以完成课后训练了`} />
-            )}
-          </>
-        )}
-      </div>
-    )
-  }
-})

+ 2 - 0
src/views/exercise-after-class/index.tsx

@@ -252,6 +252,7 @@ export default defineComponent({
         data.trainingTimes != 0 &&
         data.trainingTimes == (data.videoData as any)?.training?.practiceTimes
       ) {
+        handleStopVideo()
         const itemIndex = data.details.findIndex(
           (n: any) => n.materialId == data.videoData?.materialId
         )
@@ -276,6 +277,7 @@ export default defineComponent({
               })
             }
             if (nextItem?.type === materialType.曲目) {
+              goback()
               let src = `${location.origin}/orchestra-music-score/?id=${nextItem.content}`
               postMessage({
                 api: 'openAccompanyWebView',

+ 3 - 3
src/views/exercise-record/index.tsx

@@ -171,13 +171,13 @@ export default defineComponent({
 
     const getSubjects = async () => {
       try {
-        const res = await request.post(`${platformApi.value}/subject/page`, {
+        const res = await request.post(`${platformApi.value}/subjectBasicConfig/page`, {
           data: { page: 1, rows: 9999 }
         })
         state.subjects = res.data.rows.map((item) => {
           return {
-            name: item.name,
-            value: item.id as string
+            name: item.subjectName,
+            value: item.subjectId as string
           }
         })
         state.subjects.unshift({ name: '全部声部', value: '' })