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/Profile-a2a7e06c.js

2 lines
11 KiB

import{_ as ke}from"./whisper-0918fca1.js";import{_ as ye,a as be}from"./post-item.vue_vue_type_style_index_0_lang-62423795.js";import{_ as Ie}from"./post-skeleton-06353fe4.js";import{_ as Pe}from"./main-nav.vue_vue_type_style_index_0_lang-b99ada21.js";import{d as Oe,H as i,b as Te,E as Ae,r as Fe,f as n,k as r,bf as u,q as p,w as v,Y as m,e as t,j as h,x as O,A as R,y as ne,F as b,u as I}from"./@vue-a481fc63.js";import{u as xe}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as L,K as ze,u as qe,f as $e,_ as Ce}from"./index-632f0e92.js";import{W as Se}from"./v3-infinite-loading-2c58ec2f.js";import{F as Le,G as Ue,a as Be,o as De,M as He,f as Ne,g as Ve,J as We,k as je,H as Ee}from"./naive-ui-eecf2ec3.js";import"./content-a18cbbe2.js";import"./@vicons-f0266f88.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-7c8d4b48.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 Re={class:"profile-baseinfo"},Ge={class:"avatar"},Je={class:"base-info"},Ke={class:"username"},Ye={class:"userinfo"},Qe={class:"info-item"},Xe={class:"info-item"},Ze={class:"userinfo"},ea={class:"info-item"},aa={class:"info-item"},ta={key:0,class:"skeleton-wrap"},sa={key:1},la={key:0,class:"empty-wrap"},oa={key:1},na={key:0},ua={key:1},ia={key:2},ra={key:3},ca={key:4},_a={key:2},va={key:0},da={key:1},ma={key:2},fa={key:3},pa={key:4},ha={class:"load-more-wrap"},ga={class:"load-more-spinner"},wa=Oe({__name:"Profile",setup(ka){const o=xe(),T=Me(),ue=Le(),d=i(!1),P=i(!1),l=i([]),A=i([]),F=i([]),x=i([]),M=i([]),z=i([]),f=i("post"),G=i(+T.query.p||1),J=i(1),K=i(1),Y=i(1),Q=i(1),s=i(+T.query.p||1),g=i(20),_=i(0),X=i(0),Z=i(0),ee=i(0),ae=i(0),te=i(0),B=i(!1),se=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{se.value=e,B.value=!0},ie=()=>{B.value=!1},k=e=>{ue.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?qe({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),le(e.user_id,!1)}).catch(c=>{}):$e({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),le(e.user_id,!0)}).catch(c=>{})}})};function le(e,c){q(A.value,e,c),q(F.value,e,c),q(x.value,e,c),q(M.value,e,c),q(z.value,e,c)}function q(e,c,E){if(e&&e.length>0)for(let U in e)e[U].user_id==c&&(e[U].user.is_following=E)}const D=()=>{switch(f.value){case"post":H();break;case"comment":N();break;case"highlight":V();break;case"media":W();break;case"star":j();break}},H=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,X.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},N=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,Z.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),x.value=l.value,ee.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},W=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,ae.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),_.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,te.value=_.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},re=e=>{switch(f.value=e,f.value){case"post":l.value=A.value,s.value=G.value,_.value=X.value,H();break;case"comment":l.value=F.value,s.value=J.value,_.value=Z.value,N();break;case"highlight":l.value=x.value,s.value=K.value,_.value=ee.value,V();break;case"media":l.value=M.value,s.value=Y.value,_.value=ae.value,W();break;case"star":l.value=z.value,s.value=Q.value,_.value=te.value,j();break}},ce=()=>{switch(f.value){case"post":G.value=s.value,H();break;case"comment":J.value=s.value,N();break;case"highlight":K.value=s.value,V();break;case"media":Y.value=s.value,W();break;case"star":Q.value=s.value,j();break}},_e=()=>{s.value<_.value||_.value==0?(P.value=!1,s.value++,ce()):P.value=!0};return Te(()=>{D()}),Ae(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const E=Pe,U=De,ve=He,oe=Fe("router-link"),$=Ne,de=Ve,me=Ie,fe=We,C=ye,y=Ee,S=be,pe=ke,he=Ue,ge=je,we=Be;return t(),n("div",null,[r(E,{title:"主页"}),u(o).state.userInfo.id>0?(t(),p(he,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:v(()=>[h("div",Re,[h("div",Ge,[r(U,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),h("div",Je,[h("div",Ke,[h("strong",null,O(u(o).state.userInfo.nickname),1),h("span",null," @"+O(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(t(),p(ve,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:v(()=>[R(" 管理员 ")]),_:1})):m("",!0)]),h("div",Ye,[h("span",Qe,"UID. "+O(u(o).state.userInfo.id),1),h("span",Xe,O(u(ze)(u(o).state.userInfo.created_on))+" 加入",1)]),h("div",Ze,[h("span",ea,[r(oe,{onClick:c[0]||(c[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:v(()=>[R(" 关注  "+O(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),h("span",aa,[r(oe,{onClick:c[1]||(c[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:v(()=>[R(" 粉丝  "+O(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),r(de,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":re},{default:v(()=>[r($,{name:"post",tab:"泡泡"}),r($,{name:"comment",tab:"评论"}),r($,{name:"highlight",tab:"亮点"}),r($,{name:"media",tab:"图文"}),r($,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(t(),n("div",ta,[r(me,{num:g.value},null,8,["num"])])):(t(),n("div",sa,[l.value.length===0?(t(),n("div",la,[r(fe,{size:"large",description:"暂无数据"})])):m("",!0),u(o).state.desktopModelShow?(t(),n("div",oa,[f.value==="post"?(t(),n("div",na,[(t(!0),n(b,null,I(A.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(C,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="comment"?(t(),n("div",ua,[(t(!0),n(b,null,I(F.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(C,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="highlight"?(t(),n("div",ia,[(t(!0),n(b,null,I(x.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(C,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="media"?(t(),n("div",ra,[(t(!0),n(b,null,I(M.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(C,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="star"?(t(),n("div",ca,[(t(!0),n(b,null,I(z.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(C,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(t(),n("div",_a,[f.value==="post"?(t(),n("div",va,[(t(!0),n(b,null,I(A.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(S,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="comment"?(t(),n("div",da,[(t(!0),n(b,null,I(F.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(S,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="highlight"?(t(),n("div",ma,[(t(!0),n(b,null,I(x.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(S,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="media"?(t(),n("div",fa,[(t(!0),n(b,null,I(M.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(S,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),f.value==="star"?(t(),n("div",pa,[(t(!0),n(b,null,I(z.value,a=>(t(),p(y,{key:a.id},{default:v(()=>[r(S,{post:a,isOwner:u(o).state.userInfo.id==a.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))])),r(pe,{show:B.value,user:se.value,onSuccess:ie},null,8,["show","user"])]),_:1})):m("",!0),_.value>0?(t(),p(we,{key:1,justify:"center"},{default:v(()=>[r(u(Se),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=a=>_e())},{spinner:v(()=>[h("div",ha,[P.value?m("",!0):(t(),p(ge,{key:0,size:14})),h("span",ga,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}});const Za=Ce(wa,[["__scopeId","data-v-b44eae22"]]);export{Za as default};