group-detail-legacy.3dcfa92a.js 7.0 KB

1
  1. !function(){function e(e,t,r,n,o,a,u){try{var s=e[a](u),i=s.value}catch(c){return void r(c)}s.done?t(i):Promise.resolve(i).then(n,o)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(o,a){var u=t.apply(r,n);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 r=document.createElement("style");r.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(r),System.register(["./ResizeObserver.es-legacy.44b91b4c.js","./index-legacy.4c17bd6d.js","./index-legacy.65f447aa.js","./index-legacy.ffbd6cdc.js","./index-legacy.5d9f864a.js","./live-item-legacy.7dcddb96.js","./index-legacy.6ac2a941.js","./index-legacy.3e0c4738.js","./index-legacy.c8c5bc4e.js","./index-legacy.7ce7fe04.js","./index-legacy.4be048cf.js","./icon_teacher-legacy.42ba77b1.js","./icon_timer2-legacy.b6c78faa.js","./index-legacy.9d5cae73.js","./code-down-load-legacy.4137246a.js","./logo-legacy.cf4b3bd2.js","./browser-legacy.da3142a2.js","./html2canvas.esm-legacy.19f9c2b7.js","./index-legacy.4bad5b90.js"],(function(e){"use strict";var r,n,o,a,u,s,i,c,d,l,f,m,p,v,h,g,b,I;return{setters:[function(e){r=e.d,n=e.w,o=e.y,a=e.g,u=e.n,s=e.T,i=e.j,c=e.F,d=e.B,l=e.A,f=e.aS},function(e){m=e.S},function(e){p=e.U},function(e){v=e.C},function(e){h=e.C},function(e){g=e.L},function(e){b=e.C},function(e){I=e.G},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var y="_live-detail_1bpz3_1",_="_introduction_1bpz3_1",j="_shareCourse_1bpz3_9";e("default",r({name:"GroupDetail",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,r=this.live,o=r.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,s=r.maxStudentNum||0-r.studentCount||0;return{headUrl:r.avatar,avatar:r.avatar,username:r.userName,id:r.teacherId,startTime:"".concat(n(a).format("YYYY-MM-DD")," ").concat(n(a).format("HH:mm"),"~").concat(n(u).format("HH:mm"))||"",lessonPrice:r.coursePrice,buyNum:r.studentCount||0,type:"group",mixStudentNum:s>0?s:0,lessonId:r.courseGroupId,lessonNum:r.courseNum||0,lessonDesc:r.courseIntroduce,lessonCoverUrl:r.backgroundPic||r.backgroundPicTemplate,lessonName:r.courseGroupName,subjectName:r.subjectName,courseStartTime:r.courseStartTime,auditVersion:r.auditVersion||0,isDegree:!!r.degreeFlag,isTeacher:!!r.teacherFlag}},courseInfo:function(){var e=[],t=this.live.planList||[],r=this.live;return t.forEach((function(t){var o=t.startTime||new Date,a=t.endTime||new Date;e.push({courseTime:"".concat(n(o).format("YYYY-MM-DD")," ").concat(n(o).format("HH:mm"),"~").concat(n(a).format("HH:mm")),coursePlan:t.plan,teacherName:r.teacherName,subjectName:r.subjectName,roomUid:t.roomUid,liveState:t.liveState,id:t.courseId})})),e||[]},liveStatus:function(){var e=this,t=this.live.planList||[],r={status:!1,liveStatus:0,roomUid:""};return t.forEach((function(t){t.courseId===Number(e.courseId)&&(r.status=!0,r.liveStatus=t.liveStatus,r.roomUid=t.roomUid)})),r},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 r,n;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,e.live=n.data||{},"TEACHER"===a.platformType&&(e.myself=!n.data.myself),e.shareUrl="".concat(location.origin,"/teacher/#/shareLive?recomUserId=").concat(null===(r=a.user.data)||void 0===r?void 0:r.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 r,n,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:r=t.sent,n=r.data||{},a=n.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:[y,"mb12"]},[i(b,null,null),i(p,{userInfo:this.userInfo},null),i(m,{border:!0},{default:function(){return[i("p",{class:_},[e.userInfo.lessonDesc])]}}),i(I,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null),"OUT_SALE"!==this.live.status&&i(c,null,[this.courseOffStatus&&i(h,{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[l("取消课程")]}})])]}}),"1"==this.joinRoom&&2!==this.liveStatus.liveStatus&&i(h,{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[l("进入直播间")]}})])]}})]),i(f,{show:this.shareStatus,"onUpdate:show":function(t){return e.shareStatus=t},style:{background:"transparent"}},{default:function(){return[i(v,{teacherId:e.userInfo.id,shareUrl:e.shareUrl,shareType:"live"},{default:function(){return[i(g,{class:j,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)]}})]}})])}}))}}}))}();