1 |
- import{_ as d,a as _,b as p,c as m,d as f,e as v,f as b,g as S,h as I,i as E,j as k,k as C,l as T,m as L,n as w,o as F,p as j,q as y,r as B,s}from"./teacher-header.module.374e6712.js";import{d as N,e as g,D as O,T as D,x as r,i as e,p as V,A as l,C as A,$ as x}from"./index.6b776f4b.js";import{I as c}from"./index.7cc0b0e7.js";import{L as P}from"./index.9b1da5d2.js";import{R}from"./index.069e2fb8.js";import{S as U}from"./index.998c3386.js";import{i as H}from"./icon_teacher.40b6f077.js";import{C as G}from"./index.1c64afe2.js";import{I as M,a as q}from"./icon-jiaozi.20e415ca.js";import"./use-tab-status.ad41a764.js";import"./use-refs.a68d4385.js";import"./index.7486196c.js";import"./index.ef17e812.js";import"./use-id.40b6af6b.js";function z(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!x(i)}const o=i=>{const a=`./images/${i}`;return{"./images/cert_active.png":d,"./images/cert_default.png":_,"./images/follow_bg.png":p,"./images/head_bg.png":m,"./images/icon-chat.png":f,"./images/icon-close.png":v,"./images/icon_fans.png":b,"./images/icon_subject.png":S,"./images/icon_video.png":I,"./images/live_active.png":E,"./images/live_bg.png":k,"./images/live_default.png":C,"./images/music_active.png":T,"./images/music_default.png":L,"./images/teacher-icon.png":w,"./images/video_active.png":F,"./images/video_default.png":j,"./images/vip_active.png":y,"./images/vip_default.png":B}[a].default};var la=N({name:"teacher-follow",data(){return{userInfo:{},starGrade:0,subjectNameList:[],list:[],dataShow:!0,loading:!1,finished:!1,params:{username:"",page:1,rows:20}}},mounted(){this.getList()},methods:{getSubjectNameList(i){return i.split(",")||[]},onSearch(i){this.params.username=i,this.onSort()},onSort(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},async getList(){try{const i=this.params,a=await g.post("/api-student/student/queryMyFollow",{data:{...i}});this.loading=!1;const t=a.data||{};if(this.list.length>0&&t.pageNo===1)return;this.list=this.list.concat(t.rows||[]),this.finished=t.pageNo>=t.totalPage,this.params.page=t.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}},async onUnLike(i){O.confirm({message:"\u786E\u5B9A\u53D6\u6D88\u5173\u6CE8\u5417\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{await g.get("/api-student/teacher/starOrUnStar",{params:{userId:i.userId,starStatus:0}}),D("\u53D6\u6D88\u5173\u6CE8\u6210\u529F"),setTimeout(()=>{this.onSort()},1e3)}catch{}})},checkBadge(i,a){let t=!1;switch(i){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":a.tag&&(t=a.tag.indexOf(i)>-1);break;case"VIP":if(a.membershipStartTime&&a.membershipEndTime){const u=r(a.membershipStartTime).valueOf(),h=r(a.membershipEndTime).valueOf(),n=r().valueOf();t=n>=u&&n<=h}else t=!1;break;case"DEGREE":t=!!a.degreeFlag;break;case"TEACHER":t=!!a.teacherFlag;break;default:t=!1;break}return t}},render(){let i;return e("div",{class:s.teacherFollow},[e(U,{position:"top",offsetTop:0},{default:()=>[e(G,{onSearch:this.onSearch},null)]}),this.dataShow?e(P,{class:s.liveList,loading:this.loading,"onUpdate:loading":a=>this.loading=a,immediateCheck:!1,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86"},z(i=this.list.map(a=>e("div",{class:[s.headerCount,s.headerFollow],onClick:t=>{t.stopPropagation(),sessionStorage.removeItem("teacherHomeTabs"),this.$router.push({path:"/teacherHome",query:{teacherId:a.userId,tabs:"single"}})}},[e("div",{class:s.followContainer},[e("div",{class:s.teacherContent},[e("div",{class:s.teacherIcon,onClick:t=>{a.liveFlag===1&&(t.stopPropagation(),V({api:"joinLiveRoom",content:{roomId:a.roomUid,teacherId:a.userId}}))}},[e(c,{class:[s.avatar,this.checkBadge("VIP",a.teacher)&&s.avatarActive],round:!0,src:a.avatar||H,fit:"cover"},null),a.liveFlag===1?e("p",{class:[s.liveTag,s.liveTagFollow]},[l("\u76F4\u64AD\u4E2D")]):e(c,{class:s.teacherIconVip,src:this.checkBadge("VIP",a.teacher)?o("vip_active.png"):o("vip_default.png")},null)])]),e("div",null,[e("div",{class:s.teacherInfo},[e("div",{class:s.teacherInfoName},[a.userName||`\u6E38\u5BA2${a.userId||""}`]),this.checkBadge("DEGREE",a.teacher)&&e("img",{src:M},null),this.checkBadge("TEACHER",a.teacher)&&e("img",{src:q},null)]),e("div",{class:s.piNameSubject},[e("div",{class:s.subjectList},[this.getSubjectNameList(a.subjectName).map(t=>e("span",{class:s.subject},[t]))])])])]),e("div",{class:s.teacherHonor},[e("div",null,[l("\u52CB\u7AE0:")]),e("div",{class:s.teacherIcons},[e(c,{class:s.iconOther,src:this.checkBadge("STYLE",a.teacher)?o("cert_active.png"):o("cert_default.png")},null),e(c,{class:s.iconOther,src:this.checkBadge("VIDEO",a.teacher)?o("video_active.png"):o("video_default.png")},null),e(c,{class:s.iconOther,src:this.checkBadge("LIVE",a.teacher)?o("live_active.png"):o("live_default.png")},null),e(c,{class:s.iconOther,src:this.checkBadge("MUSIC",a.teacher)?o("music_active.png"):o("music_default.png")},null)]),e("div",{class:s.score},[l("\u8BC4\u5206: ")]),e("div",{class:s.level},[a.starGrade?e(R,{readonly:!0,modelValue:a.starGrade,iconPrefix:"iconfont",color:"#FFC459","void-icon":"star_default",icon:"star_active",size:15},null):e("span",{style:{fontSize:"12px",color:"#999999"}},[l("\u6682\u65E0\u8BC4\u5206")])])]),e("div",{class:[s["teacher-bottom"],s.followFans]},[e("div",{class:s["teacher-data"]},[e("div",{class:s["teacher-data_item"]},[l("\u7C89\u4E1D "),e("span",null,[a.fansNum||0])]),e("div",{class:s["teacher-data_item"]},[l("\u5DF2\u4E0A\u8BFE\u65F6 "),e("span",null,[a.expTime||0])])]),e("div",{class:s.unlinkeBtn,onClick:t=>{t.stopPropagation(),this.onUnLike(a)}},[l("\u53D6\u6D88\u5173\u6CE8")])])])))?i:{default:()=>[i]}):e(A,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5173\u6CE8"},null)])}});export{la as default,o as getAssetsHomeFile};
|