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.
paopao-ce/web/dist/assets/Contacts-d4090444.js

2 lines
4.4 KiB

import{_ as W}from"./whisper-11b20d3d.js";import{d as N,c as A,r as J,e as a,f as p,k as t,w as n,j as c,y as R,A as E,x as d,bf as h,h as x,H as l,b as G,q as $,Y as b,F as S,u as L}from"./@vue-a481fc63.js";import{J as U,_ as P,b as Y}from"./index-5ca8b57f.js";import{k as K,r as Q}from"./@vicons-f0266f88.js";import{j as M,o as X,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-c35d42a5.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-148fe87d.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(C,{emit:g}){const o=C,r=e=>()=>x(M,null,{default:()=>x(e)}),_=A(()=>[{label:"私信",key:"whisper",icon:r(Q)}]),i=e=>{switch(e){case"whisper":const s={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",s);break}};return(e,s)=>{const m=X,f=J("router-link"),w=Z,k=ee,y=te;return a(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[c("span",pe,[t(f,{onClick:s[0]||(s[0]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[E(d(e.contact.nickname),1)]),_:1},8,["to"])]),c("span",me," @"+d(e.contact.username),1),c("div",de,[c("span",fe," UID. "+d(e.contact.user_id),1),c("span",ve,d(h(U)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[c("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:_.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(K))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},be={class:"load-more-wrap"},Ce={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(C){const g=re(),o=l(!1),r=l(!1),_=l([]),i=l(+g.query.p||1),e=l(20),s=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value<s.value||s.value==0?(r.value=!1,i.value++,z()):r.value=!0};G(()=>{z()});const z=(v=!1)=>{_.value.length===0&&(o.value=!0),Y({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?_.value=_.value.concat(u.list):(_.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),s.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return a(),p(S,null,[c("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value?(a(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(a(),p("div",ye,[_.value.length===0?(a(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):b("",!0),(a(!0),p(S,null,L(_.value,I=>(a(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),s.value>0?(a(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[c("div",be,[r.value?b("",!0):(a(),$(O,{key:0,size:14})),c("span",Ce,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)],64)}}});const Xe=P(ze,[["__scopeId","data-v-3631bf3d"]]);export{Xe as default};