video-class-detail.1b913598.js 6.8 KB

1
  1. import{d as f,g as d,w as n,T as h,j as s,M as g,z as u,u as _,C as y,B as I,Z as b}from"./index.394decd7.js";import{C}from"./index.360ebc13.js";import{S as L}from"./index.63f283ba.js";import{C as T}from"./index.e6e212d8.js";import{C as S}from"./index.f53ab473.js";import{C as m}from"./index.9e0d46e4.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as U,a as p}from"./index.ae00317c.js";import{I as x}from"./index.ae2dd816.js";import{F as N}from"./index.224299a1.js";import{L as w}from"./index.dc786267.js";import{s as A}from"./icon_student.c3c58354.js";import"./index.dab716ce.js";import"./bars.4f1962a6.js";import"./icon_album_active.469423f9.js";import"./icon_music_active.1e7b47ef.js";import"./index.9462d7c5.js";import"./plyr.623e6d1e.js";import"./use-id.e2f22365.js";import"./use-tab-status.723110ee.js";import"./use-refs.09b2d19c.js";const B="_titleInfo_veoie_1",D="_label_veoie_8",R="_userLogo_veoie_33",V="_users_veoie_50",M="_level_veoie_61",P="_videoDesc_veoie_71",F="_title_veoie_1",H="_isFixed_veoie_111",Y="_messageContainer_veoie_117";var a={"video-class-detail":"_video-class-detail_veoie_1",titleInfo:B,label:D,"open-teacher-info":"_open-teacher-info_veoie_26",userLogo:R,"teacher-info":"_teacher-info_veoie_44",users:V,"teacher-name":"_teacher-name_veoie_54",level:M,"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:H,messageContainer:Y};function v(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!b(t)}var ne=f({name:"VideoClassDetail",data(){const t=this.$route.query;return{groupId:t.groupId,classId:t.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 t=this.navHeight;return Number(t)+44+"px"}},async mounted(){var t,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||[],((t=d.user.data)==null?void 0:t.userId)!==l.lessonGroup.teacherId&&(this.trySee=!l.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-student/sysConfig/queryByParamNameList",{params:{paramNames:"video_lesson_free_rate"}});this.freeRate=((o=c.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 t=this.params,o=await n.post("/api-student/videoLesson/page",{data:{...t,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(t){t.id!==Number(this.classId)&&(this.reload=!0,this.posterUrl=t.imgUrl,this.srcUrl=t.videoUrl,this.title=t.title,this.currentClassIndex=t.index,this.videoContent=t.content,this.classId=t.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 t,o;return s("div",{class:a["video-class-detail"]},[s(T,null,null),s(S,{src:this.srcUrl,poster:this.posterUrl,freeTitleStatus:this.lessonPrice>0,freeRate:Number(this.freeRate),trySee:this.trySee,height:this.videoHeight},null),s(m,{border:!1,class:a.cell,title:this.title,titleClass:a.titleInfo},{icon:()=>s(g,{name:"video",size:18,color:"var(--van-primary)",style:{display:"flex",alignItems:"center"}},null),value:()=>s("div",{class:a.label},[s("span",null,[this.currentClassIndex]),u("/"),this.detailList.length,u("\u8BFE\u65F6")])}),s("div",{class:a.videoDesc},[this.videoContent]),s(U,{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:()=>[s(p,{title:"\u76EE\u5F55",name:1},{default:()=>[s("div",{style:{height:"calc(100vh - 320px)",overflowY:"auto"}},[s(L,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList"},v(t=this.detailList.map((e,l)=>{const r=(e.musicAlbumInfos||[]).map(i=>({relationMusicAlbum:i.relationType,musicAlbumName:i.name,musicAlbumId:i.musicAlbumId,status:i.status,useRelationType:this.useRelationType}));return s(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:i=>{if(!this.alreadyBuy&&!i.status){h("\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)}))?t:{default:()=>[t]})])]}),s(p,{title:"\u8BA8\u8BBA",name:3},{default:()=>[s("div",{style:{overflowY:"auto",marginBottom:"calc(var(--van-cell-vertical-padding) * 2 + var( --van-cell-line-height))"}},[this.dataShow?s(w,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,onLoad:this.getList},v(o=this.list.map(e=>s(m,{class:[a["message-list"],e.isTeacher===1&&a["message-active"]],valueClass:a["message-time"]},{icon:()=>s(x,{class:a.userLogo,src:e.avatar||A,fit:"cover"},null),title:()=>s("div",{class:a.title},[s("div",{class:a["message-name"]},[e.userName]),s("div",{class:a["message-time"]},[_(e.evaluateTime).format("YYYY\u5E74MM\u6708DD\u65E5")])]),label:()=>s("div",{class:a.label},[e.content])})))?o:{default:()=>[o]}):s(y,{btnStatus:!1,tips:"\u6682\u65E0\u8BA8\u8BBA"},null)]),s("div",{class:[a.messageContainer]},[s(N,{placeholder:"\u5FEB\u6765\u8BA8\u8BBA\u5427\uFF5E",modelValue:this.message,"onUpdate:modelValue":e=>this.message=e},{button:()=>s(I,{type:"primary",disabled:!this.message,style:{padding:"0 20px"},size:"small",round:!0,onClick:this.onSubmit},{default:()=>[u("\u53D1\u5E03")]})})])]})]})])}});export{ne as default};