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
13 KiB
2 lines
13 KiB
import{_ as He,a as je}from"./post-item.vue_vue_type_style_index_0_lang-ebd1ae42.js";import{_ as Ee}from"./post-skeleton-3703f541.js";import{C as Ge,_ as se,D as Je,E as Qe,B,F as Ke,G as Xe,H as Ye,I as Ze}from"./index-b4b0f710.js";import{R as pe,J as de,S as me,b as fe,e as ae,i as he,T as es,F as ss,a as as,j as ue,o as ts,M as ls,O as os,k as ns,f as us,g as is,H as cs,G as rs}from"./naive-ui-702193c2.js";import{d as te,r as o,o as r,Q as y,a2 as i,a as _,V as l,e as g,M as h,E as _s,n as vs,j as ps,w as ds,a4 as ms,c as w,O as P,_ as f,a3 as ie,F as ce,a5 as re,s as _e}from"./@vue-7e1ab0af.js";import{_ as fs}from"./main-nav.vue_vue_type_style_index_0_lang-fa3b58e7.js";import{u as hs}from"./vuex-f1ee712f.js";import{b as gs}from"./vue-router-edf90322.js";import{b as ws}from"./formatTime-4210fcd1.js";import{W as ks}from"./v3-infinite-loading-0611cb6c.js";import{i as ys,w as bs,x as ve,y as Ps,z as $s,D as xs,G as Ts}from"./@vicons-b98681e0.js";import"./content-1c30deb5.js";import"./paopao-video-player-66a1a537.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-2fc92f18.js";import"./evtd-b614532e.js";import"./@css-render-16be7445.js";import"./vooks-e23078ea.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 zs={class:"whisper-wrap"},Us={class:"whisper-line"},Is={class:"whisper-line send-wrap"},Ms=te({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(D,{emit:$}){const d=D,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Ge({user_id:d.user.id,content:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",zs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 即将发送私信给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Us,[l(z,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=M=>v.value=M),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Is,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Cs=se(Ms,[["__scopeId","data-v-0cbfe47c"]]),Fs={class:"whisper-wrap"},qs={class:"whisper-line"},Ss={class:"whisper-line send-wrap"},Ws=te({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(D,{emit:$}){const d=D,v=o(""),u=o(!1),p=()=>{$("success")},s=()=>{u.value=!0,Je({user_id:d.user.id,greetings:v.value}).then(n=>{window.$message.success("发送成功"),u.value=!1,v.value="",p()}).catch(n=>{u.value=!1})};return(n,k)=>{const x=pe,a=de,T=me,z=fe,U=ae,I=he;return r(),y(I,{show:n.show,"onUpdate:show":p,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:i(()=>[_("div",Fs,[l(T,{"show-icon":!1},{default:i(()=>[g(" 发送添加朋友申请给: "),l(a,{style:{"max-width":"100%"}},{default:i(()=>[l(x,{type:"success"},{default:i(()=>[g(h(n.user.nickname)+"@"+h(n.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",qs,[l(z,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":k[0]||(k[0]=M=>v.value=M),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ss,[l(U,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:s},{default:i(()=>[g(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Os=se(Ws,[["__scopeId","data-v-60be56a2"]]),Bs={key:0,class:"profile-baseinfo"},Ds={class:"avatar"},Ls={class:"base-info"},Rs={class:"username"},As={class:"userinfo"},Ns={class:"info-item"},Vs={class:"info-item"},Hs={class:"userinfo"},js={class:"info-item"},Es={class:"info-item"},Gs={key:0,class:"user-opts"},Js={key:0,class:"skeleton-wrap"},Qs={key:1},Ks={key:0,class:"empty-wrap"},Xs={key:1},Ys={key:2},Zs={class:"load-more-wrap"},ea={class:"load-more-spinner"},sa=te({__name:"User",setup(D){const $=es(),d=hs(),v=gs(),u=o(!1),p=o(!1),s=_s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),n=o(!1),k=o(!1),x=o(!1),a=o([]),T=o([]),z=o([]),U=o([]),I=o([]),M=o([]),C=o(v.query.s||""),t=o(+v.query.p||1),q=o("post"),R=o(+v.query.p||1),A=o(1),N=o(1),V=o(1),H=o(1),m=o(20),c=o(0),j=o(0),E=o(0),G=o(0),J=o(0),Q=o(0),ge=()=>{p.value=!1,a.value=[],T.value=[],z.value=[],U.value=[],I.value=[],M.value=[],q.value="post",t.value=1,R.value=1,A.value=1,N.value=1,V.value=1,H.value=1,c.value=0,j.value=0,E.value=0,G.value=0,J.value=0,Q.value=0},we=()=>{switch(q.value){case"post":L();break;case"comment":K();break;case"highlight":X();break;case"media":Y();break;case"star":Z();break}},L=()=>{u.value=!0,B({username:C.value,style:"post",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),T.value=a.value,j.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,B({username:C.value,style:"comment",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),z.value=a.value,E.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,B({username:C.value,style:"highlight",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),U.value=a.value,G.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Y=()=>{u.value=!0,B({username:C.value,style:"media",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),I.value=a.value,J.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,B({username:C.value,style:"star",page:t.value,page_size:m.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/m.value),M.value=a.value,Q.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},ke=e=>{switch(q.value=e,q.value){case"post":a.value=T.value,t.value=R.value,c.value=j.value,L();break;case"comment":a.value=z.value,t.value=A.value,c.value=E.value,K();break;case"highlight":a.value=U.value,t.value=N.value,c.value=G.value,X();break;case"media":a.value=I.value,t.value=V.value,c.value=J.value,Y();break;case"star":a.value=M.value,t.value=H.value,c.value=Q.value,Z();break}},W=()=>{n.value=!0,Qe({username:C.value}).then(e=>{n.value=!1,s.id=e.id,s.avatar=e.avatar,s.username=e.username,s.nickname=e.nickname,s.is_admin=e.is_admin,s.is_friend=e.is_friend,s.created_on=e.created_on,s.is_following=e.is_following,s.follows=e.follows,s.followings=e.followings,s.status=e.status,we()}).catch(e=>{n.value=!1,console.log(e)})},ye=()=>{switch(q.value){case"post":R.value=t.value,L();break;case"comment":A.value=t.value,K();break;case"highlight":N.value=t.value,X();break;case"media":V.value=t.value,Y();break;case"star":H.value=t.value,Z();break}},be=()=>{k.value=!0},Pe=()=>{x.value=!0},$e=()=>{k.value=!1},xe=()=>{x.value=!1},F=e=>()=>_e(ue,null,{default:()=>_e(e)}),Te=vs(()=>{let e=[{label:"私信",key:"whisper",icon:F(bs)}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned",icon:F(ve)}):e.push({label:"解封",key:"deblocking",icon:F(ve)})),s.is_following?e.push({label:"取消关注",key:"unfollow",icon:F(Ps)}):e.push({label:"关注",key:"follow",icon:F($s)}),s.is_friend?e.push({label:"删除好友",key:"delete",icon:F(xs)}):e.push({label:"添加朋友",key:"requesting",icon:F(Ts)}),e}),ze=e=>{switch(e){case"whisper":be();break;case"delete":Ue();break;case"requesting":Pe();break;case"follow":case"unfollow":Ie();break;case"banned":case"deblocking":Me();break}},Ue=()=>{$.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ke({user_id:s.id}).then(e=>{n.value=!1,s.is_friend=!1,L()}).catch(e=>{n.value=!1,console.log(e)})}})},Ie=()=>{$.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,s.is_following?Xe({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)}):Ye({user_id:s.id}).then(e=>{n.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Me=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.value=!0,Ze({id:s.id,status:s.status===1?2:1}).then(e=>{n.value=!1,s.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{n.value=!1,console.log(e)})}})},Ce=()=>{t.value<c.value||c.value==0?(p.value=!1,t.value++,ye()):p.value=!0};return ps(()=>{W()}),ds(()=>({path:v.path,query:v.query}),(e,b)=>{b.path==="/u"&&e.path==="/u"&&(C.value=v.query.s||"",ge(),W())}),(e,b)=>{const Fe=fs,qe=ts,ee=ls,le=ms("router-link"),Se=ae,We=os,Oe=Cs,oe=ns,O=us,Be=is,De=Ee,Le=cs,Re=He,ne=rs,Ae=je,Ne=ss,Ve=as;return r(),w("div",null,[l(Fe,{title:"用户详情"}),l(Ne,{class:"main-content-wrap profile-wrap",bordered:""},{default:i(()=>[l(oe,{show:n.value},{default:i(()=>[s.id>0?(r(),w("div",Bs,[_("div",Ds,[l(qe,{size:72,src:s.avatar},null,8,["src"])]),_("div",Ls,[_("div",Rs,[_("strong",null,h(s.nickname),1),_("span",null," @"+h(s.username),1),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:i(()=>[g(" 好友 ")]),_:1})):P("",!0),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username&&s.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:i(()=>[g(" 已关注 ")]),_:1})):P("",!0),s.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:i(()=>[g(" 管理员 ")]),_:1})):P("",!0)]),_("div",As,[_("span",Ns,"UID. "+h(s.id),1),_("span",Vs,h(f(ws)(s.created_on))+" 加入",1)]),_("div",Hs,[_("span",js,[l(le,{onClick:b[0]||(b[0]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"follows"}}},{default:i(()=>[g(" 关注 "+h(s.follows),1)]),_:1},8,["to"])]),_("span",Es,[l(le,{onClick:b[1]||(b[1]=ie(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"followings"}}},{default:i(()=>[g(" 粉丝 "+h(s.followings),1)]),_:1},8,["to"])])])]),f(d).state.userInfo.id>0&&f(d).state.userInfo.username!=s.username?(r(),w("div",Gs,[l(We,{placement:"bottom-end",trigger:"click",size:"small",options:Te.value,onSelect:ze},{default:i(()=>[l(Se,{quaternary:"",circle:""},{icon:i(()=>[l(f(ue),null,{default:i(()=>[l(f(ys))]),_:1})]),_:1})]),_:1},8,["options"])])):P("",!0)])):P("",!0),l(Oe,{show:k.value,user:s,onSuccess:$e},null,8,["show","user"]),l(Os,{show:x.value,user:s,onSuccess:xe},null,8,["show","user"])]),_:1},8,["show"]),l(Be,{class:"profile-tabs-wrap",type:"line",animated:"",value:q.value,"onUpdate:value":ke},{default:i(()=>[l(O,{name:"post",tab:"泡泡"}),l(O,{name:"comment",tab:"评论"}),l(O,{name:"highlight",tab:"亮点"}),l(O,{name:"media",tab:"图文"}),l(O,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&a.value.length===0?(r(),w("div",Js,[l(De,{num:m.value},null,8,["num"])])):(r(),w("div",Qs,[a.value.length===0?(r(),w("div",Ks,[l(Le,{size:"large",description:"暂无数据"})])):P("",!0),f(d).state.desktopModelShow?(r(),w("div",Xs,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(Re,{post:S},null,8,["post"])]),_:2},1024))),128))])):(r(),w("div",Ys,[(r(!0),w(ce,null,re(a.value,S=>(r(),y(ne,{key:S.id},{default:i(()=>[l(Ae,{post:S},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),c.value>0?(r(),y(Ve,{key:0,justify:"center"},{default:i(()=>[l(f(ks),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:b[2]||(b[2]=S=>Ce())},{spinner:i(()=>[_("div",Zs,[p.value?P("",!0):(r(),y(oe,{key:0,size:14})),_("span",ea,h(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):P("",!0)])}}});const Sa=se(sa,[["__scopeId","data-v-17f0dc61"]]);export{Sa as default};
|