video-detail.3a7ec0f2.js 6.5 KB

1
  1. import{d as m,g as u,w as n,D as l,j as t,f as h,T as p,B as I,aR as f,Z as y}from"./index.e6d6174e.js";import{C as b}from"./index.43f63892.js";import{S as d}from"./index.884a0e76.js";import{U as g}from"./index.af98ec6d.js";import{C as v}from"./index.045f03fd.js";import{o as a,a as _}from"./orderStatus.fea01d83.js";import{t as C}from"./tradeOrder.d6463377.js";import{C as T}from"./index.b0eda115.js";import{i as U}from"./icon-share.4e09e300.js";import{C as N}from"./index.88fe9143.js";import{L as D}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"./index.d8c651bf.js";import"./use-height.8140ea04.js";import"./index.68f32c85.js";import"./index.b4a53c6a.js";import"./code-down-load.3acfa024.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const w="_introduction_wlqmz_6",P="_btnGroup_wlqmz_11",O="_btnMore_wlqmz_15",S="_videoItem_wlqmz_22",q="_shareCourse_wlqmz_28",A="_coverClass_wlqmz_36";var i={"video-detail":"_video-detail_wlqmz_1",introduction:w,btnGroup:P,btnMore:O,videoItem:S,"van-cell__title":"_van-cell__title_wlqmz_22",shareCourse:q,coverClass:A};function B(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!y(e)}var le=m({name:"VideoDetail",data(){const e=this.$route.query;return{userInfo:{},detailList:[],recomUserId:e.recomUserId,params:{groupId:e.groupId},shareStatus:!1,shareUrl:""}},async mounted(){var e,r;await this._init(),/(localhost|192)/g.test(location.origin)?this.shareUrl=`https://dev.colexiu.com/teacher#/shareVideo?recomUserId=${(e=u.user.data)==null?void 0:e.userId}&groupId=${this.params.groupId}&userType=${u.platformType}`:this.shareUrl=`${location.origin}/teacher#/shareVideo?recomUserId=${(r=u.user.data)==null?void 0:r.userId}&groupId=${this.params.groupId}&userType=${u.platformType}`},methods:{async _init(){try{const r=(await n.get("/api-student/videoLesson/selectVideoLesson",{params:{groupId:this.params.groupId}})).data||{},s=r.lessonGroup||{},c=r.teachertTag||"";this.userInfo={alreadyBuy:r.alreadyBuy,username:s.username||`\u6E38\u5BA2${s.teacherId||""}`,headUrl:s.avatar,buyNum:s.countStudent,id:s.id,lessonNum:s.lessonCount,lessonName:s.lessonName,lessonDesc:s.lessonDesc,lessonPrice:s.lessonPrice,relationType:s.relationType,teacherId:s.teacherId,lessonCoverUrl:s.lessonCoverUrl,auditVersion:s.auditVersion,isDegree:!!r.degreeFlag,isTeacher:!!r.teacherFlag},this.detailList=r.detailList||[]}catch{}},onPlay(e){this.$router.push({path:"/videoClassDetail",query:{groupId:this.params.groupId,classId:e.id}})},async onBuy(){try{const e=this.userInfo;if(a.orderObject.orderType="VIDEO",a.orderObject.orderName="\u89C6\u9891\u8BFE\u8D2D\u4E70",a.orderObject.orderDesc="\u89C6\u9891\u8BFE\u8D2D\u4E70",a.orderObject.actualPrice=e.lessonPrice,a.orderObject.recomUserId=this.recomUserId,a.orderObject.orderNo="",a.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:this.userInfo.relationType,courseInfo:this.detailList,recomUserId:this.recomUserId}],e.lessonPrice<=0){await _(()=>{l.alert({message:"\u9886\u53D6\u6210\u529F",confirmButtonText:"\u786E\u5B9A",confirmButtonColor:"#2dc7aa"}).then(()=>{this._init()})});return}const s=(await n.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"VIDEO",bizId:this.params.groupId}})).data;s?l.confirm({title:"\u63D0\u793A",message:"\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F",confirmButtonColor:"#269a93",cancelButtonText:"\u53D6\u6D88\u8BA2\u5355",confirmButtonText:"\u7EE7\u7EED\u652F\u4ED8"}).then(async()=>{C(s,this.routerTo)}).catch(()=>{l.close(),this.cancelPayment(s.orderNo)}):this.routerTo()}catch{}},routerTo(){this.$router.push({path:"/orderDetail",query:{orderType:"VIDEO",courseGroupId:this.params.groupId}})},async cancelPayment(e){try{await n.post("/api-student/userOrder/orderCancel",{data:{orderNo:e}})}catch{}}},render(){let e;return t("div",{class:[i["video-detail"]]},[t(v,null,{right:()=>t("img",{src:U,onClick:()=>this.shareStatus=!0},null)}),t(g,{userInfo:this.userInfo,onUserDetail:r=>{console.log(r),h().isApp&&u.platformType==="STUDENT"&&this.$router.push({path:"/teacherHome",query:{teacherId:r.teacherId,tabs:"video"}})}},null),t(d,{border:!1},{default:()=>[t("p",{class:i.introduction},[this.userInfo.lessonDesc])]}),t(d,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",class:"mb12",border:!1},B(e=this.detailList.map(r=>{const c=(r.musicAlbumInfos||[]).map(o=>({relationMusicAlbum:o.relationType,musicAlbumName:o.name,musicAlbumId:o.musicAlbumId,status:o.status,useRelationType:this.userInfo.relationType}));return t(b,{musicAlbumInfos:c,class:[i.videoItem],detail:{id:r.id,title:r.videoTitle,content:r.videoContent,imgUrl:r.coverUrl},onPlay:this.onPlay,onMusicAlbumDetail:o=>{if(!this.userInfo.alreadyBuy&&!o.status){p("\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)}))?e:{default:()=>[e]}),this.userInfo.id&&!this.userInfo.alreadyBuy&&t(T,{position:"bottom",background:"white"},{default:()=>[t("div",{class:["btnGroup",i.btnMore]},[t(I,{block:!0,round:!0,type:"primary",onClick:this.onBuy},{default:()=>[this.userInfo.lessonPrice<=0?"\u514D\u8D39\u9886\u53D6":"\u7ACB\u5373\u8D2D\u4E70"]})])]}),t(f,{show:this.shareStatus,"onUpdate:show":r=>this.shareStatus=r,style:{background:"transparent"}},{default:()=>[t(N,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"video"},{default:()=>[t(D,{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{le as default};