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

2 lines
14 KiB

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