teacher-follow.09cac54d.js 7.6 KB

1
  1. import{_ as l,c as h,d as p,e as d,f as g,g as u,h as f,j as m,k as v,l as b,m as I,n as S,o as C,p as T,q as j,r as w,s as L,t as k,u as N,v as F,w as V,x as E,y,z as P,A as B,B as D,C as A,D as O}from"./vip_default.72e2ecab.js";import{_ as H}from"./icon_video.7027332d.js";import{d as x,y as r,D as R,T as U,j as a,n as z,A as n,C as G,$ as M}from"./ResizeObserver.es.282029b9.js";import{I as _}from"./index.c5bd2feb.js";import{L as q}from"./index.55b2f838.js";import{R as $}from"./index.768fc171.js";import{i as W}from"./icon_teacher.40b6f077.js";import{S as J}from"./index.5af8dde5.js";import{I as X,a as Y}from"./icon-jiaozi.20e415ca.js";import{C as K}from"./index.eb139bb9.js";import{T as Q}from"./index.13e5fb89.js";import"./use-tab-status.9bf787ad.js";import"./use-refs.3580c3ef.js";import"./index.aa695a1a.js";import"./index.bb35c1e6.js";import"./use-id.19b4fa35.js";import"./index.9b4a8510.js";const Z="_headerContent_fdpo8_1",ee="_teacherContent_fdpo8_7",ae="_teacherIcon_fdpo8_12",te="_avatar_fdpo8_17",oe="_avatarActive_fdpo8_25",se="_teacherIconVip_fdpo8_29",ce="_teacherInfo_fdpo8_36",ne="_teacherInfoName_fdpo8_41",ie="_teacherHonor_fdpo8_55",re="_score_fdpo8_65",_e="_headerCount_fdpo8_68",le="_teacherOperation_fdpo8_76",he="_btn_fdpo8_79",pe="_btnStar_fdpo8_83",de="_subjectSection_fdpo8_87",ge="_followFans_fdpo8_98",ue="_iconVip_fdpo8_134",fe="_iconOther_fdpo8_138",me="_teacherCert_fdpo8_154",ve="_teacherLast_fdpo8_158",be="_subjectList_fdpo8_165",Ie="_piNameSubject_fdpo8_175",Se="_subject_fdpo8_87",Ce="_rTitle_fdpo8_194",Te="_liveTag_fdpo8_207",je="_teacherName_fdpo8_223",we="_teacherIcons_fdpo8_231",Le="_teaherPopup_fdpo8_235",ke="_teacherIconWrap_fdpo8_240",Ne="_teacherIconItem_fdpo8_246",Fe="_teacherIconItemTop_fdpo8_249",Ve="_teacherIconTitle_fdpo8_259",Ee="_teacherIconDes_fdpo8_264",ye="_closeIcon_fdpo8_271",Pe="_liveList_fdpo8_279",Be="_headerFollow_fdpo8_282",De="_unlinkeBtn_fdpo8_316",Ae="_followContainer_fdpo8_323";var t={headerContent:Z,teacherContent:ee,teacherIcon:ae,avatar:te,avatarActive:oe,teacherIconVip:se,teacherInfo:ce,teacherInfoName:ne,teacherHonor:ie,score:re,headerCount:_e,teacherOperation:le,btn:he,btnStar:pe,subjectSection:de,"teacher-bottom":"_teacher-bottom_fdpo8_92",followFans:ge,"teacher-data":"_teacher-data_fdpo8_101","teacher-data_item":"_teacher-data_item_fdpo8_106",iconVip:ue,iconOther:fe,"teacher-info":"_teacher-info_fdpo8_143","teacher-name":"_teacher-name_fdpo8_146",teacherCert:me,teacherLast:ve,subjectList:be,piNameSubject:Ie,subject:Se,rTitle:Ce,liveTag:Te,teacherName:je,teacherIcons:we,teaherPopup:Le,teacherIconWrap:ke,teacherIconItem:Ne,teacherIconItemTop:Fe,teacherIconTitle:Ve,teacherIconDes:Ee,closeIcon:ye,liveList:Pe,headerFollow:Be,unlinkeBtn:De,followContainer:Ae};function Oe(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!M(o)}const i=o=>{const e=`./images/${o}`;return{"./images/cert_active.png":l,"./images/cert_default.png":h,"./images/follow_bg.png":p,"./images/head_bg.png":d,"./images/icon-add.png":g,"./images/icon-cert.png":u,"./images/icon-chat.png":f,"./images/icon-close.png":m,"./images/icon-live.png":v,"./images/icon-message.png":b,"./images/icon-small-live.png":I,"./images/icon1.png":S,"./images/icon2.png":C,"./images/icon3.png":T,"./images/icon_fans.png":j,"./images/icon_subject.png":w,"./images/icon_subject1.png":L,"./images/icon_video.png":H,"./images/live_active.png":k,"./images/live_bg.png":N,"./images/live_default.png":F,"./images/music_active.png":V,"./images/music_default.png":E,"./images/svip_active.png":y,"./images/teacher-icon.png":P,"./images/video_active.png":B,"./images/video_default.png":D,"./images/vip_active.png":A,"./images/vip_default.png":O}[e].default};var aa=x({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(o){return o.split(",")||[]},onSearch(o){this.params.username=o,this.onSort()},onSort(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.getList()},async getList(){try{const o=this.params,e=await r.post("/api-student/student/queryMyFollow",{data:{...o}});this.loading=!1;const s=e.data||{};if(this.list.length>0&&s.pageNo===1)return;this.list=this.list.concat(s.rows||[]),this.finished=s.pageNo>=s.totalPage,this.params.page=s.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}},async onUnLike(o){R.confirm({message:"\u786E\u5B9A\u53D6\u6D88\u5173\u6CE8\u5417\uFF1F",confirmButtonColor:"var(--van-primary)"}).then(async()=>{try{await r.get("/api-student/teacher/starOrUnStar",{params:{userId:o.userId,starStatus:0}}),U("\u53D6\u6D88\u5173\u6CE8\u6210\u529F"),setTimeout(()=>{this.onSort()},1e3)}catch{}})},checkBadge(o,e,s){let c=!1;switch(o){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":e.tag&&(c=e.tag.indexOf(o)>-1);break;case"VIP":c=s==="VIP";break;case"SVIP":c=s==="SVIP"||s==="PERMANENT_SVIP";break;case"DEGREE":c=!!e.degreeFlag;break;case"TEACHER":c=!!e.teacherFlag;break;default:c=!1;break}return c}},render(){let o;return a("div",{class:t.teacherFollow},[a(Q,{position:"top"},{default:()=>[a(K,{border:!1,isFixed:!1},null),a(J,{onSearch:this.onSearch},null)]}),this.dataShow?a(q,{class:t.liveList,loading:this.loading,"onUpdate:loading":e=>this.loading=e,immediateCheck:!1,finished:this.finished,finishedText:"\u6CA1\u6709\u66F4\u591A\u4E86"},Oe(o=this.list.map(e=>a("div",{class:[t.headerCount,t.headerFollow],onClick:s=>{s.stopPropagation(),sessionStorage.removeItem("teacherHomeTabs"),this.$router.push({path:"/teacherHome",query:{teacherId:e.userId,tabs:"single"}})}},[a("div",{class:t.followContainer},[a("div",{class:t.teacherContent},[a("div",{class:t.teacherIcon,onClick:s=>{e.liveFlag===1&&(s.stopPropagation(),z({api:"joinLiveRoom",content:{roomId:e.roomUid,teacherId:e.userId}}))}},[a(_,{class:[t.avatar,(this.checkBadge("VIP",e.teacher,e.vipType)||this.checkBadge("SVIP",e.teacher,e.vipType))&&t.avatarActive],round:!0,src:e.avatar||W,fit:"cover"},null),e.liveFlag===1?a("p",{class:[t.liveTag,t.liveTagFollow]},[n("\u76F4\u64AD\u4E2D")]):(this.checkBadge("SVIP",e.teacher,e.vipType)||this.checkBadge("VIP",e.teacher,e.vipType))&&a(_,{class:t.teacherIconVip,src:this.checkBadge("SVIP",e.teacher,e.vipType)?i("svip_active.png"):this.checkBadge("VIP",e.teacher,e.vipType)?i("vip_active.png"):i("vip_default.png")},null)])]),a("div",null,[a("div",{class:t.teacherInfo},[a("div",{class:t.teacherInfoName},[e.userName||`\u6E38\u5BA2${e.userId||""}`]),this.checkBadge("DEGREE",e.teacher)&&a("img",{src:X},null),this.checkBadge("TEACHER",e.teacher)&&a("img",{src:Y},null)]),a("div",{class:t.piNameSubject},[a("div",{class:t.subjectList},[this.getSubjectNameList(e.subjectName).map(s=>a("span",{class:t.subject},[s]))])])])]),a("div",{class:t.teacherHonor},[a("div",{class:t.score},[n("\u8BC4\u5206: ")]),a("div",{class:t.level},[e.starGrade?a($,{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"}},[n("\u6682\u65E0\u8BC4\u5206")])])]),a("div",{class:[t["teacher-bottom"],t.followFans]},[a("div",{class:t["teacher-data"]},[a("div",{class:t["teacher-data_item"]},[n("\u7C89\u4E1D "),a("span",null,[e.fansNum||0])]),a("div",{class:t["teacher-data_item"]},[n("\u5DF2\u4E0A\u8BFE\u65F6 "),a("span",null,[e.expTime||0])])]),a("div",{class:t.unlinkeBtn,onClick:s=>{s.stopPropagation(),this.onUnLike(e)}},[n("\u53D6\u6D88\u5173\u6CE8")])])])))?o:{default:()=>[o]}):a(G,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u5173\u6CE8"},null)])}});export{aa as default,i as getAssetsHomeFile};