Browse Source

修改样式与处理bug

lex 2 years ago
parent
commit
18cfb55fac

+ 4 - 0
src/base-event.ts

@@ -4,4 +4,8 @@ export default new EventEmitter()
 
 
 /**
 /**
  * 事件列表
  * 事件列表
+ * toastShow 显示加载动画
+ * toastClose 关闭加载动画
+ * 
+ * playerClosed 关闭视频播放
  */
  */

+ 4 - 1
src/components/o-video/index.tsx

@@ -111,7 +111,7 @@ export default defineComponent({
       })
       })
 
 
       this.player.on('play', () => {
       this.player.on('play', () => {
-        this.onPlay && this.onPlay()
+        this.onPlay && this.onPlay(this.player)
       })
       })
 
 
       this.player.on('enterfullscreen', () => {
       this.player.on('enterfullscreen', () => {
@@ -151,6 +151,9 @@ export default defineComponent({
       this.player.restart()
       this.player.restart()
       this.player.play()
       this.player.play()
       this.domPlayVisibility(false)
       this.domPlayVisibility(false)
+    },
+    onStop() {
+      this.player.stop()
     }
     }
   },
   },
   unmounted() {
   unmounted() {

+ 1 - 1
src/router/routes-school.ts

@@ -227,7 +227,7 @@ export default [
         name: 'train-planning',
         name: 'train-planning',
         component: () => import('@/school/train-planning/index'),
         component: () => import('@/school/train-planning/index'),
         meta: {
         meta: {
-          title: '训练规划'
+          title: '乐团排课'
         }
         }
       },
       },
       {
       {

+ 2 - 1
src/school/companion-teacher/companion-detail.module.less

@@ -11,7 +11,8 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }
 .sectionCellGroup {
 .sectionCellGroup {

+ 2 - 1
src/school/companion-teacher/compontent/teacher.module.less

@@ -29,7 +29,8 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }
 
 

+ 2 - 1
src/school/companion-teacher/index.module.less

@@ -12,7 +12,8 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }
 
 

+ 2 - 1
src/school/mass-message/component/manage-list/index.module.less

@@ -42,6 +42,7 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }

+ 2 - 1
src/school/mass-message/component/student-list/index.module.less

@@ -42,6 +42,7 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }

+ 2 - 1
src/school/mass-message/component/teacher-list/teacher-list.module.less

@@ -42,6 +42,7 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }

+ 15 - 2
src/school/orchestra-story/index.tsx

@@ -12,7 +12,7 @@ import {
   Swipe,
   Swipe,
   SwipeItem
   SwipeItem
 } from 'vant'
 } from 'vant'
-import { defineComponent, onMounted, reactive } from 'vue'
+import { defineComponent, onMounted, reactive, ref } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { useRoute, useRouter } from 'vue-router'
 import styles from './index.module.less'
 import styles from './index.module.less'
 import iconEdit from './images/icon-edit.png'
 import iconEdit from './images/icon-edit.png'
@@ -24,6 +24,7 @@ import OFullRefresh from '@/components/o-full-refresh'
 import OEmpty from '@/components/o-empty'
 import OEmpty from '@/components/o-empty'
 import dayjs from 'dayjs'
 import dayjs from 'dayjs'
 import OVideo from '@/components/o-video'
 import OVideo from '@/components/o-video'
+import baseEvent from '@/base-event'
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'orchestra-story',
   name: 'orchestra-story',
@@ -136,6 +137,15 @@ export default defineComponent({
       })
       })
     }
     }
 
 
+    const videoRef: any = ref([])
+    const onPlay = (index: any) => {
+      videoRef.value.forEach((item: any, child: any) => {
+        if (child !== index) {
+          item.onStop()
+        }
+      })
+    }
+
     onMounted(async () => {
     onMounted(async () => {
       getOrchestras()
       getOrchestras()
     })
     })
@@ -186,7 +196,7 @@ export default defineComponent({
             immediateCheck={false}
             immediateCheck={false}
           >
           >
             <Steps direction="vertical" class={styles.storySteps}>
             <Steps direction="vertical" class={styles.storySteps}>
-              {state.list.map((item: any) => (
+              {state.list.map((item: any, index: number) => (
                 <Step
                 <Step
                   v-slots={{
                   v-slots={{
                     'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
                     'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
@@ -213,10 +223,13 @@ export default defineComponent({
                           )}
                           )}
                           {item.type === 'VIDEO' && (
                           {item.type === 'VIDEO' && (
                             <OVideo
                             <OVideo
+                              // ref={videoRef}
+                              ref={(el: any) => (videoRef.value[index] = el)}
                               src={child.url}
                               src={child.url}
                               height={'100%'}
                               height={'100%'}
                               poster={child.coverImage}
                               poster={child.coverImage}
                               class={styles.swipeImg}
                               class={styles.swipeImg}
+                              onPlay={() => onPlay(index)}
                             />
                             />
                           )}
                           )}
                         </SwipeItem>
                         </SwipeItem>

+ 3 - 0
src/school/orchestra/compontent/information.module.less

@@ -21,6 +21,9 @@
       font-size: 12px;
       font-size: 12px;
       color: #333333;
       color: #333333;
     }
     }
+    span {
+      font-family: DINA;
+    }
   }
   }
   .red {
   .red {
     color: #f67146;
     color: #f67146;

+ 11 - 9
src/school/orchestra/compontent/information.tsx

@@ -63,10 +63,9 @@ export default defineComponent({
       },
       },
 
 
       params: {
       params: {
-        startTime: dayjs(dayjs().year() + startTime.value)
-          .subtract(1, 'year')
-          .format('YYYY-MM-DD HH:mm:ss'),
+        startTime: dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD HH:mm:ss'),
         endTime: dayjs(dayjs().year() + endTime.value)
         endTime: dayjs(dayjs().year() + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss'),
           .format('YYYY-MM-DD HH:mm:ss'),
         page: 1,
         page: 1,
@@ -86,17 +85,19 @@ export default defineComponent({
       state.actionType = val.value
       state.actionType = val.value
 
 
       if (val.value === 'up') {
       if (val.value === 'up') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+        state.params.startTime = dayjs(Number(state.currentData[0]) + startTime.value).format(
           'YYYY-MM-DD HH:mm:ss'
           'YYYY-MM-DD HH:mm:ss'
         )
         )
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (val.value === 'down') {
       } else if (val.value === 'down') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
-          'YYYY-MM-DD HH:mm:ss'
-        )
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
+          .format('YYYY-MM-DD HH:mm:ss')
         state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       }
       }
@@ -106,10 +107,11 @@ export default defineComponent({
     const onConfirmDate = (date: any) => {
     const onConfirmDate = (date: any) => {
       state.currentData = date.selectedValues
       state.currentData = date.selectedValues
       if (state.actionType === 'up') {
       if (state.actionType === 'up') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+        state.params.startTime = dayjs(Number(state.currentData[0]) + startTime.value).format(
           'YYYY-MM-DD HH:mm:ss'
           'YYYY-MM-DD HH:mm:ss'
         )
         )
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (state.actionType === 'down') {
       } else if (state.actionType === 'down') {
@@ -233,7 +235,7 @@ export default defineComponent({
           <GridItem>
           <GridItem>
             <p class={[styles.title, styles.red]}>
             <p class={[styles.title, styles.red]}>
               <span id="currentStudentNum">{state.statistics.studentNum || 0}</span>
               <span id="currentStudentNum">{state.statistics.studentNum || 0}</span>
-              <i>名</i>
+              <i> 名</i>
             </p>
             </p>
             <p class={styles.name}>在读学生</p>
             <p class={styles.name}>在读学生</p>
           </GridItem>
           </GridItem>

+ 10 - 8
src/school/orchestra/compontent/plan.tsx

@@ -46,10 +46,9 @@ export default defineComponent({
       },
       },
 
 
       params: {
       params: {
-        startTime: dayjs(dayjs().year() + startTime.value)
-          .subtract(1, 'year')
-          .format('YYYY-MM-DD HH:mm:ss'),
+        startTime: dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD HH:mm:ss'),
         endTime: dayjs(dayjs().year() + endTime.value)
         endTime: dayjs(dayjs().year() + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss'),
           .format('YYYY-MM-DD HH:mm:ss'),
         page: 1,
         page: 1,
@@ -67,17 +66,19 @@ export default defineComponent({
       state.actionType = val.value
       state.actionType = val.value
 
 
       if (val.value === 'up') {
       if (val.value === 'up') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+        state.params.startTime = dayjs(Number(state.currentData[0]) + startTime.value).format(
           'YYYY-MM-DD HH:mm:ss'
           'YYYY-MM-DD HH:mm:ss'
         )
         )
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (val.value === 'down') {
       } else if (val.value === 'down') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value).format(
-          'YYYY-MM-DD HH:mm:ss'
-        )
+        state.params.startTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
+          .format('YYYY-MM-DD HH:mm:ss')
         state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + startTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       }
       }
@@ -87,10 +88,11 @@ export default defineComponent({
     const onConfirmDate = (date: any) => {
     const onConfirmDate = (date: any) => {
       state.currentData = date.selectedValues
       state.currentData = date.selectedValues
       if (state.actionType === 'up') {
       if (state.actionType === 'up') {
-        state.params.startTime = dayjs(Number(state.currentData[0]) - 1 + startTime.value).format(
+        state.params.startTime = dayjs(Number(state.currentData[0]) + startTime.value).format(
           'YYYY-MM-DD HH:mm:ss'
           'YYYY-MM-DD HH:mm:ss'
         )
         )
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
         state.params.endTime = dayjs(Number(state.currentData[0]) + endTime.value)
+          .add(1, 'year')
           .subtract(1, 'day')
           .subtract(1, 'day')
           .format('YYYY-MM-DD HH:mm:ss')
           .format('YYYY-MM-DD HH:mm:ss')
       } else if (state.actionType === 'down') {
       } else if (state.actionType === 'down') {

+ 2 - 1
src/school/orchestra/modal/teacher-list.module.less

@@ -37,7 +37,8 @@
   }
   }
   .tagSubject {
   .tagSubject {
     margin-right: 10px;
     margin-right: 10px;
-    margin-bottom: 4px;
+    margin-top: 2px;
+    margin-bottom: 2px;
   }
   }
 }
 }
 
 

+ 4 - 0
src/school/train-planning/component/practice-detail/index.tsx

@@ -201,6 +201,7 @@ export default defineComponent({
                 formatter={onFormatterInt}
                 formatter={onFormatterInt}
                 maxlength={3}
                 maxlength={3}
                 type="tel"
                 type="tel"
+                center
                 onUpdate:modelValue={(val: any) => {
                 onUpdate:modelValue={(val: any) => {
                   console.log(val)
                   console.log(val)
                   item.startTime = null
                   item.startTime = null
@@ -214,6 +215,7 @@ export default defineComponent({
                 inputAlign="right"
                 inputAlign="right"
                 readonly
                 readonly
                 isLink
                 isLink
+                center
                 modelValue={item.startTime ? dayjs(item.startTime).format('HH:mm') : ''}
                 modelValue={item.startTime ? dayjs(item.startTime).format('HH:mm') : ''}
                 onClick={() => {
                 onClick={() => {
                   if (!item.trainTimer) {
                   if (!item.trainTimer) {
@@ -231,6 +233,7 @@ export default defineComponent({
                 v-model={item.times}
                 v-model={item.times}
                 formatter={onFormatterInt}
                 formatter={onFormatterInt}
                 maxlength={2}
                 maxlength={2}
+                center
                 type="tel"
                 type="tel"
               >
               >
                 {{ extra: () => <span style={{ paddingLeft: '6px' }}>课时</span> }}
                 {{ extra: () => <span style={{ paddingLeft: '6px' }}>课时</span> }}
@@ -238,6 +241,7 @@ export default defineComponent({
               <Cell
               <Cell
                 title="训练班级"
                 title="训练班级"
                 isLink
                 isLink
+                center
                 onClick={() => {
                 onClick={() => {
                   f.selectItem = item
                   f.selectItem = item
                   forms.classStatus = true
                   forms.classStatus = true

+ 6 - 1
src/school/train-planning/component/train-content/index.tsx

@@ -6,7 +6,7 @@ import { trainCourseEmnu } from '@/constant'
 import request from '@/helpers/request'
 import request from '@/helpers/request'
 import { state } from '@/state'
 import { state } from '@/state'
 import dayjs from 'dayjs'
 import dayjs from 'dayjs'
-import { Button, Cell, CellGroup, showDialog, Tag } from 'vant'
+import { Button, Cell, CellGroup, showDialog, showToast, Tag } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
 import { defineComponent, onMounted, reactive } from 'vue'
 import { useRouter } from 'vue-router'
 import { useRouter } from 'vue-router'
 import { forms, weekFormat } from '../../create'
 import { forms, weekFormat } from '../../create'
@@ -60,6 +60,11 @@ export default defineComponent({
 
 
     const onSubmit = async () => {
     const onSubmit = async () => {
       try {
       try {
+        if (base.contentList.length <= 0) {
+          base.dialogStatus = true
+          base.dialogMessage = '暂无可排课班级'
+          return
+        }
         const list = base.contentList
         const list = base.contentList
         const trainingPlanClassList: any = []
         const trainingPlanClassList: any = []
 
 

+ 21 - 8
src/views/mine-orchestra/orchestra-deeds/index.tsx

@@ -12,7 +12,7 @@ import {
   Swipe,
   Swipe,
   SwipeItem
   SwipeItem
 } from 'vant'
 } from 'vant'
-import { defineComponent, onMounted, reactive, watch } from 'vue'
+import { defineComponent, onMounted, reactive, ref, watch } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import { useRoute, useRouter } from 'vue-router'
 import styles from './index.module.less'
 import styles from './index.module.less'
 import iconStep from './images/icon-step.png'
 import iconStep from './images/icon-step.png'
@@ -78,13 +78,24 @@ export default defineComponent({
         state.isClick = false
         state.isClick = false
       }
       }
     }
     }
-    watch(() => props.orchestraId, () => {
-      state.params.page = 1
-      state.list = []
-      state.listState.finished = false
-      getList()
-    })
+    watch(
+      () => props.orchestraId,
+      () => {
+        state.params.page = 1
+        state.list = []
+        state.listState.finished = false
+        getList()
+      }
+    )
 
 
+    const videoRef: any = ref([])
+    const onPlay = (index: any) => {
+      videoRef.value.forEach((item: any, child: any) => {
+        if (child !== index) {
+          item.onStop()
+        }
+      })
+    }
     onMounted(() => {
     onMounted(() => {
       getList()
       getList()
     })
     })
@@ -103,7 +114,7 @@ export default defineComponent({
             immediateCheck={false}
             immediateCheck={false}
           >
           >
             <Steps direction="vertical" class={styles.storySteps}>
             <Steps direction="vertical" class={styles.storySteps}>
-              {state.list.map((item: any) => (
+              {state.list.map((item: any, index: number) => (
                 <Step
                 <Step
                   v-slots={{
                   v-slots={{
                     'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
                     'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
@@ -130,6 +141,8 @@ export default defineComponent({
                               height={'100%'}
                               height={'100%'}
                               poster={child.coverImage}
                               poster={child.coverImage}
                               class={styles.swipeImg}
                               class={styles.swipeImg}
+                              ref={(el: any) => (videoRef.value[index] = el)}
+                              onPlay={() => onPlay(index)}
                             />
                             />
                           )}
                           )}
                         </SwipeItem>
                         </SwipeItem>