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,r,c){try{var s=e[r](c),o=s.value}catch(l){return void a(l)}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,r){var c=e.apply(t,a);function s(e){n(c,i,r,s,o,"next",e)}function o(e){n(c,i,r,s,o,"throw",e)}s(void 0)}))}}System.register(["./teacher-header.module-legacy.c66097d3.js","./ResizeObserver.es-legacy.9ef5ac8c.js","./index-legacy.8802e914.js","./index-legacy.63f64e9b.js","./index-legacy.6e9edf81.js","./index-legacy.49dc34f1.js","./icon_teacher-legacy.42ba77b1.js","./index-legacy.46228add.js","./icon-jiaozi-legacy.dd5ed0e2.js","./index-legacy.402479d8.js","./use-tab-status-legacy.257600f9.js","./use-refs-legacy.c67c62a4.js","./index-legacy.e9381954.js","./index-legacy.b5b73462.js","./use-id-legacy.4538a8e2.js"],(function(e){"use strict";var a,n,r,c,s,o,l,u,d,g,f,p,h,m,v,b,j,y,S,_,w,O,k,I,x,E,P,L,T,C,R,F,B,N,D,V,U,A,H,z;return{setters:[function(e){a=e._,n=e.a,r=e.b,c=e.c,s=e.d,o=e.e,l=e.f,u=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,_=e.s,w=e.t},function(e){O=e.d,k=e.y,I=e.D,x=e.T,E=e.w,P=e.j,L=e.n,T=e.A,C=e.C,R=e.$},function(e){F=e.I},function(e){B=e.L},function(e){N=e.R},function(e){D=e.S},function(e){V=e.i},function(e){U=e.S},function(e){A=e.I,H=e.a},function(e){z=e.C},function(){},function(){},function(){},function(){},function(){}],execute:function(){var G=e("getAssetsHomeFile",(function(e){var t="./images/".concat(e);return{"./images/cert_active.png":a,"./images/cert_default.png":n,"./images/follow_bg.png":r,"./images/head_bg.png":c,"./images/icon-chat.png":s,"./images/icon-close.png":o,"./images/icon_fans.png":l,"./images/icon_subject.png":u,"./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/svip_active.png":v,"./images/teacher-icon.png":b,"./images/video_active.png":j,"./images/video_default.png":y,"./images/vip_active.png":S,"./images/vip_default.png":_}[t].default}));e("default",O({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,r;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,n=e.params,a.next=4,k.post("/api-student/student/queryMyFollow",{data:t({},n)});case 4:if(i=a.sent,e.loading=!1,r=i.data||{},!(e.list.length>0&&1===r.pageNo)){a.next=9;break}return a.abrupt("return");case 9:e.list=e.list.concat(r.rows||[]),e.finished=r.pageNo>=r.totalPage,e.params.page=r.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:I.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,k.get("/api-student/teacher/starOrUnStar",{params:{userId:e.userId,starStatus:0}});case 3:x("取消关注成功"),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=E(t.membershipStartTime).valueOf(),i=E(t.membershipEndTime).valueOf(),r=E().valueOf();a=r>=n&&r<=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 P("div",{class:w.teacherFollow},[P(D,{position:"top",offsetTop:0},{default:function(){return[P(z,{border:!1},null),P(U,{onSearch:a.onSearch},null)]}}),this.dataShow?P(B,{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 P("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"}})}},[P("div",{class:w.followContainer},[P("div",{class:w.teacherContent},[P("div",{class:w.teacherIcon,onClick:function(t){1===e.liveFlag&&(t.stopPropagation(),L({api:"joinLiveRoom",content:{roomId:e.roomUid,teacherId:e.userId}}))}},[P(F,{class:[w.avatar,a.checkBadge("VIP",e.teacher)&&w.avatarActive],round:!0,src:e.avatar||V,fit:"cover"},null),1===e.liveFlag?P("p",{class:[w.liveTag,w.liveTagFollow]},[T("直播中")]):P(F,{class:w.teacherIconVip,src:a.checkBadge("VIP",e.teacher)?G("vip_active.png"):G("vip_default.png")},null)])]),P("div",null,[P("div",{class:w.teacherInfo},[P("div",{class:w.teacherInfoName},[e.userName||"游客".concat(e.userId||"")]),a.checkBadge("DEGREE",e.teacher)&&P("img",{src:A},null),a.checkBadge("TEACHER",e.teacher)&&P("img",{src:H},null)]),P("div",{class:w.piNameSubject},[P("div",{class:w.subjectList},[a.getSubjectNameList(e.subjectName).map((function(e){return P("span",{class:w.subject},[e])}))])])])]),P("div",{class:w.teacherHonor},[P("div",null,[T("勋章:")]),P("div",{class:w.teacherIcons},[P(F,{class:w.iconOther,src:a.checkBadge("STYLE",e.teacher)?G("cert_active.png"):G("cert_default.png")},null),P(F,{class:w.iconOther,src:a.checkBadge("VIDEO",e.teacher)?G("video_active.png"):G("video_default.png")},null),P(F,{class:w.iconOther,src:a.checkBadge("LIVE",e.teacher)?G("live_active.png"):G("live_default.png")},null),P(F,{class:w.iconOther,src:a.checkBadge("MUSIC",e.teacher)?G("music_active.png"):G("music_default.png")},null)]),P("div",{class:w.score},[T("评分: ")]),P("div",{class:w.level},[e.starGrade?P(N,{readonly:!0,modelValue:e.starGrade,iconPrefix:"iconfont",color:"#FFC459","void-icon":"star_default",icon:"star_active",size:15},null):P("span",{style:{fontSize:"12px",color:"#999999"}},[T("暂无评分")])])]),P("div",{class:[w["teacher-bottom"],w.followFans]},[P("div",{class:w["teacher-data"]},[P("div",{class:w["teacher-data_item"]},[T("粉丝 "),P("span",null,[e.fansNum||0])]),P("div",{class:w["teacher-data_item"]},[T("已上课时 "),P("span",null,[e.expTime||0])])]),P("div",{class:w.unlinkeBtn,onClick:function(t){t.stopPropagation(),a.onUnLike(e)}},[T("取消关注")])])])})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!R(t)?e:{default:function(){return[e]}})):P(C,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无关注"},null)])}}))}}}))}();
|