Parcourir la source

Merge branch 'liu-v1.3'

skyblued il y a 3 ans
Parent
commit
01e14c8d4d
41 fichiers modifiés avec 666 ajouts et 172 suppressions
  1. 1 0
      dist/assets/index-legacy.6c44262b.js
  2. 1 1
      dist/assets/index-legacy.73950ada.js
  3. 0 0
      dist/assets/index-legacy.746a129b.js
  4. 1 0
      dist/assets/index-legacy.78a7d9c9.js
  5. 0 0
      dist/assets/index-legacy.b253ff30.js
  6. 0 0
      dist/assets/index-legacy.e43910b7.js
  7. 1 0
      dist/assets/index.1f7a71d8.js
  8. 1 0
      dist/assets/index.2c81c3ca.js
  9. 1 0
      dist/assets/index.40d0084b.js
  10. 1 0
      dist/assets/index.b404ac15.js
  11. 1 0
      dist/assets/index.b7ee2c0c.js
  12. 1 0
      dist/assets/index.d66810a4.js
  13. 0 0
      dist/assets/teacher-legacy.043bb283.js
  14. 0 0
      dist/assets/teacher-legacy.e30565a6.js
  15. 10 0
      dist/index.html
  16. 10 0
      dist/teacher.html
  17. 33 9
      src/business-components/calendar/index.tsx
  18. 2 2
      src/student/invite-teacher/teacher-change/index.tsx
  19. 1 1
      src/student/share-active/track-review-activity/index.tsx
  20. 2 1
      src/teacher/income-consus/index.tsx
  21. 68 40
      src/teacher/live-class/create-components/arrange.tsx
  22. 3 1
      src/teacher/live-class/create-components/course-plan.tsx
  23. 29 18
      src/teacher/live-class/create-components/course-start.tsx
  24. 8 1
      src/teacher/live-class/create-components/course.tsx
  25. 2 0
      src/teacher/live-class/create-components/createState.ts
  26. 34 3
      src/teacher/live-class/create-components/detail.tsx
  27. 27 0
      src/teacher/live-class/create.tsx
  28. 31 18
      src/teacher/music/upload/index.tsx
  29. 1 1
      src/teacher/share-page/track-review-activity/index.tsx
  30. 1 1
      src/views/live-class/index.tsx
  31. 14 0
      src/views/music/album/index.module.less
  32. 47 2
      src/views/music/album/index.tsx
  33. 14 0
      src/views/music/list/index.module.less
  34. 48 2
      src/views/music/list/index.tsx
  35. 1 1
      src/views/music/list/item.tsx
  36. 46 18
      src/views/music/search/header.tsx
  37. 14 0
      src/views/music/search/index.module.less
  38. 13 51
      src/views/music/search/index.tsx
  39. 79 0
      src/views/music/search/select-subject.module.less
  40. 118 0
      src/views/music/search/select-subject.tsx
  41. 1 1
      src/views/video-class/index.tsx

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index-legacy.6c44262b.js


+ 1 - 1
dist/assets/index-legacy.73950ada.js

@@ -2,7 +2,7 @@
 activeInfo:{},popupStatus:false,wxStatus:false,behaviorId:getRandomKey(),selectMusic:{},hiddenProperty:null};},computed:{activityMusic:function activityMusic(){var activeInfo=this.activeInfo;return activeInfo.activityMusicVoList||[];},// 用户是否有中选的曲子
 userSelectMusic:function userSelectMusic(){var status=false;this.activityMusic.forEach(function(item){if(item.join===1){status=true;}});return status;}},mounted:function mounted(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var visibilityChangeEvent;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return _this.getMusicInfo();case 2:if(browser().isApp){_context.next=8;break;}_this.popupStatus=true;removeAuth();return _context.abrupt("return");case 8:if(!(state.platformType==='TEACHER')){_context.next=13;break;}_this.onBackDialog('请使用酷乐秀学生端扫码打开');return _context.abrupt("return");case 13:_this.hiddenProperty='hidden'in document?'hidden':'webkitHidden'in document?'webkitHidden':'mozHidden'in document?'mozHidden':null;visibilityChangeEvent=_this.hiddenProperty.replace(/hidden/i,'visibilitychange');document.addEventListener(visibilityChangeEvent,_this.onVisibilityChange);case 16:// 判断活动状态的活动时间
 _this.checkActivityTime();case 17:case"end":return _context.stop();}}},_callee);}))();},methods:{onVisibilityChange:function onVisibilityChange(){if(!document[this.hiddenProperty]){this.getMusicInfo();}},getMusicInfo:function getMusicInfo(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var res;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return request.post('/api-student/open/activity/info/'+_this2.id);case 3:res=_context2.sent;_this2.activeInfo=res.data;document.title=_this2.activeInfo.activityName;_context2.next=10;break;case 8:_context2.prev=8;_context2.t0=_context2["catch"](0);case 10:case"end":return _context2.stop();}}},_callee2,null,[[0,8]]);}))();},checkActivityTime:function checkActivityTime(){// 判断活动状态的活动时间
-try{var activeInfo=this.activeInfo;if(activeInfo.activityState===0){Dialog.alert({message:'活动已结束,感谢你的关注!',theme:'round-button',confirmButtonColor:'#2dc7aa'});this.onBackDialog('活动已结束,感谢你的关注!');return false;}var nowTime=dayjs();var startTime=dayjs(activeInfo.activityStart);var endTime=dayjs(activeInfo.activityEnd);if(dayjs(nowTime).isBefore(dayjs(startTime))){this.onBackDialog('活动尚未开始,请您耐心等待!');return false;}else if(!dayjs(nowTime).isBefore(dayjs(endTime))){this.onBackDialog('活动已结束,感谢你的关注!');return false;}return true;}catch(_unused2){//
+try{var activeInfo=this.activeInfo;if(activeInfo.activityState!==1){Dialog.alert({message:'活动已结束,感谢你的关注!',theme:'round-button',confirmButtonColor:'#2dc7aa'});this.onBackDialog('活动已结束,感谢你的关注!');return false;}var nowTime=dayjs();var startTime=dayjs(activeInfo.activityStart);var endTime=dayjs(activeInfo.activityEnd);if(dayjs(nowTime).isBefore(dayjs(startTime))){this.onBackDialog('活动尚未开始,请您耐心等待!');return false;}else if(!dayjs(nowTime).isBefore(dayjs(endTime))){this.onBackDialog('活动已结束,感谢你的关注!');return false;}return true;}catch(_unused2){//
 }},onBackDialog:function onBackDialog(str){Dialog.alert({message:str,theme:'round-button',confirmButtonColor:'#2dc7aa'}).then(function(){postMessage({api:'back'});});},onJoinActve:function onJoinActve(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){var activeInfo,_res$data,res;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:activeInfo=_this3.activeInfo;_context3.prev=1;if(_this3.checkActivityTime()){_context3.next=4;break;}return _context3.abrupt("return");case 4:if(!(activeInfo.registrationMethod==='CHARGE')){_context3.next=18;break;}_context3.next=7;return request.post('/api-student/userOrder/getPendingOrder',{data:{goodType:'ACTI_REGIST',bizId:activeInfo.id}});case 7:res=_context3.sent;// 判断是否是收费活动
 orderStatus.orderObject.orderType='ACTI_REGIST';orderStatus.orderObject.orderName=activeInfo.activityName;orderStatus.orderObject.orderDesc=activeInfo.activityName;orderStatus.orderObject.actualPrice=activeInfo.registrationPrice;orderStatus.orderObject.orderNo=((_res$data=res.data)===null||_res$data===void 0?void 0:_res$data.orderNo)||'';orderStatus.orderObject.recomUserId=_this3.recomUserId;orderStatus.orderObject.orderList=[{orderType:'ACTI_REGIST',goodsName:activeInfo.activityName,activityId:activeInfo.id,actualPrice:activeInfo.registrationPrice,recomUserId:_this3.recomUserId}];_this3.$router.push({path:'/orderDetail',query:{orderType:'ACTI_REGIST',activityId:activeInfo.id}});_context3.next=22;break;case 18:_context3.next=20;return request.post("/api-student/activity/joinActivity/".concat(activeInfo.id));case 20:// 成功通知
 Notify({type:'success',message:'报名成功'});_this3.getMusicInfo();case 22:_context3.next=26;break;case 24:_context3.prev=24;_context3.t0=_context3["catch"](1);case 26:case"end":return _context3.stop();}}},_callee3,null,[[1,24]]);}))();},onOpenMusic:function onOpenMusic(){var _this4=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee4(){var selectMusic,browserInfo,url;return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:_context4.prev=0;selectMusic=_this4.selectMusic;if(!(selectMusic.join!==1)){_context4.next=6;break;}_context4.next=5;return request.post("/api-student/activity/evaluation/".concat(selectMusic.evaluationId));case 5:_this4.selectMusic.join=1;case 6:_this4.popupStatus=false;browserInfo=browser();url=qs.stringifyUrl({url:location.origin+'/accompany',query:{id:selectMusic.musicSheetId,behaviorId:_this4.behaviorId,client:browserInfo.isTeacher?'teacher':'student',setting:JSON.stringify({mode:'EVALUATING',resets:['SPEED'],difficulty:_this4.activeInfo.evaluationDifficulty,feeType:'FREE',submitData:{evaluationId:_this4.selectMusic.evaluationId}})}});postMessage({api:'openAccompanyWebView',content:{url:url,orientation:0,isHideTitle:true,statusBarTextColor:false,isOpenLight:true}});_context4.next=14;break;case 12:_context4.prev=12;_context4.t0=_context4["catch"](0);case 14:case"end":return _context4.stop();}}},_callee4,null,[[0,12]]);}))();},onOpenApp:function onOpenApp(){//

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/assets/index-legacy.746a129b.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index-legacy.78a7d9c9.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/assets/index-legacy.b253ff30.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/assets/index-legacy.e43910b7.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.1f7a71d8.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.2c81c3ca.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.40d0084b.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.b404ac15.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.b7ee2c0c.js


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
dist/assets/index.d66810a4.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/assets/teacher-legacy.043bb283.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
dist/assets/teacher-legacy.e30565a6.js


+ 10 - 0
dist/index.html

@@ -35,9 +35,15 @@
     <meta name="msapplication-tap-highlight" content="no" />
     <title>酷乐秀</title>
     <script src="./flexible.js" charset="UTF-8"></script>
+<<<<<<< HEAD
     <script type="module" crossorigin src="./assets/index.1f7a71d8.js"></script>
     <link rel="modulepreload" href="./assets/vendor.d0a55a8b.js">
     <link rel="modulepreload" href="./assets/index.d9876936.js">
+=======
+    <script type="module" crossorigin src="./assets/index.40d0084b.js"></script>
+    <link rel="modulepreload" href="./assets/vendor.d0a55a8b.js">
+    <link rel="modulepreload" href="./assets/index.831b5104.js">
+>>>>>>> liu-v1.3
     <link rel="stylesheet" href="./assets/index.cb2212cc.css">
     <link rel="stylesheet" href="./assets/vendor.68261ebd.css">
     <link rel="stylesheet" href="./assets/index.5062a520.css">
@@ -50,6 +56,10 @@
     <!-- <script type="module" src="/src/teacher/main.ts"></script> -->
     <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
     <script nomodule id="vite-legacy-polyfill" src="./assets/polyfills-legacy.5924a30f.js"></script>
+<<<<<<< HEAD
     <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.e43910b7.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+=======
+    <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.b253ff30.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+>>>>>>> liu-v1.3
   </body>
 </html>

+ 10 - 0
dist/teacher.html

@@ -35,9 +35,15 @@
     <meta name="msapplication-tap-highlight" content="no" />
     <title>酷乐秀</title>
     <script src="./flexible.js" charset="UTF-8"></script>
+<<<<<<< HEAD
     <script type="module" crossorigin src="./assets/teacher.0799404f.js"></script>
     <link rel="modulepreload" href="./assets/vendor.d0a55a8b.js">
     <link rel="modulepreload" href="./assets/index.d9876936.js">
+=======
+    <script type="module" crossorigin src="./assets/teacher.641ebfbf.js"></script>
+    <link rel="modulepreload" href="./assets/vendor.d0a55a8b.js">
+    <link rel="modulepreload" href="./assets/index.831b5104.js">
+>>>>>>> liu-v1.3
     <link rel="stylesheet" href="./assets/vendor.68261ebd.css">
     <link rel="stylesheet" href="./assets/index.cb2212cc.css">
     <link rel="stylesheet" href="./assets/index.5062a520.css">
@@ -49,6 +55,10 @@
     
     <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
     <script nomodule id="vite-legacy-polyfill" src="./assets/polyfills-legacy.5924a30f.js"></script>
+<<<<<<< HEAD
     <script nomodule id="vite-legacy-entry" data-src="./assets/teacher-legacy.e30565a6.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+=======
+    <script nomodule id="vite-legacy-entry" data-src="./assets/teacher-legacy.043bb283.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+>>>>>>> liu-v1.3
   </body>
 </html>

+ 33 - 9
src/business-components/calendar/index.tsx

@@ -1,9 +1,11 @@
-import { Button, Calendar, Icon, Image, Popup, Tag, Toast } from 'vant'
+import { Button, Calendar, Dialog, Icon, Image, Popup, Tag, Toast } from 'vant'
 import { defineComponent } from 'vue'
 import dayjs from 'dayjs'
 import styles from './index.module.less'
 import IconArrow from '@/common/images/icon_arrow.png'
 import IconClock from '@/common/images/icon_clock.png'
+import isToday from 'dayjs/plugin/isToday'
+dayjs.extend(isToday)
 
 export default defineComponent({
   name: 'calendar',
@@ -109,13 +111,14 @@ export default defineComponent({
     formatter(date: any) {
       const dateStr = dayjs(date.date).format('YYYY-MM-DD')
       const dateObj = this.list[dateStr]
+      date.type = ''
       // 判断是否有课程 并且 时间在当前时间之后
-      if (dateObj && dayjs().isBefore(dayjs(date.date))) {
+      if (dateObj && dayjs().subtract(1, 'day').isBefore(dayjs(date.date))) {
+        // fullCourse当天是否排满 0: 未,1:满 , courseTime 当天没有课程
         if (
-          dateObj &&
-          (dateObj.fullCourse ||
-            !dateObj?.courseTime ||
-            dateObj?.courseTime?.length <= 0)
+          dateObj.fullCourse ||
+          !dateObj?.courseTime ||
+          dateObj?.courseTime?.length <= 0
         ) {
           date.bottomInfo = '满'
           date.className = 'full'
@@ -124,12 +127,14 @@ export default defineComponent({
       } else {
         date.type = 'disabled'
       }
+      // 是否是节假日
       if (dateObj && this.isSkipHolidays && dateObj.holiday) {
         // date.bottomInfo = '节假日'
         date.type = 'disabled'
       }
 
-      date.type = date.type === 'selected' ? '' : date.type
+      // date.type = date.type === 'selected' ? 'selected' : date.type
+      // console.log(date.type)
       return date
     },
     onPrevMonth() {
@@ -188,15 +193,34 @@ export default defineComponent({
       const tempDate = dayjs(this.currentDate).add(1, 'day')
       this._dayChange(tempDate.toDate())
     },
-    onDateSelect(date: any) {
+    async onDateSelect(date: any) {
+      if (this.$route.name == 'liveCreate' && dayjs(date).isToday()) {
+        let comfirm = '' as any
+        try {
+          comfirm = await Dialog.alert({
+            title: '提示',
+            message:
+              '直播课选择当天, 售卖时间为: 现在到开课时间, 确定选择今天吗?',
+            theme: 'round-button',
+            showCancelButton: true
+          })
+        } catch (err) {}
+        if (!comfirm) return 
+      }
       // 选择日历上某一个日期
+      // console.log([...this.selectList])
       this.selectDays = [...this.selectList] // 初始化用户选中的值
       this._dayChange(date)
       this.onSelect && this.onSelect(date)
     },
     _dayChange(date: Date) {
       const dateStr = dayjs(date).format('YYYY-MM-DD')
-      let dataList = (this.list[dateStr] && this.list[dateStr].courseTime) || []
+      let dataList = [] as any
+      if (this.list[dateStr] && Array.isArray(this.list[dateStr].courseTime)) {
+        dataList = [...this.list[dateStr].courseTime].filter(n =>
+          dayjs().isBefore(dayjs(n.startTime))
+        )
+      }
       dataList.forEach((item: any) => {
         item.start = dayjs(item.startTime).format('HH:mm')
         item.end = dayjs(item.endTime).format('HH:mm')

+ 2 - 2
src/student/invite-teacher/teacher-change/index.tsx

@@ -24,9 +24,9 @@ export default defineComponent({
     teacherInfo() {
       const { old, now } = this.changeInfo
       return {
-        oldName: old.realName,
+        oldName: old.username,
         oldAvatar: old.avatar,
-        nowName: now.realName,
+        nowName: now.username,
         nowAvatar: now.avatar
       }
     }

+ 1 - 1
src/student/share-active/track-review-activity/index.tsx

@@ -102,7 +102,7 @@ export default defineComponent({
       // 判断活动状态的活动时间
       try {
         const activeInfo = this.activeInfo
-        if (activeInfo.activityState === 0) {
+        if (activeInfo.activityState !== 1) {
           Dialog.alert({
             message: '活动已结束,感谢你的关注!',
             theme: 'round-button',

+ 2 - 1
src/teacher/income-consus/index.tsx

@@ -161,7 +161,8 @@ export default defineComponent({
             result.liveShareRate +
             result.videoShareRate +
             result.musicShareRate +
-            result.mallShareRate,
+            result.mallShareRate +
+            result.actiRegistShareRate,
           totalInAmount: result.totalInAmount || 0,
           practiceAmount: result.practiceAmount || 0,
           practiceRate: result.practiceRate || 0,

+ 68 - 40
src/teacher/live-class/create-components/arrange.tsx

@@ -112,6 +112,11 @@ export default defineComponent({
       })
     },
     async onSubmit() {
+      const groupId = this.$route.query.groupId
+      if (groupId){
+        createState.active = 4
+        return
+      }
       if (createState.selectCourseList.length <= 0) {
         Toast('请选择课程时间')
         return
@@ -230,49 +235,72 @@ export default defineComponent({
     }
   },
   render() {
+    const groupId = this.$route.query.groupId
     return (
       <div class={styles.arrange}>
-        <Calendar
-          selectList={createState.selectCourseList}
-          list={this.calendarList}
-          maxDays={createState.live.courseNum || 0}
-          nextMonth={(date: Date) => this.getList(date)}
-          prevMonth={(date: Date) => this.getList(date)}
-          selectDay={this.onSelectDay}
-          v-model:calendarDate={this.calendarDate}
-        />
-
-        <Cell
-          class={[styles.arrangeCell, 'mb12']}
-          v-slots={{
-            title: () => (
-              <div class={styles.rTitle}>
-                <span>已选择课程时间</span>
-              </div>
-            ),
-            label: () => (
-              <div class={styles.rTag}>
-                {this.showSelectList.map((item: any) => (
-                  <>
-                    <Tag
-                      plain
-                      round
-                      closeable
-                      size="large"
-                      type="primary"
-                      class={styles.tag}
-                      onClose={() => this.onCloseTag(item)}
-                    >
-                      {item.title}
-                    </Tag>
-                    <br />
-                  </>
-                ))}
-              </div>
-            )
-          }}
-        ></Cell>
+        {!groupId ? (
+          <>
+            <Calendar
+              selectList={createState.selectCourseList}
+              list={this.calendarList}
+              maxDays={createState.live.courseNum || 0}
+              nextMonth={(date: Date) => this.getList(date)}
+              prevMonth={(date: Date) => this.getList(date)}
+              selectDay={this.onSelectDay}
+              v-model:calendarDate={this.calendarDate}
+            />
 
+            <Cell
+              class={[styles.arrangeCell, 'mb12']}
+              v-slots={{
+                title: () => (
+                  <div class={styles.rTitle}>
+                    <span>已选择课程时间</span>
+                  </div>
+                ),
+                label: () => (
+                  <div class={styles.rTag}>
+                    {this.showSelectList.map((item: any) => (
+                      <>
+                        <Tag
+                          plain
+                          round
+                          closeable
+                          size="large"
+                          type="primary"
+                          class={styles.tag}
+                          onClose={() => this.onCloseTag(item)}
+                        >
+                          {item.title}
+                        </Tag>
+                        <br />
+                      </>
+                    ))}
+                  </div>
+                )
+              }}
+            ></Cell>
+          </>
+        ): (
+          <>
+            <Cell
+                class={[styles.arrangeCell, 'mb12']}
+                v-slots={{
+                  title: () => (
+                    <div class={styles.rTitle}>
+                      <span>已选择课程时间</span>
+                    </div>
+                  ),
+                }}
+            ></Cell>
+            {createState.live.coursePlanList.map(item => {
+              return (
+                <Cell title={`${item.startTime} ~ ${item.endTime}`}></Cell>
+              )
+            })}
+            <div class={['mb12']}></div>
+          </>
+        )}
         <Sticky offsetBottom={0} position="bottom">
           <div class={['btnGroup', 'btnMore']}>
             <Button

+ 3 - 1
src/teacher/live-class/create-components/course-plan.tsx

@@ -73,7 +73,9 @@ export default defineComponent({
               plain
               onClick={() => {
                 createState.active = 1
-                createState.live.coursePlanList = [{ ...basePlan }]
+                if (!createState.live.courseGroupId){ // 修改时不重置
+                  createState.live.coursePlanList = [{ ...basePlan }]
+                }
               }}
             >
               上一步

+ 29 - 18
src/teacher/live-class/create-components/course-start.tsx

@@ -39,9 +39,12 @@ export default defineComponent({
     }
   },
   mounted() {
-    this.maxDate = dayjs(createState.selectCourseList[0].startTime)
+    if (createState.selectCourseList[0]?.startTime) {
+      this.maxDate = dayjs(createState.selectCourseList[0].startTime)
       .subtract(1, 'day')
       .toDate()
+    }
+    
 
     createState.live.salesStartDate =
       createState.live.salesStartDate ||
@@ -87,6 +90,7 @@ export default defineComponent({
         class={styles.courseStart}
         onSubmit={() => (createState.active = 5)}
         scrollToError
+        disabled={createState.live.courseGroupId ? true : false}
       >
         <ColFieldGroup>
           <ColField title="开售日期" required>
@@ -97,6 +101,9 @@ export default defineComponent({
               isLink
               placeholder="请选择开售日期"
               onClick={() => {
+                if (createState.live.courseGroupId) {
+                  return
+                }
                 this.minDate = dayjs().toDate()
                 this.currentDate = dayjs(
                   createState.live.salesStartDate
@@ -114,6 +121,9 @@ export default defineComponent({
               readonly
               isLink
               onClick={() => {
+                if (createState.live.courseGroupId) {
+                  return
+                }
                 this.minDate = dayjs(createState.live.salesStartDate).toDate()
                 this.currentDate = dayjs(createState.live.salesEndDate).toDate()
                 this.typeDateTime = 'end'
@@ -157,18 +167,17 @@ export default defineComponent({
             border={false}
             v-slots={{
               title: () => (
-                // <Tabs
-                //   v-model:active={createState.tabIndex}
-                //   class={styles.infoField}
-                //   onChange={this.tabChange}
-                //   shrink
-                //   color="var(--van-primary)"
-                //   lineWidth={20}
-                // >
-                //   <Tab title="图片模板" name={1}></Tab>
-                //   <Tab title="自定义模板" name={2}></Tab>
-                // </Tabs>
-                <p>请上传自定义模板</p>
+                <Tabs
+                  v-model:active={createState.tabIndex}
+                  class={styles.infoField}
+                  onChange={this.tabChange}
+                  shrink
+                  color="var(--van-primary)"
+                  lineWidth={20}
+                >
+                  {/* <Tab title="图片模板" name={1}></Tab> */}
+                  <Tab title="自定义模板" name={2}></Tab>
+                </Tabs>
               )
             }}
           >
@@ -278,11 +287,13 @@ export default defineComponent({
               plain
               onClick={() => {
                 createState.active = 3
-                createState.live.salesStartDate = ''
-                createState.live.salesEndDate = ''
-                createState.live.backgroundPic = ''
-                createState.live.backgroundPicTemplate = ''
-                createState.live.mixStudentNum = null
+                if(!createState.live.courseGroupId){
+                  createState.live.salesStartDate = ''
+                  createState.live.salesEndDate = ''
+                  createState.live.backgroundPic = ''
+                  createState.live.backgroundPicTemplate = ''
+                  createState.live.mixStudentNum = null
+                }
               }}
             >
               上一步

+ 8 - 1
src/teacher/live-class/create-components/course.tsx

@@ -83,6 +83,7 @@ export default defineComponent({
         class={styles.classInfo}
         onSubmit={() => (createState.active = 2)}
         scrollToError
+        disabled={createState.live.courseGroupId ? true : false}
       >
         <ColFieldGroup>
           <ColField title="课程名称" required>
@@ -96,11 +97,15 @@ export default defineComponent({
           </ColField>
           <ColField title="课程声部" required>
             <Field
+              
               modelValue={this.lessonSubjectName}
               name="subjectId"
               readonly
               isLink
               onClick={() => {
+                if (createState.live.courseGroupId) {
+                  return
+                }
                 this.subjectStatus = true
               }}
               rules={[{ required: true, message: '请选择课程声部' }]}
@@ -145,7 +150,9 @@ export default defineComponent({
               readonly
               isLink
               onClick={() => {
-                this.classTimeStatus = true
+                if (!createState.live.courseGroupId){
+                  this.classTimeStatus = true
+                }
               }}
               rules={[{ required: true, message: '请选择单课时时长' }]}
               placeholder="请选择单课时时长"

+ 2 - 0
src/teacher/live-class/create-components/createState.ts

@@ -22,6 +22,8 @@ export const createState = reactive({
   selectCourseList: [] as any, // 选择课程列表
   coursePlanStatus: false, // 是否有锁课程
   live: {
+    teacherId: '',
+    courseGroupId: '',
     name: '',
     subjectId: null as any,
     courseIntroduce: '',

+ 34 - 3
src/teacher/live-class/create-components/detail.tsx

@@ -94,6 +94,30 @@ export default defineComponent({
           createState.coursePlanStatus = false
         })
       }
+    },
+
+    async onUpdate(){
+      
+      const params = {
+        id: createState.live.courseGroupId,
+        ...createState.live,
+        startTime: createState.live.coursePlanList[0].startTime,
+        backgroundPic:
+          createState.live.backgroundPic ||
+          createState.live.backgroundPicTemplate,
+      }
+      console.log({...params})
+      await request.post('/api-teacher/courseGroup/updateLiveCourse', {
+        data: params
+      })
+      Toast({
+        type: 'success',
+        message: '编辑成功',
+        duration: 1000,
+        onClose: () => {
+          postMessage({ api: 'back' })
+        }
+      })
     }
   },
   render() {
@@ -127,9 +151,16 @@ export default defineComponent({
             >
               返回编辑
             </Button>
-            <Button block round type="primary" onClick={this.onSubmit}>
-              创建成功
-            </Button>
+            {createState.live.courseGroupId ? (
+              <Button block round type="primary" onClick={this.onUpdate}>
+                确认修改
+              </Button>
+            ) : (
+              <Button block round type="primary" onClick={this.onSubmit}>
+                创建成功
+              </Button>
+            )}
+            
           </div>
         </Sticky>
       </div>

+ 27 - 0
src/teacher/live-class/create.tsx

@@ -46,6 +46,33 @@ export default defineComponent({
     } catch (err: any) {
       console.log(err)
     }
+    this.getLiveClassDetail()
+  },
+  methods:{
+     // 获取直播课详情
+    async getLiveClassDetail(){
+      const groupId = this.$route.query.groupId
+      if (!groupId) return
+      const res = await request.get(`/api-teacher/courseGroup/queryLiveCourseInfo?groupId=${groupId}`)
+      console.log(res, createState)
+      if (res.code == 200){
+        const data = res.data
+        createState.live.courseGroupId = data.courseGroupId
+        createState.live.teacherId = data.teacherId
+        createState.live.name = data.courseGroupName
+        createState.live.subjectId = (createState.subjectList.find((n:any) => n.name === data.subjectName) as any)?.id || ''
+        createState.live.courseIntroduce = data.courseIntroduce
+        createState.live.courseNum = data.courseNum
+        createState.live.singleMins = data.singleCourseMinutes
+        createState.live.coursePrice = data.coursePrice
+        createState.live.coursePlanList = data.planList
+        createState.live.salesStartDate = data.salesStartDate
+        createState.live.salesEndDate = data.salesEndDate
+        createState.live.mixStudentNum = data.mixStudentNum
+        // createState.live.coursePrice = data.singleCourseMinutes
+        createState.live.backgroundPic = data.backgroundPic
+      }
+    }
   },
   render() {
     return (

+ 31 - 18
src/teacher/music/upload/index.tsx

@@ -194,7 +194,7 @@ export default defineComponent({
             res.data.audioType === 'MIDI'
               ? 1
               : 0
-          this.mp3Url = res.data.audioFileUrl //res.data.metronomeUrl || res.data.url
+          this.mp3Url = res.data.audioFileUrl || res.data.url //res.data.metronomeUrl || res.data.url
         } else {
           this.midiUrl = res.data.midiUrl
         }
@@ -245,6 +245,7 @@ export default defineComponent({
       }
     },
     async submit(vals: any) {
+      console.log(vals)
       this.submitLoading = true
       try {
         if (this.$route.params.id) {
@@ -409,11 +410,14 @@ export default defineComponent({
                           : '上传文件'}
                       </Button>
                     ) : (
-                      <Upload
-                        onUpdate:modelValue={val => (this.xmlFileUrl = val)}
-                        accept=".xml"
-                        formatFile={this.readerFile}
-                      />
+                      <>
+                        <Upload
+                          onUpdate:modelValue={val => (this.xmlFileUrl = val)}
+                          accept=".xml"
+                          formatFile={this.readerFile}
+                        />
+                        <div style={{marginLeft: '8px'}}>{this.fileName(this.xmlFileUrl)}</div>
+                      </>
                     )
                 }}
               />
@@ -477,10 +481,13 @@ export default defineComponent({
                               : '上传文件'}
                           </Button>
                         ) : (
-                          <Upload
-                            onUpdate:modelValue={val => (this.mp3Url = val)}
-                            accept=".mp3"
-                          />
+                          <>
+                            <Upload
+                              onUpdate:modelValue={val => (this.mp3Url = val)}
+                              accept=".mp3"
+                            />
+                            <div style={{marginLeft: '8px'}}>{this.fileName(this.mp3Url)}</div>
+                          </>
                         )
                     }}
                   />
@@ -520,10 +527,13 @@ export default defineComponent({
                                 : '上传文件'}
                             </Button>
                           ) : (
-                            <Upload
-                              onUpdate:modelValue={val => (this.bgmp3Url = val)}
-                              accept=".mp3"
-                            />
+                            <>
+                              <Upload
+                                onUpdate:modelValue={val => (this.bgmp3Url = val)}
+                                accept=".mp3"
+                              />
+                              <div style={{marginLeft: '8px'}}>{this.fileName(this.bgmp3Url)}</div>
+                            </>
                           )
                       }}
                     />
@@ -551,10 +561,13 @@ export default defineComponent({
                             : '上传文件'}
                         </Button>
                       ) : (
-                        <Upload
-                          onUpdate:modelValue={val => (this.midiUrl = val)}
-                          accept=".mid"
-                        />
+                        <>
+                          <Upload
+                            onUpdate:modelValue={val => (this.midiUrl = val)}
+                            accept=".mid"
+                          />
+                          <div style={{marginLeft: '8px'}}>{this.fileName(this.midiUrl)}</div>
+                        </>
                       )
                   }}
                 />

+ 1 - 1
src/teacher/share-page/track-review-activity/index.tsx

@@ -57,7 +57,7 @@ export default defineComponent({
       // 判断活动状态的活动时间
       try {
         const activeInfo = this.activeInfo
-        if (activeInfo.activityState === 0) {
+        if (activeInfo.activityState !== 1) {
           Dialog.alert({
             message: '活动已结束,感谢你的关注!',
             theme: 'round-button',

+ 1 - 1
src/views/live-class/index.tsx

@@ -40,7 +40,7 @@ export default defineComponent({
   },
   async mounted() {
     try {
-      const res = await request.get(`${this.apiSuffix}/subject/subjectSelect`)
+      const res = await request.get(`${this.apiSuffix}/subject/subjectSelect?type=LIVE`)
       this.subjectList = res.data || []
     } catch {
       //

+ 14 - 0
src/views/music/album/index.module.less

@@ -3,3 +3,17 @@
     box-shadow: 10px 10px 10px var(--box-shadow-color);
   }
 }
+.label {
+  margin-right: 8px;
+  font-size: 14px;
+  :global {
+    .van-list__loading,
+    .van-list__finished-text,
+    .van-list__error-text {
+      width: 100%;
+    }
+    .iconfont-down {
+      margin-left: 4px;
+    }
+  }
+}

+ 47 - 2
src/views/music/album/index.tsx

@@ -1,5 +1,5 @@
 import { defineComponent, reactive, ref } from 'vue'
-import { Sticky, List, Popup } from 'vant'
+import { Sticky, List, Popup, Icon } from 'vant'
 import Search from '@/components/col-search'
 import request from '@/helpers/request'
 import Item from './item'
@@ -8,6 +8,7 @@ import { useRoute } from 'vue-router'
 import ColResult from '@/components/col-result'
 import styles from './index.module.less'
 import { state } from '@/state'
+import SelectSubject from '../search/select-subject'
 
 export default defineComponent({
   name: 'Album',
@@ -88,9 +89,26 @@ export default defineComponent({
       tagVisibility.value = false
     }
 
+    const onComfirmSubject = item => {
+      params.page = 1
+      params.subjectIds = item.id
+      subject.id = item.id
+      subject.name = item.name
+      data.value = null
+      FetchList()
+      subject.show = false
+    }
+
     expose({
       onSearch,
-      onComfirm
+      onComfirm,
+      onComfirmSubject
+    })
+
+    const subject = reactive({
+      show: false,
+      name: '全部',
+      id: ''
     })
 
     return () => {
@@ -113,6 +131,22 @@ export default defineComponent({
                   onSearch={onSearch}
                   onFilter={() => (tagVisibility.value = true)}
                   filterDot={!!params.albumTagIds}
+                  v-slots={{
+                    left: () => (
+                      <div
+                        class={styles.label}
+                        onClick={() => (subject.show = true)}
+                      >
+                        {subject.name}
+                        <Icon
+                          classPrefix="iconfont"
+                          name="down"
+                          size={12}
+                          color="#333"
+                        />
+                      </div>
+                    )
+                  }}
                 />
               </Sticky>
             )}
@@ -142,6 +176,17 @@ export default defineComponent({
               onCancel={() => {}}
             />
           </Popup>
+          <Popup
+            show={subject.show}
+            position="bottom"
+            round
+            closeable
+            safe-area-inset-bottom
+            onClose={() => (subject.show = false)}
+            onClosed={() => (subject.show = false)}
+          >
+            <SelectSubject isReset onComfirm={onComfirmSubject} />
+          </Popup>
         </>
       )
     }

+ 14 - 0
src/views/music/list/index.module.less

@@ -3,3 +3,17 @@
     box-shadow: 10px 10px 10px var(--box-shadow-color);
   }
 }
+.label {
+  margin-right: 8px;
+  font-size: 14px;
+  :global {
+    .van-list__loading,
+    .van-list__finished-text,
+    .van-list__error-text {
+      width: 100%;
+    }
+    .iconfont-down {
+      margin-left: 4px;
+    }
+  }
+}

+ 48 - 2
src/views/music/list/index.tsx

@@ -1,5 +1,5 @@
 import { defineComponent, reactive, ref } from 'vue'
-import { Sticky, List, Popup } from 'vant'
+import { Sticky, List, Popup, Icon } from 'vant'
 import Search from '@/components/col-search'
 import request from '@/helpers/request'
 import Item from './item'
@@ -9,6 +9,7 @@ import ColResult from '@/components/col-result'
 import styles from './index.module.less'
 import { getRandomKey, musicBuy } from '../music'
 import { state } from '@/state'
+import SelectSubject from '../search/select-subject'
 
 const noop = () => {}
 
@@ -104,10 +105,26 @@ export default defineComponent({
       FetchList()
       tagVisibility.value = false
     }
+    const onComfirmSubject = (item) => {
+      params.page = 1
+      params.subjectIds = item.id
+      subject.id = item.id
+      subject.name = item.name
+      data.value = null
+      FetchList()
+      subject.show = false
+    }
+
+    const subject = reactive({
+      show: false,
+      name: '全部',
+      id: ''
+    })
 
     expose({
       onSearch,
-      onComfirm
+      onComfirm,
+      onComfirmSubject
     })
 
     return () => (
@@ -128,6 +145,22 @@ export default defineComponent({
                 onSearch={onSearch}
                 onFilter={() => (tagVisibility.value = true)}
                 filterDot={!!params.musicTagIds}
+                v-slots={{
+                  left: () => (
+                    <div
+                      class={styles.label}
+                      onClick={() => (subject.show = true)}
+                    >
+                      {subject.name}
+                      <Icon
+                        classPrefix="iconfont"
+                        name="down"
+                        size={12}
+                        color="#333"
+                      />
+                    </div>
+                  )
+                }}
               />
             </Sticky>
           )}
@@ -168,6 +201,19 @@ export default defineComponent({
             defaultValue={route.query.tagids as string}
           />
         </Popup>
+
+        {/* 声部弹框 */}
+        <Popup
+            show={subject.show}
+            position="bottom"
+            round
+            closeable
+            safe-area-inset-bottom
+            onClose={() => (subject.show = false)}
+            onClosed={() => (subject.show = false)}
+          >
+            <SelectSubject isReset onComfirm={onComfirmSubject} />
+          </Popup>
       </>
     )
   }

+ 1 - 1
src/views/music/list/item.tsx

@@ -51,7 +51,7 @@ export default defineComponent({
 
     const shareStatus = ref(false)
     const shareUrl = ref('')
-    console.log(data)
+    // console.log(data)
     const onShare = (evt: MouseEvent) => {
       evt.stopPropagation()
       // if (!shareStatus.value) {

+ 46 - 18
src/views/music/search/header.tsx

@@ -6,7 +6,7 @@ import {
   onBeforeRouteUpdate,
   onBeforeRouteLeave
 } from 'vue-router'
-import { defineComponent, onMounted, ref, watch } from 'vue'
+import { defineComponent, onMounted, reactive, ref, watch } from 'vue'
 import mitt from 'mitt'
 import Search from '@/components/col-search'
 import { useLocalStorage } from '@vueuse/core'
@@ -14,6 +14,7 @@ import styles from './index.module.less'
 import classNames from 'classnames'
 import SelectTag from './select-tag'
 import { getRandomKey, musicBuy } from '../music'
+import SelectSubject from './select-subject'
 
 export const mitter = mitt()
 
@@ -26,22 +27,19 @@ export default defineComponent({
     localStorage.setItem('behaviorId', getRandomKey())
     const router = useRouter()
     const route = useRoute()
-    const loading = ref(false)
+    const subjectIds = ref('')
     const keyword = ref('')
     const tagids = ref('')
-    const albumRows = ref([])
-    const sheetRows = ref([])
     const tagVisibility = ref(false)
     const words = useLocalStorage<string[]>('music-search', [])
     const activeTab = ref('songe')
 
     onBeforeRouteUpdate(() => {
-      // console.log('onBeforeRouteUpdate', route.fullPath)
       if (route.path === '/music-songbook/search') {
         keyword.value = ''
         tagids.value = ''
+        subjectIds.value = ''
         activeTab.value = 'songe'
-        // console.log('onBeforeRouteUpdate')
         try {
           selectTagRef.value?.resetTags?.()
         } catch (error) {
@@ -66,28 +64,29 @@ export default defineComponent({
         words.value.length = Math.min(words.value.length, 5)
       }
       mitter.emit('search', val)
-      // const activeRef = activeTab.value === 'album' ? albumList : musicList
-      // ;(activeRef.value as any).onSearch?.(val)
-      // FetchList()
     }
 
     const onComfirm = (tags, name = '') => {
       const data = Object.values(tags).flat().filter(Boolean).join(',')
       tagids.value = data
       mitter.emit('confirm', tags)
-      // FetchList()
-      // const activeRef = activeTab.value === 'album' ? albumList : musicList
-      // ;(activeRef.value as any).onComfirm?.(tags)
       tagVisibility.value = false
     }
 
-    // const albumList = ref(null)
-    // const musicList = ref(null)
+    const onComfirmSubject = (item: any) => {
+      // console.log('onSort', item)
+      subject.name = item.name
+      subject.id = item.id
+      mitter.emit('confirmSubject', subject.id)
+      subject.show = false
+    }
+
+    onMounted(() => {})
 
-    onMounted(() => {
-      // const activeRef = activeTab.value === 'album' ? albumList : musicList
-      // ;(activeRef.value as any).onSearch?.('')
-      // console.log(searchInputRef.value)
+    const subject = reactive({
+      show: false,
+      name: '全部',
+      id: ''
     })
     return () => {
       return (
@@ -107,6 +106,22 @@ export default defineComponent({
                   })
                 }
               }}
+              v-slots={{
+                left: () => (
+                  <div
+                    class={styles.label}
+                    onClick={() => (subject.show = true)}
+                  >
+                    {subject.name}
+                    <Icon
+                      classPrefix="iconfont"
+                      name="down"
+                      size={12}
+                      color="#333"
+                    />
+                  </div>
+                )
+              }}
             />
             {route.path === '/music-songbook/search' && (
               <Tabs
@@ -159,6 +174,19 @@ export default defineComponent({
               onCancel={() => {}}
             />
           </Popup>
+
+          {/* 声部弹框 */}
+          <Popup
+            show={subject.show}
+            position="bottom"
+            round
+            closeable
+            safe-area-inset-bottom
+            onClose={() => (subject.show = false)}
+            onClosed={() => (subject.show = false)}
+          >
+            <SelectSubject isReset onComfirm={onComfirmSubject} />
+          </Popup>
         </div>
       )
     }

+ 14 - 0
src/views/music/search/index.module.less

@@ -49,4 +49,18 @@
       font-size: 16px;
     }
   }
+  .label {
+    margin-right: 8px;
+    font-size: 14px;
+    :global {
+      .van-list__loading,
+      .van-list__finished-text,
+      .van-list__error-text {
+        width: 100%;
+      }
+      .iconfont-down {
+        margin-left: 4px;
+      }
+    }
+  }
 }

+ 13 - 51
src/views/music/search/index.tsx

@@ -1,17 +1,8 @@
-import { Sticky, Cell, Tag, Icon, Popup, Tabs, Tab, Dialog } from 'vant'
 import { defineComponent, onMounted, onUnmounted, ref } from 'vue'
-// import Search from '@/components/col-search'
 import { useLocalStorage } from '@vueuse/core'
-// import AlbumItem from '../album/item'
 import AlbumList from '../album'
-// import MusicItem from '../list/item'
 import MusicList from '../list'
 import styles from './index.module.less'
-// import classNames from 'classnames'
-// import request from '@/helpers/request'
-import SelectTag from './select-tag'
-// import ColResult from '@/components/col-result'
-// import { orderStatus } from '@/views/order-detail/orderStatus'
 import { useRoute, useRouter } from 'vue-router'
 import { getRandomKey, musicBuy } from '../music'
 import { mitter } from './header'
@@ -20,39 +11,16 @@ export default defineComponent({
   name: 'MusicSearch',
   emits: ['confirm'],
   setup() {
-    const searchInputRef = ref()
     localStorage.setItem('behaviorId', getRandomKey())
     const route = useRoute()
     const router = useRouter()
-    const loading = ref(false)
     const keyword = ref(route.query.keyword || '')
     const tagids = ref(route.query.tagids || '')
-    const albumRows = ref([])
-    const sheetRows = ref([])
+    const subject = ref()
     const tagVisibility = ref(false)
     const words = useLocalStorage<string[]>('music-search', [])
     const activeTab = ref('songe')
 
-    const FetchList = async () => {
-      // loading.value = true
-      // try {
-      //   const res = await request.post(
-      //     '/api-student/music/sheet/albumAndSheetList',
-      //     {
-      //       data: {
-      //         albumRow: 3,
-      //         sheetRow: 10,
-      //         search: keyword.value,
-      //         musicTagIds: tagids.value
-      //       }
-      //     }
-      //   )
-      //   albumRows.value = res.data.musicAlbumList.rows
-      //   sheetRows.value = res.data.musicSheetList.rows
-      // } catch (error) {}
-      // loading.value = false
-    }
-
     const onSearch = val => {
       keyword.value = val
       const indexOf = words.value.indexOf(val)
@@ -64,20 +32,23 @@ export default defineComponent({
         words.value.length = Math.min(words.value.length, 5)
       }
       const activeRef = activeTab.value === 'album' ? albumList : musicList
-      console.log(val)
       ;(activeRef.value as any).onSearch?.(val)
-      // FetchList()
     }
 
     const onComfirm = tags => {
       const data = Object.values(tags).flat().filter(Boolean).join(',')
       tagids.value = data
-      // FetchList()
       const activeRef = activeTab.value === 'album' ? albumList : musicList
       ;(activeRef.value as any).onComfirm?.(tags)
       tagVisibility.value = false
     }
 
+    const onConfirmSubject = (id: any) => {
+      subject.value = id
+      const activeRef = activeTab.value === 'album' ? albumList : musicList
+      ;(activeRef.value as any).onComfirmSubject?.(subject)
+    }
+
     const albumList = ref(null)
     const musicList = ref(null)
 
@@ -89,14 +60,14 @@ export default defineComponent({
       mitter.on('changeTab', changeTab)
       mitter.on('search', onSearch)
       mitter.on('confirm', onComfirm)
-      // ;(activeRef.value as any).onSearch?.('')
-      // console.log(searchInputRef.value)
+      mitter.on('confirmSubject', onConfirmSubject)
     })
 
     onUnmounted(() => {
       mitter.off('changeTab', changeTab)
       mitter.off('search', onSearch)
       mitter.off('confirm', onComfirm)
+      mitter.off('confirmSubject', onConfirmSubject)
     })
 
     return () => {
@@ -108,7 +79,8 @@ export default defineComponent({
               ref={albumList}
               defauleParams={{
                 search: keyword.value,
-                tagids: tagids.value
+                tagids: tagids.value,
+                subjectIds: subject.value
               }}
             />
           ) : (
@@ -127,21 +99,11 @@ export default defineComponent({
               }}
               defauleParams={{
                 search: keyword.value,
-                tagids: tagids.value
+                tagids: tagids.value,
+                subjectIds: subject.value
               }}
             />
           )}
-          {/* <Popup
-            show={tagVisibility.value}
-            round
-            closeable
-            position="bottom"
-            style={{ height: '60%' }}
-            teleport="body"
-            onUpdate:show={val => (tagVisibility.value = val)}
-          >
-            <SelectTag onConfirm={onComfirm} onCancel={() => {}} />
-          </Popup> */}
         </div>
       )
     }

+ 79 - 0
src/views/music/search/select-subject.module.less

@@ -0,0 +1,79 @@
+.filterTitle {
+  font-size: 18px;
+  font-weight: 500;
+  color: #000000;
+  line-height: 25px;
+  text-align: center;
+  padding: 20px 0;
+}
+
+.searchResult {
+  padding: 0 16px;
+  overflow: hidden;
+  margin-bottom: 20px;
+  .searchTitle {
+    font-size: 16px;
+    color: #333333;
+    line-height: 22px;
+  }
+}
+
+.radio-group {
+  display: flex;
+  margin-top: 10px;
+  margin-bottom: 20px;
+  flex-wrap: wrap;
+  .radio:first-child {
+    :global {
+      .van-radio__label {
+        margin-left: 0;
+      }
+    }
+  }
+}
+
+.radio {
+  :global {
+    .van-radio__icon {
+      display: none;
+    }
+    .van-tag--large {
+      width: 80px;
+      height: 32px;
+      font-size: 16px;
+      text-align: center;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .van-tag {
+      box-sizing: border-box;
+    }
+    .van-tag--default {
+      color: var(--van-tag-text-default-color);
+    }
+    .van-tag--primary {
+      background-color: var(--tag-bg-color);
+    }
+  }
+}
+
+.organ-radio {
+  :global {
+    .van-tag--large {
+      width: auto;
+      padding: 0 12px;
+      margin-bottom: 8px;
+      margin-right: 8px;
+      font-size: 14px;
+    }
+  }
+}
+
+.btn {
+  padding: 5px 14px;
+
+  & + .btn {
+    margin-left: 10px;
+  }
+}

+ 118 - 0
src/views/music/search/select-subject.tsx

@@ -0,0 +1,118 @@
+import { defineComponent } from 'vue'
+import styles from './select-subject.module.less'
+import { Tag, Button, Sticky } from 'vant'
+import { state } from '@/state'
+import request from '@/helpers/request'
+
+export default defineComponent({
+  name: 'selectSubject',
+  props: {
+    isReset: {
+      type: Boolean,
+      default: false
+    },
+    onComfirm: {
+      type: Function,
+      default: (item: any) => {}
+    }
+  },
+  data() {
+    return {
+      subject: {
+        name: '',
+        id: ''
+      },
+      subjectList: [] as any,
+      apiSuffix:
+        state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+      const { data } = await request.get(
+        `${this.apiSuffix}/subject/subjectSelect`
+      )
+      if (Array.isArray(data)) {
+        this.subjectList = data
+      }
+    }
+  },
+  render() {
+    return (
+      <>
+        <div class={styles.filterTitle}>全部声部</div>
+        <div
+          class={styles.searchResult}
+          style={{ maxHeight: '45vh', overflowY: 'auto' }}
+        >
+          {this.subjectList.map(
+            (item: any) =>
+              item.subjects &&
+              item.subjects.length > 0 && (
+                <>
+                  <div class={styles.searchTitle}>{item.name}</div>
+                  <div
+                    class={[
+                      styles['radio-group'],
+                      styles.radio,
+                      styles['organ-radio']
+                    ]}
+                  >
+                    {item.subjects.map((subject: any) => {
+                      const isActive = subject.id === Number(this.subject.id)
+                      const type = isActive ? 'primary' : 'default'
+                      return (
+                        <Tag
+                          size="large"
+                          plain={isActive}
+                          type={type}
+                          round
+                          onClick={() => {
+                            this.subject = subject
+                          }}
+                        >
+                          {subject.name}
+                        </Tag>
+                      )
+                    })}
+                  </div>
+                </>
+              )
+          )}
+        </div>
+        <Sticky position="bottom" offsetBottom={0}>
+          <div class={['btnGroup', this.isReset ? 'btnMore' : '']}>
+            {this.isReset && (
+              <Button
+                type="primary"
+                plain
+                round
+                onClick={() => {
+                  this.subject.name = '全部'
+                  this.subject.id = ''
+                  this.onComfirm({...this.subject})
+                }}
+              >
+                重置
+              </Button>
+            )}
+
+            <Button
+              type="primary"
+              round
+              block
+              onClick={() => {
+                this.onComfirm({ ...this.subject })
+              }}
+            >
+              确认
+            </Button>
+          </div>
+        </Sticky>
+      </>
+    )
+  }
+})

+ 1 - 1
src/views/video-class/index.tsx

@@ -40,7 +40,7 @@ export default defineComponent({
   },
   async mounted() {
     try {
-      const res = await request.get(`${this.apiSuffix}/subject/subjectSelect`)
+      const res = await request.get(`${this.apiSuffix}/subject/subjectSelect?type=VIDEO`)
       this.subjectList = res.data || []
     } catch {
       //

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff