live-detail-legacy.b5a4db13.js 8.3 KB

1
  1. !function(){function e(e,t,n,r,o,a,u){try{var s=e[a](u),i=s.value}catch(c){return void n(c)}s.done?t(i):Promise.resolve(i).then(r,o)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(o,a){var u=t.apply(n,r);function s(t){e(u,o,a,s,i,"next",t)}function i(t){e(u,o,a,s,i,"throw",t)}s(void 0)}))}}var n=document.createElement("style");n.innerHTML="._live-detail_1bpz3_1 ._introduction_1bpz3_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._live-detail_1bpz3_1 .van-tabs__wrap{margin-bottom:.4rem}._live-detail_1bpz3_1 ._shareCourse_1bpz3_9{margin:0;padding:.21333rem;background:#fff}._live-detail_1bpz3_1 ._shareCourse_1bpz3_9 .itemTitle{max-width:2.93333rem!important}\n",document.head.appendChild(n),System.register(["./index-legacy.b903c881.js","./index-legacy.14d3c1e7.js","./index-legacy.147431b7.js","./index-legacy.2eb3e4dd.js","./index-legacy.db0ec8a3.js","./index-legacy.fd2fff34.js","./index-legacy.6b8d5fc3.js","./live-item-legacy.c58b4598.js","./index-legacy.8abefd50.js","./index-legacy.ae2ce69e.js","./index-legacy.ba78f33e.js","./index-legacy.885c229f.js","./index-legacy.033ce0ab.js","./plyr-legacy.180f4c53.js","./index-legacy.b7f666cc.js","./index-legacy.5907f1a9.js","./index-legacy.5b93d63d.js","./icon_teacher-legacy.42ba77b1.js","./icon_timer2-legacy.b6c78faa.js","./icon-jiaozi-legacy.dd5ed0e2.js","./icon_student-legacy.49eef9e9.js","./code-down-load-legacy.162151e4.js","./logo-legacy.cf4b3bd2.js","./browser-legacy.869507ab.js","./html2canvas.esm-legacy.19f9c2b7.js","./use-id-legacy.29724920.js","./use-tab-status-legacy.a19d344b.js","./use-refs-legacy.14daae14.js"],(function(e){"use strict";var n,r,o,a,u,s,i,c,l,d,f,m,p,v,h,g,b,I,y,j,_,x;return{setters:[function(e){n=e.d,r=e.u,o=e.w,a=e.g,u=e.n,s=e.T,i=e.j,c=e.C,l=e.F,d=e.B,f=e.z,m=e.aR},function(e){p=e.C},function(e){v=e.S},function(e){h=e.U},function(e){g=e.U},function(e){b=e.C},function(e){I=e.C},function(e){y=e.L},function(){},function(){},function(e){j=e.T,_=e.a},function(e){x=e.C},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var T="_live-detail_1bpz3_1",S="_introduction_1bpz3_1",C="_shareCourse_1bpz3_9";e("default",n({name:"LiveDetail",data:function(){var e=this.$route.query;return{share:e.share,joinRoom:e.joinRoom,groupId:e.groupId,courseId:e.classId,live:{},shareStatus:!1,shareUrl:"",myself:!1}},computed:{userInfo:function(){var e,t,n=this.live,o=n.planList||[],a=(null===(e=o[0])||void 0===e?void 0:e.startTime)||new Date,u=(null===(t=o[0])||void 0===t?void 0:t.endTime)||new Date;return{headUrl:n.avatar,avatar:n.avatar,username:n.userName,id:n.teacherId,startTime:"".concat(r(a).format("YYYY-MM-DD")," ").concat(r(a).format("HH:mm"),"~").concat(r(u).format("HH:mm"))||"",lessonPrice:n.coursePrice,buyNum:n.studentCount||0,lessonId:n.courseGroupId,lessonNum:n.courseNum||0,lessonDesc:n.courseIntroduce,lessonCoverUrl:n.backgroundPic||n.backgroundPicTemplate,lessonName:n.courseGroupName,subjectName:n.subjectName,courseStartTime:n.courseStartTime,auditVersion:n.auditVersion||0,isDegree:!!n.degreeFlag,isTeacher:!!n.teacherFlag}},courseInfo:function(){var e=[];return(this.live.planList||[]).forEach((function(t){var n=t.startTime||new Date,o=t.endTime||new Date;e.push({courseTime:"".concat(r(n).format("YYYY-MM-DD")," ").concat(r(n).format("HH:mm"),"~").concat(r(o).format("HH:mm")),coursePlan:t.plan,roomUid:t.roomUid,liveState:t.liveState,id:t.courseId})})),e||[]},liveStatus:function(){var e=this,t=this.live.planList||[],n={status:!1,liveStatus:0,roomUid:""};return t.forEach((function(t){t.courseId===Number(e.courseId)&&(n.status=!0,n.liveStatus=t.liveStatus,n.roomUid=t.roomUid)})),n},studentList:function(){return this.live.studentList||[]},courseOffStatus:function(){var e=this.live,t=!1;return("APPLY"===e.status&&0===e.studentList.length||"NOT_SALE"===e.status)&&(t=!0),t}},mounted:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.get("/api-teacher/courseGroup/queryLiveCourseInfo",{params:{groupId:e.groupId}});case 3:r=t.sent,e.live=r.data||{},"TEACHER"===a.platformType&&(e.myself=!r.data.myself),e.shareUrl="".concat(location.origin,"/teacher/#/shareLive?recomUserId=").concat(null===(n=a.user.data)||void 0===n?void 0:n.userId,"&groupId=").concat(e.groupId,"&p=tenant"),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])})))()},methods:{onJoinRoom:function(){var e=this;return t(regeneratorRuntime.mark((function t(){var n,r,a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.get("/api-teacher/courseGroup/queryLiveCourseInfo",{params:{groupId:e.groupId}});case 3:n=t.sent,r=n.data||{},a=r.planList||[],i={},a.forEach((function(t){t.courseId===Number(e.courseId)&&(i=t)})),i&&1===i.liveState?u({api:"joinLiveRoom",content:{roomId:i.roomUid,teacherId:e.live.teacherId}}):i&&2===i.liveState?setTimeout((function(){s("课程已结束")}),100):setTimeout((function(){s("课程尚未开始,请耐心等候")}),100),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(0);case 13:case"end":return t.stop()}}),t,null,[[0,11]])})))()},cancelCourseGroup:function(){var e=this;return t(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.get("/api-teacher/courseGroup/cancelCourseGroup",{params:{groupId:e.groupId}});case 3:s("取消课程成功"),setTimeout((function(){u({api:"back",content:{}})}),500),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})))()}},render:function(){var e=this;return i("div",{class:[T,"mb12"]},[i(x,null,null),i(h,{userInfo:this.userInfo},null),i(v,{border:!0},{default:function(){return[i("p",{class:S},[e.userInfo.lessonDesc])]}}),this.myself?i(v,{title:"课程列表",icon:"courseList",border:!0},{default:function(){return[i(p,{courseInfo:e.courseInfo,courseId:Number(e.courseId)||0},null)]}}):i(v,{title:"课程列表",icon:"courseList",titleShow:!1,contentStyle:{paddingTop:"0"}},{default:function(){return[i(j,{color:"var(--van-primary)",lineWidth:20,sticky:!0},{default:function(){return[i(_,{title:"课程",titleClass:"van-hairline--bottom"},{default:function(){return[i(p,{courseInfo:e.courseInfo,courseId:Number(e.courseId)||0},null)]}}),i(_,{title:"学员列表",titleClass:"van-hairline--bottom"},{default:function(){return[e.studentList.map((function(e){return i(g,{class:"mb12",users:{avatar:e.avatar,studentId:e.studentId,studentName:e.userName,createTime:e.createTime}},null)})),0===e.studentList.length&&i(c,{tips:"暂无购买学员",classImgSize:"SMALL",btnStatus:!1},null)]}})]}})]}}),"OUT_SALE"!==this.live.status&&i(l,null,[this.courseOffStatus&&i(I,{position:"bottom",background:"white"},{default:function(){return[i("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[i(d,{block:!0,round:!0,type:"primary",onClick:e.cancelCourseGroup},{default:function(){return[f("取消课程")]}})])]}}),"1"==this.joinRoom&&2!==this.liveStatus.liveStatus&&i(I,{position:"bottom",background:"white"},{default:function(){return[i("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[i(d,{block:!0,round:!0,type:"primary",onClick:e.onJoinRoom},{default:function(){return[f("进入直播间")]}})])]}}),"1"==this.share&&this.courseInfo.length>0&&i(I,{position:"bottom",background:"white"},{default:function(){return[i("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[i(d,{block:!0,round:!0,type:"primary",onClick:function(){e.shareStatus=!0}},{default:function(){return[f("分享")]}})])]}})]),i(m,{show:this.shareStatus,"onUpdate:show":function(t){return e.shareStatus=t},style:{background:"transparent"}},{default:function(){return[i(b,{teacherId:e.userInfo.id,shareUrl:e.shareUrl,shareType:"live"},{default:function(){return[i(y,{class:C,liveInfo:{backgroundPic:e.userInfo.lessonCoverUrl,courseGroupId:e.userInfo.lessonId,courseGroupName:e.userInfo.lessonName,courseNum:e.userInfo.lessonNum,coursePrice:e.userInfo.lessonPrice,teacherName:e.userInfo.username,teacherId:e.userInfo.id,avatar:e.userInfo.avatar,studentCount:e.userInfo.buyNum,courseStartTime:e.userInfo.courseStartTime,existBuy:0,subjectName:e.userInfo.subjectName}},null)]}})]}})])}}))}}}))}();