1 |
- !function(){function e(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function a(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t,a,n,i,c,r){try{var s=e[c](r),o=s.value}catch(u){return void a(u)}s.done?t(o):Promise.resolve(o).then(n,i)}function i(e){return function(){var t=this,a=arguments;return new Promise((function(i,c){var r=e.apply(t,a);function s(e){n(r,i,c,s,o,"next",e)}function o(e){n(r,i,c,s,o,"throw",e)}s(void 0)}))}}System.register(["./teacher-header.module-legacy.3b80627b.js","./index-legacy.fba2875c.js","./index-legacy.d92f7da7.js","./index-legacy.a7012d0a.js","./index-legacy.8a89ab2d.js","./index-legacy.edb65d0c.js","./icon_teacher-legacy.42ba77b1.js","./index-legacy.fc679d65.js","./icon-jiaozi-legacy.dd5ed0e2.js","./use-tab-status-legacy.8752ccde.js","./use-refs-legacy.2affcb61.js","./index-legacy.7dcec7b3.js","./index-legacy.8921f068.js","./use-id-legacy.db87b112.js"],(function(e){"use strict";var a,n,c,r,s,o,u,l,d,g,f,p,h,m,v,b,j,y,S,w,_,O,k,I,x,E,P,L,T,C,F,R,B,N,D,V,U,H;return{setters:[function(e){a=e._,n=e.a,c=e.b,r=e.c,s=e.d,o=e.e,u=e.f,l=e.g,d=e.h,g=e.i,f=e.j,p=e.k,h=e.l,m=e.m,v=e.n,b=e.o,j=e.p,y=e.q,S=e.r,w=e.s},function(e){_=e.d,O=e.w,k=e.D,I=e.T,x=e.u,E=e.j,P=e.n,L=e.z,T=e.C,C=e.Z},function(e){F=e.I},function(e){R=e.L},function(e){B=e.R},function(e){N=e.S},function(e){D=e.i},function(e){V=e.S},function(e){U=e.I,H=e.a},function(){},function(){},function(){},function(){},function(){}],execute:function(){var z=e("getAssetsHomeFile",(function(e){var t="./images/".concat(e);return{"./images/cert_active.png":a,"./images/cert_default.png":n,"./images/follow_bg.png":c,"./images/head_bg.png":r,"./images/icon-chat.png":s,"./images/icon-close.png":o,"./images/icon_fans.png":u,"./images/icon_subject.png":l,"./images/icon_video.png":d,"./images/live_active.png":g,"./images/live_bg.png":f,"./images/live_default.png":p,"./images/music_active.png":h,"./images/music_default.png":m,"./images/teacher-icon.png":v,"./images/video_active.png":b,"./images/video_default.png":j,"./images/vip_active.png":y,"./images/vip_default.png":S}[t].default}));e("default",_({name:"teacher-follow",data:function(){return{userInfo:{},starGrade:0,subjectNameList:[],list:[],dataShow:!0,loading:!1,finished:!1,params:{username:"",page:1,rows:20}}},mounted:function(){this.getList()},methods:{getSubjectNameList:function(e){return e.split(",")||[]},onSearch:function(e){this.params.username=e,this.onSort()},onSort:function(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},getList:function(){var e=this;return i(regeneratorRuntime.mark((function a(){var n,i,c;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,n=e.params,a.next=4,O.post("/api-student/student/queryMyFollow",{data:t({},n)});case 4:if(i=a.sent,e.loading=!1,c=i.data||{},!(e.list.length>0&&1===c.pageNo)){a.next=9;break}return a.abrupt("return");case 9:e.list=e.list.concat(c.rows||[]),e.finished=c.pageNo>=c.totalPage,e.params.page=c.pageNo+1,e.dataShow=e.list.length>0,a.next=19;break;case 15:a.prev=15,a.t0=a.catch(0),e.dataShow=!1,e.finished=!0;case 19:case"end":return a.stop()}}),a,null,[[0,15]])})))()},onUnLike:function(e){var t=this;return i(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:k.confirm({message:"确定取消关注吗?",confirmButtonColor:"var(--van-primary)"}).then(i(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,O.get("/api-student/teacher/starOrUnStar",{params:{userId:e.userId,starStatus:0}});case 3:I("取消关注成功"),setTimeout((function(){t.onSort()}),1e3),a.next=9;break;case 7:a.prev=7,a.t0=a.catch(0);case 9:case"end":return a.stop()}}),a,null,[[0,7]])}))));case 1:case"end":return a.stop()}}),a)})))()},checkBadge:function(e,t){var a=!1;switch(e){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":t.tag&&(a=t.tag.indexOf(e)>-1);break;case"VIP":if(t.membershipStartTime&&t.membershipEndTime){var n=x(t.membershipStartTime).valueOf(),i=x(t.membershipEndTime).valueOf(),c=x().valueOf();a=c>=n&&c<=i}else a=!1;break;case"DEGREE":a=!!t.degreeFlag;break;case"TEACHER":a=!!t.teacherFlag;break;default:a=!1}return a}},render:function(){var e,t,a=this;return E("div",{class:w.teacherFollow},[E(N,{position:"top",offsetTop:0},{default:function(){return[E(V,{onSearch:a.onSearch},null)]}}),this.dataShow?E(R,{class:w.liveList,loading:this.loading,"onUpdate:loading":function(e){return a.loading=e},immediateCheck:!1,finished:this.finished,finishedText:"没有更多了"},(t=e=this.list.map((function(e){return E("div",{class:[w.headerCount,w.headerFollow],onClick:function(t){t.stopPropagation(),sessionStorage.removeItem("teacherHomeTabs"),a.$router.push({path:"/teacherHome",query:{teacherId:e.userId,tabs:"single"}})}},[E("div",{class:w.followContainer},[E("div",{class:w.teacherContent},[E("div",{class:w.teacherIcon,onClick:function(t){1===e.liveFlag&&(t.stopPropagation(),P({api:"joinLiveRoom",content:{roomId:e.roomUid,teacherId:e.userId}}))}},[E(F,{class:[w.avatar,a.checkBadge("VIP",e.teacher)&&w.avatarActive],round:!0,src:e.avatar||D,fit:"cover"},null),1===e.liveFlag?E("p",{class:[w.liveTag,w.liveTagFollow]},[L("直播中")]):E(F,{class:w.teacherIconVip,src:a.checkBadge("VIP",e.teacher)?z("vip_active.png"):z("vip_default.png")},null)])]),E("div",null,[E("div",{class:w.teacherInfo},[E("div",{class:w.teacherInfoName},[e.userName||"游客".concat(e.userId||"")]),a.checkBadge("DEGREE",e.teacher)&&E("img",{src:U},null),a.checkBadge("TEACHER",e.teacher)&&E("img",{src:H},null)]),E("div",{class:w.piNameSubject},[E("div",{class:w.subjectList},[a.getSubjectNameList(e.subjectName).map((function(e){return E("span",{class:w.subject},[e])}))])])])]),E("div",{class:w.teacherHonor},[E("div",null,[L("勋章:")]),E("div",{class:w.teacherIcons},[E(F,{class:w.iconOther,src:a.checkBadge("STYLE",e.teacher)?z("cert_active.png"):z("cert_default.png")},null),E(F,{class:w.iconOther,src:a.checkBadge("VIDEO",e.teacher)?z("video_active.png"):z("video_default.png")},null),E(F,{class:w.iconOther,src:a.checkBadge("LIVE",e.teacher)?z("live_active.png"):z("live_default.png")},null),E(F,{class:w.iconOther,src:a.checkBadge("MUSIC",e.teacher)?z("music_active.png"):z("music_default.png")},null)]),E("div",{class:w.score},[L("评分: ")]),E("div",{class:w.level},[e.starGrade?E(B,{readonly:!0,modelValue:e.starGrade,iconPrefix:"iconfont",color:"#FFC459","void-icon":"star_default",icon:"star_active",size:15},null):E("span",{style:{fontSize:"12px",color:"#999999"}},[L("暂无评分")])])]),E("div",{class:[w["teacher-bottom"],w.followFans]},[E("div",{class:w["teacher-data"]},[E("div",{class:w["teacher-data_item"]},[L("粉丝 "),E("span",null,[e.fansNum||0])]),E("div",{class:w["teacher-data_item"]},[L("已上课时 "),E("span",null,[e.expTime||0])])]),E("div",{class:w.unlinkeBtn,onClick:function(t){t.stopPropagation(),a.onUnLike(e)}},[L("取消关注")])])])})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!C(t)?e:{default:function(){return[e]}})):E(T,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无关注"},null)])}}))}}}))}();
|