video-detail.41c908d6.js 7.2 KB

1
  1. import{d as g,w as l,g as h,D as v,T as n,n as L,j as e,C,F as A,B as c,z as p,aR as U,Z as S}from"./index.e6d6174e.js";import{C as f}from"./index.43f63892.js";import{S as d}from"./index.884a0e76.js";import{U as T}from"./index.af98ec6d.js";import{U as G}from"./index.4fe76fee.js";import{L as N}from"./index.f904775d.js";import"./index.9093bc60.js";import"./index.b4a53c6a.js";import{T as _,a as b}from"./index.54627972.js";import{C as w}from"./index.88fe9143.js";import{C as I}from"./index.b0eda115.js";import{L as B}from"./live-item.7738586b.js";import"./index.af99cf22.js";import"./index.67c54471.js";import"./index.05f2b7dd.js";import"./bars.4f1962a6.js";import"./icon_album_active.ce98b2a8.js";import"./icon_music_active.3b316ab8.js";import"./index.4aea64de.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.e9ba8498.js";import"./use-id.f239f36f.js";import"./use-refs.eb803454.js";import"./code-down-load.3acfa024.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.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 m(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!S(a)}var ms=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}`,!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(()=>{L({api:"back"})},800)}catch{}})}},render(){let a,r,s;return e("div",{class:[i["video-detail"],"mb12"]},[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(C,{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(c,{block:!0,round:!0,type:"primary",onClick:()=>{this.shareStatus=!0}},{default:()=>[p("\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(c,{block:!0,round:!0,type:"primary",onClick:this.updateShelves},{default:()=>[p("\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{ms as default};