video-class-detail.d975260e.js 7.3 KB

1
  1. 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.b7226882.js";import{C}from"./index.54d01dd3.js";import{S as w}from"./index.a841fff0.js";import{C as T}from"./index.969bba7f.js";import{C as L}from"./index.2476b303.js";import{C as m}from"./index.40f703b6.js";import"./index.f6c44874.js";import"./index.cf00521e.js";import{T as S,a as p}from"./index.dc988884.js";import{I as U}from"./index.20c0f4c5.js";import{F as x}from"./index.021f1c7b.js";import{L as N}from"./index.9fec2202.js";import{s as A}from"./icon_student.c3c58354.js";import{C as B}from"./index.0b42adfa.js";import"./index.ed3a5560.js";import"./bars.4f1962a6.js";import"./icon_album_active.cb923735.js";import"./icon_music_active.f55820b3.js";import"./index.9269bf1e.js";/* empty css */import"./tcplayer.v4.8.0.min.aee5aab1.js";import"./use-id.5d5e6e63.js";import"./use-tab-status.db1f6d2e.js";import"./use-refs.428b450a.js";import"./index.1eaf642c.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};