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
7.7 KiB
2 lines
7.7 KiB
import{_ as de}from"./whisper-f9793dd1.js";import{_ as ge,a as he}from"./post-item.vue_vue_type_style_index_0_lang-899852f8.js";import{_ as we}from"./post-skeleton-54a835d7.js";import{_ as ke}from"./main-nav.vue_vue_type_style_index_0_lang-a402eae2.js";import{d as ye,H as s,b as be,E as Pe,r as Ie,f,k as u,bf as i,q as w,w as p,Y as y,e as r,j as c,x as d,A as $,y as Q,F as X,u as Z}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as b,_ as ze}from"./index-8d220080.js";import{b as qe}from"./formatTime-4210fcd1.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 Ne,I as Ve,k as De,G as Fe}from"./naive-ui-d8de3dda.js";import"./content-e3389a3a.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";/* 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";import"./moment-2ab8298d.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:2},ea={class:"load-more-wrap"},aa={class:"load-more-spinner"},ta=ye({__name:"Profile",setup(sa){const o=Te(),g=Me(),n=s(!1),_=s(!1),a=s([]),C=s([]),L=s([]),B=s([]),N=s([]),V=s([]),P=s("post"),D=s(+g.query.p||1),F=s(1),U=s(1),W=s(1),j=s(1),t=s(+g.query.p||1),v=s(20),l=s(0),E=s(0),H=s(0),R=s(0),A=s(0),G=s(0),I=s(!1),Y=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=e=>{Y.value=e,I.value=!0},ee=()=>{I.value=!1},T=()=>{switch(P.value){case"post":M();break;case"comment":z();break;case"highlight":q();break;case"media":x();break;case"star":S();break}},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),C.value=a.value,E.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=a.value,H.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=a.value,R.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),N.value=a.value,A.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},S=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),V.value=a.value,G.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},ae=e=>{switch(P.value=e,P.value){case"post":a.value=C.value,t.value=D.value,l.value=E.value,M();break;case"comment":a.value=L.value,t.value=F.value,l.value=H.value,z();break;case"highlight":a.value=B.value,t.value=U.value,l.value=R.value,q();break;case"media":a.value=N.value,t.value=W.value,l.value=A.value,x();break;case"star":a.value=V.value,t.value=j.value,l.value=G.value,S();break}},te=()=>{switch(P.value){case"post":D.value=t.value,M();break;case"comment":F.value=t.value,z();break;case"highlight":U.value=t.value,q();break;case"media":W.value=t.value,x();break;case"star":j.value=t.value,S();break}},se=()=>{t.value<l.value||l.value==0?(_.value=!1,t.value++,te()):_.value=!0};return be(()=>{T()}),Pe(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+g.query.p||1,setTimeout(()=>{T()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+g.query.p||1,setTimeout(()=>{T()},0))}),(e,m)=>{const oe=ke,le=Ce,ne=Le,K=Ie("router-link"),k=Be,ue=Ne,ie=we,re=Ve,ce=ge,O=Fe,ve=he,_e=de,me=Se,pe=De,fe=$e;return r(),f("div",null,[u(oe,{title:"主页"}),i(o).state.userInfo.id>0?(r(),w(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Ue,[c("div",We,[u(le,{size:72,src:i(o).state.userInfo.avatar},null,8,["src"])]),c("div",je,[c("div",Ee,[c("strong",null,d(i(o).state.userInfo.nickname),1),c("span",null," @"+d(i(o).state.userInfo.username),1),i(o).state.userInfo.is_admin?(r(),w(ne,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[$(" 管理员 ")]),_:1})):y("",!0)]),c("div",He,[c("span",Re,"UID. "+d(i(o).state.userInfo.id),1),c("span",Ae,d(i(qe)(i(o).state.userInfo.created_on))+" 加入",1)]),c("div",Ge,[c("span",Ye,[u(K,{onClick:m[0]||(m[0]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[$(" 关注 "+d(i(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",Je,[u(K,{onClick:m[1]||(m[1]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[$(" 粉丝 "+d(i(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(ue,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":ae},{default:p(()=>[u(k,{name:"post",tab:"泡泡"}),u(k,{name:"comment",tab:"评论"}),u(k,{name:"highlight",tab:"亮点"}),u(k,{name:"media",tab:"图文"}),u(k,{name:"star",tab:"喜欢"})]),_:1}),n.value&&a.value.length===0?(r(),f("div",Ke,[u(ie,{num:v.value},null,8,["num"])])):(r(),f("div",Oe,[a.value.length===0?(r(),f("div",Qe,[u(re,{size:"large",description:"暂无数据"})])):y("",!0),i(o).state.desktopModelShow?(r(),f("div",Xe,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ce,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",Ze,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ve,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))]))])),u(_e,{show:I.value,user:Y.value,onSuccess:ee},null,8,["show","user"])]),_:1})):y("",!0),l.value>0?(r(),w(fe,{key:1,justify:"center"},{default:p(()=>[u(i(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>se())},{spinner:p(()=>[c("div",ea,[_.value?y("",!0):(r(),w(pe,{key:0,size:14})),c("span",aa,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Da=ze(ta,[["__scopeId","data-v-52df1da9"]]);export{Da as default};
|