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
14 KiB
2 lines
14 KiB
import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-8624318f.js";import{_ as Ne}from"./post-skeleton-63a82733.js";import{_ as Ve}from"./whisper-ccc06a56.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-04907baf.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,R as Ee,c as Ge,b as Ye,E as Je,r as Ke,f as u,Y as d,bf as k,y as ce,F as $,u as T,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{D as Ze,_ as me,E as ea,e as V,F as aa,G as sa,H as ta,I as la}from"./index-6886c40b.js";import{R as na,H as oa,S as ua,b as ia,e as fe,i as ra,T as ca,F as _a,a as va,j as ve,o as da,M as pa,O as ma,k as fa,f as ha,g as ga,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,p as $a,y as de,z as Ta,v as xa,D as za,G as Ua}from"./@vicons-7a4ef312.js";import"./content-e5b2b63d.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=pe({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ue,{emit:O}){const y=ue,g=i(""),F=i(!1),c=()=>{O("success")},h=()=>{F.value=!0,Ze({user_id:y.user.id,greetings:g.value}).then(a=>{window.$message.success("发送成功"),F.value=!1,g.value="",c()}).catch(a=>{F.value=!1})};return(a,v)=>{const L=na,A=oa,l=ua,I=ia,q=fe,C=ra;return s(),m(C,{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",Fa,[t(l,{"show-icon":!1},{default:r(()=>[U(" 发送添加朋友申请给: "),t(A,{style:{"max-width":"100%"}},{default:r(()=>[t(L,{type:"success"},{default:r(()=>[U(x(a.user.nickname)+"@"+x(a.user.username),1)]),_:1})]),_:1})]),_:1}),f("div",Ia,[t(I,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:g.value,"onUpdate:value":v[0]||(v[0]=M=>g.value=M),maxlength:"120","show-count":""},null,8,["value"])]),f("div",qa,[t(q,{strong:"",secondary:"",type:"primary",loading:F.value,onClick:h},{default:r(()=>[U(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=me(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:0},Ka={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 O=ca(),y=Qe(),g=Xe(),F="true".toLowerCase()==="true",c=i(!1),h=i(!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}),v=i(!1),L=i(!1),A=i(!1),l=i([]),I=i([]),q=i([]),C=i([]),M=i([]),D=i([]),S=i(g.query.s||""),n=i(+g.query.p||1),p=i("post"),E=i(+g.query.p||1),G=i(1),Y=i(1),J=i(1),K=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=[],I.value=[],q.value=[],C.value=[],M.value=[],D.value=[],p.value="post",n.value=1,E.value=1,G.value=1,Y.value=1,J.value=1,K.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),I.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),q.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),C.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),M.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),D.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=I.value,n.value=E.value,_.value=Q.value,j();break;case"comment":l.value=q.value,n.value=G.value,_.value=X.value,se();break;case"highlight":l.value=C.value,n.value=Y.value,_.value=Z.value,te();break;case"media":l.value=M.value,n.value=J.value,_.value=ee.value,le();break;case"star":l.value=D.value,n.value=K.value,_.value=ae.value,ne();break}},B=()=>{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":E.value=n.value,j();break;case"comment":G.value=n.value,se();break;case"highlight":Y.value=n.value,te();break;case"media":J.value=n.value,le();break;case"star":K.value=n.value,ne();break}},ye=()=>{L.value=!0},be=()=>{A.value=!0},Pe=()=>{L.value=!1},$e=()=>{A.value=!1},W=e=>()=>_e(ve,null,{default:()=>_e(e)}),Te=Ge(()=>{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(Ta)}):e.push({label:"关注",key:"follow",icon:W(xa)}),F&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:W(za)}):e.push({label:"添加朋友",key:"requesting",icon:W(Ua)})),e}),xe=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":Fe();break}},ze=()=>{O.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,aa({user_id:a.id}).then(e=>{v.value=!1,a.is_friend=!1,j()}).catch(e=>{v.value=!1,console.log(e)})}})},Ue=()=>{O.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,a.is_following?sa({user_id:a.id}).then(e=>{v.value=!1,window.$message.success("取消关注成功"),B()}).catch(e=>{v.value=!1,console.log(e)}):ta({user_id:a.id}).then(e=>{v.value=!1,window.$message.success("关注成功"),B()}).catch(e=>{v.value=!1,console.log(e)})}})},Fe=()=>{O.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{v.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{v.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),B()}).catch(e=>{v.value=!1,console.log(e)})}})},Ie=()=>{n.value<_.value||_.value==0?(h.value=!1,n.value++,ke()):h.value=!0};return Ye(()=>{B()}),Je(()=>({path:g.path,query:g.query}),(e,z)=>{z.path==="/u"&&e.path==="/u"&&(S.value=g.query.s||"",he(),B())}),(e,z)=>{const qe=je,Ce=da,oe=pa,ie=Ke("router-link"),Me=fe,Se=ma,We=Ve,re=fa,R=ha,Le=ga,Oe=Ne,Ae=wa,H=Re,P=ka,N=He,De=_a,Be=va;return s(),u("div",null,[t(qe,{title:"用户详情"}),t(De,{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(Ce,{size:72,src:a.avatar},null,8,["src"])]),f("div",La,[f("div",Oa,[f("strong",null,x(a.nickname),1),f("span",null," @"+x(a.username),1),F&&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",Aa,[f("span",Da,"UID. "+x(a.id),1),f("span",Ba,x(k(ya)(a.created_on))+" 加入",1)]),f("div",Ra,[f("span",Ha,[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(" 关注 "+x(a.follows),1)]),_:1},8,["to"])]),f("span",Na,[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(" 粉丝 "+x(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:Te.value,onSelect:xe},{default:r(()=>[t(Me,{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(Ma,{show:A.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(R,{name:"post",tab:"泡泡"}),t(R,{name:"comment",tab:"评论"}),t(R,{name:"highlight",tab:"亮点"}),t(R,{name:"media",tab:"图文"}),t(R,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),c.value&&l.value.length===0?(s(),u("div",ja,[t(Oe,{num:w.value},null,8,["num"])])):(s(),u("div",Ea,[l.value.length===0?(s(),u("div",Ga,[t(Ae,{size:"large",description:"暂无数据"})])):d("",!0),k(y).state.desktopModelShow?(s(),u("div",Ya,[p.value==="post"?(s(),u("div",Ja,[(s(!0),u($,null,T(I.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",Ka,[(s(!0),u($,null,T(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==="highlight"?(s(),u("div",Qa,[(s(!0),u($,null,T(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==="media"?(s(),u("div",Xa,[(s(!0),u($,null,T(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==="star"?(s(),u("div",Za,[(s(!0),u($,null,T(D.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(H,{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,T(I.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="comment"?(s(),u("div",ss,[(s(!0),u($,null,T(q.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="highlight"?(s(),u("div",ts,[(s(!0),u($,null,T(C.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="media"?(s(),u("div",ls,[(s(!0),u($,null,T(M.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0),p.value==="star"?(s(),u("div",ns,[(s(!0),u($,null,T(D.value,o=>(s(),m(P,{key:o.id},{default:r(()=>[t(N,{post:o,onSendWhisper:b},null,8,["post"])]),_:2},1024))),128))])):d("",!0)]))]))]),_:1}),_.value>0?(s(),m(Be,{key:0,justify:"center"},{default:r(()=>[t(k(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:z[2]||(z[2]=o=>Ie())},{spinner:r(()=>[f("div",os,[h.value?d("",!0):(s(),m(re,{key:0,size:14})),f("span",us,x(h.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Hs=me(is,[["__scopeId","data-v-ebc19734"]]);export{Hs as default};
|