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-01d95431.js

2 lines
9.6 KiB

import{_ as xe,a as $e}from"./post-item.vue_vue_type_style_index_0_lang-cf654b7f.js";import{_ as Ue}from"./post-skeleton-627d3fc3.js";import{B as Pe,_ as A,C as ze,D as Fe,A as q,E as Se,F as Te}from"./index-8b4e1776.js";import{R as G,K,S as Q,b as J,e as D,i as X,T as Ie,F as Me,G as qe,o as Ce,O as We,j as Be,P as Re,k as Ae,f as De,g as Ne,I as Ve,H as Ee}from"./naive-ui-62663ad7.js";import{d as N,r as o,o as c,Q as F,a1 as n,a as p,V as a,e as w,M as k,E as Oe,n as je,w as He,j as Le,c as m,_ as y,O as z,F as H,a4 as L}from"./@vue-e0e89260.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-c955aa6b.js";import{u as Ke}from"./vuex-473b3783.js";import{b as Qe}from"./vue-router-b8e3382f.js";import{i as Je}from"./@vicons-d502290a.js";import"./content-c0ce69b7.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.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 Xe={class:"whisper-wrap"},Ye={class:"whisper-line"},Ze={class:"whisper-line send-wrap"},es=N({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(T,{emit:b}){const d=T,i=o(""),t=o(!1),s=()=>{b("success")},_=()=>{t.value=!0,Pe({user_id:d.user.id,content:i.value}).then(u=>{window.$message.success("发送成功"),t.value=!1,i.value="",s()}).catch(u=>{t.value=!1})};return(u,h)=>{const r=G,v=K,l=Q,g=J,x=D,$=X;return c(),F($,{show:u.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[p("div",Xe,[a(l,{"show-icon":!1},{default:n(()=>[w(" 即将发送私信给: "),a(v,{style:{"max-width":"100%"}},{default:n(()=>[a(r,{type:"success"},{default:n(()=>[w(k(u.user.nickname)+"@"+k(u.user.username),1)]),_:1})]),_:1})]),_:1}),p("div",Ye,[a(g,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:i.value,"onUpdate:value":h[0]||(h[0]=U=>i.value=U),maxlength:"200","show-count":""},null,8,["value"])]),p("div",Ze,[a(x,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:_},{default:n(()=>[w(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const ss=A(es,[["__scopeId","data-v-0cbfe47c"]]),as={class:"whisper-wrap"},ts={class:"whisper-line"},ns={class:"whisper-line send-wrap"},os=N({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(T,{emit:b}){const d=T,i=o(""),t=o(!1),s=()=>{b("success")},_=()=>{t.value=!0,ze({user_id:d.user.id,greetings:i.value}).then(u=>{window.$message.success("发送成功"),t.value=!1,i.value="",s()}).catch(u=>{t.value=!1})};return(u,h)=>{const r=G,v=K,l=Q,g=J,x=D,$=X;return c(),F($,{show:u.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[p("div",as,[a(l,{"show-icon":!1},{default:n(()=>[w(" 发送添加朋友申请给: "),a(v,{style:{"max-width":"100%"}},{default:n(()=>[a(r,{type:"success"},{default:n(()=>[w(k(u.user.nickname)+"@"+k(u.user.username),1)]),_:1})]),_:1})]),_:1}),p("div",ts,[a(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:i.value,"onUpdate:value":h[0]||(h[0]=U=>i.value=U),maxlength:"120","show-count":""},null,8,["value"])]),p("div",ns,[a(x,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:_},{default:n(()=>[w(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const ls=A(os,[["__scopeId","data-v-60be56a2"]]),cs={key:0,class:"profile-baseinfo"},is={class:"avatar"},us={class:"base-info"},rs={class:"username"},_s={class:"uid"},ps={key:0,class:"user-opts"},ds={key:0,class:"skeleton-wrap"},ms={key:1},vs={key:0,class:"empty-wrap"},hs={key:1},fs={key:2},gs={key:0,class:"pagination-wrap"},ws=N({__name:"User",setup(T){const b=Ie(),d=Ke(),i=Qe(),t=o(!1),s=Oe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),_=o(!1),u=o(!1),h=o(!1),r=o([]),v=o(i.query.username||""),l=o(+i.query.p||1),g=o("post"),x=o(+i.query.p||1),$=o(1),U=o(1),V=o(1),f=o(20),P=o(0),Y=()=>{switch(g.value){case"post":I();break;case"comment":C();break;case"media":W();break;case"star":B();break}},I=()=>{t.value=!0,q({username:v.value,style:"post",page:l.value,page_size:f.value}).then(e=>{t.value=!1,r.value=e.list||[],P.value=Math.ceil(e.pager.total_rows/f.value),window.scrollTo(0,0)}).catch(e=>{r.value=[],t.value=!1})},C=()=>{t.value=!0,q({username:v.value,style:"comment",page:l.value,page_size:f.value}).then(e=>{t.value=!1,r.value=e.list||[],P.value=Math.ceil(e.pager.total_rows/f.value),window.scrollTo(0,0)}).catch(e=>{r.value=[],t.value=!1})},W=()=>{t.value=!0,q({username:v.value,style:"media",page:l.value,page_size:f.value}).then(e=>{t.value=!1,r.value=e.list||[],P.value=Math.ceil(e.pager.total_rows/f.value),window.scrollTo(0,0)}).catch(e=>{r.value=[],t.value=!1})},B=()=>{t.value=!0,q({username:v.value,style:"star",page:l.value,page_size:f.value}).then(e=>{t.value=!1,r.value=e.list||[],P.value=Math.ceil(e.pager.total_rows/f.value),window.scrollTo(0,0)}).catch(e=>{r.value=[],t.value=!1})},Z=e=>{switch(g.value=e,g.value){case"post":l.value=x.value,I();break;case"comment":l.value=$.value,C();break;case"media":l.value=U.value,W();break;case"star":l.value=V.value,B();break}},R=()=>{_.value=!0,Fe({username:v.value}).then(e=>{_.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.status=e.status,Y()}).catch(e=>{_.value=!1,console.log(e)})},ee=e=>{switch(l.value=e,g.value){case"post":x.value=e,I();break;case"comment":$.value=l.value,C();break;case"media":U.value=l.value,W();break;case"star":V.value=l.value,B();break}},se=()=>{u.value=!0},ae=()=>{h.value=!0},te=()=>{u.value=!1},ne=()=>{h.value=!1},oe=je(()=>{let e=[{label:"私信",key:"whisper"}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned"}):e.push({label:"解封",key:"deblocking"})),s.is_friend?e.push({label:"删除好友",key:"delete"}):e.push({label:"添加朋友",key:"requesting"}),e}),le=e=>{switch(e){case"whisper":se();break;case"delete":ce();break;case"requesting":ae();break;case"banned":case"deblocking":ie();break}},ce=()=>{b.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,Se({user_id:s.id}).then(e=>{_.value=!1,s.is_friend=!1,I()}).catch(e=>{_.value=!1,console.log(e)})}})},ie=()=>{b.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,Te({id:s.id,status:s.status===1?2:1}).then(e=>{_.value=!1,R()}).catch(e=>{_.value=!1,console.log(e)})}})};return He(()=>({path:i.path,query:i.query}),(e,E)=>{E.path==="/user"&&e.path==="/user"&&(v.value=i.query.username||"",R())}),Le(()=>{R()}),(e,E)=>{const ue=Ge,re=Ce,O=We,_e=Be,pe=D,de=Re,me=ss,ve=Ae,M=De,he=Ne,fe=Ue,ge=Ve,we=xe,j=Ee,ye=$e,ke=Me,be=qe;return c(),m("div",null,[a(ue,{title:"用户详情"}),a(ke,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[a(ve,{show:_.value},{default:n(()=>[s.id>0?(c(),m("div",cs,[p("div",is,[a(re,{size:"large",src:s.avatar},null,8,["src"])]),p("div",us,[p("div",rs,[p("strong",null,k(s.nickname),1),p("span",null," @"+k(s.username),1),y(d).state.userInfo.id>0&&y(d).state.userInfo.username!=s.username&&s.is_friend?(c(),F(O,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[w(" 好友 ")]),_:1})):z("",!0),s.is_admin?(c(),F(O,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[w(" 管理员 ")]),_:1})):z("",!0)]),p("div",_s,"UID. "+k(s.id),1)]),y(d).state.userInfo.id>0&&y(d).state.userInfo.username!=s.username?(c(),m("div",ps,[a(de,{placement:"bottom-end",trigger:"click",size:"small",options:oe.value,onSelect:le},{default:n(()=>[a(pe,{quaternary:"",circle:""},{icon:n(()=>[a(_e,null,{default:n(()=>[a(y(Je))]),_:1})]),_:1})]),_:1},8,["options"])])):z("",!0)])):z("",!0),a(me,{show:u.value,user:s,onSuccess:te},null,8,["show","user"]),a(ls,{show:h.value,user:s,onSuccess:ne},null,8,["show","user"])]),_:1},8,["show"]),a(he,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":Z},{default:n(()=>[a(M,{name:"post",tab:"泡泡"}),a(M,{name:"comment",tab:"评论"}),a(M,{name:"media",tab:"图文"}),a(M,{name:"star",tab:"喜欢"})]),_:1}),t.value?(c(),m("div",ds,[a(fe,{num:f.value},null,8,["num"])])):(c(),m("div",ms,[r.value.length===0?(c(),m("div",vs,[a(ge,{size:"large",description:"暂无数据"})])):z("",!0),y(d).state.desktopModelShow?(c(),m("div",hs,[(c(!0),m(H,null,L(r.value,S=>(c(),F(j,{key:S.id},{default:n(()=>[a(we,{post:S},null,8,["post"])]),_:2},1024))),128))])):(c(),m("div",fs,[(c(!0),m(H,null,L(r.value,S=>(c(),F(j,{key:S.id},{default:n(()=>[a(ye,{post:S},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),P.value>0?(c(),m("div",gs,[a(be,{page:l.value,"onUpdate:page":ee,"page-slot":y(d).state.collapsedRight?5:8,"page-count":P.value},null,8,["page","page-slot","page-count"])])):z("",!0)])}}});const Js=A(ws,[["__scopeId","data-v-fd0defa8"]]);export{Js as default};