1 |
- import{C as r}from"./index.3aad660f.js";import{P as p}from"./index.0a26a5e6.js";import{d as l,aC as d,b as n,b5 as u,c as t,a as i,bB as o,az as m,ax as c,aO as g,F as h}from"./index.050174ca.js";import{i as f}from"./icon_vip.c0b45767.js";import{E as x}from"./index2.c9975b03.js";import{E as b,a}from"./index2.9d6fe82d.js";import"./index2.d594d929.js";function w(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!c(e)}var v=l({name:"item",props:{item:{type:Object,default:{}},getList:{type:Function,default:()=>{}}},computed:{subjects(){const{subjectName:e}=this.item;return e.split(",")}},methods:{async onUnLike(){d.confirm("\u786E\u5B9A\u53D6\u6D88\u5173\u6CE8\u5417\uFF1F","\u63D0\u793A").then(async()=>{try{await n.get("/api-website/student/starOrUnStar",{params:{userId:this.item.userId,starStatus:0}}),u.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]"},[i("\u8001\u5E08")]),t("div",{class:"flex flex-col items-center"},[t(o,{src:e.avatar||m,class:"w-12 h-12 rounded-full border-2 border-[#2DC7AA] object-cover"},null),e.isVip>0&&t(o,{src:f,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(x,{effect:"dark",size:"small",color:"#E0FEF9",round:!0,style:{borderColor:"#E0FEF9",color:"#1B967E",margin:"0 4px 8px"}},w(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:()=>[i("\u53D6\u6D88\u5173\u6CE8")]})])])}}),y=l({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 n.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(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(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(p,{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)])}}),k=l({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 "},[i("\u5173\u6CE8\u7684\u8001\u5E08")]),t(y,null,null)])}});export{k as default};
|