index.2b580f62.js 5.5 KB

1
  1. import{C as m}from"./index.2d005e3b.js";import{P as _}from"./index.df62445e.js";import{r as g,d as f}from"./index.1f84bfe1.js";import{_ as h,a as x,b,c as v,d as w,e as E,f as y,g as I,h as k,i as j,j as S,k as F,l as L,m as T,n as B,o as O}from"./music_default.211e2c2b.js";import{_ as C}from"./icon_timer.ca726814.js";import{_ as V,a as U}from"./icon_vip_default.803a2c38.js";import{d as o,j as M,E as z,a9 as n,c as e,a as r,x as u,T as D,k as N,a8 as P,aj as q,ak as l,F as A}from"./vendor.9f3c6e4d.js";function Y(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!P(t)}const a=t=>{const s=`../../user-info/images/${t}`;return{"../../user-info/images/course_bg.png":h,"../../user-info/images/entry_active.png":x,"../../user-info/images/entry_default.png":b,"../../user-info/images/icon_cert.png":v,"../../user-info/images/icon_cert_default.png":w,"../../user-info/images/icon_king.png":E,"../../user-info/images/icon_live.png":y,"../../user-info/images/icon_live_default.png":I,"../../user-info/images/icon_member.png":k,"../../user-info/images/icon_member_default.png":j,"../../user-info/images/icon_music.png":S,"../../user-info/images/icon_music_default.png":F,"../../user-info/images/icon_timer.png":C,"../../user-info/images/icon_video.png":L,"../../user-info/images/icon_video_default.png":T,"../../user-info/images/icon_vip.png":V,"../../user-info/images/icon_vip_default.png":U,"../../user-info/images/music_active.png":B,"../../user-info/images/music_default.png":O}[s].default};var H=o({name:"item",props:{item:{type:Object,default:{}},getList:{type:Function,default:()=>{}}},computed:{subjects(){const{subjectName:t}=this.item;return t.split(",")||[]}},methods:{async onUnLike(){M.confirm("\u786E\u5B9A\u53D6\u6D88\u5173\u6CE8\u5417\uFF1F","\u63D0\u793A").then(async()=>{try{await g.get("/api-website/student/starOrUnStar",{params:{userId:this.item.userId,starStatus:0}}),z.success("\u53D6\u6D88\u5173\u6CE8\u6210\u529F"),this.getList()}catch{}})},checkBadge(t){let s=!1;const{teacher:i}=this.item;switch(t){case"STYLE":case"VIDEO":case"LIVE":case"MUSIC":i&&i.tag&&(s=i.tag.indexOf(t)>-1);break;case"VIP":if(i.membershipStartTime&&i.membershipEndTime){const p=n(i.membershipStartTime).valueOf(),d=n(i.membershipEndTime).valueOf(),c=n().valueOf();s=c>=p&&c<=d}else s=!1;break;default:s=!1;break}return s}},render(){const t=this.item;return e("div",{class:"w-[334px] rounded-[10px] mb-4 m-auto user-shadow relative"},[e("div",{class:"bg-[#CFF2FF] absolute right-4 top-5 text-[#0089B9] text-xs py-0.5 px-2 rounded-[10px]"},[r("\u8001\u5E08")]),e("div",{class:"p-[18px] flex"},[e(u,{src:t.avatar||f,class:"w-12 h-12 rounded-full border-2 border-[#2DC7AA] object-cover"},null),e("div",{class:"flex flex-col pl-5"},[e("p",{class:"text-base text-[#333] font-semibold leading-tight pb-0"},[t.userName]),e("div",{class:"flex items-center"},[e(u,{src:this.checkBadge("VIP")?a("icon_vip.png"):a("icon_vip_default.png"),class:"h-7 -ml-1"},null),e("img",{src:this.checkBadge("STYLE")?a("icon_cert.png"):a("icon_cert_default.png"),class:"h-[26px] px-1"},null),e("img",{src:this.checkBadge("VIDEO")?a("icon_video.png"):a("icon_video_default.png"),class:"h-[26px] px-1"},null),e("img",{src:this.checkBadge("LIVE")?a("icon_live.png"):a("icon_live_default.png"),class:"h-[26px] px-1"},null),e("img",{src:this.checkBadge("MUSIC")?a("icon_music.png"):a("icon_music_default.png"),class:"h-[26px] px-1"},null)])])]),e("p",{class:"mx-4 mb-3"},[this.subjects.map(s=>e(D,{effect:"dark",size:"small",color:"#E0FEF9",round:!0,style:{borderColor:"#E0FEF9",color:"#1B967E",margin:"0 4px 8px"}},Y(s)?s:{default:()=>[s]}))]),e("div",{class:"border-[#E7E6E6] border-t block mx-2.5 pt-1 pb-2 text-center"},[e(N,{type:"text",plain:!0,size:"small",class:"!bg-white !text-[#999999] hover:!text-[#FF8B00]",onClick:this.onUnLike},{default:()=>[r("\u53D6\u6D88\u5173\u6CE8")]})])])}}),W=o({name:"list",data(){return{pageInfo:{limit:10,page:1,total:0,page_size:[10,20,40,50]},list:[],loading:!1,dataShow:!1}},mounted(){this.getList()},methods:{async getList(){this.loading=!0;try{const{data:t}=await g.post("/api-website/student/queryMyFollow",{requestType:"json",data:{page:this.pageInfo.page,rows:this.pageInfo.limit}});this.list=t.rows||[],this.pageInfo.total=t.total,t.total<=0&&(this.dataShow=!0)}catch{}this.dataShow?this.loading=!1:setTimeout(()=>{this.loading=!1},200)}},render(){return e(A,null,[e("div",{class:"px-3 pt-5"},[e(q,{loading:this.loading,animated:!0,class:"w-full m-auto flex flex-wrap",count:2},{default:()=>[e("div",{class:"flex flex-wrap"},[this.list.map(t=>e("div",{class:"basis-1/2"},[e(H,{item:t,getList:this.getList},null)]))])],template:()=>e("div",{class:"w-[334px] rounded-[10px] p-[18px] flex mb-4 m-auto flex-col user-shadow relative"},[e("div",{class:"flex w-full"},[e(l,{variant:"circle",style:{width:"48px",height:"48px"}},null),e("div",{class:"flex flex-1 flex-col pl-5"},[e(l,{variant:"h3",style:{width:"50%",marginBottom:"8px"}},null),e(l,{variant:"p",style:{width:"60%"}},null)])]),e(l,{variant:"p",style:{width:"60%",marginTop:"6px"}},null)])})]),this.dataShow&&e(m,null,null),e(_,{total:this.pageInfo.total,page:this.pageInfo.page,"onUpdate:page":t=>this.pageInfo.page=t,limit:this.pageInfo.limit,"onUpdate:limit":t=>this.pageInfo.limit=t,pageSizes:this.pageInfo.page_size,pagination:this.getList},null)])}}),Z=o({name:"my-follow",data(){return{active:"MYFOLLOW"}},render(){return e("div",{class:"rounded-md overflow-hidden"},[e("div",{class:"text-2xl font-semibold text-black leading-none px-6 py-5 "},[r("\u5173\u6CE8\u7684\u8001\u5E08")]),e(W,null,null)])}});export{Z as default};