1234 |
- ;(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_xq4ge_1 ._introduction_xq4ge_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._live-detail_xq4ge_1 .van-tabs__wrap{margin-bottom:.4rem}._live-detail_xq4ge_1 ._shareCourse_xq4ge_9{margin:1.06667rem 0 0;padding:0;background:transparent}._live-detail_xq4ge_1 ._shareCourse_xq4ge_9 .itemTitle{max-width:3.2rem!important}\n";document.head.appendChild(__vite_style__);System.register(['./index-legacy.477e6810.js','./index-legacy.51c32d39.js','./index-legacy.0a729531.js','./index-legacy.29377f48.js','./index-legacy.a46cdcf2.js','./index-legacy.534fd478.js','./index-legacy.c4ceaaef.js','./live-item-legacy.90505708.js','./vendor-legacy.85605a93.js','./index-legacy.f25f109a5.js','./index-legacy.637f35562.js','./index-legacy.637f35563.js','./index-legacy.e4e58e1c.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a10.js','./icon_teacher-legacy.42ba77b1.js','./icon_timer2-legacy.b6c78faa.js','./icon_student-legacy.45be2fa9.js','./browser-legacy.5a92c2a9.js'],function(exports){'use strict';var CoursePlanStep,SectionDetail,UserDetail,UserList,request,state,postMessage,ColResult,ColShare,ColSticky,LiveItem,defineComponent,dayjs,Toast,createVNode,Tabs,Tab,Button,createTextVNode,Popup;return{setters:[function(module){CoursePlanStep=module.C;},function(module){SectionDetail=module.S;},function(module){UserDetail=module.U;},function(module){UserList=module.U;},function(module){request=module.r;state=module.s;postMessage=module.p;ColResult=module.C;},function(module){ColShare=module.C;},function(module){ColSticky=module.C;},function(module){LiveItem=module.L;},function(module){defineComponent=module.d;dayjs=module.g;Toast=module.T;createVNode=module.a;Tabs=module.G;Tab=module.H;Button=module.B;createTextVNode=module.j;Popup=module.P;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var introduction="_introduction_xq4ge_1";var shareCourse="_shareCourse_xq4ge_9";var styles={"live-detail":"_live-detail_xq4ge_1",introduction:introduction,shareCourse:shareCourse};var liveDetail=exports('default',defineComponent({name:'LiveDetail',data:function data(){var query=this.$route.query;return{share:query.share,joinRoom:query.joinRoom,// 原生传递过来的参数,判断是否进入直播间
- groupId:query.groupId,courseId:query.classId,live:{},shareStatus:false,shareUrl:''};},computed:{userInfo:function userInfo(){var _planList$,_planList$2;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:live.avatar,avatar:live.avatar,username:live.userName,id:live.teacherId,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,lessonId:live.courseGroupId,lessonNum:live.courseNum||0,// 课时数
- lessonDesc:live.courseIntroduce,lessonCoverUrl:live.backgroundPic||live.backgroundPicTemplate,lessonName:live.courseGroupName,subjectName:live.subjectName,courseStartTime:live.courseStartTime};},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,roomUid:item.roomUid,liveState:item.liveState,id:item.courseId});});return tempArr||[];},liveStatus:function liveStatus(){var _this=this;var coursePlanList=this.live.planList||[];var tempObj={status:false,liveStatus:0,roomUid:''};coursePlanList.forEach(function(item){if(item.courseId===Number(_this.courseId)){tempObj.status=true;tempObj.liveStatus=item.liveStatus;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 _state$user$data,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;_this2.live=res.data||{};_this2.shareUrl="".concat(location.origin,"/teacher/#/shareLive?recomUserId=").concat((_state$user$data=state.user.data)===null||_state$user$data===void 0?void 0:_state$user$data.userId,"&groupId=").concat(_this2.groupId);// console.log(this.live)
- _context.next=10;break;case 8:_context.prev=8;_context.t0=_context["catch"](0);case 10:case"end":return _context.stop();}}},_callee,null,[[0,8]]);}))();},methods:{onJoinRoom:function onJoinRoom(){var _this3=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){var res,result,coursePlanList,tempObj;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/queryLiveCourseInfo',{params:{groupId:_this3.groupId}});case 3:res=_context2.sent;result=res.data||{};coursePlanList=result.planList||[];tempObj={};coursePlanList.forEach(function(item){if(item.courseId===Number(_this3.courseId)){tempObj=item;}});if(tempObj&&tempObj.liveState===1){postMessage({api:'joinLiveRoom',content:{roomId:tempObj.roomUid,teacherId:_this3.live.teacherId}});}else if(tempObj&&tempObj.liveState===2){setTimeout(function(){Toast('课程已结束');},100);}else{setTimeout(function(){Toast('课程尚未开始,请耐心等候');},100);}_context2.next=13;break;case 11:_context2.prev=11;_context2.t0=_context2["catch"](0);case 13:case"end":return _context2.stop();}}},_callee2,null,[[0,11]]);}))();},cancelCourseGroup:function cancelCourseGroup(){var _this4=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=3;return request.get('/api-teacher/courseGroup/cancelCourseGroup',{params:{groupId:_this4.groupId}});case 3:Toast('下架成功');setTimeout(function(){postMessage({api:'back',content:{}});},500);_context3.next=9;break;case 7:_context3.prev=7;_context3.t0=_context3["catch"](0);case 9:case"end":return _context3.stop();}}},_callee3,null,[[0,7]]);}))();}},render:function render(){var _this5=this;return createVNode("div",{"class":[styles['live-detail'],'mb12']},[createVNode(UserDetail,{"userInfo":this.userInfo},null),createVNode(SectionDetail,{"border":true},{default:function _default(){return[createVNode("p",{"class":styles.introduction},[_this5.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":_this5.courseInfo,"courseId":Number(_this5.courseId)||0},null)];}}),createVNode(Tab,{"title":"学员列表","titleClass":"van-hairline--bottom"},{default:function _default(){return[_this5.studentList.map(function(item){return createVNode(UserList,{"class":"mb12","users":{avatar:item.avatar,studentId:item.studentId,studentName:item.userName,createTime:item.createTime}},null);}),_this5.studentList.length===0&&createVNode(ColResult,{"tips":"暂无购买学员","classImgSize":"SMALL","btnStatus":false},null)];}})];}})];}}),this.courseOffStatus&&createVNode(ColSticky,{"position":"bottom"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":_this5.cancelCourseGroup},{default:function _default(){return[createTextVNode("\u4E0B\u67B6")];}})])];}}),this.joinRoom=='1'&&this.liveStatus.liveStatus!==2&&createVNode(ColSticky,{"position":"bottom"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":_this5.onJoinRoom},{default:function _default(){return[createTextVNode("\u8FDB\u5165\u76F4\u64AD\u95F4")];}})])];}}),this.share=='1'&&this.courseInfo.length>0&&createVNode(ColSticky,{"position":"bottom"},{default:function _default(){return[createVNode("div",{"class":['btnGroup'],"style":{paddingTop:'12px'}},[createVNode(Button,{"block":true,"round":true,"type":"primary","onClick":function onClick(){_this5.shareStatus=true;}},{default:function _default(){return[createTextVNode("\u5206\u4EAB")];}})])];}}),createVNode(Popup,{"show":this.shareStatus,"onUpdate:show":function onUpdateShow($event){return _this5.shareStatus=$event;},"style":{background:'transparent'}},{default:function _default(){return[createVNode(ColShare,{"teacherId":_this5.userInfo.id,"shareUrl":_this5.shareUrl},{default:function _default(){return[createVNode(LiveItem,{"class":styles.shareCourse,"liveInfo":{backgroundPic:_this5.userInfo.lessonCoverUrl,courseGroupId:_this5.userInfo.lessonId,courseGroupName:_this5.userInfo.lessonName,courseNum:_this5.userInfo.lessonNum,coursePrice:_this5.userInfo.lessonPrice,teacherName:_this5.userInfo.username,teacherId:_this5.userInfo.id,avatar:_this5.userInfo.avatar,studentCount:_this5.userInfo.buyNum,courseStartTime:_this5.userInfo.courseStartTime,existBuy:0,subjectName:_this5.userInfo.subjectName}},null)];}})];}})]);}}));}};});})();
|