index.e643631a.js 3.5 KB

1
  1. import{C as r}from"./index.1c784c89.js";import{P as d}from"./index.c120de84.js";import{r as o,d as p}from"./index.3b4d272a.js";import{i as u}from"./icon_vip.11fd3e2a.js";import{d as i,j as c,E as m,c as t,a as l,x as n,T as g,a3 as h,k as f,F as x,ag as b,ah as a}from"./vendor.af4d8d64.js";function v(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!h(e)}var w=i({name:"item",props:{item:{type:Object,default:{}},getList:{type:Function,default:()=>{}}},computed:{subjects(){const{subjectName:e}=this.item;return e.split(",")}},methods:{async onUnLike(){c.confirm("\u786E\u5B9A\u53D6\u6D88\u5173\u6CE8\u5417\uFF1F","\u63D0\u793A").then(async()=>{try{await o.get("/api-website/student/starOrUnStar",{params:{userId:this.item.userId,starStatus:0}}),m.success("\u53D6\u6D88\u5173\u6CE8\u6210\u529F"),this.getList()}catch{}})}},render(){const e=this.item;return t("div",{class:"w-[158px] rounded-[10px] pt-10 mb-4 m-auto user-shadow relative"},[t("div",{class:"bg-[#CFF2FF] absolute left-2.5 top-2.5 text-[#0089B9] text-xs py-0.5 px-2 rounded-[10px]"},[l("\u8001\u5E08")]),t("div",{class:"flex flex-col items-center"},[t(n,{src:e.avatar||p,class:"w-12 h-12 rounded-full border-2 border-[#2DC7AA] object-cover"},null),e.isVip>0&&t(n,{src:u,class:"h-7 -mt-4"},null)]),t("p",{class:"text-base text-[#333] font-semibold leading-tight pb-5 pt-2 text-center"},[e.userName]),t("p",{class:"mx-4 text-center mb-3"},[this.subjects.map(s=>t(g,{effect:"dark",size:"small",color:"#E0FEF9",round:!0,style:{borderColor:"#E0FEF9",color:"#1B967E",margin:"0 4px 8px"}},v(s)?s:{default:()=>[s]}))]),t("div",{class:"border-[#E7E6E6] border-t block mx-2.5 pt-1 pb-2 text-center"},[t(f,{type:"text",plain:!0,size:"small",class:"!bg-white !text-[#999999] hover:!text-[#FF8B00]",onClick:this.onUnLike},{default:()=>[l("\u53D6\u6D88\u5173\u6CE8")]})])])}}),y=i({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:e}=await o.post("/api-website/student/queryMyFollow",{requestType:"json",data:{page:this.pageInfo.page,rows:this.pageInfo.limit}});this.list=e.rows||[],this.pageInfo.total=e.total,e.total<=0&&(this.dataShow=!0)}catch{}this.dataShow?this.loading=!1:setTimeout(()=>{this.loading=!1},200)}},render(){return t(x,null,[t("div",{class:"px-3 pt-5"},[t(b,{loading:this.loading,animated:!0,class:"w-full m-auto flex flex-wrap",count:4},{default:()=>[t("div",{class:"flex flex-wrap"},[this.list.map(e=>t("div",{class:"basis-1/4"},[t(w,{item:e,getList:this.getList},null)]))])],template:()=>t("div",{class:"w-[158px] rounded-[10px] pt-10 pb-7 mb-4 m-auto flex items-center justify-center flex-col user-shadow relative"},[t(a,{variant:"circle",style:{width:"48px",height:"48px"}},null),t(a,{variant:"h3",style:{width:"50%",marginTop:"8px",marginBottom:"20px"}},null),t(a,{variant:"p",style:{width:"60%",marginTop:"6px"}},null),t(a,{variant:"p",style:{width:"60%",marginTop:"6px"}},null)])})]),this.dataShow&&t(r,null,null),t(d,{total:this.pageInfo.total,page:this.pageInfo.page,"onUpdate:page":e=>this.pageInfo.page=e,limit:this.pageInfo.limit,"onUpdate:limit":e=>this.pageInfo.limit=e,pageSizes:this.pageInfo.page_size,pagination:this.getList},null)])}}),S=i({name:"my-follow",data(){return{active:"MYFOLLOW"}},render(){return t("div",{class:"h-full rounded-md overflow-hidden"},[t("div",{class:"text-2xl font-semibold text-black leading-none px-6 py-5 "},[l("\u5173\u6CE8\u7684\u8001\u5E08")]),t(y,null,null)])}});export{S as default};