teacher-follow-legacy.7089cca6.js 7.6 KB

1
  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.b2528a15.js","./index-legacy.ca42ae97.js","./index-legacy.9cbe7ce8.js","./index-legacy.14dec19b.js","./index-legacy.4f922f18.js","./icon_teacher-legacy.42ba77b1.js","./index-legacy.a87134f4.js","./icon-jiaozi-legacy.dd5ed0e2.js","./use-tab-status-legacy.5c2c2da3.js","./use-refs-legacy.2f8acfce.js","./index-legacy.207dc8c2.js","./index-legacy.ab501af1.js","./use-id-legacy.4f071235.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,A;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,_=e.s},function(e){w=e.d,O=e.e,k=e.D,I=e.T,x=e.x,E=e.i,P=e.p,L=e.A,T=e.C,C=e.$},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.C},function(e){U=e.I,A=e.a},function(){},function(){},function(){},function(){},function(){}],execute:function(){var H=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",w({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:_.teacherFollow},[E(N,{position:"top",offsetTop:0},{default:function(){return[E(V,{onSearch:a.onSearch},null)]}}),this.dataShow?E(R,{class:_.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:[_.headerCount,_.headerFollow],onClick:function(t){t.stopPropagation(),sessionStorage.removeItem("teacherHomeTabs"),a.$router.push({path:"/teacherHome",query:{teacherId:e.userId,tabs:"single"}})}},[E("div",{class:_.followContainer},[E("div",{class:_.teacherContent},[E("div",{class:_.teacherIcon,onClick:function(t){1===e.liveFlag&&(t.stopPropagation(),P({api:"joinLiveRoom",content:{roomId:e.roomUid,teacherId:e.userId}}))}},[E(F,{class:[_.avatar,a.checkBadge("VIP",e.teacher)&&_.avatarActive],round:!0,src:e.avatar||D,fit:"cover"},null),1===e.liveFlag?E("p",{class:[_.liveTag,_.liveTagFollow]},[L("直播中")]):E(F,{class:_.teacherIconVip,src:a.checkBadge("VIP",e.teacher)?H("vip_active.png"):H("vip_default.png")},null)])]),E("div",null,[E("div",{class:_.teacherInfo},[E("div",{class:_.teacherInfoName},[e.userName||"游客".concat(e.userId||"")]),a.checkBadge("DEGREE",e.teacher)&&E("img",{src:U},null),a.checkBadge("TEACHER",e.teacher)&&E("img",{src:A},null)]),E("div",{class:_.piNameSubject},[E("div",{class:_.subjectList},[a.getSubjectNameList(e.subjectName).map((function(e){return E("span",{class:_.subject},[e])}))])])])]),E("div",{class:_.teacherHonor},[E("div",null,[L("勋章:")]),E("div",{class:_.teacherIcons},[E(F,{class:_.iconOther,src:a.checkBadge("STYLE",e.teacher)?H("cert_active.png"):H("cert_default.png")},null),E(F,{class:_.iconOther,src:a.checkBadge("VIDEO",e.teacher)?H("video_active.png"):H("video_default.png")},null),E(F,{class:_.iconOther,src:a.checkBadge("LIVE",e.teacher)?H("live_active.png"):H("live_default.png")},null),E(F,{class:_.iconOther,src:a.checkBadge("MUSIC",e.teacher)?H("music_active.png"):H("music_default.png")},null)]),E("div",{class:_.score},[L("评分: ")]),E("div",{class:_.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:[_["teacher-bottom"],_.followFans]},[E("div",{class:_["teacher-data"]},[E("div",{class:_["teacher-data_item"]},[L("粉丝 "),E("span",null,[e.fansNum||0])]),E("div",{class:_["teacher-data_item"]},[L("已上课时 "),E("span",null,[e.expTime||0])])]),E("div",{class:_.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)])}}))}}}))}();