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
9.3 KiB
2 lines
9.3 KiB
import{_ as fe}from"./whisper-7dcedd50.js";import{_ as he,a as ge}from"./post-item.vue_vue_type_style_index_0_lang-a5e9cab2.js";import{_ as ke}from"./post-skeleton-4d2b103e.js";import{_ as ye}from"./main-nav.vue_vue_type_style_index_0_lang-2982e04a.js";import{d as we,H as n,b as be,E as Pe,r as Ie,f as o,k as u,bf as _,q as d,w as c,Y as m,e,j as f,x as I,A as E,y as ae,F as y,u as w}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as x,F as ze,_ as qe}from"./index-4a465428.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Fe,I as Ne,k as Ve,G as De}from"./naive-ui-d8de3dda.js";import"./content-0e30acaf.js";import"./@vicons-7a4ef312.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.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:"profile-baseinfo"},We={class:"avatar"},je={class:"base-info"},Ee={class:"username"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={class:"info-item"},Ke={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Xe={key:1},Ze={key:0},ea={key:1},aa={key:2},ta={key:3},sa={key:4},la={key:2},oa={key:0},na={key:1},ua={key:2},ia={key:3},ra={key:4},ca={class:"load-more-wrap"},va={class:"load-more-spinner"},_a=we({__name:"Profile",setup(ma){const i=Te(),T=Me(),v=n(!1),b=n(!1),s=n([]),S=n([]),$=n([]),C=n([]),L=n([]),B=n([]),p=n("post"),H=n(+T.query.p||1),R=n(1),A=n(1),G=n(1),Y=n(1),t=n(+T.query.p||1),h=n(20),r=n(0),J=n(0),K=n(0),O=n(0),Q=n(0),X=n(0),F=n(!1),Z=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),g=a=>{Z.value=a,F.value=!0},te=()=>{F.value=!1},N=()=>{switch(p.value){case"post":V();break;case"comment":D();break;case"highlight":U();break;case"media":W();break;case"star":j();break}},V=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"post",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),S.value=s.value,J.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},D=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"comment",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),$.value=s.value,K.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},U=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"highlight",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),C.value=s.value,O.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},W=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"media",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),L.value=s.value,Q.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},j=()=>{v.value=!0,x({username:i.state.userInfo.username,style:"star",page:t.value,page_size:h.value}).then(a=>{v.value=!1,a.list.length===0&&(b.value=!0),t.value>1?s.value=s.value.concat(a.list):(s.value=a.list||[],window.scrollTo(0,0)),r.value=Math.ceil(a.pager.total_rows/h.value),B.value=s.value,X.value=r.value}).catch(a=>{s.value=[],t.value>1&&t.value--,v.value=!1})},se=a=>{switch(p.value=a,p.value){case"post":s.value=S.value,t.value=H.value,r.value=J.value,V();break;case"comment":s.value=$.value,t.value=R.value,r.value=K.value,D();break;case"highlight":s.value=C.value,t.value=A.value,r.value=O.value,U();break;case"media":s.value=L.value,t.value=G.value,r.value=Q.value,W();break;case"star":s.value=B.value,t.value=Y.value,r.value=X.value,j();break}},le=()=>{switch(p.value){case"post":H.value=t.value,V();break;case"comment":R.value=t.value,D();break;case"highlight":A.value=t.value,U();break;case"media":G.value=t.value,W();break;case"star":Y.value=t.value,j();break}},oe=()=>{t.value<r.value||r.value==0?(b.value=!1,t.value++,le()):b.value=!0};return be(()=>{N()}),Pe(()=>({path:T.path,query:T.query,refresh:i.state.refresh}),(a,P)=>{if(a.refresh!==P.refresh){t.value=+T.query.p||1,setTimeout(()=>{N()},0);return}P.path!=="/post"&&a.path==="/profile"&&(t.value=+T.query.p||1,setTimeout(()=>{N()},0))}),(a,P)=>{const ne=ye,ue=Ce,ie=Le,ee=Ie("router-link"),M=Be,re=Fe,ce=ke,ve=Ne,z=he,k=De,q=ge,_e=fe,me=Se,pe=Ve,de=$e;return e(),o("div",null,[u(ne,{title:"主页"}),_(i).state.userInfo.id>0?(e(),d(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[f("div",Ue,[f("div",We,[u(ue,{size:72,src:_(i).state.userInfo.avatar},null,8,["src"])]),f("div",je,[f("div",Ee,[f("strong",null,I(_(i).state.userInfo.nickname),1),f("span",null," @"+I(_(i).state.userInfo.username),1),_(i).state.userInfo.is_admin?(e(),d(ie,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[E(" 管理员 ")]),_:1})):m("",!0)]),f("div",He,[f("span",Re,"UID. "+I(_(i).state.userInfo.id),1),f("span",Ae,I(_(ze)(_(i).state.userInfo.created_on))+" 加入",1)]),f("div",Ge,[f("span",Ye,[u(ee,{onClick:P[0]||(P[0]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:_(i).state.userInfo.username,n:_(i).state.userInfo.nickname,t:"follows"}}},{default:c(()=>[E(" 关注 "+I(_(i).state.userInfo.follows),1)]),_:1},8,["to"])]),f("span",Je,[u(ee,{onClick:P[1]||(P[1]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:_(i).state.userInfo.username,n:_(i).state.userInfo.nickname,t:"followings"}}},{default:c(()=>[E(" 粉丝 "+I(_(i).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(re,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":se},{default:c(()=>[u(M,{name:"post",tab:"泡泡"}),u(M,{name:"comment",tab:"评论"}),u(M,{name:"highlight",tab:"亮点"}),u(M,{name:"media",tab:"图文"}),u(M,{name:"star",tab:"喜欢"})]),_:1}),v.value&&s.value.length===0?(e(),o("div",Ke,[u(ce,{num:h.value},null,8,["num"])])):(e(),o("div",Oe,[s.value.length===0?(e(),o("div",Qe,[u(ve,{size:"large",description:"暂无数据"})])):m("",!0),_(i).state.desktopModelShow?(e(),o("div",Xe,[p.value==="post"?(e(),o("div",Ze,[(e(!0),o(y,null,w(S.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(e(),o("div",ea,[(e(!0),o(y,null,w($.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(e(),o("div",aa,[(e(!0),o(y,null,w(C.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(e(),o("div",ta,[(e(!0),o(y,null,w(L.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(e(),o("div",sa,[(e(!0),o(y,null,w(B.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(z,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0)])):(e(),o("div",la,[p.value==="post"?(e(),o("div",oa,[(e(!0),o(y,null,w(S.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="comment"?(e(),o("div",na,[(e(!0),o(y,null,w($.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="highlight"?(e(),o("div",ua,[(e(!0),o(y,null,w(C.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="media"?(e(),o("div",ia,[(e(!0),o(y,null,w(L.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0),p.value==="star"?(e(),o("div",ra,[(e(!0),o(y,null,w(B.value,l=>(e(),d(k,{key:l.id},{default:c(()=>[u(q,{post:l,onSendWhisper:g},null,8,["post"])]),_:2},1024))),128))])):m("",!0)]))])),u(_e,{show:F.value,user:Z.value,onSuccess:te},null,8,["show","user"])]),_:1})):m("",!0),r.value>0?(e(),d(de,{key:1,justify:"center"},{default:c(()=>[u(_(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:P[2]||(P[2]=l=>oe())},{spinner:c(()=>[f("div",ca,[b.value?m("",!0):(e(),d(pe,{key:0,size:14})),f("span",va,I(b.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Ga=qe(_a,[["__scopeId","data-v-756dadd0"]]);export{Ga as default};
|