import{d as g,w as l,g as h,D as v,T as n,n as C,j as e,C as L,F as A,B as p,z as c,aR as U,Z as S}from"./index.394decd7.js";import{C as f}from"./index.360ebc13.js";import{S as d}from"./index.63f283ba.js";import{U as T}from"./index.6c72fde6.js";import{U as G}from"./index.d0a6db21.js";import{L as N}from"./index.dc786267.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as _,a as b}from"./index.ae00317c.js";import{C as w}from"./index.52a60bda.js";import{C as I}from"./index.45d094fa.js";import{L as B}from"./live-item.d72fb44d.js";import{C as M}from"./index.e6e212d8.js";import"./index.9e0d46e4.js";import"./index.ae2dd816.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"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./icon_student.c3c58354.js";import"./use-tab-status.723110ee.js";import"./use-id.e2f22365.js";import"./use-refs.09b2d19c.js";import"./code-down-load.37c8e9cc.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const D="_introduction_f64bq_1",P="_shareCourse_f64bq_9",k="_coverClass_f64bq_17";var i={"video-detail":"_video-detail_f64bq_1",introduction:D,shareCourse:P,coverClass:k};function m(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!S(a)}var ps=g({name:"VideoDetail",data(){const a=this.$route.query;return{userInfo:{},detailList:[],musicAlbumInfos:[],buyUserList:[],dataShow:!0,loading:!1,finished:!1,share:a.share,params:{videoLessonGroupId:a.groupId,page:1,rows:20},shareStatus:!1,shareUrl:"",shelvesFlag:0,myself:!1}},async mounted(){var a;try{const s=(await l.get("/api-teacher/videoLessonGroup/selectVideoLesson",{params:{groupId:this.params.videoLessonGroupId}})).data||{};h.platformType==="TEACHER"&&(this.myself=!s.myself),this.userInfo={id:s.lessonGroup.teacherId,username:s.lessonGroup.username,headUrl:s.lessonGroup.avatar,buyNum:s.lessonGroup.countStudent,lessonId:s.lessonGroup.id,lessonNum:s.lessonGroup.lessonCount,lessonName:s.lessonGroup.lessonName,lessonDesc:s.lessonGroup.lessonDesc,lessonPrice:s.lessonGroup.lessonPrice,lessonCoverUrl:s.lessonGroup.lessonCoverUrl,relationType:s.lessonGroup.relationType,lessonSubjectName:s.lessonGroup.lessonSubjectName,auditVersion:s.lessonGroup.auditVersion,isDegree:!!s.degreeFlag,isTeacher:!!s.teacherFlag,alreadyBuy:s.alreadyBuy},this.shelvesFlag=s.lessonGroup.shelvesFlag,this.detailList=s.detailList||[],this.shareUrl=`${location.origin}/teacher/#/shareVideo?recomUserId=${(a=h.user.data)==null?void 0:a.userId}&groupId=${this.params.videoLessonGroupId}&p=tenant`,!this.myself&&this.getList()}catch(r){console.log(r)}},methods:{async getList(){try{const a=this.params,r=await l.post("/api-teacher/videoLesson/pageStudent",{data:{...a}});this.loading=!1;const s=r.data||{};if(this.buyUserList.length>0&&s.pageNo===1)return;this.buyUserList=this.buyUserList.concat(s.rows||[]),this.finished=s.pageNo>=s.totalPage,this.params.page=s.pageNo+1,this.dataShow=this.buyUserList.length>0}catch{this.dataShow=!1,this.finished=!0}},onPlay(a){this.$router.push({path:"/videoClassDetail",query:{groupId:this.params.videoLessonGroupId,classId:a.id}})},async updateShelves(){v.confirm({title:"\u63D0\u793A",message:"\u786E\u8BA4\u4E0B\u67B6\u8BE5\u8BFE\u7A0B\u5417\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{await l.post("/api-teacher/videoLessonGroup/updateShelves",{data:{id:this.userInfo.lessonId,shelvesFlag:0}}),n("\u4E0B\u67B6\u6210\u529F"),setTimeout(()=>{C({api:"back"})},800)}catch{}})}},render(){let a,r,s;return e("div",{class:[i["video-detail"],"mb12"]},[e(M,null,null),this.userInfo.id&&e(T,{userInfo:this.userInfo},null),e(d,{border:!0},{default:()=>[e("p",{class:i.introduction},[this.userInfo.lessonDesc])]}),this.myself?e(d,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},m(a=this.detailList.map(o=>{const u=(o.musicAlbumInfos||[]).map(t=>({relationMusicAlbum:t.relationType,musicAlbumName:t.name,musicAlbumId:t.musicAlbumId,status:t.status,useRelationType:this.userInfo.relationType}));return e(f,{musicAlbumInfos:u,detail:{id:o.id,title:o.videoTitle,content:o.videoContent,imgUrl:o.coverUrl},onPlay:this.onPlay,onMusicAlbumDetail:t=>{if(!this.userInfo.alreadyBuy&&!t.status){n("\u6570\u636E\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}t.relationMusicAlbum==="MUSIC"?this.$router.push({path:"/music-detail",query:{id:t.musicAlbumId}}):t.relationMusicAlbum==="ALBUM"&&this.$router.push({path:"/music-album-detail/"+t.musicAlbumId})}},null)}))?a:{default:()=>[a]}):e(d,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",titleShow:!1,contentStyle:{paddingTop:"0"}},{default:()=>[e(_,{color:"var(--van-primary)",lineWidth:20,sticky:!0},{default:()=>[e(b,{title:"\u8BFE\u7A0B",titleClass:"van-hairline--bottom"},m(r=this.detailList.map(o=>{const u=(o.musicAlbumInfos||[]).map(t=>({relationMusicAlbum:t.relationType,musicAlbumName:t.name,musicAlbumId:t.musicAlbumId,status:t.status,useRelationType:this.userInfo.relationType}));return e(f,{musicAlbumInfos:u,detail:{id:o.id,title:o.videoTitle,content:o.videoContent,imgUrl:o.coverUrl},onPlay:this.onPlay,onMusicAlbumDetail:t=>{if(!this.userInfo.alreadyBuy&&!t.status){n("\u6570\u636E\u6B63\u5728\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}t.relationMusicAlbum==="MUSIC"?this.$router.push({path:"/music-detail",query:{id:t.musicAlbumId}}):t.relationMusicAlbum==="ALBUM"&&this.$router.push({path:"/music-album-detail/"+t.musicAlbumId})}},null)}))?r:{default:()=>[r]}),e(b,{title:"\u5B66\u5458\u5217\u8868",titleClass:"van-hairline--bottom"},{default:()=>[this.dataShow?e(N,{loading:this.loading,"onUpdate:loading":o=>this.loading=o,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86",onLoad:this.getList},m(s=this.buyUserList.map(o=>e(G,{class:"mb12",users:{avatar:o.avatar,studentId:o.userId,studentName:o.username,createTime:o.createTime}},null)))?s:{default:()=>[s]}):e(L,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5B66\u751F\u8D2D\u4E70"},null)]})]})]}),this.shelvesFlag===1&&e(A,null,[this.share=="1"&&this.detailList.length>0&&e(I,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(p,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[c("\u5206\u4EAB\u8BFE\u7A0B")]})])]}),this.share!="1"&&this.detailList.length>0&&e(I,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(p,{block:!0,round:!0,type:"primary",onClick:this.updateShelves},{default:()=>[c("\u4E0B\u67B6")]})])]})]),e(U,{show:this.shareStatus,"onUpdate:show":o=>this.shareStatus=o,style:{background:"transparent"}},{default:()=>[e(w,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"video"},{default:()=>[e(B,{class:i.shareCourse,coverClass:i.coverClass,liveInfo:{backgroundPic:this.userInfo.lessonCoverUrl,courseGroupId:this.userInfo.lessonId,courseGroupName:this.userInfo.lessonName,courseNum:this.userInfo.lessonNum,coursePrice:this.userInfo.lessonPrice,teacherName:this.userInfo.username,teacherId:this.userInfo.id,avatar:this.userInfo.headUrl,studentCount:this.userInfo.buyNum,existBuy:0,subjectName:this.userInfo.lessonSubjectName}},null)]})]})])}});export{ps as default};