video-class-detail.4f9050c7.js 7.6 KB

1
  1. import{C as g}from"./index.9b67dbb3.js";import{S as v}from"./index.363c593b.js";import{C as y}from"./index.c5bf3ab5.js";import{C as I}from"./index.549cf3f7.js";import{d as b,s as c,e as l,T as u,i as t,D as _,N as C,A as d,x as T,C as L,B as S,$ as U}from"./index.7994470a.js";import{C as h}from"./index.777f4790.js";import"./index.6449f9de.js";import"./index.889feca1.js";import{T as N,a as m}from"./index.a28173c9.js";import{I as x}from"./index.2fbdc579.js";import{F as D}from"./index.3dd26d27.js";import{L as w}from"./index.ec643df3.js";import{i as k}from"./icon_teacher.40b6f077.js";import{o as r,a as A}from"./orderStatus.020f67a3.js";import"./index.0262b810.js";import"./bars.4f1962a6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_music_active.3b316ab8.js";import"./index.9cdb5783.js";import"./index.0a2aeb2c.js";import"./use-height.ffa5a0f3.js";import"./plyr.623e6d1e.js";import"./use-id.117b75b2.js";import"./use-tab-status.00d7316c.js";import"./use-refs.ad5f4144.js";const B="_videoDesc_hpnky_4",P="_titleInfo_hpnky_12",V="_label_hpnky_20",j="_title_hpnky_12",O="_userLogo_hpnky_50",H="_messageContainer_hpnky_69";var i={"video-class-detail":"_video-class-detail_hpnky_1",videoDesc:B,titleInfo:P,label:V,"message-list":"_message-list_hpnky_37","message-active":"_message-active_hpnky_37",title:j,"message-name":"_message-name_hpnky_41","message-time":"_message-time_hpnky_45",userLogo:O,messageContainer:H};function p(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!U(s)}var ue=b({name:"VideoClassDetail",data(){const s=this.$route.query;return{groupId:s.groupId,classId:s.classId,tabIndex:1,title:"",lessonPrice:0,useRelationType:"",alreadyBuy:!1,videoDetail:{},detailList:[],posterUrl:"",srcUrl:"",message:"",navHeight:0,currentClassIndex:1,reload:!1,videoContent:"",list:[],dataShow:!0,loading:!1,finished:!1,params:{page:1,rows:20},freeRate:0,trySee:!1,videoHeight:"212px"}},computed:{users(){return c.user.data},offsetTop(){const s=this.navHeight;return Number(s)+44+"px"}},async mounted(){var a;const s=document.body.clientWidth||document.body.offsetWidth;this.videoHeight=s/16*9+"px",this.navHeight=sessionStorage.getItem("navHeight")||0;try{await this.__init();const e=await l.get("/api-student/sysConfig/queryByParamNameList",{params:{paramNames:"video_lesson_free_rate"}});this.freeRate=((a=e.data[0])==null?void 0:a.paramValue)||0}catch{}this.getList()},methods:{async __init(){try{this.reload=!0;const a=(await l.get("/api-student/videoLesson/selectVideoLesson",{params:{groupId:this.groupId}})).data||{};this.videoDetail=a.lessonGroup,this.title=a.lessonGroup.lessonName,this.lessonPrice=a.lessonGroup.lessonPrice,this.useRelationType=a.lessonGroup.relationType,this.alreadyBuy=a.alreadyBuy,this.detailList=a.detailList||[],this.trySee=!a.alreadyBuy,this.detailList.forEach((e,n)=>{e.id===Number(this.classId)&&(this.posterUrl=e.coverUrl,this.srcUrl=e.videoUrl,this.title=e.videoTitle,this.currentClassIndex=n+1,this.videoContent=e.videoContent)}),this.reload=!1}catch{}},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,a=await l.post("/api-student/videoLesson/page",{data:{...s,videoId:this.classId}});this.loading=!1;const e=a.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 l.post("/api-student/videoLesson/evaluate",{data:{isTeacher:0,videoId:this.classId,content:this.message,studentId:c.user.data.userId}}),u("\u8BC4\u8BBA\u6210\u529F"),this.message="",setTimeout(()=>{this.onSearch()},500)}catch{}}},render(){let s,a;return t("div",{class:i["video-class-detail"]},[t(y,null,{default:()=>!this.reload&&t(I,{freeRate:Number(this.freeRate),freeTitleStatus:this.lessonPrice>0,trySee:this.trySee,src:this.srcUrl,poster:this.posterUrl,height:this.videoHeight,isBuy:!0,onBuyEmit:async()=>{if(this.lessonPrice>0){this.$router.back();return}try{const e=this.videoDetail;r.orderObject.orderType="VIDEO",r.orderObject.orderName="\u89C6\u9891\u8BFE\u8D2D\u4E70",r.orderObject.orderDesc="\u89C6\u9891\u8BFE\u8D2D\u4E70",r.orderObject.actualPrice=e.lessonPrice,r.orderObject.recomUserId="",r.orderObject.orderNo="",r.orderObject.orderList=[{orderType:"VIDEO",goodsName:"\u89C6\u9891\u8BFE\u8D2D\u4E70",courseGroupId:e.id,courseGroupName:e.lessonName,coursePrice:e.lessonPrice,teacherName:e.username||`\u6E38\u5BA2${e.teacherId||""}`,teacherId:e.teacherId,avatar:e.headUrl,relationType:e.relationType,courseInfo:this.detailList,recomUserId:""}],await A(()=>{_.alert({message:"\u9886\u53D6\u6210\u529F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"#2dc7aa"}).then(()=>{this.__init()})})}catch{}}},null)}),t(h,{border:!1,class:i.cell,title:this.title,titleClass:[i.titleInfo,"van-ellipsis"]},{icon:()=>t(C,{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]),d("/"),this.detailList.length,d("\u8BFE\u65F6")])}),t("div",{class:i.videoDesc},[this.videoContent]),t(N,{active:this.tabIndex,"onUpdate:active":e=>this.tabIndex=e,class:i.infoField,color:"var(--van-primary)",sticky:!0,offsetTop:this.offsetTop,lineWidth:20},{default:()=>[t(m,{title:"\u76EE\u5F55",name:1},{default:()=>[t("div",{style:{overflowY:"auto"}},[t(v,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},p(s=this.detailList.map((e,n)=>{const f=(e.musicAlbumInfos||[]).map(o=>({relationMusicAlbum:o.relationType,musicAlbumName:o.name,musicAlbumId:o.musicAlbumId,status:o.status,useRelationType:this.useRelationType}));return t(g,{musicAlbumInfos:f,playId:Number(this.classId),detail:{id:e.id,title:e.videoTitle,content:e.videoContent,imgUrl:e.coverUrl,videoUrl:e.videoUrl,index:n+1},onPlay:this.onPlay,onMusicAlbumDetail:o=>{if(!this.alreadyBuy&&!o.status){u("\u6570\u636E\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}o.relationMusicAlbum==="MUSIC"?this.$router.push({path:"/music-detail",query:{id:o.musicAlbumId}}):o.relationMusicAlbum==="ALBUM"&&this.$router.push({path:"/music-album-detail/"+o.musicAlbumId})}},null)}))?s:{default:()=>[s]})])]}),t(m,{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(w,{loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,onLoad:this.getList},p(a=this.list.map(e=>t(h,{class:[i["message-list"],e.isTeacher===1&&i["message-active"]],valueClass:i["message-time"]},{icon:()=>t(x,{class:i.userLogo,src:e.avatar||k,fit:"cover"},null),title:()=>t("div",{class:i.title},[t("div",{class:i["message-name"]},[e.userName]),t("div",{class:i["message-time"]},[T(e.evaluateTime).format("YYYY\u5E74MM\u6708DD\u65E5")])]),label:()=>t("div",{class:i.label},[e.content])})))?a:{default:()=>[a]}):t(L,{btnStatus:!1,tips:"\u6682\u65E0\u8BA8\u8BBA"},null)]),t("div",{class:i.messageContainer},[t(D,{placeholder:"\u5FEB\u6765\u8BA8\u8BBA\u5427\uFF5E",modelValue:this.message,"onUpdate:modelValue":e=>this.message=e},{button:()=>t(S,{type:"primary",disabled:!this.message,style:{padding:"0 20px"},size:"small",round:!0,onClick:this.onSubmit},{default:()=>[d("\u53D1\u5E03")]})})])]})]})])}});export{ue as default};