Browse Source

Merge branch 'master' into jenkins

skyblued 2 years ago
parent
commit
f056d41931

+ 10 - 0
src/router/routes-teacher.ts

@@ -77,7 +77,17 @@ export default [
         meta: {
           title: '教学课件'
         }
+      },
+
+      {
+        path: '/unit-list',
+        name: 'unit-list',
+        component: () => import('@/views/unit-test/unit-list/index'),
+        meta: {
+          title: '单元测验'
+        }
       }
+      //unit-list
     ]
   },
   ...rootRouter,

+ 3 - 0
src/school/approval-manage/components/studnet-course-item.module.less

@@ -75,6 +75,9 @@
       color: #777777;
       line-height: 20px;
     }
+    .itemWrapBottomRight {
+      flex: 1;
+    }
     .rejectBtn {
       font-size: 14px;
       font-family: PingFangSC-Medium, PingFang SC;

+ 1 - 1
src/school/attendance/components/attend-teacher.tsx

@@ -174,7 +174,7 @@ export default defineComponent({
             <div class={styles.chioseWrap}>
               <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
                 <div
-                  class={styles.searchBand}
+                  class={[styles.searchBand, styles.orchestraBand]}
                   onClick={() => {
                     state.showPopoverTime = true
                   }}

+ 12 - 0
src/school/attendance/components/attent-student.module.less

@@ -6,4 +6,16 @@
   background-color: #f8f8f8;
   color: #333;
   font-weight: 500;
+  font-size: 14px;
+  .orchestraBand {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    p {
+      max-width: 120px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+    }
+  }
 }

+ 12 - 0
src/views/accompany/index.module.less

@@ -47,7 +47,19 @@
         top: 0;
         width: 100%;
         z-index: 10;
+        :global{
+          .van-dropdown-menu__bar{
+            box-shadow: none;
+          }
+          .van-dropdown-menu__title:after{
+            border: 0.11rem solid;
+            border-color: transparent transparent var(--van-gray-4) var(--van-gray-4);
+          }
+        }
     }
+    // .cell{
+    //   padding: 16px 10px;
+    // }
     .filter{
         display: flex;
         align-items: center;

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

@@ -123,7 +123,6 @@ export default defineComponent({
     }
     // 重置搜索
     const onSearch = () => {
-      console.log(234)
       data.pagenation.page = 1
       data.finished = false
       data.loading = false
@@ -246,7 +245,7 @@ export default defineComponent({
             <CellGroup inset>
               {data.list.map((item: any) => {
                 return (
-                  <Cell center title={item.musicSheetName} isLink onClick={() => openView(item)}>
+                  <Cell size="large" center title={item.musicSheetName} isLink onClick={() => openView(item)}>
                     {{
                       icon: () => (
                         <Icon style={{ marginRight: '12px' }} size={40} name={imgDefault} />

+ 5 - 1
src/views/courseList/index.module.less

@@ -30,8 +30,12 @@
     }
     .title {
       text-align: center;
-      padding: 10px;
+      padding: 14px;
       color: #742c00;
+      font-size: 16px;
+    }
+    .subtitle{
+      font-size: 12px;
     }
     .num {
       position: absolute;

+ 1 - 1
src/views/courseList/index.tsx

@@ -173,7 +173,7 @@ export default defineComponent({
                   <img src={iconCourse} class={styles.cover} />
                   <div class={styles.title}>
                     <div>{item.coursewareDetailName}</div>
-                    {route.query.code !== 'select' && <div>已使用 {item.useNum} 次</div>}
+                    {route.query.code !== 'select' && <div class={styles.subtitle}>已使用 {item.useNum} 次</div>}
                   </div>
                   {route.query.code !== 'select' ? (
                     <>

+ 3 - 1
src/views/coursewarePlay/component/point.module.less

@@ -12,6 +12,7 @@
   align-items: center;
   padding: 13px 10px 15px 15px;
   flex-shrink: 0;
+  font-size: 14px;
   img {
     width: 16px;
     height: 16px;
@@ -30,7 +31,7 @@
   :global {
     .van-cell {
       background: transparent;
-      font-size: 12px;
+      font-size: 14px;
       color: #fff;
       padding: 0 13px 6px 18px;
     }
@@ -63,6 +64,7 @@
   justify-content: space-between;
   padding: 4px 5px;
   border-radius: 6px;
+  font-size: 12px;
   :global {
     .van-icon {
       display: none;

+ 22 - 12
src/views/coursewarePlay/index.module.less

@@ -18,13 +18,11 @@
   left: 0;
   right: 0;
   z-index: 1;
-  padding: 10px;
   display: flex;
   align-items: center;
   background: linear-gradient(180deg, rgba(0, 0, 0, .6), transparent);
 }
 .backBtn {
-  position: absolute;
   color: #fff;
   width: 40px;
   height: 26px;
@@ -32,11 +30,15 @@
   justify-content: space-between;
   align-items: center;
   z-index: 10;
+  padding: 4px 10px 4px 20px;
 }
 .menu {
-  flex: 1;
+  position: absolute;
+  width: 100%;
+  height: 100%;
   display: flex;
   justify-content: center;
+  align-items: center;
   font-size: 12px;
   color: #fff;
 }
@@ -90,7 +92,7 @@
   position: fixed;
   top: 50%;
   transform: translateY(-50%);
-  left: 20px;
+  left: 26px;
   .prePoint {
     margin-bottom: 8px;
   }
@@ -121,23 +123,31 @@
     justify-content: space-between;
     color: #fff;
     font-size: 10px;
-    padding: 4px 10px;
+    padding: 4px 20px;
   }
   .slider {
-    padding: 8px 10px;
+    padding: 8px 20px;
+    :global{
+      .van-slider__button{
+        background: var(--van-primary);
+      }
+    }
   }
   .actions {
     display: flex;
     justify-content: space-between;
     color: #fff;
     font-size: 12px;
-    padding: 8px 10px;
+    padding: 0 10px 0 20px;
     align-items: center;
-    :global {
-      .van-icon {
-        font-size: 20px;
-        margin-right: 14px;
-      }
+    .actionBtn{
+      display: flex;
+    }
+    .actionBtn > img {
+      width: 26px;
+      height: 26px;
+      display: block;
+      padding: 4px 10px 14px 4px;
     }
   }
 }

+ 36 - 33
src/views/coursewarePlay/index.tsx

@@ -163,7 +163,9 @@ export default defineComponent({
               timer: null,
               playModel: false,
               isprepare: false,
-              isDrage: false
+              isDrage: false,
+              muted: i === 0 && j === 0 ? true : false,
+              isAutoNext: false // 是否自动播放到当前页面
             }
           }
           list.push({
@@ -216,7 +218,8 @@ export default defineComponent({
     const iframeHandle = (ev: MessageEvent) => {
       // console.log(ev.data)
       if (ev.data?.api === 'headerTogge') {
-        activeData.model = ev.data.show
+        // activeData.model = ev.data.show
+        activeData.model = !activeData.model
       }
     }
     onMounted(() => {
@@ -268,6 +271,7 @@ export default defineComponent({
     }
     // 轮播切换
     const handleSwipeChange = (val: any) => {
+      console.log('轮播切换')
       popupData.activeIndex = val
       const item = data.itemList[val]
       if (item) {
@@ -275,9 +279,14 @@ export default defineComponent({
         popupData.itemActive = item.id
         popupData.itemName = item.name
         popupData.tabName = item.tabName
-        activeData.model = true
-        if (item.type === 'VIDEO') {
-          item.playModel = true
+        if (item.isAutoNext) {
+          item.isAutoNext = false
+          item.playModel = false
+        } else {
+          activeData.model = true
+          if (item.type === 'VIDEO') {
+            item.playModel = true
+          }
         }
       }
     }
@@ -309,7 +318,6 @@ export default defineComponent({
       if (item && item.type === 'VIDEO') {
         const videoEle: HTMLVideoElement = item.videoEle
         if (videoEle) {
-          console.log(videoEle)
           if (videoEle.paused) {
             closeToast()
             videoEle.play()
@@ -318,16 +326,12 @@ export default defineComponent({
             videoEle.pause()
           }
         }
-        item.timer = setTimeout(() => {
-          activeData.model = false
-        }, 3000)
       }
     }
 
     // 暂停播放
     const handlePaused = (e: Event, m: any) => {
       e.stopPropagation()
-      console.log('暂停')
       m.videoEle?.pause()
       m.paused = true
     }
@@ -337,10 +341,6 @@ export default defineComponent({
       clearTimeout(m.timer)
       closeToast()
       m.videoEle?.play()
-      m.paused = false
-      m.timer = setTimeout(() => {
-        activeData.model = false
-      }, 3000)
     }
 
     // 调整播放进度
@@ -359,15 +359,16 @@ export default defineComponent({
         popupData.activeIndex++
         swipeRef.value?.next()
         const nextItem = data.itemList[popupData.activeIndex]
-        if (nextItem.type === 'VIDEO'){
+        if (nextItem.type === 'VIDEO') {
+          nextItem.isAutoNext = true
           nextTick(() => {
-            // 自动播放下一个知识点
-            // if (m.autoPlay) {
-            // }
+            // 自动播放下一个视频
+            clearTimeout(m.timer)
+            closeToast()
             nextItem.videoEle?.play()
           })
         }
-        
+
         console.log('🚀 ~ nextItem', nextItem)
       }
     }
@@ -425,15 +426,15 @@ export default defineComponent({
                       <>
                         <video
                           playsinline="false"
+                          webkit-playsinline
+                          muted={m.muted}
                           preload="auto"
                           class="player"
                           poster={iconVideobg}
                           data-vid={m.id}
                           src={m.content}
                           loop={m.loop}
-                          // onLoadeddata={(e: Event) =>
-                          //   handleFirstFrame(e.target as unknown as HTMLVideoElement)
-                          // }
+                          autoplay={mIndex === 0 ? true : false}
                           onLoadedmetadata={(e: Event) => {
                             const videoEle = e.target as unknown as HTMLVideoElement
                             m.currentTime = videoEle.currentTime
@@ -455,6 +456,11 @@ export default defineComponent({
                           onPlay={() => {
                             // 播放
                             m.paused = false
+                            console.log('播放')
+                            m.timer = setTimeout(() => {
+                              activeData.model = false
+                            }, 3000)
+                            m.muted = false
                           }}
                           onPause={() => {
                             //暂停
@@ -504,29 +510,26 @@ export default defineComponent({
                               </div>
 
                               <div class={styles.actions}>
-                                <div>
+                                <div class={styles.actionBtn}>
                                   {m.paused ? (
-                                    <Icon
-                                      name={iconplay}
-                                      onClick={(e: Event) => handlePlay(e, m)}
-                                    />
+                                    <img src={iconplay} onClick={(e: Event) => handlePlay(e, m)} />
                                   ) : (
-                                    <Icon
-                                      name={iconpause}
+                                    <img
+                                      src={iconpause}
                                       onClick={(e: Event) => handlePaused(e, m)}
                                     />
                                   )}
                                   {m.loop ? (
-                                    <Icon
-                                      name={iconLoopActive}
+                                    <img
+                                      src={iconLoopActive}
                                       onClick={(e: Event) => {
                                         e.stopPropagation()
                                         m.loop = false
                                       }}
                                     />
                                   ) : (
-                                    <Icon
-                                      name={iconLoop}
+                                    <img
+                                      src={iconLoop}
                                       onClick={(e: Event) => {
                                         e.stopPropagation()
                                         m.loop = true

+ 1 - 0
src/views/exercise-record/exercis-detail.module.less

@@ -99,6 +99,7 @@
     font-weight: 500;
     color: #333333;
     line-height: 20px;
+    font-size: 14px;
   }
 }
 

+ 2 - 1
src/views/exercise-record/index.module.less

@@ -4,8 +4,9 @@
   align-items: center;
   justify-content: space-around;
   background-color: #f8f8f8;
+  font-size: 14px;
   .searchBandWrap {
-    max-width: 23%;
+    max-width: 24%;
   }
   .searchBand {
     display: flex;

+ 2 - 1
src/views/lessonCourseware/index.module.less

@@ -31,8 +31,9 @@
     .title {
       position: relative;
       text-align: center;
-      padding: 10px;
+      padding: 14px;
       color:#742C00;
+      font-size: 14px;
     }
     .num {
       position: absolute;

+ 71 - 0
src/views/unit-test/unit-list/index.module.less

@@ -0,0 +1,71 @@
+.unitTest {
+  .searchBand {
+    display: inline-block;
+    font-size: 14px;
+    font-weight: 500;
+    color: #333333;
+  }
+
+  .cellGroup {
+    margin-bottom: 12px;
+    :global {
+      .van-cell {
+        padding: 12px;
+        font-size: 16px;
+        font-weight: 500;
+      }
+    }
+
+    .img {
+      width: 18px;
+      height: 18px;
+      margin-right: 6px;
+    }
+    .unitTitle {
+      color: #333333;
+      max-width: 150px;
+      line-height: 22px;
+    }
+
+    .no-start {
+      color: #f44541;
+    }
+    .pass {
+      color: #4ab78e;
+    }
+  }
+
+  .unitSection {
+    padding-top: 15px !important;
+    padding-bottom: 20px !important;
+    .name {
+      font-size: 15px;
+      font-weight: 500;
+      color: #333333;
+      padding-bottom: 6px;
+    }
+    .endTime {
+      font-size: 13px;
+      color: #777777;
+    }
+  }
+
+  .unitBtnGroup {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding-top: 16px;
+    :global {
+      .van-button {
+        line-height: 40px;
+        height: 40px;
+        & + .van-button {
+          margin-left: 13px;
+        }
+      }
+    }
+  }
+  .liveList {
+    padding: 12px 13px 0;
+  }
+}

+ 161 - 0
src/views/unit-test/unit-list/index.tsx

@@ -0,0 +1,161 @@
+import OEmpty from '@/components/o-empty'
+import OHeader from '@/components/o-header'
+import OSearch from '@/components/o-search'
+import OSticky from '@/components/o-sticky'
+import { ActionSheet, Button, Cell, CellGroup, Icon, Image, List, showToast } from 'vant'
+import { defineComponent, onMounted, reactive, ref } from 'vue'
+import styles from './index.module.less'
+import iconEdit from '../images/icon-edit.png'
+import { useRouter } from 'vue-router'
+import UnitListItem from './models/unit-list-item'
+import OFullRefresh from '@/components/o-full-refresh'
+import request from '@/helpers/request'
+export default defineComponent({
+  name: 'unit-list',
+  setup() {
+    const router = useRouter()
+    const form = reactive({
+      oPopover: false,
+      list: [] as any,
+      listState: {
+        dataShow: true, // 判断是否有数据
+        loading: false,
+        finished: false
+      },
+      statusText: '班级类型',
+      params: {
+        keyword: null,
+        status: null,
+        page: 1,
+        rows: 20
+      },
+      isClick: false
+    })
+    const refreshing = ref(false)
+    const loading = ref(false)
+    const getList = async () => {
+      loading.value = true
+      try {
+        if (refreshing.value) {
+          form.params.page = 1
+          form.list = []
+          refreshing.value = false
+        }
+
+        const res = await request.post('/api-teacher/studentUnitExamination/queryPageByTeacher', {
+          data: { ...form.params }
+        })
+
+        if (form.list.length > 0 && res.data.pages === 1) {
+          return
+        }
+
+        form.params.page = res.data.current + 1
+        //form.list  =form.list .concat(res.data.rows || [])
+        form.list = res.data.rows
+        form.listState.dataShow = form.list.length > 0
+        console.log(
+          '🚀 ~ file: index.tsx:57 ~ getList ~  form.listState.dataShow',
+          form.listState.dataShow
+        )
+        loading.value = false
+        form.listState.finished = true
+
+        // finished.value = res.data.current >= res.data.pages
+      } catch (e: any) {
+        // console.log(e, 'e')
+        const message = e.message
+        showToast(message)
+        form.listState.dataShow = false
+        form.listState.finished = true
+      }
+    }
+    const onRefresh = () => {
+      form.listState.finished = true
+      // 重新加载数据
+      // 将 loading 设置为 true,表示处于加载状态
+      loading.value = true
+      getList()
+    }
+    const onSearch = () => {
+      form.params.page = 1
+      form.list = []
+      form.listState.dataShow = true // 判断是否有数据
+      form.listState.loading = false
+      form.listState.finished = false
+      getList()
+    }
+    onMounted(() => {
+      getList()
+    })
+    return () => (
+      <div class={styles.unitTest}>
+        <OSticky position="top">
+          <OHeader></OHeader>
+          <OSearch
+            placeholder="请输入测验名称"
+            inputBackground="white"
+            background="#f6f8f9"
+            onSearch={(val: any) => {
+              form.params.keyword = val
+              onSearch()
+            }}
+            v-slots={{
+              left: () => (
+                <div
+                  class={styles.searchBand}
+                  style={{ marginRight: '13px' }}
+                  onClick={() => (form.oPopover = true)}
+                >
+                  {form.statusText} <Icon name={form.oPopover ? 'arrow-up' : 'arrow-down'} />
+                </div>
+              )
+            }}
+          />
+        </OSticky>
+
+        {form.listState.dataShow ? (
+          <OFullRefresh
+            v-model:modelValue={refreshing.value}
+            onRefresh={onRefresh}
+            style="min-height: 100vh;"
+          >
+            <List
+              v-model:loading={form.listState.loading}
+              finished={form.listState.finished}
+              finishedText=" "
+              class={[styles.liveList]}
+              onLoad={getList}
+              immediateCheck={false}
+            >
+              {form.list.map((item: any) => (
+                <UnitListItem item={item}></UnitListItem>
+              ))}
+            </List>
+          </OFullRefresh>
+        ) : (
+          <OEmpty tips="暂无单元测验" />
+        )}
+
+        <ActionSheet
+          v-model:show={form.oPopover}
+          cancelText="取消"
+          actions={
+            [
+              { name: '班级类型', id: 'ALL' },
+              { name: '单技班', id: 'SINGLE' },
+              { name: '乐理班', id: 'MUSIC_THEORY' },
+              { name: '合奏班', id: 'INSTRUMENTAL_ENSEMBLE' }
+            ] as any
+          }
+          onSelect={(val: any) => {
+            form.statusText = val.name
+            form.params.status = val.id === 'ALL' ? null : val.id
+            form.oPopover = false
+            onSearch()
+          }}
+        />
+      </div>
+    )
+  }
+})

+ 101 - 0
src/views/unit-test/unit-list/models/unit-list-item.module.less

@@ -0,0 +1,101 @@
+.unitItem {
+  background-color: #fff;
+  padding-top: 12px;
+  margin-bottom: 14px;
+  border-radius: 10px;
+  .unitItemTop {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 12px;
+    .unitItemLeft {
+      p {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        font-size: 16px;
+        font-family: PingFangSC-Medium, PingFang SC;
+        font-weight: 500;
+        color: #333333;
+        line-height: 22px;
+        margin-bottom: 3px;
+        .editImg {
+          width: 18px;
+          height: 18px;
+          margin-right: 6px;
+        }
+      }
+      span {
+        font-size: 13px;
+        font-weight: 400;
+        color: #777777;
+        line-height: 18px;
+      }
+    }
+    .unitItemICon {
+      .msgImg {
+        width: 20px;
+        height: 20px;
+      }
+    }
+  }
+  .unitItemInfo {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-around;
+    padding: 15px 0;
+    .unitItemInfoMain {
+      font-size: 26px;
+      font-family: 'DINA';
+      font-weight: bold;
+      color: #333333;
+      line-height: 30px;
+      text-align: center;
+    }
+    .unitItemInfosub {
+      font-size: 14px;
+      font-weight: 400;
+      color: #333333;
+      line-height: 20px;
+      text-align: center;
+    }
+    .orange {
+      color: #f67146;
+    }
+    .unitItemInfoWrap {
+      width: 50%;
+    }
+    .unitItemInfoWrapLine {
+      position: relative;
+
+      &:after {
+        content: ' ';
+        position: absolute;
+        top: 50%;
+        right: 0;
+        margin-top: -10px;
+        width: 1px;
+        height: 20px;
+        background: #eaeaea;
+        border-radius: 1px;
+      }
+    }
+  }
+  .unitItemOrchestra {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    border-top: 1px solid #f2f2f2;
+    padding: 12px;
+    font-size: 14px;
+    font-weight: 400;
+    color: #333333;
+    .arrow {
+      color: #f2f2f2;
+      font-size: 12px;
+    }
+  }
+}

+ 53 - 0
src/views/unit-test/unit-list/models/unit-list-item.tsx

@@ -0,0 +1,53 @@
+import { ActionSheet, Button, Cell, CellGroup, Icon, Image, List } from 'vant'
+import { defineComponent, reactive } from 'vue'
+import styles from './unit-list-item.module.less'
+import iconEdit from '../../images/icon-edit.png'
+import iconMessage from '@common/images/icon-muit-message.png'
+import { useRouter } from 'vue-router'
+import dayjs from 'dayjs'
+export default defineComponent({
+  name: 'unit-list-item',
+  props: {
+    item: {
+      type: Object,
+      default: () => {}
+    }
+  },
+  setup(props) {
+    const router = useRouter()
+    return () => (
+      <div class={styles.unitItem}>
+        <div class={styles.unitItemTop}>
+          <div class={styles.unitItemLeft}>
+            <p>
+              {' '}
+              <Image src={iconEdit} class={styles.editImg} />
+              {props.item.classGroupName}
+            </p>
+            <span>
+              布置时间 {dayjs(props.item.createTime).format('YYYY-MM-DD HH:mm')} -
+              {dayjs(props.item.expiryDate).format('HH:mm')}
+            </span>
+          </div>
+          <div class={styles.unitItemICon} onClick={}>
+            <Image src={iconMessage} class={styles.msgImg}></Image>
+          </div>
+        </div>
+        <div class={[styles.unitItemInfo]}>
+          <div class={[styles.unitItemInfoWrap, styles.unitItemInfoWrapLine]}>
+            <p class={styles.unitItemInfoMain}>{props.item.commitNum || 0}</p>
+            <p class={styles.unitItemInfosub}>提交人数</p>
+          </div>
+          <div class={[styles.unitItemInfoWrap]}>
+            <p class={[styles.unitItemInfoMain, styles.orange]}>{props.item.passNum || 0}</p>
+            <p class={styles.unitItemInfosub}>达标人数</p>
+          </div>
+        </div>
+        <div class={styles.unitItemOrchestra}>
+          <p>{props.item.orchestraName || '--'}</p>
+          <Icon class={styles.arrow} name="arrow"></Icon>
+        </div>
+      </div>
+    )
+  }
+})