import{d as g,y 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 m,A as c,aS as T,$ as U}from"./ResizeObserver.es.f28023e0.js";import{C as f}from"./index.46d36266.js";import{S as d}from"./index.07a2a95f.js";import{U as S}from"./index.d9fd7ad5.js";import{U as G}from"./index.27b78462.js";import{L as N}from"./index.79f59946.js";import"./index.b0753b8c.js";import"./index.966d1893.js";import{T as _,a as y}from"./index.aa87c0e3.js";import{C as B}from"./index.b76c8ebe.js";import{C as b}from"./index.8c937010.js";import{L as w}from"./live-item.bf79c28b.js";import{C as M}from"./index.bd375ca9.js";import"./index.3b2e70c8.js";import"./index.7a1af785.js";import"./index.af901340.js";import"./bars.4f1962a6.js";import"./icon_album_active.a67a159e.js";import"./icon_music_active.5a84cf57.js";import"./index.2a22730e.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.653933d8.js";import"./use-id.cc14bbe9.js";import"./use-refs.b4f9d723.js";import"./code-down-load.7b8e3080.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";import"./index.9a41251d.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 p(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!U(a)}var cs=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,payType:s.lessonGroup.payType,type:"video",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`,console.log(this.shareUrl,"shareVideo"),!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(S,{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},p(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(y,{title:"\u8BFE\u7A0B",titleClass:"van-hairline--bottom"},p(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(y,{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},p(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(b,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(m,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[c("\u5206\u4EAB\u8BFE\u7A0B")]})])]}),this.share!="1"&&this.detailList.length>0&&e(b,{position:"bottom",background:"white"},{default:()=>[e("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[e(m,{block:!0,round:!0,type:"primary",onClick:this.updateShelves},{default:()=>[c("\u4E0B\u67B6")]})])]})]),e(T,{show:this.shareStatus,"onUpdate:show":o=>this.shareStatus=o,style:{background:"transparent"}},{default:()=>[e(B,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"video"},{default:()=>[e(w,{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,payType:this.userInfo.payType,avatar:this.userInfo.headUrl,studentCount:this.userInfo.buyNum,existBuy:0,subjectName:this.userInfo.lessonSubjectName}},null)]})]})])}});export{cs as default};