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
8.3 KiB
2 lines
8.3 KiB
import{_ as pe,a as de}from"./post-item.vue_vue_type_style_index_0_lang-0101e23f.js";import{_ as me}from"./post-skeleton-701feee1.js";import{B as he,_ as S,C as ve,D as fe,A as ge,E as we,F as ye}from"./index-8275f3fe.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 $e,G as xe,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-18c654e5.js";import{d as M,r as c,o,K as F,$ as t,a as r,L as n,e as h,M as $,D as Be,n as Pe,w as Re,j as Te,c as p,Y as b,O as U,F as P,a2 as R}from"./@vue-0075cdd2.js";import{_ as Ae}from"./main-nav.vue_vue_type_style_index_0_lang-899ed46d.js";import{u as De}from"./vuex-9af76a69.js";import{b as Ne}from"./vue-router-863a6505.js";import{i as Ve}from"./@vicons-4a4bea9c.js";import"./content-f2c12f71.js";import"./nonesir-video-36879f7c.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-471a8e21.js";import"./evtd-b614532e.js";import"./@css-render-d7709484.js";import"./vooks-848f90ef.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:{}},emits:["success"],setup(I,{emit:x}){const u=I,a=c(""),i=c(!1),e=()=>{x("success")},_=()=>{i.value=!0,he({user_id:u.user.id,content:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Le,[n(f,{"show-icon":!1},{default:t(()=>[h(" 即将发送私信给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h($(l.user.nickname)+"@"+$(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",Oe,[n(g,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"200","show-count":""},null,8,["value"])]),r("div",je,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_: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:{}},emits:["success"],setup(I,{emit:x}){const u=I,a=c(""),i=c(!1),e=()=>{x("success")},_=()=>{i.value=!0,ve({user_id:u.user.id,greetings:a.value}).then(l=>{window.$message.success("发送成功"),i.value=!1,a.value="",e()}).catch(l=>{i.value=!1})};return(l,d)=>{const m=T,v=A,f=D,g=N,w=q,y=V;return o(),F(y,{show:l.show,"onUpdate:show":e,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:t(()=>[r("div",Ge,[n(f,{"show-icon":!1},{default:t(()=>[h(" 发送添加朋友申请给: "),n(v,{style:{"max-width":"100%"}},{default:t(()=>[n(m,{type:"success"},{default:t(()=>[h($(l.user.nickname)+"@"+$(l.user.username),1)]),_:1})]),_:1})]),_:1}),r("div",Ke,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:a.value,"onUpdate:value":d[0]||(d[0]=k=>a.value=k),maxlength:"120","show-count":""},null,8,["value"])]),r("div",Qe,[n(w,{strong:"",secondary:"",type:"primary",loading:i.value,onClick:_},{default:t(()=>[h(" 发送 ")]),_: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},_s={key:2},cs={key:0,class:"pagination-wrap"},rs=M({__name:"User",setup(I){ke();const x=be(),u=De(),a=Ne(),i=c(!1),e=Be({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),_=c(!1),l=c(!1),d=c(!1),m=c([]),v=c(a.query.username||""),f=c(+a.query.p||1),g=c(20),w=c(0),y=()=>{i.value=!0,ge({username:v.value,page:f.value,page_size:g.value}).then(s=>{i.value=!1,m.value=s.list,w.value=Math.ceil(s.pager.total_rows/g.value),window.scrollTo(0,0)}).catch(s=>{i.value=!1})},k=()=>{_.value=!0,fe({username:v.value}).then(s=>{_.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,y()}).catch(s=>{_.value=!1,console.log(s)})},L=s=>{f.value=s,y()},O=()=>{l.value=!0},j=()=>{d.value=!0},E=()=>{l.value=!1},H=()=>{d.value=!1},G=Pe(()=>{let s=[{label:"私信",key:"whisper"}];return u.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=()=>{x.warning({title:"删除好友",content:"将好友 “"+e.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,we({user_id:e.id}).then(s=>{_.value=!1,e.is_friend=!1,y()}).catch(s=>{_.value=!1,console.log(s)})}})},Y=()=>{x.warning({title:"警告",content:"确定对该用户进行"+(e.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,ye({id:e.id,status:e.status===1?2:1}).then(s=>{_.value=!1,k()}).catch(s=>{_.value=!1,console.log(s)})}})};return Re(()=>({path:a.path,query:a.query}),(s,W)=>{W.path==="/user"&&s.path==="/user"&&(v.value=a.query.username||"",k())}),Te(()=>{k()}),(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,_e=pe,B=Ce,ce=de,re=$e,ue=xe;return o(),p("div",null,[n(J,{title:"用户详情"}),n(re,{class:"main-content-wrap profile-wrap",bordered:""},{default:t(()=>[n(te,{show:_.value},{default:t(()=>[e.id>0?(o(),p("div",Xe,[r("div",Ze,[n(X,{size:"large",src:e.avatar},null,8,["src"])]),r("div",es,[r("div",ss,[r("strong",null,$(e.nickname),1),r("span",null," @"+$(e.username),1),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username&&e.is_friend?(o(),F(C,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:t(()=>[h(" 好友 ")]),_:1})):U("",!0),e.is_admin?(o(),F(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:t(()=>[h(" 管理员 ")]),_:1})):U("",!0)]),r("div",ns,"UID. "+$(e.id),1)]),b(u).state.userInfo.id>0&&b(u).state.userInfo.username!=e.username?(o(),p("div",ts,[n(se,{placement:"bottom-end",trigger:"click",size:"small",options:G.value,onSelect:K},{default:t(()=>[n(ee,{quaternary:"",circle:""},{icon:t(()=>[n(Z,null,{default:t(()=>[n(b(Ve))]),_:1})]),_:1})]),_:1},8,["options"])])):U("",!0)])):U("",!0),n(ne,{show:l.value,user:e,onSuccess:E},null,8,["show","user"]),n(Je,{show:d.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}),i.value?(o(),p("div",os,[n(le,{num:g.value},null,8,["num"])])):(o(),p("div",as,[m.value.length===0?(o(),p("div",ls,[n(ie,{size:"large",description:"暂无数据"})])):U("",!0),b(u).state.desktopModelShow?(o(),p("div",is,[(o(!0),p(P,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(_e,{post:z},null,8,["post"])]),_:2},1024))),128))])):(o(),p("div",_s,[(o(!0),p(P,null,R(m.value,z=>(o(),F(B,{key:z.id},{default:t(()=>[n(ce,{post:z},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(o(),p("div",cs,[n(ue,{page:f.value,"onUpdate:page":L,"page-slot":b(u).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):U("",!0)])}}});const Vs=S(rs,[["__scopeId","data-v-31cfec9c"]]);export{Vs as default};
|