Bladeren bron

Merge branch 'master' of http://git.dayaedu.com/lex/orchestra-app

mo 2 jaren geleden
bovenliggende
commit
d67361a47a

+ 9 - 11
src/school/approval-manage/course-adjust.module.less

@@ -21,14 +21,12 @@
     }
   }
 }
-.wall {
-  height: 60px;
-}
-.btnWrap {
-  position: fixed;
-  width: 85%;
-  bottom: 60px;
-  .unpassBtn {
-    border-radius: 22px;
-  }
-}
+
+// .btnWrap {
+//   position: fixed;
+//   width: 85%;
+//   bottom: 60px;
+//   .unpassBtn {
+//     border-radius: 22px;
+//   }
+// }

+ 23 - 9
src/school/approval-manage/course-adjust.tsx

@@ -13,6 +13,7 @@ import OPopup from '@/components/o-popup'
 import Calendar from '../train-planning/modal/calendar'
 import Timer from '../train-planning/modal/timer'
 import TeacherList from '../orchestra/modal/teacher-list'
+import OSticky from '@/components/o-sticky'
 
 export default defineComponent({
   name: 'course-adjust',
@@ -199,15 +200,28 @@ export default defineComponent({
               <Cell title="课程时长" value={(courseDetail.value.singleCourseTime || 0) + '分钟'} />
             </CellGroup>
           </div>
-          <div class={styles.wall}></div>
-          <div class={['btnGroup btnMore', styles.btnWrap]}>
-            <Button color="#ccc" class={styles.unpassBtn} onClick={() => reset()}>
-              取消
-            </Button>
-            <Button color="#FF8057" class={styles.unpassBtn} onClick={() => submit()}>
-              确认调整
-            </Button>
-          </div>
+          <OSticky position="bottom">
+            <div class={['btnGroup btnMore']}>
+              <Button
+                color="#ccc"
+                size="large"
+                round
+                class={styles.unpassBtn}
+                onClick={() => reset()}
+              >
+                取消
+              </Button>
+              <Button
+                color="#FF8057"
+                size="large"
+                round
+                class={styles.unpassBtn}
+                onClick={() => submit()}
+              >
+                确认调整
+              </Button>
+            </div>
+          </OSticky>
 
           {/* 选择训练开始日期 */}
           <OPopup v-model:modelValue={state.showPopoverTime} position="bottom" destroy>

+ 38 - 8
src/school/orchestra/modal/add-information.tsx

@@ -2,11 +2,21 @@ 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, reactive } from 'vue'
+import { defineComponent, onMounted, reactive } from 'vue'
 import styles from './add-information.module.less'
 
 export default defineComponent({
   name: 'add-information',
+  props: {
+    selectType: {
+      type: String,
+      default: 'add'
+    },
+    selectItem: {
+      type: Object,
+      default: {}
+    }
+  },
   emits: ['close', 'getList'],
   setup(props, { slots, attrs, emit }) {
     const forms = reactive({
@@ -35,12 +45,22 @@ export default defineComponent({
         return
       }
       try {
-        await request.post('/api-school/sysNewsInformation/save', {
-          data: {
-            ...forms
-          }
-        })
-        showNotify({ type: 'primary', message: '添加成功' })
+        if (props.selectType === 'add') {
+          await request.post('/api-school/sysNewsInformation/save', {
+            data: {
+              ...forms
+            }
+          })
+          showNotify({ type: 'primary', message: '添加成功' })
+        } else if (props.selectType === 'update') {
+          await request.post('/api-school/sysNewsInformation/update', {
+            data: {
+              ...forms,
+              id: props.selectItem.id
+            }
+          })
+          showNotify({ type: 'primary', message: '修改成功' })
+        }
 
         emit('close')
         emit('getList')
@@ -49,6 +69,16 @@ export default defineComponent({
       }
     }
 
+    onMounted(() => {
+      if (props.selectType === 'update') {
+        const selectItem = props.selectItem
+        forms.coverImage = selectItem.coverImage
+        forms.title = selectItem.title
+        forms.linkUrl = selectItem.linkUrl
+        forms.memo = selectItem.memo
+      }
+    })
+
     return () => (
       <div class={styles.addInformation}>
         <div class={styles.title}>
@@ -79,7 +109,7 @@ export default defineComponent({
 
         <div class={'btnGroup'} style={{ marginTop: '24px' }}>
           <Button type="primary" size="large" block round onClick={onSubmit}>
-            发布资讯
+            {props.selectType === 'add' ? '发布资讯' : '确认修改'}
           </Button>
         </div>
       </div>

+ 81 - 7
src/school/orchestra/orchestra-information.tsx

@@ -3,7 +3,7 @@ import OPopup from '@/components/o-popup'
 import request from '@/helpers/request'
 import { router } from '@/router/routes-common'
 import dayjs from 'dayjs'
-import { Button, Cell, Image, List } from 'vant'
+import { ActionSheet, Button, Cell, Icon, Image, List, showConfirmDialog, showToast } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
 import { useRoute, useRouter } from 'vue-router'
 import AddInformation from './modal/add-information'
@@ -28,7 +28,10 @@ export default defineComponent({
         clientType: 'SCHOOL',
         page: 1,
         rows: 20
-      }
+      },
+      oPopover: false,
+      selectItem: {} as any,
+      selectType: 'add'
     })
 
     const getList = async () => {
@@ -87,12 +90,49 @@ export default defineComponent({
       }
     }
 
+    const onUpdate = async () => {
+      state.selectType = 'update'
+      state.addStatus = true
+    }
+
+    const onRemove = async () => {
+      showConfirmDialog({
+        message: '您确认删除该资讯吗?'
+      }).then(async () => {
+        try {
+          await request.post('/api-school/sysNewsInformation/remove', {
+            requestType: 'form',
+            data: {
+              id: state.selectItem.id
+            }
+          })
+          setTimeout(() => {
+            showToast('删除成功')
+          }, 100)
+
+          setTimeout(() => {
+            onSearch()
+          }, 1100)
+        } catch {
+          //
+        }
+      })
+    }
+
     onMounted(() => {
       getList()
     })
     return () => (
       <div class={styles.information}>
-        <Button icon="plus" block class={styles.addPhone} onClick={() => (state.addStatus = true)}>
+        <Button
+          icon="plus"
+          block
+          class={styles.addPhone}
+          onClick={() => {
+            state.selectType = 'add'
+            state.addStatus = true
+          }}
+        >
           添加资讯
         </Button>
 
@@ -112,8 +152,27 @@ export default defineComponent({
                     <div>
                       <div class={[styles.title, 'van-ellipsis']}>{item.title}</div>
                       <div class={[styles.content, 'van-multi-ellipsis--l2']}>{item.memo}</div>
-                      <div class={styles.time}>
-                        {dayjs(item.createTime).format('YYYY年MM月DD日')}
+                      <div
+                        style={{
+                          display: 'flex',
+                          alignItems: 'center',
+                          justifyContent: 'space-between'
+                        }}
+                      >
+                        <div class={styles.time}>
+                          {item.createTime ? dayjs(item.createTime).format('YYYY年MM月DD日') : ''}
+                        </div>
+                        <Icon
+                          name="ellipsis"
+                          size={23}
+                          color="#777777"
+                          style={{ fontWeight: 'bold' }}
+                          onClick={(e: any) => {
+                            e.stopPropagation()
+                            state.selectItem = item
+                            state.oPopover = true
+                          }}
+                        />
                       </div>
                     </div>
                   )
@@ -125,9 +184,24 @@ export default defineComponent({
           <OEmpty btnStatus={false} classImgSize="SMALL" tips="暂无资讯" />
         )}
 
-        <OPopup v-model:modelValue={state.addStatus} style={{ background: '#f8f8f8' }}>
-          <AddInformation onClose={() => (state.addStatus = false)} onGetList={onSearch} />
+        <OPopup v-model:modelValue={state.addStatus} style={{ background: '#f8f8f8' }} destroy>
+          <AddInformation
+            selectType={state.selectType}
+            selectItem={state.selectItem}
+            onClose={() => (state.addStatus = false)}
+            onGetList={onSearch}
+          />
         </OPopup>
+
+        <ActionSheet
+          cancelText="取消"
+          v-model:show={state.oPopover}
+          closeOnClickAction
+          actions={[
+            { name: '修改', callback: () => onUpdate() },
+            { name: '删除', color: '#F44541', callback: () => onRemove() }
+          ]}
+        />
       </div>
     )
   }

+ 11 - 1
src/school/train-planning/component/course-preview/index.module.less

@@ -68,6 +68,11 @@
   .cellTeacher {
     padding: 10px 12px 15px;
   }
+  .conflictGrouop {
+    padding: 0 12px;
+    :global {
+    }
+  }
 
   .cellDate {
     display: flex;
@@ -106,6 +111,10 @@
     font-weight: bold;
     color: #333333;
     line-height: 35px;
+
+    &.conflictType {
+      color: #f44541;
+    }
   }
 
   .conflict {
@@ -113,6 +122,7 @@
     padding: 2px 4px;
     border-radius: 3px;
     margin-left: 8px;
+    margin-bottom: 15px;
   }
 
   .teacherName {
@@ -123,7 +133,7 @@
   }
 
   .btn {
-    padding: 5px 28px;
+    padding: 0 28px;
     height: 32px;
     line-height: 30px;
   }

+ 72 - 64
src/school/train-planning/component/course-preview/index.tsx

@@ -241,72 +241,16 @@ export default defineComponent({
                 value: () => <span class={styles.cellTime}>{item.singleCourseTime}分钟</span>
               }}
             </Cell>
-            <div class={styles.cellTimeRange}>
+
+            <div
+              class={[
+                styles.cellTimeRange,
+                item.conflictType && item.conflictType.length > 0 && styles.conflictType
+              ]}
+            >
               {dayjs(item.startTime).format('HH:mm')}-{dayjs(item.endTime).format('HH:mm')}
-              {item.conflictType && item.conflictType.includes('STUDENT') ? (
-                <Tag
-                  class={styles.conflict}
-                  color="#F44541"
-                  onClick={() => {
-                    //             conflictStatus: false,
-                    // conflictMessage: '该时间段伴学指导在其他学校有课',
-                    state.conflictMessage = '学生时间冲突'
-                    state.conflictStatus = true
-                    state.choiceCourse = item
-                  }}
-                >
-                  学生冲突
-                </Tag>
-              ) : (
-                ''
-              )}
-              {item.conflictType && item.conflictType.includes('DIFF_SCHOOL_TEACHER') ? (
-                <Tag
-                  class={styles.conflict}
-                  color="#F44541"
-                  onClick={() => {
-                    state.conflictMessage = '该时间段伴学指导在其他学校有课'
-                    state.conflictStatus = true
-                    state.choiceCourse = item
-                  }}
-                >
-                  学校冲突
-                </Tag>
-              ) : (
-                ''
-              )}
-              {item.conflictType && item.conflictType.includes('SAME_SCHOOL_TEACHER') ? (
-                <Tag
-                  class={styles.conflict}
-                  color="#F44541"
-                  onClick={() => {
-                    state.conflictMessage = '伴学指导在本学校时间有冲突'
-                    state.conflictStatus = true
-                    state.choiceCourse = item
-                  }}
-                >
-                  老师冲突
-                </Tag>
-              ) : (
-                ''
-              )}
-              {item.conflictType && item.conflictType.includes('LEAVE') ? (
-                <Tag
-                  class={styles.conflict}
-                  color="#F44541"
-                  onClick={() => {
-                    state.conflictMessage = '伴学指导请假冲突'
-                    state.conflictStatus = true
-                    state.choiceCourse = item
-                  }}
-                >
-                  请假冲突
-                </Tag>
-              ) : (
-                ''
-              )}
             </div>
-            <Cell center class={styles.cellTeacher}>
+            <Cell center class={styles.cellTeacher} border={false}>
               {{
                 icon: () => <Image src={item.teacherAvatar || iconTeacher} class={styles.img} />,
                 title: () => (
@@ -328,6 +272,70 @@ export default defineComponent({
                 )
               }}
             </Cell>
+            <Cell center border={false} class={[styles.cellTeacher, styles.conflictGrouop]}>
+              {{
+                title: () => (
+                  <>
+                    {item.conflictType && item.conflictType.includes('STUDENT') && (
+                      <Tag
+                        class={styles.conflict}
+                        color="#F44541"
+                        size="large"
+                        onClick={() => {
+                          state.conflictMessage = '学生时间冲突'
+                          state.conflictStatus = true
+                          state.choiceCourse = item
+                        }}
+                      >
+                        学生冲突
+                      </Tag>
+                    )}
+                    {item.conflictType && item.conflictType.includes('DIFF_SCHOOL_TEACHER') && (
+                      <Tag
+                        class={styles.conflict}
+                        color="#F44541"
+                        size="large"
+                        onClick={() => {
+                          state.conflictMessage = '该时间段伴学指导在其他学校有课'
+                          state.conflictStatus = true
+                          state.choiceCourse = item
+                        }}
+                      >
+                        学校冲突
+                      </Tag>
+                    )}
+                    {item.conflictType && item.conflictType.includes('SAME_SCHOOL_TEACHER') && (
+                      <Tag
+                        class={styles.conflict}
+                        color="#F44541"
+                        size="large"
+                        onClick={() => {
+                          state.conflictMessage = '伴学指导在本学校时间有冲突'
+                          state.conflictStatus = true
+                          state.choiceCourse = item
+                        }}
+                      >
+                        老师冲突
+                      </Tag>
+                    )}
+                    {item.conflictType && item.conflictType.includes('LEAVE') && (
+                      <Tag
+                        class={styles.conflict}
+                        color="#F44541"
+                        size="large"
+                        onClick={() => {
+                          state.conflictMessage = '伴学指导请假冲突'
+                          state.conflictStatus = true
+                          state.choiceCourse = item
+                        }}
+                      >
+                        请假冲突
+                      </Tag>
+                    )}
+                  </>
+                )
+              }}
+            </Cell>
           </CellGroup>
         ))}
 

+ 3 - 2
src/school/train-planning/component/practice/index.tsx

@@ -26,6 +26,7 @@ import OPopup from '@/components/o-popup'
 import ClassList from '../../modal/class-list'
 import request from '@/helpers/request'
 import { state } from '@/state'
+import OSticky from '@/components/o-sticky'
 
 export default defineComponent({
   name: 'practice',
@@ -206,13 +207,13 @@ export default defineComponent({
           </Cell>
         </CellGroup>
 
-        <Sticky position="bottom">
+        <OSticky position="bottom">
           <div class={'btnGroup'} style={{ marginTop: '24px' }}>
             <Button type="primary" block round size="large" onClick={onSubmit}>
               下一步
             </Button>
           </div>
-        </Sticky>
+        </OSticky>
 
         {/* 训练周次 */}
         <Popup v-model:show={forms.weekStatus} position="bottom" round>

+ 2 - 2
src/school/train-planning/component/standard/index.tsx

@@ -246,13 +246,13 @@ export default defineComponent({
           </Cell>
         </CellGroup>
 
-        <Sticky position="bottom">
+        <OSticky position="bottom">
           <div class={'btnGroup'} style={{ marginTop: '24px' }}>
             <Button type="primary" block round size="large" onClick={onSubmit}>
               下一步
             </Button>
           </div>
-        </Sticky>
+        </OSticky>
 
         <Popup v-model:show={forms.weekStatus} position="bottom" round>
           <Picker

+ 1 - 10
src/student/payment-result/index.tsx

@@ -20,7 +20,6 @@ export default defineComponent({
     const state = reactive({
       orders: {} as any,
       goodsInfos: [] as any,
-      backIconColor: 'white' as any,
       background: 'transparent'
     })
     const getDetails = async () => {
@@ -75,23 +74,15 @@ export default defineComponent({
         const { y } = useWindowScroll()
         if (y.value > 52) {
           state.background = '#fff'
-          state.backIconColor = 'black'
         } else {
           state.background = 'transparent'
-          state.backIconColor = 'white'
         }
       })
     })
     return () => (
       <div class={styles.paymentResult}>
         <div class={styles.paymentTitle}>
-          {browser().isApp && (
-            <OHeader
-              border={false}
-              background={state.background}
-              backIconColor={state.backIconColor}
-            />
-          )}
+          {browser().isApp && <OHeader border={false} background={state.background} />}
 
           {state.orders.id && (
             <>

+ 5 - 3
src/styles/index.less

@@ -123,18 +123,20 @@ body {
 }
 
 .btnGroup {
-  padding: 0 28px;
+  padding: 0 25px;
   padding-bottom: 15px;
 }
 .btnMore {
+  padding-left: 13px;
+  padding-right: 13px;
   display: flex !important;
   justify-content: center !important;
   // :global {
   .van-button {
-    width: 48% !important;
+    // width: 49% !important;
   }
   .van-button + .van-button {
-    margin-left: 6px;
+    margin-left: 15px;
   }
   // }
 }

+ 1 - 0
src/views/coursewarePlay/index.module.less

@@ -94,6 +94,7 @@
     display: block;
     width: 100%;
     height: 100%;
+    object-fit: contain;
   }
 }
 .songItem {

+ 30 - 10
src/views/coursewarePlay/index.tsx

@@ -66,7 +66,8 @@ export default defineComponent({
       detail: null,
       active: '',
       knowledgePointList: [] as any,
-      showHead: true
+      showHead: true,
+      players: [] as any
     })
     const getDetail = async () => {
       try {
@@ -90,13 +91,33 @@ export default defineComponent({
       })
     }
     const videoInit = () => {
-      console.log(document.querySelectorAll('.player'))
-      const player = Plyr.setup('.player', {
+      // console.log(document.querySelectorAll('.player'))
+      data.players = Plyr.setup('.player', {
         debug: false,
         ratio: '16:9',
+        clickToPlay: true,
         controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions']
       })
-      console.log('🚀 ~ player', player)
+      data.players.forEach((p: Plyr) => {
+        // console.log(p)
+        p.on('play', () => {
+          console.log('开始播放了')
+          data.showHead = false
+        })
+        p.on('pause', () => {
+          console.log('暂停了')
+          data.showHead = true
+        })
+        p.on('controlsshown', () => {
+          console.log('显示控件')
+          data.showHead = true
+        })
+        p.on('controlshidden', () => {
+          console.log('控件隐藏')
+          data.showHead = false
+        })
+      })
+      console.log('🚀 ~ player', data.players)
     }
     onMounted(() => {
       handleInit()
@@ -108,11 +129,14 @@ export default defineComponent({
     }
     // 所有的切换
     const handleChange = () => {
-      console.log('切换了')
+      // console.log('切换了')
       const iframes = document.querySelectorAll('.musicIframe')
       Array.from(iframes).map((f: any) => {
         f.contentWindow.postMessage({ api: 'setPlayState' }, '*')
       })
+      data.players.forEach((p: any) => {
+        p.stop()
+      })
     }
     onUnmounted(() => {
       postMessage({
@@ -144,11 +168,11 @@ export default defineComponent({
       () => popupData.active,
       () => {
         console.log(data.active, '监听切换')
+        handleChange()
         const knowledge = data.knowledgePointList.find((n: any) => n.id === data.active)
         if (knowledge && knowledge?.materialList[knowledge.index]) {
           // 如果是曲谱,隐藏头部
           if (knowledge.materialList[knowledge.index]?.type === 'SONG') {
-            console.log(2134)
             data.showHead = false
             return
           }
@@ -174,8 +198,6 @@ export default defineComponent({
                     popupData.active = `${data.active}-${
                       knowledge?.materialList?.[knowledge.index]?.id
                     }`
-                    // console.log("🚀 ~ popupData.active", popupData.active)
-                    handleChange()
                   }}
                 >
                   {{
@@ -206,8 +228,6 @@ export default defineComponent({
                   onChange={(val: any) => {
                     item.index = val
                     popupData.active = `${item.id}-${item?.materialList?.[item.index]?.id}`
-                    // console.log("🚀 ~ popupData.active", popupData.active)
-                    handleChange()
                   }}
                 >
                   {Array.isArray(item?.materialList) &&