mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
5.0 KiB
2 lines
5.0 KiB
import{d as B,n as L,a4 as Q,o as l,c as r,V as o,a2 as t,a as p,a3 as A,e as q,M as k,Q as N,O as z,_ as v,s as C,r as f,j as E,F as I,a5 as W}from"./@vue-7e1ab0af.js";import{u as J,b as K}from"./vue-router-edf90322.js";import{G as X,H as Y,_ as O,R as Z,S as ee}from"./index-dd38be03.js";import{b as oe}from"./formatTime-4210fcd1.js";import{i as te,y as ne,z as se}from"./@vicons-b98681e0.js";import{T as ae,j as x,o as le,M as ce,e as _e,O as ie,L as ue,F as re,Q as pe,f as me,g as de,H as fe,G as ge}from"./naive-ui-702193c2.js";import{_ as ve}from"./post-skeleton-a2a78086.js";import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-d73b2ee7.js";import{u as he}from"./vuex-f1ee712f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./evtd-b614532e.js";import"./@css-render-16be7445.js";import"./vooks-e23078ea.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const ke={class:"follow-item"},ye={class:"nickname-wrap"},be={class:"username-wrap"},Fe={class:"user-info"},$e={class:"info-item"},ze={class:"info-item"},Te={class:"item-header-extra"},Ue=B({__name:"follow-item",props:{contact:{}},setup(T){const s=T,m=ae();J();const n=e=>()=>C(x,null,{default:()=>C(e)}),c=()=>{m.success({title:"提示",content:"确定"+(s.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.contact.is_following?X({user_id:s.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),s.contact.is_following=!1}).catch(e=>{console.log(e)}):Y({user_id:s.contact.user_id}).then(e=>{window.$message.success("关注成功"),s.contact.is_following=!0}).catch(e=>{console.log(e)})}})},y=e=>{switch(e){case"follow":case"unfollow":c();break}},w=L(()=>{let e=[];return s.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:n(ne)}):e.push({label:"关注",key:"follow",icon:n(se)}),e});return(e,i)=>{const u=le,d=Q("router-link"),b=ce,F=_e,g=ie,$=ue;return l(),r("div",ke,[o($,{"content-indented":""},{avatar:t(()=>[o(u,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",ye,[o(d,{onClick:i[0]||(i[0]=A(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[q(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",be," @"+k(e.contact.username),1),e.contact.is_following?(l(),N(b,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[q(" 已关注 ")]),_:1})):z("",!0),p("div",Fe,[p("span",$e," UID. "+k(e.contact.user_id),1),p("span",ze,k(v(oe)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Te,[o(g,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:y},{default:t(()=>[o(F,{quaternary:"",circle:""},{icon:t(()=>[o(v(x),null,{default:t(()=>[o(v(te))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Me=O(Ue,[["__scopeId","data-v-64f1874c"]]),qe={key:0,class:"skeleton-wrap"},Ce={key:1},Ie={key:0,class:"empty-wrap"},xe={key:0,class:"pagination-wrap"},Be=B({__name:"Following",setup(T){const s=he(),m=K(),n=f(!1),c=f([]),y=m.query.n||"粉丝详情",w=m.query.s||"",e=f(m.query.t||"follows"),i=f(+m.query.p||1),u=f(20),d=f(0),b=_=>{i.value=_,g()},F=_=>{e.value=_,g()},g=()=>{e.value==="follows"?$(w):e.value==="followings"&&S(w)},$=(_,h=!1)=>{c.value.length===0&&(n.value=!0),Z({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})},S=(_,h=!1)=>{c.value.length===0&&(n.value=!0),ee({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})};return E(()=>{g()}),(_,h)=>{const a=we,U=me,V=de,D=ve,P=fe,R=Me,H=ge,j=re,G=pe;return l(),r(I,null,[p("div",null,[o(a,{title:v(y),back:!0},null,8,["title"]),o(j,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(V,{type:"line",animated:"","default-value":e.value,"onUpdate:value":F},{default:t(()=>[o(U,{name:"follows",tab:"正在关注"}),o(U,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),n.value?(l(),r("div",qe,[o(D,{num:u.value},null,8,["num"])])):(l(),r("div",Ce,[c.value.length===0?(l(),r("div",Ie,[o(P,{size:"large",description:"暂无数据"})])):z("",!0),(l(!0),r(I,null,W(c.value,M=>(l(),N(H,{key:M.user_id},{default:t(()=>[o(R,{contact:M},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(l(),r("div",xe,[o(G,{page:i.value,"onUpdate:page":b,"page-slot":v(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):z("",!0)],64)}}});const ao=O(Be,[["__scopeId","data-v-1f0f223d"]]);export{ao as default};
|