;(function(){function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}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);});};}System.register(['./teacher-header.module-legacy.2a7a5319.js','./vendor-legacy.b3aeff6a.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a6.js','./index-legacy.f25f109a9.js','./index-legacy.f25f109a3.js','./icon_teacher-legacy.e765b7f7.js','./index-legacy.101dd5f6.js','./index-legacy.03b70b26.js','./icon-jiaozi-legacy.dd5ed0e2.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a5.js'],function(exports){'use strict';var styles,__glob_18_0,__glob_18_1,__glob_18_2,__glob_18_3,__glob_18_4,__glob_18_5,__glob_18_6,__glob_18_7,__glob_18_8,__glob_18_9,__glob_18_10,__glob_18_11,__glob_18_12,__glob_18_13,__glob_18_14,__glob_18_15,__glob_18_16,__glob_18_17,__glob_18_18,defineComponent,Dialog,Toast,dayjs,createVNode,Sticky,List,Image,createTextVNode,Rate,isVNode,IconAvator,request,postMessage,ColResult,ColSearch,IconXueli,IconJiaozi;return{setters:[function(module){styles=module.s;__glob_18_0=module._;__glob_18_1=module.a;__glob_18_2=module.b;__glob_18_3=module.c;__glob_18_4=module.d;__glob_18_5=module.e;__glob_18_6=module.f;__glob_18_7=module.g;__glob_18_8=module.h;__glob_18_9=module.i;__glob_18_10=module.j;__glob_18_11=module.k;__glob_18_12=module.l;__glob_18_13=module.m;__glob_18_14=module.n;__glob_18_15=module.o;__glob_18_16=module.p;__glob_18_17=module.q;__glob_18_18=module.r;},function(module){defineComponent=module.d;Dialog=module.D;Toast=module.T;dayjs=module.g;createVNode=module.a;Sticky=module.S;List=module.M;Image=module.I;createTextVNode=module.j;Rate=module.J;isVNode=module.x;},function(){},function(){},function(){},function(){},function(module){IconAvator=module.I;},function(module){request=module.r;postMessage=module.p;ColResult=module.C;},function(module){ColSearch=module.C;},function(module){IconXueli=module.I;IconJiaozi=module.a;},function(){},function(){}],execute:function execute(){function _isSlot(s){return typeof s==='function'||Object.prototype.toString.call(s)==='[object Object]'&&!isVNode(s);}var getAssetsHomeFile=exports('getAssetsHomeFile',function(fileName){var path="./images/".concat(fileName);var modules={"./images/cert_active.png":__glob_18_0,"./images/cert_default.png":__glob_18_1,"./images/follow_bg.png":__glob_18_2,"./images/head_bg.png":__glob_18_3,"./images/icon-chat.png":__glob_18_4,"./images/icon-close.png":__glob_18_5,"./images/icon_fans.png":__glob_18_6,"./images/icon_subject.png":__glob_18_7,"./images/icon_video.png":__glob_18_8,"./images/live_active.png":__glob_18_9,"./images/live_bg.png":__glob_18_10,"./images/live_default.png":__glob_18_11,"./images/music_active.png":__glob_18_12,"./images/music_default.png":__glob_18_13,"./images/teacher-icon.png":__glob_18_14,"./images/video_active.png":__glob_18_15,"./images/video_default.png":__glob_18_16,"./images/vip_active.png":__glob_18_17,"./images/vip_default.png":__glob_18_18};return modules[path].default;});var teacherFollow=exports('default',defineComponent({name:'teacher-follow',data:function data(){return{userInfo:{},starGrade:0,subjectNameList:[],list:[],dataShow:true,// 判断是否有数据
loading:false,finished:false,params:{username:'',page:1,rows:20}};},mounted:function mounted(){this.getList();},methods:{getSubjectNameList:function getSubjectNameList(subject){var subjectList=subject.split(',');return subjectList||[];},onSearch:function onSearch(val){this.params.username=val;this.onSort();},onSort:function onSort(){this.params.page=1;this.list=[];this.dataShow=true;// 判断是否有数据
this.loading=false;this.finished=false;this.getList();},getList:function getList(){var _this=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){var params,res,result;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;params=_this.params;_context.next=4;return request.post('/api-student/student/queryMyFollow',{data:_objectSpread({},params)});case 4:res=_context.sent;_this.loading=false;result=res.data||{};// 处理重复请求数据
if(!(_this.list.length>0&&result.pageNo===1)){_context.next=9;break;}return _context.abrupt("return");case 9:_this.list=_this.list.concat(result.rows||[]);_this.finished=result.pageNo>=result.totalPage;_this.params.page=result.pageNo+1;_this.dataShow=_this.list.length>0;_context.next=19;break;case 15:_context.prev=15;_context.t0=_context["catch"](0);_this.dataShow=false;_this.finished=true;case 19:case"end":return _context.stop();}}},_callee,null,[[0,15]]);}))();},onUnLike:function onUnLike(item){var _this2=this;return _asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee3(){return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:Dialog.confirm({message:'确定取消关注吗？',confirmButtonColor:'var(--van-primary)'}).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee2(){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-student/teacher/starOrUnStar',{params:{userId:item.userId,starStatus:0}});case 3:Toast('取消关注成功');setTimeout(function(){_this2.onSort();},1000);_context2.next=9;break;case 7:_context2.prev=7;_context2.t0=_context2["catch"](0);case 9:case"end":return _context2.stop();}}},_callee2,null,[[0,7]]);})));case 1:case"end":return _context3.stop();}}},_callee3);}))();},// 检验是否有对应徽章
checkBadge:function checkBadge(type,item){// tag : 老师点亮图标
// STYLE:个人风采
// VIDEO：视频课
// LIVE：直播课，
// MUSIC：曲目 逗号隔开
var status=false;switch(type){case'STYLE':case'VIDEO':case'LIVE':case'MUSIC':if(item.tag){status=item.tag.indexOf(type)>-1;}break;case'VIP':if(item.membershipStartTime&&item.membershipEndTime){var startTime=dayjs(item.membershipStartTime).valueOf();var endTime=dayjs(item.membershipEndTime).valueOf();var nowTime=dayjs().valueOf();status=nowTime>=startTime&&nowTime<=endTime;}else{status=false;}break;case'DEGREE':status=item.degreeFlag?true:false;break;case'TEACHER':status=item.teacherFlag?true:false;break;default:status=false;break;}return status;}},render:function render(){var _this3=this;var _slot;return createVNode("div",{"class":styles.teacherFollow},[createVNode(Sticky,{"position":"top","offsetTop":0},{default:function _default(){return[createVNode(ColSearch,{"onSearch":_this3.onSearch},null)];}}),this.dataShow?createVNode(List,{"class":styles.liveList,"loading":this.loading,"onUpdate:loading":function onUpdateLoading($event){return _this3.loading=$event;},"immediateCheck":false,"finished":this.finished,"finishedText":"没有更多了"},_isSlot(_slot=this.list.map(function(item){return createVNode("div",{"class":[styles.headerCount,styles.headerFollow],"onClick":function onClick(e){e.stopPropagation();sessionStorage.removeItem('teacherHomeTabs');_this3.$router.push({path:'/teacherHome',query:{teacherId:item.userId,tabs:'single'}});}},[createVNode("div",{"class":styles.followContainer},[createVNode("div",{"class":styles.teacherContent},[createVNode("div",{"class":styles.teacherIcon,"onClick":function onClick(e){// 判断是否在直播中
if(item.liveFlag===1){e.stopPropagation();postMessage({api:'joinLiveRoom',content:{roomId:item.roomUid,teacherId:item.userId}});}}},[createVNode(Image,{"class":[styles.avatar,_this3.checkBadge('VIP',item.teacher)&&styles.avatarActive],"round":true,"src":item.avatar||IconAvator,"fit":"cover"},null),item.liveFlag===1&&createVNode("p",{"class":styles.liveTag},[createTextVNode("\u76F4\u64AD\u4E2D")]),createVNode(Image,{"class":styles.teacherIconVip,"src":_this3.checkBadge('VIP',item.teacher)?getAssetsHomeFile('vip_active.png'):getAssetsHomeFile('vip_default.png')},null)])]),createVNode("div",null,[createVNode("div",{"class":styles.teacherInfo},[createVNode("div",{"class":styles.teacherInfoName},[item.userName||"\u6E38\u5BA2".concat(item.userId||'')]),_this3.checkBadge('DEGREE',item.teacher)&&createVNode("img",{"src":IconXueli},null),_this3.checkBadge('TEACHER',item.teacher)&&createVNode("img",{"src":IconJiaozi},null)]),createVNode("div",{"class":styles.teacherHonor},[createVNode("div",null,[createTextVNode("\u52CB\u7AE0:")]),createVNode("div",{"class":styles.teacherIcons},[createVNode(Image,{"class":styles.iconOther,"src":_this3.checkBadge('STYLE',item.teacher)?getAssetsHomeFile('cert_active.png'):getAssetsHomeFile('cert_default.png')},null),createVNode(Image,{"class":styles.iconOther,"src":_this3.checkBadge('VIDEO',item.teacher)?getAssetsHomeFile('video_active.png'):getAssetsHomeFile('video_default.png')},null),createVNode(Image,{"class":styles.iconOther,"src":_this3.checkBadge('LIVE',item.teacher)?getAssetsHomeFile('live_active.png'):getAssetsHomeFile('live_default.png')},null),createVNode(Image,{"class":styles.iconOther,"src":_this3.checkBadge('MUSIC',item.teacher)?getAssetsHomeFile('music_active.png'):getAssetsHomeFile('music_default.png')},null)]),createVNode("div",{"class":styles.score},[createTextVNode("\u8BC4\u5206: ")]),createVNode("div",{"class":styles.level},[item.starGrade?createVNode(Rate,{"readonly":true,"modelValue":item.starGrade,"iconPrefix":"iconfont","color":"#FFC459","void-icon":"star_default","icon":"star_active","size":15},null):createVNode("span",{"style":{fontSize:'12px',color:'#999999'}},[createTextVNode("\u6682\u65E0\u8BC4\u5206")])])]),createVNode("div",{"class":styles.piNameSubject},[createVNode(Image,{"class":styles.subjectSection,"src":getAssetsHomeFile('icon_subject.png'),"fit":"contain"},null),createVNode("div",{"class":styles.subjectList},[_this3.getSubjectNameList(item.subjectName).map(function(item){return createVNode("span",{"class":styles.subject},[item]);})])])])]),createVNode("div",{"class":styles['teacher-bottom']},[createVNode("div",{"class":styles['teacher-data']},[createVNode("div",{"class":styles['teacher-data_item']},[createTextVNode("\u7C89\u4E1D "),createVNode("span",null,[item.fansNum||0])]),createVNode("div",{"class":styles['teacher-data_item']},[createTextVNode("\u5DF2\u4E0A\u8BFE\u65F6 "),createVNode("span",null,[item.expTime||0])])]),createVNode("div",{"class":styles.unlinkeBtn,"onClick":function onClick(e){e.stopPropagation();_this3.onUnLike(item);}},[createTextVNode("\u53D6\u6D88\u5173\u6CE8")])])]);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无关注"},null)]);}}));}};});})();
