;(function(){function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}var __vite_style__=document.createElement('style');__vite_style__.innerHTML="._live-detail_1aqns_1 ._introduction_1aqns_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._live-detail_1aqns_1 .van-tabs__wrap{margin-bottom:.4rem}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.908133b4.js','./index-legacy.965b97e0.js','./index-legacy.97dc5dc2.js','./index-legacy.93c7e066.js','./index-legacy.ebe81e45.js','./vendor-legacy.c3310871.js','./index-legacy.f25f109a5.js','./index-legacy.637f35563.js','./index-legacy.637f35564.js','./index-legacy.f25f109a4.js','./icon_video_stop-legacy.6dbf3c96.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a9.js','./icon_teacher-legacy.00e7cdce.js','./icon_timer2-legacy.90431d1a.js','./icon_student-legacy.45be2fa9.js'],function(exports){'use strict';var CoursePlanStep,SectionDetail,UserDetail,UserList,state,request,postMessage,ColResult,defineComponent,dayjs,Toast,createVNode,Tabs,Tab,Sticky,Button,createTextVNode;return{setters:[function(module){CoursePlanStep=module.C;},function(module){SectionDetail=module.S;},function(module){UserDetail=module.U;},function(module){UserList=module.U;},function(module){state=module.s;request=module.r;postMessage=module.p;ColResult=module.C;},function(module){defineComponent=module.d;dayjs=module.g;Toast=module.T;createVNode=module.a;Tabs=module.G;Tab=module.H;Sticky=module.S;Button=module.B;createTextVNode=module.j;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var introduction="_introduction_1aqns_1";var styles={"live-detail":"_live-detail_1aqns_1",introduction:introduction};var liveDetail=exports('default',defineComponent({name:'LiveDetail',data:function data(){var query=this.$route.query;return{joinRoom:query.joinRoom,groupId:query.groupId,courseId:query.classId,live:{}};},computed:{userInfo:function userInfo(){var _planList$,_planList$2,_state$user$data,_state$user$data2,_state$user$data3;var live=this.live;var planList=live.planList||[];var startTime=((_planList$=planList[0])===null||_planList$===void 0?void 0:_planList$.startTime)||new Date();var endTime=((_planList$2=planList[0])===null||_planList$2===void 0?void 0:_planList$2.endTime)||new Date();return{headUrl:(_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.heardUrl,username:((_state$user$data2=state.user.data)===null||_state$user$data2===void 0?void 0:_state$user$data2.username)||"\u6E38\u5BA2".concat(((_state$user$data3=state.user.data)===null||_state$user$data3===void 0?void 0:_state$user$data3.userId)||''),startTime:"".concat(dayjs(startTime).format('YYYY-MM-DD')," ").concat(dayjs(startTime).format('HH:mm'),"~").concat(dayjs(endTime).format('HH:mm'))||'',lessonPrice:live.coursePrice,buyNum:live.studentCount||0,lessonDesc:live.courseIntroduce,lessonCoverUrl:live.backgroundPic||live.backgroundPicTemplate,lessonName:live.courseGroupName};},courseInfo:function courseInfo(){var tempArr=[];var coursePlanList=this.live.planList||[];coursePlanList.forEach(function(item){var startTime=item.startTime||new Date();var endTime=item.endTime||new Date();tempArr.push({courseTime:"".concat(dayjs(startTime).format('YYYY-MM-DD')," ").concat(dayjs(startTime).format('HH:mm'),"~").concat(dayjs(endTime).format('HH:mm')),coursePlan:item.plan,id:item.courseId});});return tempArr||[];},liveStatus:function liveStatus(){var _this=this;var coursePlanList=this.live.planList||[];var tempObj={status:false,roomUid:''};coursePlanList.forEach(function(item){if(item.courseId===Number(_this.courseId)){tempObj.status=true;tempObj.roomUid=item.roomUid;}});return tempObj;},studentList:function studentList(){var live=this.live;return live.studentList||[];},courseOffStatus:function courseOffStatus(){var live=this.live;var status=false;if(live.status==='APPLY'&&live.studentList.length===0||live.status==='NOT_SALE'){status=true;}return status;}},mounted:function mounted(){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var res;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return request.get('/api-teacher/courseGroup/queryLiveCourseInfo',{params:{groupId:_this2.groupId}});case 3:res=_context.sent;console.log(res);_this2.live=res.data||{};console.log(_this2.live);_context.next=11;break;case 9:_context.prev=9;_context.t0=_context["catch"](0);case 11:case"end":return _context.stop();}}},_callee,null,[[0,9]]);}))();},methods:{cancelCourseGroup:function cancelCourseGroup(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var res;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=3;return request.get('/api-teacher/courseGroup/cancelCourseGroup',{params:{groupId:_this3.groupId}});case 3:res=_context2.sent;Toast('下架成功');setTimeout(function(){postMessage({api:'back',content:{}});},500);_context2.next=10;break;case 8:_context2.prev=8;_context2.t0=_context2["catch"](0);case 10:case"end":return _context2.stop();}}},_callee2,null,[[0,8]]);}))();}},render:function render(){var _this4=this;return createVNode("div",{"class":[styles['live-detail'],'mb12']},[createVNode(UserDetail,{"userInfo":this.userInfo},null),createVNode(SectionDetail,null,{default:function _default(){return[createVNode("p",{"class":styles.introduction},[_this4.userInfo.lessonDesc])];}}),createVNode(SectionDetail,{"title":"课程列表","icon":"courseList","titleShow":false,"contentStyle":{paddingTop:'0'}},{default:function _default(){return[createVNode(Tabs,{"color":"var(--van-primary)","lineWidth":20,"sticky":true},{default:function _default(){return[createVNode(Tab,{"title":"课程","titleClass":"van-hairline--bottom"},{default:function _default(){return[createVNode(CoursePlanStep,{"courseInfo":_this4.courseInfo,"courseId":Number(_this4.courseId)||0},null)];}}),createVNode(Tab,{"title":"学员列表","titleClass":"van-hairline--bottom"},{default:function _default(){return[_this4.studentList.map(function(item){return createVNode(UserList,{"class":"mb12","users":{avatar:item.avatar,studentId:item.studentId,studentName:item.userName,createTime:item.createTime}},null);}),_this4.studentList.length===0&&createVNode(ColResult,{"tips":"暂无购买学员","classImgSize":"SMALL","btnStatus":false},null)];}})];}})];}}),this.courseOffStatus&&createVNode(Sticky,{"offsetBottom":0,"position":"bottom"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":_this4.cancelCourseGroup},{default:function _default(){return[createTextVNode("\u4E0B\u67B6")];}})])];}}),this.joinRoom=='1'&&createVNode(Sticky,{"offsetBottom":0,"position":"bottom"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":function onClick(){postMessage({api:'joinLiveRoom',content:{roomId:_this4.liveStatus.roomUid,teacherId:_this4.live.teacherId}});}},{default:function _default(){return[createTextVNode("\u8FDB\u5165\u76F4\u64AD\u95F4")];}})])];}})]);}}));}};});})();