video-detail.dfde10b8.js 7.2 KB

1
  1. import{C as m}from"./index.9b67dbb3.js";import{S as l}from"./index.363c593b.js";import{U as v}from"./index.b2bac310.js";import{U as g}from"./index.cb5c1741.js";import{d as L,e as n,s as c,D as A,T as d,p as C,i as e,C as U,F as S,B as p,A as f,aT as T,$ as G}from"./index.7994470a.js";import{L as N}from"./index.ec643df3.js";import"./index.6449f9de.js";import"./index.889feca1.js";import{T as _,a as b}from"./index.a28173c9.js";import{C as B}from"./index.fdb4c454.js";import{C as I}from"./index.aaa3ed2b.js";import{L as w}from"./live-item.cdfceac6.js";import"./index.777f4790.js";import"./index.2fbdc579.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"./icon_teacher.40b6f077.js";import"./icon_timer2.5fb1750d.js";import"./icon-jiaozi.20e415ca.js";import"./icon_student.bbb32387.js";import"./use-tab-status.00d7316c.js";import"./use-id.117b75b2.js";import"./use-refs.ad5f4144.js";import"./code-down-load.acc044c4.js";import"./logo.bcac726b.js";import"./browser.8c23ea5b.js";const M="_introduction_f64bq_1",D="_shareCourse_f64bq_9",P="_coverClass_f64bq_17";var i={"video-detail":"_video-detail_f64bq_1",introduction:M,shareCourse:D,coverClass:P};function h(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!G(a)}var ds=L({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 n.get("/api-teacher/videoLessonGroup/selectVideoLesson",{params:{groupId:this.params.videoLessonGroupId}})).data||{};c.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=c.user.data)==null?void 0:a.userId}&groupId=${this.params.videoLessonGroupId}`,!this.myself&&this.getList()}catch(r){console.log(r)}},methods:{async getList(){try{const a=this.params,r=await n.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(){A.confirm({title:"\u63D0\u793A",message:"\u786E\u8BA4\u4E0B\u67B6\u8BE5\u8BFE\u7A0B\u5417\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{await n.post("/api-teacher/videoLessonGroup/updateShelves",{data:{id:this.userInfo.lessonId,shelvesFlag:0}}),d("\u4E0B\u67B6\u6210\u529F"),setTimeout(()=>{C({api:"back"})},800)}catch{}})}},render(){let a,r,s;return e("div",{class:[i["video-detail"],"mb12"]},[this.userInfo.id&&e(v,{userInfo:this.userInfo},null),e(l,{border:!0},{default:()=>[e("p",{class:i.introduction},[this.userInfo.lessonDesc])]}),this.myself?e(l,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",border:!0},h(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(m,{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){d("\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(l,{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"},h(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(m,{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){d("\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},h(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(U,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5B66\u751F\u8D2D\u4E70"},null)]})]})]}),this.shelvesFlag===1&&e(S,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:()=>[f("\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:()=>[f("\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,avatar:this.userInfo.headUrl,studentCount:this.userInfo.buyNum,existBuy:0,subjectName:this.userInfo.lessonSubjectName}},null)]})]})])}});export{ds as default};