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
1 year ago
|
import{d as B,n as A,a3 as E,o as l,c as r,V as o,a1 as t,a as p,a2 as L,e as M,M as k,Q as N,O as z,_ as v,s as q,r as f,j as Q,F as C,a4 as W}from"./@vue-e0e89260.js";import{u as J,b as K}from"./vue-router-b8e3382f.js";import{G as X,H as Y,_ as O,R as Z,S as ee}from"./index-d161f57c.js";import{b as oe}from"./formatTime-4210fcd1.js";import{i as te,y as ne,z as se}from"./@vicons-0524c43e.js";import{T as ae,j as x,o as le,O as ce,e as _e,P as ie,M as ue,F as re,G as pe,f as me,g as de,I as fe,H as ge}from"./naive-ui-62663ad7.js";import{_ as ve}from"./post-skeleton-2db17910.js";import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-da1d5a81.js";import{u as he}from"./vuex-473b3783.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.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=>()=>q(x,null,{default:()=>q(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=A(()=>{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=E("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]=L(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[M(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(()=>[M(" 已关注 ")]),_: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 Ie=O(Ue,[["__scopeId","data-v-64f1874c"]]),Me={key:0,class:"skeleton-wrap"},qe={key:1},Ce={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"&&P(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})},P=(_,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})};retu
|