teacher-follow.c2bd3f67.js 5.7 KB

1
  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 T,l as w,m as C,n as L,o as j,p as F,q as y,r as B,s}from"./teacher-header.module.374e6712.js";import{d as N,w as g,D as O,T as D,u as r,j as e,n as V,z as l,C as A,Z as P}from"./index.e6d6174e.js";import{I as c}from"./index.67c54471.js";import{L as R}from"./index.f904775d.js";import{R as x}from"./index.9fec9f0d.js";import{S as U}from"./index.9093bc60.js";import{i as H}from"./icon_teacher.40b6f077.js";import{S as z}from"./index.c42f80e3.js";import{I as G,a as M}from"./icon-jiaozi.20e415ca.js";import"./use-tab-status.e9ba8498.js";import"./use-refs.eb803454.js";import"./index.af99cf22.js";import"./index.17d70acf.js";import"./use-id.f239f36f.js";function q(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!P(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":T,"./images/music_active.png":w,"./images/music_default.png":C,"./images/teacher-icon.png":L,"./images/video_active.png":j,"./images/video_default.png":F,"./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(z,{onSearch:this.onSearch},null)]}),this.dataShow?e(R,{class:s.liveList,loading:this.loading,"onUpdate:loading":a=>this.loading=a,immediateCheck:!1,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86"},q(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:G},null),this.checkBadge("TEACHER",a.teacher)&&e("img",{src:M},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(x,{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};