import{C as f}from"./index.4a637b5e.js";import{S as g}from"./index.cdcb8b18.js";import{C as _}from"./index.1032b0ae.js";import{d as y,s as d,e as n,T as h,i as t,N as I,A as c,x as b,C,B as L,$ as T}from"./index.6b776f4b.js";import{C as m}from"./index.7486196c.js";import"./index.998c3386.js";import"./index.570314c1.js";import{T as S,a as p}from"./index.21339447.js";import{I as x}from"./index.7cc0b0e7.js";import{F as U}from"./index.ef17e812.js";import{L as N}from"./index.9b1da5d2.js";import{i as A}from"./icon_student.bbb32387.js";import"./index.beb9a25a.js";import"./bars.82474962.js";import"./icon_album_active.ce98b2a8.js";import"./icon_music_active.3b316ab8.js";import"./index.aa464e80.js";import"./plyr.623e6d1e.js";import"./use-id.40b6af6b.js";import"./use-tab-status.ad41a764.js";import"./use-refs.a68d4385.js";const w="_titleInfo_veoie_1",B="_label_veoie_8",D="_userLogo_veoie_33",R="_users_veoie_50",V="_level_veoie_61",P="_videoDesc_veoie_71",F="_title_veoie_1",M="_isFixed_veoie_111",H="_messageContainer_veoie_117";var i={"video-class-detail":"_video-class-detail_veoie_1",titleInfo:w,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:P,"message-list":"_message-list_veoie_79","message-active":"_message-active_veoie_79",title:F,"message-name":"_message-name_veoie_83","message-time":"_message-time_veoie_87",isFixed:M,messageContainer:H};function v(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!T(s)}var le=y({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(_,{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(I,{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(g,{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(f,{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(x,{class:i.userLogo,src:e.avatar||A,fit:"cover"},null),title:()=>t("div",{class:i.title},[t("div",{class:i["message-name"]},[e.userName]),t("div",{class:i["message-time"]},[b(e.evaluateTime).format("YYYY\u5E74MM\u6708DD\u65E5")])]),label:()=>t("div",{class:i.label},[e.content])})))?o:{default:()=>[o]}):t(C,{btnStatus:!1,tips:"\u6682\u65E0\u8BA8\u8BBA"},null)]),t("div",{class:[i.messageContainer]},[t(U,{placeholder:"\u5FEB\u6765\u8BA8\u8BBA\u5427\uFF5E",modelValue:this.message,"onUpdate:modelValue":e=>this.message=e},{button:()=>t(L,{type:"primary",disabled:!this.message,style:{padding:"0 20px"},size:"small",round:!0,onClick:this.onSubmit},{default:()=>[c("\u53D1\u5E03")]})})])]})]})])}});export{le as default};