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