teacher-follow.b9645ae6.js 5.8 KB

1
  1. import{_ as h,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 w,n as L,o as j,p as F,q as y,r as B,s}from"./teacher-header.module.680b3c7a.js";import{d as N,w as g,D as O,T as D,u as c,j as a,n as V,z as l,C as A,Z as P}from"./index.394decd7.js";import{I as r}from"./index.ae2dd816.js";import{L as R}from"./index.dc786267.js";import{R as x}from"./index.eb3110b4.js";import{S as H}from"./index.3bbf4ddb.js";import{i as U}from"./icon_teacher.40b6f077.js";import{S as z}from"./index.ada5e712.js";import{I as G,a as M}from"./icon-jiaozi.20e415ca.js";import{C as q}from"./index.e6e212d8.js";import"./use-tab-status.723110ee.js";import"./use-refs.09b2d19c.js";import"./index.9e0d46e4.js";import"./index.224299a1.js";import"./use-id.e2f22365.js";function $(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!P(i)}const o=i=>{const e=`./images/${i}`;return{"./images/cert_active.png":h,"./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":w,"./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}[e].default};var ca=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,e=await g.post("/api-student/student/queryMyFollow",{data:{...i}});this.loading=!1;const t=e.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,e){let t=!1;switch(i){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":e.tag&&(t=e.tag.indexOf(i)>-1);break;case"VIP":if(e.membershipStartTime&&e.membershipEndTime){const u=c(e.membershipStartTime).valueOf(),d=c(e.membershipEndTime).valueOf(),n=c().valueOf();t=n>=u&&n<=d}else t=!1;break;case"DEGREE":t=!!e.degreeFlag;break;case"TEACHER":t=!!e.teacherFlag;break;default:t=!1;break}return t}},render(){let i;return a("div",{class:s.teacherFollow},[a(H,{position:"top",offsetTop:0},{default:()=>[a(q,{border:!1},null),a(z,{onSearch:this.onSearch},null)]}),this.dataShow?a(R,{class:s.liveList,loading:this.loading,"onUpdate:loading":e=>this.loading=e,immediateCheck:!1,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86"},$(i=this.list.map(e=>a("div",{class:[s.headerCount,s.headerFollow],onClick:t=>{t.stopPropagation(),sessionStorage.removeItem("teacherHomeTabs"),this.$router.push({path:"/teacherHome",query:{teacherId:e.userId,tabs:"single"}})}},[a("div",{class:s.followContainer},[a("div",{class:s.teacherContent},[a("div",{class:s.teacherIcon,onClick:t=>{e.liveFlag===1&&(t.stopPropagation(),V({api:"joinLiveRoom",content:{roomId:e.roomUid,teacherId:e.userId}}))}},[a(r,{class:[s.avatar,this.checkBadge("VIP",e.teacher)&&s.avatarActive],round:!0,src:e.avatar||U,fit:"cover"},null),e.liveFlag===1?a("p",{class:[s.liveTag,s.liveTagFollow]},[l("\u76F4\u64AD\u4E2D")]):a(r,{class:s.teacherIconVip,src:this.checkBadge("VIP",e.teacher)?o("vip_active.png"):o("vip_default.png")},null)])]),a("div",null,[a("div",{class:s.teacherInfo},[a("div",{class:s.teacherInfoName},[e.userName||`\u6E38\u5BA2${e.userId||""}`]),this.checkBadge("DEGREE",e.teacher)&&a("img",{src:G},null),this.checkBadge("TEACHER",e.teacher)&&a("img",{src:M},null)]),a("div",{class:s.piNameSubject},[a("div",{class:s.subjectList},[this.getSubjectNameList(e.subjectName).map(t=>a("span",{class:s.subject},[t]))])])])]),a("div",{class:s.teacherHonor},[a("div",null,[l("\u52CB\u7AE0:")]),a("div",{class:s.teacherIcons},[a(r,{class:s.iconOther,src:this.checkBadge("STYLE",e.teacher)?o("cert_active.png"):o("cert_default.png")},null),a(r,{class:s.iconOther,src:this.checkBadge("VIDEO",e.teacher)?o("video_active.png"):o("video_default.png")},null),a(r,{class:s.iconOther,src:this.checkBadge("LIVE",e.teacher)?o("live_active.png"):o("live_default.png")},null),a(r,{class:s.iconOther,src:this.checkBadge("MUSIC",e.teacher)?o("music_active.png"):o("music_default.png")},null)]),a("div",{class:s.score},[l("\u8BC4\u5206: ")]),a("div",{class:s.level},[e.starGrade?a(x,{readonly:!0,modelValue:e.starGrade,iconPrefix:"iconfont",color:"#FFC459","void-icon":"star_default",icon:"star_active",size:15},null):a("span",{style:{fontSize:"12px",color:"#999999"}},[l("\u6682\u65E0\u8BC4\u5206")])])]),a("div",{class:[s["teacher-bottom"],s.followFans]},[a("div",{class:s["teacher-data"]},[a("div",{class:s["teacher-data_item"]},[l("\u7C89\u4E1D "),a("span",null,[e.fansNum||0])]),a("div",{class:s["teacher-data_item"]},[l("\u5DF2\u4E0A\u8BFE\u65F6 "),a("span",null,[e.expTime||0])])]),a("div",{class:s.unlinkeBtn,onClick:t=>{t.stopPropagation(),this.onUnLike(e)}},[l("\u53D6\u6D88\u5173\u6CE8")])])])))?i:{default:()=>[i]}):a(A,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5173\u6CE8"},null)])}});export{ca as default,o as getAssetsHomeFile};