;(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.1ba88f4a.js','./vendor-legacy.031e1374.js','./index-legacy.f25f109a2.js','./index-legacy.f25f109a4.js','./index-legacy.f25f109a6.js','./index-legacy.f25f109a9.js','./icon_teacher-legacy.42ba77b1.js','./teacher_cert-legacy.0a706a46.js','./index-legacy.1cd7b6bb.js'],function(exports){'use strict';var styles,__glob_17_0,__glob_17_1,__glob_17_2,__glob_17_3,__glob_17_4,__glob_17_5,defineComponent,Dialog,Toast,createVNode,List,Cell,Image,Rate,createTextVNode,Icon,isVNode,iconTeacher,teacherCert,musicCert,request,postMessage,ColResult;return{setters:[function(module){styles=module.s;__glob_17_0=module._;__glob_17_1=module.a;__glob_17_2=module.b;__glob_17_3=module.c;__glob_17_4=module.d;__glob_17_5=module.e;},function(module){defineComponent=module.d;Dialog=module.D;Toast=module.T;createVNode=module.a;List=module.w;Cell=module.q;Image=module.I;Rate=module.t;createTextVNode=module.j;Icon=module.u;isVNode=module.x;},function(){},function(){},function(){},function(){},function(module){iconTeacher=module.i;},function(module){teacherCert=module.t;musicCert=module.m;},function(module){request=module.r;postMessage=module.p;ColResult=module.C;}],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/follow_bg.png":__glob_17_0,"./images/head_bg.png":__glob_17_1,"./images/icon_fans.png":__glob_17_2,"./images/icon_subject.png":__glob_17_3,"./images/icon_video.png":__glob_17_4,"./images/live_bg.png":__glob_17_5};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:{page:1,rows:20}};},mounted:function mounted(){this.getList();},methods:{getSubjectNameList:function getSubjectNameList(subject){var subjectList=subject.split(',');return subjectList||[];},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);}))();}},render:function render(){var _this3=this;var _slot;return createVNode("div",{"class":styles.teacherFollow},[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]},[createVNode(Cell,{"class":styles['open-teacher-info'],"border":false,"center":true},{default:function _default(){return[createVNode("div",{"class":styles['teacher-info']},[createVNode("div",{"class":styles['teacher-name']},[createVNode("div",{"class":styles.teacherCert},[createVNode("span",{"style":{display:'inline-block'}},[item.userName||"\u6E38\u5BA2".concat(item.userId||'')]),item.entryFlag===1&&createVNode(Image,{"class":styles.cert,"src":teacherCert},null),item.musicianFlag===1&&createVNode(Image,{"class":styles.cert,"src":musicCert},null)])]),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")])])])];},icon:function icon(){return createVNode("div",{"style":{position:'relative',lineHeight:0}},[createVNode(Image,{"class":styles.userLogo,"src":item.avatar||iconTeacher,"fit":"cover"},null),item.liveFlag===1&&createVNode("p",{"class":styles.liveTag,"onClick":function onClick(){postMessage({api:'joinLiveRoom',content:{roomId:item.roomUid,teacherId:item.userId}});}},[createTextVNode("\u76F4\u64AD\u4E2D")])]);},'right-icon':function rightIcon(){return createVNode(Icon,{"name":"like","color":"#FF6363","size":18,"onClick":function onClick(){_this3.onUnLike(item);}},null);}}),createVNode("p",{"class":styles.piNameSubject},[createVNode(Image,{"class":styles.subjectSection,"src":getAssetsHomeFile('icon_subject.png'),"fit":"contain"},null),_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])])])])]);}))?_slot:{default:function _default(){return[_slot];}}):createVNode(ColResult,{"btnStatus":false,"classImgSize":"SMALL","tips":"暂无关注"},null)]);}}));}};});})();
