import{d as f,g as d,y as n,T as u,j as t,N as v,A as h,w as y,C as _,B as I,$ as b}from"./ResizeObserver.es.39b48a47.js";import{C}from"./index.a177d001.js";import{S as w}from"./index.f11db230.js";import{C as T}from"./index.970ad07b.js";import{C as L}from"./index.1aca6fb4.js";import{C as m}from"./index.db115763.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as S,a as p}from"./index.5d4d28cc.js";import{I as U}from"./index.fcbcb027.js";import{F as x}from"./index.428ab1a8.js";import{L as N}from"./index.6c529ad4.js";import{s as A}from"./icon_student.c3c58354.js";import{C as B}from"./index.b1c0c586.js";import"./index.34ac729a.js";import"./bars.4f1962a6.js";import"./icon_album_active.cb923735.js";import"./icon_music_active.f55820b3.js";import"./index.9f5e14d1.js";/* empty css */import"./tcplayer.v4.8.0.min.3b1de996.js";import"./use-id.b004ff17.js";import"./use-tab-status.bcc0c503.js";import"./use-refs.07204da6.js";import"./index.dc19bc54.js";const D="_titleInfo_1914w_1",V="_label_1914w_8",P="_userLogo_1914w_33",R="_users_1914w_50",F="_level_1914w_61",M="_videoDesc_1914w_71",G="_title_1914w_1",H="_isFixed_1914w_111",Y="_messageContainer_1914w_117";var a={"video-class-detail":"_video-class-detail_1914w_1",titleInfo:D,label:V,"open-teacher-info":"_open-teacher-info_1914w_26",userLogo:P,"teacher-info":"_teacher-info_1914w_44",users:R,"teacher-name":"_teacher-name_1914w_54",level:F,"teacher-desc":"_teacher-desc_1914w_67",videoDesc:M,"message-list":"_message-list_1914w_79","message-active":"_message-active_1914w_79",title:G,"message-name":"_message-name_1914w_83","message-time":"_message-time_1914w_87",isFixed:H,messageContainer:Y};function g(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!b(s)}var ue=f({name:"VideoClassDetail",data(){const s=this.$route.query;return{groupId:s.groupId,classId:s.classId,tabIndex:1,title:"",lessonPrice:0,payType:"",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",offsetTop:"auto"}},computed:{users(){return d.user.data}},async mounted(){var s,l;this.navHeight=sessionStorage.getItem("navHeight")||0;try{const o=(await n.get("/api-teacher/videoLessonGroup/selectVideoLesson",{params:{groupId:this.groupId}})).data||{};this.title=o.lessonGroup.lessonName,this.useRelationType=o.lessonGroup.relationType,this.lessonPrice=o.lessonGroup.lessonPrice,this.payType=o.lessonGroup.payType,this.alreadyBuy=o.alreadyBuy,this.detailList=o.detailList||[],((s=d.user.data)==null?void 0:s.userId)!==o.lessonGroup.teacherId&&(this.trySee=!o.alreadyBuy),this.detailList.forEach((r,i)=>{r.id===Number(this.classId)&&(this.posterUrl=r.coverUrl,this.srcUrl=r.videoUrl,this.title=r.videoTitle,this.currentClassIndex=i+1,this.videoContent=r.videoContent)});const c=await n.get("/api-teacher/sysConfig/queryByParamNameList",{params:{paramNames:"video_lesson_free_rate"}});this.freeRate=((l=c.data[0])==null?void 0:l.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,l=await n.post("/api-student/videoLesson/page",{data:{...s,videoId:this.classId}});this.loading=!1;const e=l.data||{};if(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}}),u("\u8BC4\u8BBA\u6210\u529F"),this.message="",setTimeout(()=>{this.onSearch()},1e3)}catch{}}},render(){let s,l;return t("div",{class:a["video-class-detail"]},[t(B,{position:"top",onGetHeight:e=>{console.log(e),this.offsetTop=e+"px"}},{default:()=>[t(T,null,null),t(L,{src:this.srcUrl,poster:this.posterUrl,freeTitleStatus:this.lessonPrice>0||this.payType==="VIP",freeRate:Number(this.freeRate),payType:this.payType,trySee:this.trySee,height:this.videoHeight},null),t("div",{style:"overflow: hidden"},[t(m,{border:!1,class:a.cell,title:this.title,titleClass:a.titleInfo},{icon:()=>t(v,{name:"video",size:18,color:"var(--van-primary)",style:{display:"flex",alignItems:"center"}},null),value:()=>t("div",{class:a.label},[t("span",null,[this.currentClassIndex]),h("/"),this.detailList.length,h("\u8BFE\u65F6")])}),t("div",{class:a.videoDesc},[this.videoContent])])]}),t(S,{active:this.tabIndex,"onUpdate:active":e=>this.tabIndex=e,class:a.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 - var(--van-tabs-line-height) - var(--header-height))",overflowY:"auto"}},[t(w,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",style:{marginBottom:"12px"}},g(s=this.detailList.map((e,o)=>{const r=(e.musicAlbumInfos||[]).map(i=>({relationMusicAlbum:i.relationType,musicAlbumName:i.name,musicAlbumId:i.musicAlbumId,status:i.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:o+1},onPlay:this.onPlay,onMusicAlbumDetail:i=>{if(!this.alreadyBuy&&!i.status){u("\u6570\u636E\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}i.relationMusicAlbum==="MUSIC"?this.$router.push({path:"/music-detail",query:{id:i.musicAlbumId}}):i.relationMusicAlbum==="ALBUM"&&this.$router.push({path:"/music-album-detail/"+i.musicAlbumId})}},null)}))?s:{default:()=>[s]})])]}),t(p,{title:"\u8BA8\u8BBA",name:3},{default:()=>[t("div",{style:{overflowY:"auto",height:"calc(100vh - var(--van-tabs-line-height) - var(--header-height) - (var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height)))",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},g(l=this.list.map(e=>t(m,{class:[a["message-list"],e.isTeacher===1&&a["message-active"]],valueClass:a["message-time"]},{icon:()=>t(U,{class:a.userLogo,src:e.avatar||A,fit:"cover"},null),title:()=>t("div",{class:a.title},[t("div",{class:a["message-name"]},[e.userName]),t("div",{class:a["message-time"]},[y(e.evaluateTime).format("YYYY\u5E74MM\u6708DD\u65E5")])]),label:()=>t("div",{class:a.label},[e.content])})))?l:{default:()=>[l]}):t(_,{btnStatus:!1,tips:"\u6682\u65E0\u8BA8\u8BBA"},null)]),t("div",{class:[a.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:()=>[h("\u53D1\u5E03")]})})])]})]})])}});export{ue as default};