1 |
- import{C as r}from"./index.1c784c89.js";import{P as d}from"./index.d9fdf5d5.js";import{r as o}from"./index.7b2381f3.js";import{i as p}from"./icon_vip.122a3cfc.js";import{d as i,j as u,E as c,c as t,a as l,x as n,T as m,a3 as f,k as g,F as h,ag as x,ah as a}from"./vendor.af4d8d64.js";function b(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!f(e)}var v=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(){u.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}}),c.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,class:"w-12 h-12 rounded-full border-2 border-[#2DC7AA] object-cover"},null),e.isVip&&t(n,{src:p,class:"h-7 -mt-4"},null)]),t("p",{class:"text-base text-[#333] font-medium leading-tight pb-5 pt-2 text-center"},[e.userName]),t("p",{class:"mx-4 text-center mb-3"},[this.subjects.map(s=>t(m,{effect:"dark",size:"small",color:"#E0FEF9",round:!0,style:{borderColor:"#E0FEF9",color:"#1B967E",margin:"0 4px 8px"}},b(s)?s:{default:()=>[s]}))]),t("div",{class:"border-[#E7E6E6] border-t block mx-2.5 pt-1 pb-2 text-center"},[t(g,{type:"text",plain:!0,size:"small",class:"!bg-white !text-[#999999] hover:!text-[#FF8B00]",onClick:this.onUnLike},{default:()=>[l("\u53D6\u6D88\u5173\u6CE8")]})])])}}),w=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(h,null,[t("div",{class:"px-3 pt-5"},[t(x,{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(v,{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)])}}),L=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-medium text-black leading-none px-6 py-5 "},[l("\u5173\u6CE8\u7684\u8001\u5E08")]),t(w,null,null)])}});export{L as default};
|