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/User-f262d052.js

2 lines
12 KiB

import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-a10065a5.js";import{_ as Ne}from"./post-skeleton-7039dc67.js";import{_ as Ve}from"./whisper-5fc7c61f.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{d as ve,H as l,e as r,q as y,w as n,j as _,k as o,A as b,x as h,R as Ee,c as Ge,b as Ye,E as Je,r as Ke,f as g,Y as k,bf as m,y as ne,F as ue,u as ie,h as ce}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{D as Ze,_ as pe,E as ea,e as O,F as aa,G as sa,H as ta,I as la}from"./index-d9eb4c9e.js";import{R as oa,H as na,S as ua,b as ia,e as de,i as ca,T as ra,F as _a,a as va,j as re,o as pa,M as da,O as ma,k as fa,f as ga,g as ha,I as wa,G as ka}from"./naive-ui-d8de3dda.js";import{b as ya}from"./formatTime-4210fcd1.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,x as $a,y as _e,z as xa,u as Ta,D as za,G as Ua}from"./@vicons-1a3558c6.js";import"./content-218c067c.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 Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=ve({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ae,{emit:F}){const f=ae,p=l(""),P=l(!1),u=()=>{F("success")},v=()=>{P.value=!0,Ze({user_id:f.user.id,greetings:p.value}).then(a=>{window.$message.success("发送成功"),P.value=!1,p.value="",u()}).catch(a=>{P.value=!1})};return(a,c)=>{const T=oa,I=na,s=ua,q=ia,C=de,M=ca;return r(),y(M,{show:a.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",Fa,[o(s,{"show-icon":!1},{default:n(()=>[b(" 发送添加朋友申请给: "),o(I,{style:{"max-width":"100%"}},{default:n(()=>[o(T,{type:"success"},{default:n(()=>[b(h(a.user.nickname)+"@"+h(a.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ia,[o(q,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:p.value,"onUpdate:value":c[0]||(c[0]=S=>p.value=S),maxlength:"120","show-count":""},null,8,["value"])]),_("div",qa,[o(C,{strong:"",secondary:"",type:"primary",loading:P.value,onClick:v},{default:n(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=pe(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Da={class:"info-item"},Ba={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ea={key:1},Ga={key:0,class:"empty-wrap"},Ya={key:1},Ja={key:2},Ka={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=ve({__name:"User",setup(ae){const F=ra(),f=Qe(),p=Xe(),P="true".toLowerCase()==="true",u=l(!1),v=l(!1),a=Ee({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),c=l(!1),T=l(!1),I=l(!1),s=l([]),q=l([]),C=l([]),M=l([]),S=l([]),D=l([]),$=l(p.query.s||""),t=l(+p.query.p||1),z=l("post"),B=l(+p.query.p||1),R=l(1),H=l(1),N=l(1),V=l(1),d=l(20),i=l(0),j=l(0),E=l(0),G=l(0),Y=l(0),J=l(0),se=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,T.value=!0},me=()=>{v.value=!1,s.value=[],q.value=[],C.value=[],M.value=[],S.value=[],D.value=[],z.value="post",t.value=1,B.value=1,R.value=1,H.value=1,N.value=1,V.value=1,i.value=0,j.value=0,E.value=0,G.value=0,Y.value=0,J.value=0},fe=()=>{switch(z.value){case"post":A();break;case"comment":K();break;case"highlight":Q();break;case"media":X();break;case"star":Z();break}},A=()=>{u.value=!0,O({username:$.value,style:"post",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),q.value=s.value,j.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,O({username:$.value,style:"comment",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),C.value=s.value,E.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,O({username:$.value,style:"highlight",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),M.value=s.value,G.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,O({username:$.value,style:"media",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),S.value=s.value,Y.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,O({username:$.value,style:"star",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),D.value=s.value,J.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},ge=e=>{switch(z.value=e,z.value){case"post":s.value=q.value,t.value=B.value,i.value=j.value,A();break;case"comment":s.value=C.value,t.value=R.value,i.value=E.value,K();break;case"highlight":s.value=M.value,t.value=H.value,i.value=G.value,Q();break;case"media":s.value=S.value,t.value=N.value,i.value=Y.value,X();break;case"star":s.value=D.value,t.value=V.value,i.value=J.value,Z();break}},W=()=>{c.value=!0,ea({username:$.value}).then(e=>{c.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,fe()}).catch(e=>{c.value=!1,console.log(e)})},he=()=>{switch(z.value){case"post":B.value=t.value,A();break;case"comment":R.value=t.value,K();break;case"highlight":H.value=t.value,Q();break;case"media":N.value=t.value,X();break;case"star":V.value=t.value,Z();break}},we=()=>{T.value=!0},ke=()=>{I.value=!0},ye=()=>{T.value=!1},be=()=>{I.value=!1},x=e=>()=>ce(re,null,{default:()=>ce(e)}),Pe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:x($a)}];return f.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:x(_e)}):e.push({label:"解封",key:"deblocking",icon:x(_e)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:x(xa)}):e.push({label:"关注",key:"follow",icon:x(Ta)}),P&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:x(za)}):e.push({label:"添加朋友",key:"requesting",icon:x(Ua)})),e}),$e=e=>{switch(e){case"whisper":we();break;case"delete":xe();break;case"requesting":ke();break;case"follow":case"unfollow":Te();break;case"banned":case"deblocking":ze();break}},xe=()=>{F.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,aa({user_id:a.id}).then(e=>{c.value=!1,a.is_friend=!1,A()}).catch(e=>{c.value=!1,console.log(e)})}})},Te=()=>{F.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,a.is_following?sa({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)}):ta({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},ze=()=>{F.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{c.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},Ue=()=>{t.value<i.value||i.value==0?(v.value=!1,t.value++,he()):v.value=!0};return Ye(()=>{W()}),Je(()=>({path:p.path,query:p.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&($.value=p.query.s||"",me(),W())}),(e,w)=>{const Fe=je,Ie=pa,ee=da,te=Ke("router-link"),qe=de,Ce=ma,Me=Ve,le=fa,L=ga,Se=ha,We=Ne,Le=wa,Oe=Re,oe=ka,Ae=He,De=_a,Be=va;return r(),g("div",null,[o(Fe,{title:"用户详情"}),o(De,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[o(le,{show:c.value},{default:n(()=>[a.id>0?(r(),g("div",Sa,[_("div",Wa,[o(Ie,{size:72,src:a.avatar},null,8,["src"])]),_("div",La,[_("div",Oa,[_("strong",null,h(a.nickname),1),_("span",null," @"+h(a.username),1),P&&m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[b(" 好友 ")]),_:1})):k("",!0),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:n(()=>[b(" 已关注 ")]),_:1})):k("",!0),a.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[b(" 管理员 ")]),_:1})):k("",!0)]),_("div",Aa,[_("span",Da,"UID. "+h(a.id),1),_("span",Ba,h(m(ya)(a.created_on))+" 加入",1)]),_("div",Ra,[_("span",Ha,[o(te,{onClick:w[0]||(w[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:n(()=>[b(" 关注  "+h(a.follows),1)]),_:1},8,["to"])]),_("span",Na,[o(te,{onClick:w[1]||(w[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:n(()=>[b(" 粉丝  "+h(a.followings),1)]),_:1},8,["to"])])])]),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username?(r(),g("div",Va,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Pe.value,onSelect:$e},{default:n(()=>[o(qe,{quaternary:"",circle:""},{icon:n(()=>[o(m(re),null,{default:n(()=>[o(m(Pa))]),_:1})]),_:1})]),_:1},8,["options"])])):k("",!0)])):k("",!0),o(Me,{show:T.value,user:a,onSuccess:ye},null,8,["show","user"]),o(Ma,{show:I.value,user:a,onSuccess:be},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:z.value,"onUpdate:value":ge},{default:n(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&s.value.length===0?(r(),g("div",ja,[o(We,{num:d.value},null,8,["num"])])):(r(),g("div",Ea,[s.value.length===0?(r(),g("div",Ga,[o(Le,{size:"large",description:"暂无数据"})])):k("",!0),m(f).state.desktopModelShow?(r(),g("div",Ya,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Oe,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))])):(r(),g("div",Ja,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Ae,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),i.value>0?(r(),y(Be,{key:0,justify:"center"},{default:n(()=>[o(m(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=U=>Ue())},{spinner:n(()=>[_("div",Ka,[v.value?k("",!0):(r(),y(le,{key:0,size:14})),_("span",Qa,h(v.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Cs=pe(Xa,[["__scopeId","data-v-3584e0a9"]]);export{Cs as default};