1 |
- import{d as f,g as d,w as n,T as h,j as t,M as g,z as c,u as _,C as y,B as I,Z as b}from"./index.e6d6174e.js";import{C}from"./index.43f63892.js";import{S as L}from"./index.884a0e76.js";import{C as T}from"./index.4a53da74.js";import{C as m}from"./index.af99cf22.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as S,a as p}from"./index.54627972.js";import{I as U}from"./index.67c54471.js";import{F as x}from"./index.17d70acf.js";import{L as N}from"./index.f904775d.js";import{i as w}from"./icon_student.bbb32387.js";import"./index.05f2b7dd.js";import"./bars.4f1962a6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_music_active.3b316ab8.js";import"./index.4aea64de.js";import"./plyr.623e6d1e.js";import"./use-id.f239f36f.js";import"./use-tab-status.e9ba8498.js";import"./use-refs.eb803454.js";const A="_titleInfo_veoie_1",B="_label_veoie_8",D="_userLogo_veoie_33",R="_users_veoie_50",V="_level_veoie_61",M="_videoDesc_veoie_71",P="_title_veoie_1",F="_isFixed_veoie_111",H="_messageContainer_veoie_117";var i={"video-class-detail":"_video-class-detail_veoie_1",titleInfo:A,label:B,"open-teacher-info":"_open-teacher-info_veoie_26",userLogo:D,"teacher-info":"_teacher-info_veoie_44",users:R,"teacher-name":"_teacher-name_veoie_54",level:V,"teacher-desc":"_teacher-desc_veoie_67",videoDesc:M,"message-list":"_message-list_veoie_79","message-active":"_message-active_veoie_79",title:P,"message-name":"_message-name_veoie_83","message-time":"_message-time_veoie_87",isFixed:F,messageContainer:H};function v(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!b(s)}var le=f({name:"VideoClassDetail",data(){const s=this.$route.query;return{groupId:s.groupId,classId:s.classId,tabIndex:1,title:"",lessonPrice:0,useRelationType:"",alreadyBuy:!1,currentClassIndex:1,detailList:[],posterUrl:"",srcUrl:"",message:"",navHeight:0,reload:!1,videoContent:"",list:[],dataShow:!0,loading:!1,finished:!1,params:{page:1,rows:20},freeRate:0,trySee:!1,videoHeight:"212px"}},computed:{users(){return d.user.data},offsetTop(){const s=this.navHeight;return Number(s)+44+"px"}},async mounted(){var s,o;this.navHeight=sessionStorage.getItem("navHeight")||0;try{const l=(await n.get("/api-teacher/videoLessonGroup/selectVideoLesson",{params:{groupId:this.groupId}})).data||{};this.title=l.lessonGroup.lessonName,this.useRelationType=l.lessonGroup.relationType,this.lessonPrice=l.lessonGroup.lessonPrice,this.alreadyBuy=l.alreadyBuy,this.detailList=l.detailList||[],((s=d.user.data)==null?void 0:s.userId)!==l.lessonGroup.teacherId&&(this.trySee=!l.alreadyBuy),this.detailList.forEach((r,a)=>{r.id===Number(this.classId)&&(this.posterUrl=r.coverUrl,this.srcUrl=r.videoUrl,this.title=r.videoTitle,this.currentClassIndex=a+1,this.videoContent=r.videoContent)});const u=await n.get("/api-student/sysConfig/queryByParamNameList",{params:{paramNames:"video_lesson_free_rate"}});this.freeRate=((o=u.data[0])==null?void 0:o.paramValue)||0,this.getList()}catch{}},methods:{onSearch(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},async getList(){try{const s=this.params,o=await n.post("/api-student/videoLesson/page",{data:{...s,videoId:this.classId}});this.loading=!1;const e=o.data||{};if(console.log(e),this.list.length>0&&e.pageNo===1)return;this.list=this.list.concat(e.rows||[]),this.finished=e.pageNo>=e.totalPage,this.params.page=e.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}},onPlay(s){s.id!==Number(this.classId)&&(this.reload=!0,this.posterUrl=s.imgUrl,this.srcUrl=s.videoUrl,this.title=s.title,this.currentClassIndex=s.index,this.videoContent=s.content,this.classId=s.id,this.onSearch(),setTimeout(()=>{this.reload=!1},0))},async onSubmit(){try{await n.post("/api-teacher/videoLesson/evaluate",{data:{isTeacher:1,videoId:this.classId,content:this.message,studentId:d.user.data.userId}}),h("\u8BC4\u8BBA\u6210\u529F"),this.message="",setTimeout(()=>{this.onSearch()},1e3)}catch{}}},render(){let s,o;return t("div",{class:i["video-class-detail"]},[t(T,{src:this.srcUrl,poster:this.posterUrl,freeTitleStatus:this.lessonPrice>0,freeRate:Number(this.freeRate),trySee:this.trySee,height:this.videoHeight},null),t(m,{border:!1,class:i.cell,title:this.title,titleClass:i.titleInfo},{icon:()=>t(g,{name:"video",size:18,color:"var(--van-primary)",style:{display:"flex",alignItems:"center"}},null),value:()=>t("div",{class:i.label},[t("span",null,[this.currentClassIndex]),c("/"),this.detailList.length,c("\u8BFE\u65F6")])}),t("div",{class:i.videoDesc},[this.videoContent]),t(S,{active:this.tabIndex,"onUpdate:active":e=>this.tabIndex=e,class:i.infoField,color:"var(--van-primary)",lineWidth:20,sticky:!0,lazyRender:!0,offsetTop:this.offsetTop},{default:()=>[t(p,{title:"\u76EE\u5F55",name:1},{default:()=>[t("div",{style:{height:"calc(100vh - 320px)",overflowY:"auto"}},[t(L,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList"},v(s=this.detailList.map((e,l)=>{const r=(e.musicAlbumInfos||[]).map(a=>({relationMusicAlbum:a.relationType,musicAlbumName:a.name,musicAlbumId:a.musicAlbumId,status:a.status,useRelationType:this.useRelationType}));return t(C,{musicAlbumInfos:r,playId:Number(this.classId),detail:{id:e.id,title:e.videoTitle,content:e.videoContent,imgUrl:e.coverUrl,videoUrl:e.videoUrl,index:l+1},onPlay:this.onPlay,onMusicAlbumDetail:a=>{if(!this.alreadyBuy&&!a.status){h("\u6570\u636E\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}a.relationMusicAlbum==="MUSIC"?this.$router.push({path:"/music-detail",query:{id:a.musicAlbumId}}):a.relationMusicAlbum==="ALBUM"&&this.$router.push({path:"/music-album-detail/"+a.musicAlbumId})}},null)}))?s:{default:()=>[s]})])]}),t(p,{title:"\u8BA8\u8BBA",name:3},{default:()=>[t("div",{style:{overflowY:"auto",marginBottom:"calc(var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height))"}},[this.dataShow?t(N,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,onLoad:this.getList},v(o=this.list.map(e=>t(m,{class:[i["message-list"],e.isTeacher===1&&i["message-active"]],valueClass:i["message-time"]},{icon:()=>t(U,{class:i.userLogo,src:e.avatar||w,fit:"cover"},null),title:()=>t("div",{class:i.title},[t("div",{class:i["message-name"]},[e.userName]),t("div",{class:i["message-time"]},[_(e.evaluateTime).format("YYYY\u5E74MM\u6708DD\u65E5")])]),label:()=>t("div",{class:i.label},[e.content])})))?o:{default:()=>[o]}):t(y,{btnStatus:!1,tips:"\u6682\u65E0\u8BA8\u8BBA"},null)]),t("div",{class:[i.messageContainer]},[t(x,{placeholder:"\u5FEB\u6765\u8BA8\u8BBA\u5427\uFF5E",modelValue:this.message,"onUpdate:modelValue":e=>this.message=e},{button:()=>t(I,{type:"primary",disabled:!this.message,style:{padding:"0 20px"},size:"small",round:!0,onClick:this.onSubmit},{default:()=>[c("\u53D1\u5E03")]})})])]})]})])}});export{le as default};
|