group-detail-legacy.25327a9f.js 10 KB

1
  1. !function(){function e(e,r,t,n,o,a,u){try{var i=e[a](u),c=i.value}catch(s){return void t(s)}i.done?r(c):Promise.resolve(c).then(n,o)}function r(r){return function(){var t=this,n=arguments;return new Promise((function(o,a){var u=r.apply(t,n);function i(r){e(u,o,a,i,c,"next",r)}function c(r){e(u,o,a,i,c,"throw",r)}i(void 0)}))}}var t=document.createElement("style");t.innerHTML="._live-detail_1puau_1 ._introduction_1puau_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._live-detail_1puau_1 .van-tabs__wrap{margin-bottom:.4rem}._live-detail_1puau_1 .van-button--disabled{opacity:.5}._live-detail_1puau_1 ._tips_1puau_12{background-color:#fff;border-radius:.26667rem;margin:.37333rem .32rem;padding:var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding)}._live-detail_1puau_1 ._tips_1puau_12 h3{display:flex;font-size:.37333rem;font-weight:500;color:#333;line-height:1}._live-detail_1puau_1 ._tips_1puau_12 p{text-align:justify;padding-top:.24rem;font-size:.32rem;color:#7a7a7a;line-height:.61333rem}._live-detail_1puau_1 ._tips_1puau_12 .van-icon{margin-right:.16rem}._live-detail_1puau_1 ._btnMore_1puau_35{display:flex;justify-content:space-around}._live-detail_1puau_1 ._btnMore_1puau_35 .van-button{width:100%}._live-detail_1puau_1 ._shareCourse_1puau_42{margin:0;padding:.21333rem;background:#fff}._live-detail_1puau_1 ._shareCourse_1puau_42 .itemTitle{max-width:2.93333rem!important}\n",document.head.appendChild(t),System.register(["./ResizeObserver.es-legacy.44b91b4c.js","./index-legacy.4c17bd6d.js","./index-legacy.65f447aa.js","./orderStatus-legacy.12eb861d.js","./index-legacy.6ac2a941.js","./index-legacy.5d9f864a.js","./index-legacy.ffbd6cdc.js","./live-item-legacy.7dcddb96.js","./icon-share-legacy.576b0857.js","./tradeOrder-legacy.a0af1df5.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.4bad5b90.js","./index-legacy.9d5cae73.js","./code-down-load-legacy.4137246a.js","./logo-legacy.cf4b3bd2.js","./browser-legacy.da3142a2.js","./html2canvas.esm-legacy.19f9c2b7.js"],(function(e){"use strict";var t,n,o,a,u,i,c,s,d,l,f,m,p,v,h,g,_,I,b,y,x,j,T;return{setters:[function(e){t=e.d,n=e.w,o=e.g,a=e.y,u=e.n,i=e.T,c=e.D,s=e.j,d=e.f,l=e.B,f=e.A,m=e.aS},function(e){p=e.S},function(e){v=e.U},function(e){h=e.o,g=e.a},function(e){_=e.C},function(e){I=e.C},function(e){b=e.C},function(e){y=e.L},function(e){x=e.i},function(e){j=e.t},function(e){T=e.G},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var N="_live-detail_1puau_1",w="_introduction_1puau_1",U="_btnMore_1puau_35",S="_shareCourse_1puau_42";e("default",t({name:"LiveDetail",data:function(){var e=this.$route.query;return{joinRoom:e.joinRoom,recomUserId:e.recomUserId,groupId:e.groupId,courseId:e.classId,platform:e.p,live:{},shareStatus:!1,shareUrl:""}},computed:{userInfo:function(){var e,r,t=this.live,o=t.planList||[],a=(null===(e=o[0])||void 0===e?void 0:e.startTime)||new Date,u=(null===(r=o[0])||void 0===r?void 0:r.endTime)||new Date,i=t.maxStudentNum||0-t.studentCount||0;return{avatar:t.avatar,headUrl:t.avatar,username:t.userName||"游客".concat(t.teacherId||""),id:t.teacherId,startTime:"".concat(n(a).format("YYYY-MM-DD")," ").concat(n(a).format("HH:mm"),"~").concat(n(u).format("HH:mm"))||"",buyNum:t.studentCount,type:"group",lessonId:t.courseGroupId,lessonPrice:t.coursePrice,lessonNum:t.courseNum,mixStudentNum:i>0?i:0,lessonDesc:t.courseIntroduce,lessonCoverUrl:t.backgroundPic||t.backgroundPicTemplate,lessonName:t.courseGroupName,subjectName:t.subjectName,courseStartTime:t.courseStartTime,auditVersion:t.auditVersion||0,isDegree:!!t.degreeFlag,isTeacher:!!t.teacherFlag}},platformStatus:function(){var e=o.user.data,r=this.$route.query;return e.tenantId>0&&"tenant"==r.p},courseInfo:function(){var e=[],r=this.live;return(this.live.planList||[]).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,roomUid:t.roomUid,teacherName:r.teacherName,subjectName:r.subjectName,liveState:t.liveState,id:t.courseId})})),e||[]},salesEndDate:function(){var e=this.live;return n(e.salesEndDate||new Date).format("YYYY-MM-DD")},liveStatus:function(){var e=this,r=this.live.planList||[],t={status:!1,liveStatus:0,roomUid:""};return r.forEach((function(r){r.courseId===Number(e.courseId)&&(t.status=!0,t.liveStatus=r.liveStatus,t.roomUid=r.roomUid)})),t}},mounted:function(){var e=this;return r(regeneratorRuntime.mark((function r(){var t,n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e._init();case 2:/(localhost|192)/g.test(location.origin)?e.shareUrl="https://dev.colexiu.com/teacher/#/shareGroup?recomUserId=".concat(null===(t=o.user.data)||void 0===t?void 0:t.userId,"&groupId=").concat(e.groupId,"&userType=").concat(o.platformType,"&p=tenant"):e.shareUrl="".concat(location.origin,"/teacher/#/shareGroup?recomUserId=").concat(null===(n=o.user.data)||void 0===n?void 0:n.userId,"&groupId=").concat(e.groupId,"&userType=").concat(o.platformType,"&p=tenant");case 3:case"end":return r.stop()}}),r)})))()},methods:{_init:function(){var e=this;return r(regeneratorRuntime.mark((function r(){var t;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,a.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{groupId:e.groupId}});case 3:t=r.sent,e.live=t.data||{},console.log(e.live,"list"),r.next=10;break;case 8:r.prev=8,r.t0=r.catch(0);case 10:case"end":return r.stop()}}),r,null,[[0,8]])})))()},onJoinRoom:function(){var e=this;return r(regeneratorRuntime.mark((function r(){var t,n,o,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,a.get("/api-student/courseGroup/queryLiveCourseInfo",{params:{courseType:"GROUP",groupId:e.groupId}});case 3:t=r.sent,n=t.data||{},o=n.planList||[],c={},o.forEach((function(r){r.courseId===Number(e.courseId)&&(c=r)})),c&&1===c.liveState?u({api:"joinLiveRoom",content:{roomId:c.roomUid,teacherId:e.live.teacherId}}):c&&2===c.liveState?setTimeout((function(){i("课程已结束")}),100):setTimeout((function(){i("课程尚未开始,请耐心等候")}),100),r.next=13;break;case 11:r.prev=11,r.t0=r.catch(0);case 13:case"end":return r.stop()}}),r,null,[[0,11]])})))()},initLive:function(){var e=this.live;h.orderObject.orderType="GROUP",h.orderObject.orderName="小组课购买",h.orderObject.orderDesc="小组课购买",h.orderObject.actualPrice=e.coursePrice,h.orderObject.recomUserId=this.recomUserId,h.orderObject.orderNo="",h.orderObject.orderList=[{orderType:"GROUP",goodsName:"小组课购买",courseGroupId:e.courseGroupId,courseGroupName:e.courseGroupName,coursePrice:e.coursePrice,price:e.coursePrice,teacherName:e.userName||"游客".concat(e.teacherId||""),teacherId:e.teacherId,avatar:e.avatar,courseInfo:this.courseInfo,recomUserId:this.recomUserId}]},onBuy:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(e.live.coursePrice<=0)){t.next=7;break}return e.initLive(),t.next=6,g((function(){c.alert({message:"领取成功",confirmButtonText:"确定",confirmButtonColor:"#2dc7aa"}).then((function(){e._init()}))}));case 6:return t.abrupt("return");case 7:return t.next=9,a.post("/api-student/userOrder/getPendingOrder",{data:{goodType:"GROUP",bizId:e.groupId}});case 9:n=t.sent,(o=n.data)?c.confirm({title:"提示",message:"您有一个未支付的订单,是否继续支付?",confirmButtonColor:"#269a93",cancelButtonText:"取消订单",confirmButtonText:"继续支付"}).then(r(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:j(o,e.routerTo);case 1:case"end":return r.stop()}}),r)})))).catch((function(){c.close(),e.cancelPayment(o.orderNo)})):(e.initLive(),e.routerTo()),t.next=16;break;case 14:t.prev=14,t.t0=t.catch(0);case 16:case"end":return t.stop()}}),t,null,[[0,14]])})))()},routerTo:function(){var e=this.live;this.$router.push({path:"/orderDetail",query:{orderType:"GROUP",courseGroupId:e.courseGroupId}})},cancelPayment:function(e){return r(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,a.post("/api-student/userOrder/orderCancel",{data:{orderNo:e}});case 3:r.next=7;break;case 5:r.prev=5,r.t0=r.catch(0);case 7:case"end":return r.stop()}}),r,null,[[0,5]])})))()}},render:function(){var e=this;return s("div",{class:[N,"mb12"]},[s(_,null,{right:function(){return s("img",{src:x,onClick:function(){return e.shareStatus=!0}},null)}}),s(v,{userInfo:this.userInfo,showBuy:!0,onUserDetail:function(r){"STUDENT"===o.platformType&&d().isApp&&e.$router.push({path:"/teacherHome",query:{teacherId:r.id,tabs:"live"}})}},null),s(p,{border:!0},{default:function(){return[s("p",{class:w},[e.userInfo.lessonDesc])]}}),this.courseInfo.length>0&&s(T,{courseInfo:this.courseInfo,courseId:Number(this.courseId)||0},null),this.courseInfo.length>0&&1!==this.live.existBuy&&2!==this.live.existBuy&&s(I,{position:"bottom",background:"white"},{default:function(){return[s("div",{class:["btnGroup",U]},[s(l,{block:!0,round:!0,type:"primary",onClick:e.onBuy,disabled:e.platformStatus},{default:function(){return[e.live.coursePrice<=0?"免费领取":"立即购买"]}})])]}}),"1"==this.joinRoom&&2!==this.liveStatus.liveStatus&&s(I,{position:"bottom",background:"white"},{default:function(){return[s("div",{class:["btnGroup"],style:{paddingTop:"12px"}},[s(l,{block:!0,round:!0,type:"primary",onClick:e.onJoinRoom},{default:function(){return[f("进入直播间")]}})])]}}),s(m,{show:this.shareStatus,"onUpdate:show":function(r){return e.shareStatus=r},style:{background:"transparent"}},{default:function(){return[s(b,{teacherId:e.userInfo.id,shareUrl:e.shareUrl,shareType:"live"},{default:function(){return[s(y,{class:S,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)]}})]}})])}}))}}}))}();