1 |
- import{d as m,g as i,w as n,D as l,j as s,f as p,T as h,B as I,aR as f,Z as y}from"./index.394decd7.js";import{C as b}from"./index.360ebc13.js";import{S as d}from"./index.63f283ba.js";import{U as g}from"./index.6c72fde6.js";import{C as v}from"./index.e6e212d8.js";import{o as a,a as _}from"./orderStatus.535346ee.js";import{t as C}from"./tradeOrder.ba7e9856.js";import{C as T}from"./index.45d094fa.js";import{i as U}from"./icon-share.4e09e300.js";import{C as N}from"./index.52a60bda.js";import{L as D}from"./live-item.d72fb44d.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"./index.68f32c85.js";import"./index.f1b52763.js";import"./code-down-load.37c8e9cc.js";import"./logo.bcac726b.js";import"./browser.8379baf6.js";import"./html2canvas.esm.3d083717.js";const S="_introduction_wlqmz_6",w="_btnGroup_wlqmz_11",P="_btnMore_wlqmz_15",q="_videoItem_wlqmz_22",O="_shareCourse_wlqmz_28",$="_coverClass_wlqmz_36";var u={"video-detail":"_video-detail_wlqmz_1",introduction:S,btnGroup:w,btnMore:P,videoItem:q,"van-cell__title":"_van-cell__title_wlqmz_22",shareCourse:O,coverClass:$};function A(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!y(e)}var ue=m({name:"VideoDetail",data(){const e=this.$route.query;return{userInfo:{},detailList:[],recomUserId:e.recomUserId,params:{groupId:e.groupId},platform:e.p,shareStatus:!1,shareUrl:""}},computed:{platformStatus(){const e=i.user.data,r=this.$route.query;return e.tenantId>0&&r.p=="tenant"}},async mounted(){var e,r;await this._init(),/(localhost|192)/g.test(location.origin)?this.shareUrl=`https://dev.colexiu.com/teacher#/shareVideo?recomUserId=${(e=i.user.data)==null?void 0:e.userId}&groupId=${this.params.groupId}&userType=${i.platformType}&p=tenant`:this.shareUrl=`${location.origin}/teacher#/shareVideo?recomUserId=${(r=i.user.data)==null?void 0:r.userId}&groupId=${this.params.groupId}&userType=${i.platformType}&p=tenant`},methods:{async _init(){try{const r=(await n.get("/api-student/videoLesson/selectVideoLesson",{params:{groupId:this.params.groupId}})).data||{},t=r.lessonGroup||{},c=r.teachertTag||"";this.userInfo={alreadyBuy:r.alreadyBuy,username:t.username||`\u6E38\u5BA2${t.teacherId||""}`,headUrl:t.avatar,buyNum:t.countStudent,id:t.id,lessonNum:t.lessonCount,lessonName:t.lessonName,lessonDesc:t.lessonDesc,lessonPrice:t.lessonPrice,relationType:t.relationType,teacherId:t.teacherId,lessonCoverUrl:t.lessonCoverUrl,auditVersion:t.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 t=(await n.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"VIDEO",bizId:this.params.groupId}})).data;t?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(t,this.routerTo)}).catch(()=>{l.close(),this.cancelPayment(t.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 s("div",{class:[u["video-detail"]]},[s(v,null,{right:()=>s("img",{src:U,onClick:()=>this.shareStatus=!0},null)}),s(g,{userInfo:this.userInfo,onUserDetail:r=>{console.log(r),p().isApp&&i.platformType==="STUDENT"&&this.$router.push({path:"/teacherHome",query:{teacherId:r.teacherId,tabs:"video"}})}},null),s(d,{border:!1},{default:()=>[s("p",{class:u.introduction},[this.userInfo.lessonDesc])]}),s(d,{title:"\u8BFE\u7A0B\u5217\u8868",icon:"courseList",class:"mb12",border:!1},A(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 s(b,{musicAlbumInfos:c,class:[u.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){h("\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&&s(T,{position:"bottom",background:"white"},{default:()=>[s("div",{class:["btnGroup",u.btnMore]},[s(I,{block:!0,round:!0,type:"primary",onClick:this.onBuy,disabled:this.platformStatus},{default:()=>[this.userInfo.lessonPrice<=0?"\u514D\u8D39\u9886\u53D6":"\u7ACB\u5373\u8D2D\u4E70"]})])]}),s(f,{show:this.shareStatus,"onUpdate:show":r=>this.shareStatus=r,style:{background:"transparent"}},{default:()=>[s(N,{teacherId:this.userInfo.id,shareUrl:this.shareUrl,shareType:"video"},{default:()=>[s(D,{class:u.shareCourse,coverClass:u.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{ue as default};
|