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-35076387.js

2 lines
8.3 KiB

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