From 4aae50d2a7aa609bb827fbd699d0e55baa632d31 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sun, 24 Sep 2023 19:03:39 +0800 Subject: [PATCH] optimize messages page --- .../{404-449569c0.js => 404-fd38b229.js} | 2 +- ...nt-3a865c5e.js => Anouncement-e019b785.js} | 2 +- ...ion-24e69e36.js => Collection-cc8d06f9.js} | 2 +- ...tacts-76036e1a.js => Contacts-f9e04885.js} | 2 +- ...wing-04523b47.js => Following-6ce98032.js} | 2 +- .../{Home-3866e81c.js => Home-332e3a1d.js} | 2 +- web/dist/assets/Messages-0f6694f9.css | 1 - web/dist/assets/Messages-2d3ee462.js | 1 + web/dist/assets/Messages-333688e8.css | 1 + web/dist/assets/Messages-b0181f35.js | 1 - .../{Post-94d5e02e.js => Post-f693e2a8.js} | 2 +- ...rofile-636f310e.js => Profile-3c9035fa.js} | 2 +- ...etting-795c1b9a.js => Setting-0bb3d354.js} | 2 +- .../{Topic-c5d2b7a7.js => Topic-dc498894.js} | 2 +- .../{User-3f0d7b73.js => User-aa917c46.js} | 2 +- ...{Wallet-68eb1215.js => Wallet-f83d4c82.js} | 2 +- ...ontent-5f7e0179.js => content-b9c58eb8.js} | 2 +- .../{index-cb47660d.js => index-3c78935c.js} | 2 +- ...e_vue_type_style_index_0_lang-a6e1ffe5.js} | 2 +- ...e_vue_type_style_index_0_lang-b1622c74.js} | 2 +- ...-67280cce.js => post-skeleton-52d6bc96.js} | 2 +- ...hisper-7f52b83e.js => whisper-7e17488b.js} | 2 +- ...9d63.js => whisper-add-friend-622dcaa8.js} | 2 +- web/dist/index.html | 2 +- web/src/components/message-item.vue | 38 +------------------ 25 files changed, 24 insertions(+), 58 deletions(-) rename web/dist/assets/{404-449569c0.js => 404-fd38b229.js} (85%) rename web/dist/assets/{Anouncement-3a865c5e.js => Anouncement-e019b785.js} (91%) rename web/dist/assets/{Collection-24e69e36.js => Collection-cc8d06f9.js} (90%) rename web/dist/assets/{Contacts-76036e1a.js => Contacts-f9e04885.js} (92%) rename web/dist/assets/{Following-04523b47.js => Following-6ce98032.js} (95%) rename web/dist/assets/{Home-3866e81c.js => Home-332e3a1d.js} (98%) delete mode 100644 web/dist/assets/Messages-0f6694f9.css create mode 100644 web/dist/assets/Messages-2d3ee462.js create mode 100644 web/dist/assets/Messages-333688e8.css delete mode 100644 web/dist/assets/Messages-b0181f35.js rename web/dist/assets/{Post-94d5e02e.js => Post-f693e2a8.js} (98%) rename web/dist/assets/{Profile-636f310e.js => Profile-3c9035fa.js} (95%) rename web/dist/assets/{Setting-795c1b9a.js => Setting-0bb3d354.js} (98%) rename web/dist/assets/{Topic-c5d2b7a7.js => Topic-dc498894.js} (95%) rename web/dist/assets/{User-3f0d7b73.js => User-aa917c46.js} (97%) rename web/dist/assets/{Wallet-68eb1215.js => Wallet-f83d4c82.js} (95%) rename web/dist/assets/{content-5f7e0179.js => content-b9c58eb8.js} (98%) rename web/dist/assets/{index-cb47660d.js => index-3c78935c.js} (88%) rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-830cbb44.js => main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js} (96%) rename web/dist/assets/{post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js => post-item.vue_vue_type_style_index_0_lang-b1622c74.js} (98%) rename web/dist/assets/{post-skeleton-67280cce.js => post-skeleton-52d6bc96.js} (88%) rename web/dist/assets/{whisper-7f52b83e.js => whisper-7e17488b.js} (95%) rename web/dist/assets/{whisper-add-friend-70019d63.js => whisper-add-friend-622dcaa8.js} (95%) diff --git a/web/dist/assets/404-449569c0.js b/web/dist/assets/404-fd38b229.js similarity index 85% rename from web/dist/assets/404-449569c0.js rename to web/dist/assets/404-fd38b229.js index a80a5f7c..98fc1fdc 100644 --- a/web/dist/assets/404-449569c0.js +++ b/web/dist/assets/404-fd38b229.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-cb47660d.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{u as i}from"./vue-router-e5a2430e.js";import{G as a,e as c,a2 as u}from"./naive-ui-eecf2ec3.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-a481fc63.js";import{_ as g}from"./index-3c78935c.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */const v=l({__name:"404",setup(h){const e=i(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=a;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const O=g(v,[["__scopeId","data-v-e62daa85"]]);export{O as default}; diff --git a/web/dist/assets/Anouncement-3a865c5e.js b/web/dist/assets/Anouncement-e019b785.js similarity index 91% rename from web/dist/assets/Anouncement-3a865c5e.js rename to web/dist/assets/Anouncement-e019b785.js index dc60ea35..6e1ed2d3 100644 --- a/web/dist/assets/Anouncement-3a865c5e.js +++ b/web/dist/assets/Anouncement-e019b785.js @@ -1 +1 @@ -import{_ as N}from"./post-skeleton-67280cce.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-cb47660d.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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 L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; +import{_ as N}from"./post-skeleton-52d6bc96.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{J as F,_ as S}from"./index-3c78935c.js";import{G as V,R as q,J as H,H as J}from"./naive-ui-eecf2ec3.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e as t,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as I}from"./@vue-a481fc63.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-f0266f88.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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 L={key:0,class:"pagination-wrap"},M={key:0,class:"skeleton-wrap"},O={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},Y=P({__name:"Anouncement",setup($){const d=z(),g=A(),v=n(!1),i=n([]),r=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{r.value=m};return j(()=>{}),(m,K)=>{const k=R,y=q,x=N,w=H,B=J,C=V;return t(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(t(),o("div",L,[a(y,{page:r.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(t(),o("div",M,[a(x,{num:f.value},null,8,["num"])])):(t(),o("div",O,[i.value.length===0?(t(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(t(!0),o(D,null,E(i.value,e=>(t(),G(B,{key:e.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:I({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(u(F)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const ke=S(Y,[["__scopeId","data-v-d4d04859"]]);export{ke as default}; diff --git a/web/dist/assets/Collection-24e69e36.js b/web/dist/assets/Collection-cc8d06f9.js similarity index 90% rename from web/dist/assets/Collection-24e69e36.js rename to web/dist/assets/Collection-cc8d06f9.js index c8a2e91b..71ce2f9c 100644 --- a/web/dist/assets/Collection-24e69e36.js +++ b/web/dist/assets/Collection-cc8d06f9.js @@ -1 +1 @@ -import{_ as j}from"./whisper-7f52b83e.js";import{_ as q,a as D}from"./post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js";import{_ as R}from"./post-skeleton-67280cce.js";import{_ as U}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{u as E}from"./vuex-44de225f.js";import{b as G}from"./vue-router-e5a2430e.js";import{W as J}from"./v3-infinite-loading-2c58ec2f.js";import{S as L,u as Y,f as K,_ as Q}from"./index-cb47660d.js";import{d as X,H as s,b as Z,f as t,k as n,w as _,q as m,Y as g,e as o,bf as d,F as S,u as F,j as $,x as ee}from"./@vue-a481fc63.js";import{F as oe,G as se,a as te,J as ne,k as ae,H as ie}from"./naive-ui-eecf2ec3.js";import"./content-5f7e0179.js";import"./@vicons-f0266f88.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-7c8d4b48.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 le={key:0,class:"skeleton-wrap"},re={key:1},_e={key:0,class:"empty-wrap"},ue={key:1},ce={key:2},pe={class:"load-more-wrap"},me={class:"load-more-spinner"},de=X({__name:"Collection",setup(fe){const f=E(),b=G(),z=oe(),u=s(!1),r=s(!1),a=s([]),l=s(+b.query.p||1),v=s(20),c=s(0),w=s(!1),h=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),k=e=>{h.value=e,w.value=!0},B=()=>{w.value=!1},y=e=>{z.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Y({user_id:e.user.id}).then(p=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(p=>{}):K({user_id:e.user.id}).then(p=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(p=>{})}})},x=()=>{u.value=!0,L({page:l.value,page_size:v.value}).then(e=>{u.value=!1,e.list.length===0&&(r.value=!0),l.value>1?a.value=a.value.concat(e.list):(a.value=e.list,window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/v.value)}).catch(e=>{u.value=!1,l.value>1&&l.value--})},I=()=>{l.value{x()}),(e,p)=>{const M=U,O=R,P=ne,A=q,C=ie,H=D,N=j,T=se,V=ae,W=te;return o(),t("div",null,[n(M,{title:"收藏"}),n(T,{class:"main-content-wrap",bordered:""},{default:_(()=>[u.value&&a.value.length===0?(o(),t("div",le,[n(O,{num:v.value},null,8,["num"])])):(o(),t("div",re,[a.value.length===0?(o(),t("div",_e,[n(P,{size:"large",description:"暂无数据"})])):g("",!0),d(f).state.desktopModelShow?(o(),t("div",ue,[(o(!0),t(S,null,F(a.value,i=>(o(),m(C,{key:i.id},{default:_(()=>[n(A,{post:i,isOwner:d(f).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:k,onHandleFollowAction:y},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),t("div",ce,[(o(!0),t(S,null,F(a.value,i=>(o(),m(C,{key:i.id},{default:_(()=>[n(H,{post:i,isOwner:d(f).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:k,onHandleFollowAction:y},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),n(N,{show:w.value,user:h.value,onSuccess:B},null,8,["show","user"])]),_:1}),c.value>0?(o(),m(W,{key:0,justify:"center"},{default:_(()=>[n(d(J),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:I},{spinner:_(()=>[$("div",pe,[r.value?g("",!0):(o(),m(V,{key:0,size:14})),$("span",me,ee(r.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):g("",!0)])}}});const Le=Q(de,[["__scopeId","data-v-02747f0a"]]);export{Le as default}; +import{_ as j}from"./whisper-7e17488b.js";import{_ as q,a as D}from"./post-item.vue_vue_type_style_index_0_lang-b1622c74.js";import{_ as R}from"./post-skeleton-52d6bc96.js";import{_ as U}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{u as E}from"./vuex-44de225f.js";import{b as G}from"./vue-router-e5a2430e.js";import{W as J}from"./v3-infinite-loading-2c58ec2f.js";import{S as L,u as Y,f as K,_ as Q}from"./index-3c78935c.js";import{d as X,H as s,b as Z,f as t,k as n,w as _,q as m,Y as g,e as o,bf as d,F as S,u as F,j as $,x as ee}from"./@vue-a481fc63.js";import{F as oe,G as se,a as te,J as ne,k as ae,H as ie}from"./naive-ui-eecf2ec3.js";import"./content-b9c58eb8.js";import"./@vicons-f0266f88.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-7c8d4b48.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 le={key:0,class:"skeleton-wrap"},re={key:1},_e={key:0,class:"empty-wrap"},ue={key:1},ce={key:2},pe={class:"load-more-wrap"},me={class:"load-more-spinner"},de=X({__name:"Collection",setup(fe){const f=E(),b=G(),z=oe(),u=s(!1),r=s(!1),a=s([]),l=s(+b.query.p||1),v=s(20),c=s(0),w=s(!1),h=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),k=e=>{h.value=e,w.value=!0},B=()=>{w.value=!1},y=e=>{z.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?Y({user_id:e.user.id}).then(p=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(p=>{}):K({user_id:e.user.id}).then(p=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(p=>{})}})},x=()=>{u.value=!0,L({page:l.value,page_size:v.value}).then(e=>{u.value=!1,e.list.length===0&&(r.value=!0),l.value>1?a.value=a.value.concat(e.list):(a.value=e.list,window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/v.value)}).catch(e=>{u.value=!1,l.value>1&&l.value--})},I=()=>{l.value{x()}),(e,p)=>{const M=U,O=R,P=ne,A=q,C=ie,H=D,N=j,T=se,V=ae,W=te;return o(),t("div",null,[n(M,{title:"收藏"}),n(T,{class:"main-content-wrap",bordered:""},{default:_(()=>[u.value&&a.value.length===0?(o(),t("div",le,[n(O,{num:v.value},null,8,["num"])])):(o(),t("div",re,[a.value.length===0?(o(),t("div",_e,[n(P,{size:"large",description:"暂无数据"})])):g("",!0),d(f).state.desktopModelShow?(o(),t("div",ue,[(o(!0),t(S,null,F(a.value,i=>(o(),m(C,{key:i.id},{default:_(()=>[n(A,{post:i,isOwner:d(f).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:k,onHandleFollowAction:y},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),t("div",ce,[(o(!0),t(S,null,F(a.value,i=>(o(),m(C,{key:i.id},{default:_(()=>[n(H,{post:i,isOwner:d(f).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:k,onHandleFollowAction:y},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),n(N,{show:w.value,user:h.value,onSuccess:B},null,8,["show","user"])]),_:1}),c.value>0?(o(),m(W,{key:0,justify:"center"},{default:_(()=>[n(d(J),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:I},{spinner:_(()=>[$("div",pe,[r.value?g("",!0):(o(),m(V,{key:0,size:14})),$("span",me,ee(r.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):g("",!0)])}}});const Le=Q(de,[["__scopeId","data-v-02747f0a"]]);export{Le as default}; diff --git a/web/dist/assets/Contacts-76036e1a.js b/web/dist/assets/Contacts-f9e04885.js similarity index 92% rename from web/dist/assets/Contacts-76036e1a.js rename to web/dist/assets/Contacts-f9e04885.js index 92e5532d..1818d492 100644 --- a/web/dist/assets/Contacts-76036e1a.js +++ b/web/dist/assets/Contacts-f9e04885.js @@ -1 +1 @@ -import{_ as W}from"./whisper-7f52b83e.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,b as U}from"./index-cb47660d.js";import{k as Y,r as Q}from"./@vicons-f0266f88.js";import{j as M,o as X,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-67280cce.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Q)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=X,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(Y))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Xe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Xe as default}; +import{_ as W}from"./whisper-7e17488b.js";import{d as N,c as A,r as R,e as c,f as p,k as t,w as n,j as _,y as E,A as G,x as d,bf as h,h as x,H as l,b as J,q as $,Y as C,F as S,u as K}from"./@vue-a481fc63.js";import{K as L,_ as P,b as U}from"./index-3c78935c.js";import{k as Y,r as Q}from"./@vicons-f0266f88.js";import{j as M,o as X,e as Z,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-eecf2ec3.js";import{_ as _e}from"./post-skeleton-52d6bc96.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{W as le}from"./v3-infinite-loading-2c58ec2f.js";import{b as re}from"./vue-router-e5a2430e.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:g}){const o=b,r=e=>()=>x(M,null,{default:()=>x(e)}),s=A(()=>[{label:"私信",key:"whisper",icon:r(Q)}]),i=e=>{switch(e){case"whisper":const a={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};g("send-whisper",a);break}};return(e,a)=>{const m=X,f=R("router-link"),w=Z,k=ee,y=te;return c(),p("div",ue,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[_("span",pe,[t(f,{onClick:a[0]||(a[0]=E(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[G(d(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",me," @"+d(e.contact.username),1),_("div",de,[_("span",fe," UID. "+d(e.contact.user_id),1),_("span",ve,d(h(L)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[_("div",he,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:s.value,onSelect:i},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(h(M),null,{default:n(()=>[t(h(Y))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const we=P(ge,[["__scopeId","data-v-d62f19da"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=N({__name:"Contacts",setup(b){const g=re(),o=l(!1),r=l(!1),s=l([]),i=l(+g.query.p||1),e=l(20),a=l(0),m=l(!1),f=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=v=>{f.value=v,m.value=!0},k=()=>{m.value=!1},y=()=>{i.value{z()});const z=(v=!1)=>{s.value.length===0&&(o.value=!0),U({page:i.value,page_size:e.value}).then(u=>{o.value=!1,u.list.length===0&&(r.value=!0),i.value>1?s.value=s.value.concat(u.list):(s.value=u.list,v&&setTimeout(()=>{window.scrollTo(0,99999)},50)),a.value=Math.ceil(u.pager.total_rows/e.value)}).catch(u=>{o.value=!1,i.value>1&&i.value--})};return(v,u)=>{const q=ie,B=_e,V=se,j=we,D=ce,F=W,H=ne,O=ae,T=oe;return c(),p(S,null,[_("div",null,[t(q,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:n(()=>[o.value&&s.value.length===0?(c(),p("div",ke,[t(B,{num:e.value},null,8,["num"])])):(c(),p("div",ye,[s.value.length===0?(c(),p("div",$e,[t(V,{size:"large",description:"暂无数据"})])):C("",!0),(c(!0),p(S,null,K(s.value,I=>(c(),$(D,{class:"list-item",key:I.user_id},{default:n(()=>[t(j,{contact:I,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:m.value,user:f.value,onSuccess:k},null,8,["show","user"])]),_:1})]),a.value>0?(c(),$(T,{key:0,justify:"center"},{default:n(()=>[t(h(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:y},{spinner:n(()=>[_("div",Ce,[r.value?C("",!0):(c(),$(O,{key:0,size:14})),_("span",be,d(r.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):C("",!0)],64)}}});const Xe=P(ze,[["__scopeId","data-v-69277f0c"]]);export{Xe as default}; diff --git a/web/dist/assets/Following-04523b47.js b/web/dist/assets/Following-6ce98032.js similarity index 95% rename from web/dist/assets/Following-04523b47.js rename to web/dist/assets/Following-6ce98032.js index 0438ce8d..3a4cc8bb 100644 --- a/web/dist/assets/Following-04523b47.js +++ b/web/dist/assets/Following-6ce98032.js @@ -1 +1 @@ -import{_ as Q}from"./whisper-7f52b83e.js";import{d as N,c as O,r as Z,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as W,W as ie,X as _e}from"./index-cb47660d.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-67280cce.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=Z("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const We=W(Oe,[["__scopeId","data-v-1fb7364a"]]),De={key:0,class:"skeleton-wrap"},Ve={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},D=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,E=Fe,G=We,J=Te,K=Q,L=ke,X=ze,Y=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(L,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":V},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",De,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",Ve,[t.value.length===0?(c(),d("div",je,[n(E,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(J,{key:P.user_id},{default:a(()=>[n(G,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(K,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Y,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:D},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(X,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=W(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; +import{_ as Q}from"./whisper-7e17488b.js";import{d as N,c as O,r as Z,e as c,f as d,k as n,w as a,j as _,y as ee,A as S,x as g,q as $,Y as F,bf as w,h as U,H as i,b as oe,F as C,u as ne}from"./@vue-a481fc63.js";import{u as te,b as se}from"./vue-router-e5a2430e.js";import{K as ae,u as le,f as ce,_ as W,W as ie,X as _e}from"./index-3c78935c.js";import{k as ue,r as re,s as pe,t as me}from"./@vicons-f0266f88.js";import{F as fe,j as B,o as de,M as ve,e as ge,P as we,O as he,G as ke,a as ye,f as be,g as $e,J as Fe,k as ze,H as Te}from"./naive-ui-eecf2ec3.js";import{_ as qe}from"./post-skeleton-52d6bc96.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{W as Ie}from"./v3-infinite-loading-2c58ec2f.js";import"./vuex-44de225f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 Me={class:"follow-item"},Pe={class:"nickname-wrap"},Se={class:"username-wrap"},Ue={class:"user-info"},Ce={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=N({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(I,{emit:f}){const o=I,u=fe();te();const t=e=>()=>U(B,null,{default:()=>U(e)}),z=()=>{u.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?le({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):ce({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},h=O(()=>{let e=[{label:"私信",key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:t(pe)}):e.push({label:"关注",key:"follow",icon:t(me)}),e}),p=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const l={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};f("send-whisper",l);break}};return(e,l)=>{const m=de,v=Z("router-link"),k=ve,y=ge,T=we,q=he;return c(),d("div",Me,[n(q,{"content-indented":""},{avatar:a(()=>[n(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:a(()=>[_("span",Pe,[n(v,{onClick:l[0]||(l[0]=ee(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:a(()=>[S(g(e.contact.nickname),1)]),_:1},8,["to"])]),_("span",Se," @"+g(e.contact.username),1),e.contact.is_following?(c(),$(k,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[S(" 已关注 ")]),_:1})):F("",!0),_("div",Ue,[_("span",Ce," UID. "+g(e.contact.user_id),1),_("span",Be,g(w(ae)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":a(()=>[_("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:p},{default:a(()=>[n(y,{quaternary:"",circle:""},{icon:a(()=>[n(w(B),null,{default:a(()=>[n(w(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const We=W(Oe,[["__scopeId","data-v-1fb7364a"]]),De={key:0,class:"skeleton-wrap"},Ve={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Re={class:"load-more-spinner"},Ae=N({__name:"Following",setup(I){const f=se(),o=i(!1),u=i(!1),t=i([]),z=f.query.n||"粉丝详情",h=f.query.s||"",p=i(f.query.t||"follows"),e=i(+f.query.p||1),l=i(20),m=i(0),v=i(!1),k=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=O(()=>p.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=r=>{k.value=r,v.value=!0},q=()=>{v.value=!1},D=()=>{e.value{p.value=r,x()},x=()=>{p.value==="follows"?j(h):p.value==="followings"&&H(h)},j=(r,b=!1)=>{t.value.length===0&&(o.value=!0),ie({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})},H=(r,b=!1)=>{t.value.length===0&&(o.value=!0),_e({username:r,page:e.value,page_size:l.value}).then(s=>{o.value=!1,s.list.length===0&&(u.value=!0),e.value>1?t.value=t.value.concat(s.list):(t.value=s.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),m.value=Math.ceil(s.pager.total_rows/l.value)}).catch(s=>{o.value=!1,e.value>1&&e.value--})};return oe(()=>{x()}),(r,b)=>{const s=xe,M=be,R=$e,A=qe,E=Fe,G=We,J=Te,K=Q,L=ke,X=ze,Y=ye;return c(),d(C,null,[_("div",null,[n(s,{title:w(z),back:!0},null,8,["title"]),n(L,{class:"main-content-wrap",bordered:""},{default:a(()=>[n(R,{type:"line",animated:"","default-value":p.value,"onUpdate:value":V},{default:a(()=>[n(M,{name:"follows",tab:"正在关注"}),n(M,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),o.value&&t.value.length===0?(c(),d("div",De,[n(A,{num:l.value},null,8,["num"])])):(c(),d("div",Ve,[t.value.length===0?(c(),d("div",je,[n(E,{size:"large",description:"暂无数据"})])):F("",!0),(c(!0),d(C,null,ne(t.value,P=>(c(),$(J,{key:P.user_id},{default:a(()=>[n(G,{contact:P,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(K,{show:v.value,user:k.value,onSuccess:q},null,8,["show","user"])]),_:1})]),m.value>0?(c(),$(Y,{key:0,justify:"center"},{default:a(()=>[n(w(Ie),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:D},{spinner:a(()=>[_("div",He,[u.value?F("",!0):(c(),$(X,{key:0,size:14})),_("span",Re,g(u.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}});const wo=W(Ae,[["__scopeId","data-v-598cf32e"]]);export{wo as default}; diff --git a/web/dist/assets/Home-3866e81c.js b/web/dist/assets/Home-332e3a1d.js similarity index 98% rename from web/dist/assets/Home-3866e81c.js rename to web/dist/assets/Home-332e3a1d.js index 56f93e4b..4c2c2cd0 100644 --- a/web/dist/assets/Home-3866e81c.js +++ b/web/dist/assets/Home-332e3a1d.js @@ -1 +1 @@ -import{W as Ue}from"./whisper-add-friend-70019d63.js";import{_ as Be}from"./whisper-7f52b83e.js";import{_ as Ee,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js";import{_ as xe}from"./post-skeleton-67280cce.js";import{d as Ce,H as l,c as we,b as Ie,e as p,f as y,bf as A,j as b,k as a,w as i,q as x,Y as k,y as ke,A as S,x as se,F as ye,u as Ae,R as Fe,E as Ne}from"./@vue-a481fc63.js";import{u as ze}from"./vuex-44de225f.js";import{l as be}from"./lodash-e0b37ac3.js";import{g as Re,a as qe,c as Ge,b as Oe,d as Pe,e as Se,u as Ye,f as Le,h as Me,_ as We}from"./index-cb47660d.js";import{p as Ke}from"./content-5f7e0179.js";import{V,P as Q}from"./IEnum-5453a777.js";import{I as je,V as Qe,A as He,d as Ze,E as Je}from"./@vicons-f0266f88.js";import{o as De,v as Xe,j as $e,e as et,w as tt,x as st,y as at,z as nt,A as ot,B as lt,C as it,a as Te,D as rt,E as ut,F as ct,G as pt,H as dt,l as vt,I as mt,J as _t,k as ft}from"./naive-ui-eecf2ec3.js";import{_ as gt}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{b as ht,u as wt}from"./vue-router-e5a2430e.js";import{W as yt}from"./v3-infinite-loading-2c58ec2f.js";import{S as At}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const kt=H=>{const R=new FileReader,C=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),I=()=>{const r=new Uint8Array(R.result).subarray(0,4);let T="";for(let m=0;m{R.onloadend=()=>{const m=H.type;r(m===""||m==="application/octet-stream"?I():C(m))},R.readAsArrayBuffer(H.slice(0,4))})},bt={key:0,class:"compose-wrap"},Ct={class:"compose-line"},It={class:"compose-user"},zt={class:"compose-line compose-options"},Dt={class:"attachment"},Tt={class:"submit-wrap"},Ut={class:"attachment-list-wrap"},Bt={key:0,class:"attachment-price-wrap"},Et=b("span",null," 附件价格¥",-1),Vt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Ft={key:1,class:"compose-wrap"},Nt=b("div",{class:"login-wrap"},[b("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Rt={key:0,class:"login-only-wrap"},qt={key:1,class:"login-wrap"},Gt=Ce({__name:"compose",emits:["post-success"],setup(H,{emit:R}){const C=ze(),I=l([]),r=l(!1),T=l(!1),m=l(!1),F=l(!1),U=l(""),z=l([]),q=l(),Y=l(0),d=l("public/image"),_=l([]),D=l([]),G=l([]),N=l([]),f=l(V.PUBLIC),g=l(V.PUBLIC),O="true".toLowerCase()==="true",B=+"400",L=l("true".toLowerCase()==="true"),W=l("true".toLowerCase()==="true"),Z=l("true".toLowerCase()==="true"),J=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),ne="/v1/attachment",oe=we(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),le=we(()=>{let e=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return O&&e.push({value:V.FRIEND,label:"好友可见"}),e}),X=()=>{m.value=!m.value,m.value&&F.value&&(F.value=!1)},$=()=>{F.value=!F.value,F.value&&m.value&&(m.value=!1)},ee=be.debounce(e=>{Re({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),ie=be.debounce(e=>{qe({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),M=(e,t)=>{r.value||(r.value=!0,t==="@"?ee(e):ie(e))},re=e=>{e.length>B?U.value=e.substring(0,B):U.value=e},P=e=>{d.value=e},E=e=>{for(let c=0;c30&&(e[c].name=s.substring(0,18)+"..."+s.substring(s.length-9)+"."+o)}_.value=e},te=async e=>{var t,s,o,c,v;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((s=e.file.file)==null?void 0:s.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=e.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((c=e.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!await kt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((v=e.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ue=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);o.code===0&&(d.value==="public/image"&&D.value.push({id:e.id,content:o.data.content}),d.value==="public/video"&&G.value.push({id:e.id,content:o.data.content}),d.value==="attachment"&&N.value.push({id:e.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},K=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);if(o.code!==0){let c=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(v=>{c+=":"+v}),window.$message.error(c)}}catch{window.$message.error("上传失败")}},ce=({file:e})=>{let t=D.value.findIndex(s=>s.id===e.id);t>-1&&D.value.splice(t,1),t=G.value.findIndex(s=>s.id===e.id),t>-1&&G.value.splice(t,1),t=N.value.findIndex(s=>s.id===e.id),t>-1&&N.value.splice(t,1)},n=()=>{if(U.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Ke(U.value);const s=[];let o=100;s.push({content:U.value,type:Q.TEXT,sort:o}),D.value.map(c=>{o++,s.push({content:c.content,type:Q.IMAGEURL,sort:o})}),G.value.map(c=>{o++,s.push({content:c.content,type:Q.VIDEOURL,sort:o})}),N.value.map(c=>{o++,s.push({content:c.content,type:Q.ATTACHMENT,sort:o})}),z.value.length>0&&z.value.map(c=>{o++,s.push({content:c,type:Q.LINKURL,sort:o})}),T.value=!0,Ge({contents:s,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+Y.value*100,visibility:f.value}).then(c=>{var v;window.$message.success("发布成功"),T.value=!1,R("post-success",c),m.value=!1,F.value=!1,(v=q.value)==null||v.clear(),_.value=[],U.value="",z.value=[],D.value=[],G.value=[],N.value=[],f.value=g.value}).catch(c=>{T.value=!1})},u=e=>{C.commit("triggerAuth",!0),C.commit("triggerAuthKey",e)};return Ie(()=>{const e="friend".toLowerCase();O&&e==="friend"?g.value=V.FRIEND:e==="following"?g.value=V.Following:e==="public"?g.value=V.PUBLIC:g.value=V.PRIVATE,f.value=g.value}),(e,t)=>{const s=De,o=Xe,c=$e,v=et,j=tt,pe=st,de=at,ve=nt,me=ot,_e=lt,fe=it,ge=Te,he=rt,w=ut;return p(),y("div",null,[A(C).state.userInfo.id>0?(p(),y("div",bt,[b("div",Ct,[b("div",It,[a(s,{round:"",size:30,src:A(C).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:U.value,prefix:["@","#"],options:I.value,onSearch:M,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(_e,{ref_key:"uploadRef",ref:q,abstract:"","list-type":"image",multiple:!0,max:9,action:ne,headers:{Authorization:oe.value},data:{type:d.value},"file-list":_.value,onBeforeUpload:te,onFinish:ue,onError:K,onRemove:ce,"onUpdate:fileList":E},{default:i(()=>[b("div",zt,[b("div",Dt,[a(j,{abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("public/image"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),W.value?(p(),x(j,{key:0,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value!=="public/video"||_.value.length===9,onClick:()=>{P("public/video"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),Z.value?(p(),x(j,{key:1,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("attachment"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(He))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(v,{quaternary:"",circle:"",type:"primary",onClick:ke(X,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Ze))]),_:1})]),_:1},8,["onClick"]),ae.value?(p(),x(v,{key:2,quaternary:"",circle:"",type:"primary",onClick:ke($,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Je))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),b("div",Tt,[a(de,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(pe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:U.value.length/A(B)*100},null,8,["percentage"])]),default:i(()=>[S(" "+se(U.value.length)+" / "+se(A(B)),1)]),_:1}),a(v,{loading:T.value,onClick:n,type:"primary",secondary:"",round:""},{default:i(()=>[S(" 发布 ")]),_:1},8,["loading"])])]),b("div",Ut,[a(ve),N.value.length>0?(p(),y("div",Bt,[J.value?(p(),x(me,{key:0,value:Y.value,"onUpdate:value":t[0]||(t[0]=h=>Y.value=h),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Et]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),F.value?(p(),y("div",Vt,[a(he,{value:f.value,"onUpdate:value":t[1]||(t[1]=h=>f.value=h),name:"radiogroup"},{default:i(()=>[a(ge,null,{default:i(()=>[(p(!0),y(ye,null,Ae(le.value,h=>(p(),x(fe,{key:h.value,value:h.value,label:h.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),m.value?(p(),y("div",xt,[a(w,{value:z.value,"onUpdate:value":t[2]||(t[2]=h=>z.value=h),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[S(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(p(),y("div",Ft,[Nt,L.value?k("",!0):(p(),y("div",Rt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1})])),L.value?(p(),y("div",qt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1}),a(v,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=h=>u("signup"))},{default:i(()=>[S(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Ot="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Pt="/assets/discover-tweets-ab101944.jpeg",St="/assets/following-tweets-e36b4410.jpeg",Yt={class:"slide-bar-item"},Lt={class:"slide-bar-item-title slide-bar-user-link"},Mt={key:1,class:"skeleton-wrap"},Wt={key:0,class:"empty-wrap"},Kt={key:1},jt={key:2},Qt={class:"load-more-wrap"},Ht={class:"load-more-spinner"},Zt=Ce({__name:"Home",setup(H){const R="true".toLowerCase()==="true",C="true".toLowerCase()==="true",I=ze(),r=ht(),T=wt(),m=ct(),F=l(9),U=l(8),z=l([{title:"最新动态",style:1,username:"",avatar:Ot,show:!0},{title:"热门推荐",style:2,username:"",avatar:Pt,show:!1},{title:"正在关注",style:3,username:"",avatar:St,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),q=Fe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=l(null),d=l("泡泡广场"),_=l(!1),D=l(!1),G=l(1),N=l(""),f=l([]),g=l(1),O=l(20),B=l(0),L=l(!1),W=l(!1),Z=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=n=>{Z.value=n,L.value=!0},ae=()=>{L.value=!1},ne=()=>{W.value=!0},oe=n=>{m.warning({title:"删除好友",content:"将好友 “"+n.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Me({user_id:q.id}).then(u=>{window.$message.success("操作成功"),n.user.is_friend=!1}).catch(u=>{})}})},le=()=>{W.value=!1,Y.value=null},X=n=>{Y.value=n,q.id=n.user.id,q.username=n.user.username,q.nickname=n.user.nickname,n.user.is_friend?oe(n):ne()},$=n=>{m.success({title:"提示",content:"确定"+(n.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.user.is_following?Ye({user_id:n.user.id}).then(u=>{window.$message.success("操作成功"),n.user.is_following=!1}).catch(u=>{}):Le({user_id:n.user.id}).then(u=>{window.$message.success("关注成功"),n.user.is_following=!0}).catch(u=>{})}})},ee=()=>{d.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?d.value="#"+decodeURIComponent(r.query.q):d.value="搜索: "+decodeURIComponent(r.query.q))},ie=we(()=>R&&C&&I.state.desktopModelShow&&I.state.userInfo.id>0),M=()=>{_.value=!1,D.value=!1,f.value=[],g.value=1,B.value=0},re=(n,u)=>{switch(M(),G.value=n.style,r.query.q&&(r.query.q=null,ee()),n.style){case 1:E("newest");break;case 2:E("hots");break;case 3:r.query.q=null,E("following");break;case 21:N.value=n.username,te();break}z.value[u].show=!1},P=()=>{z.value=z.value.slice(0,3),!(!R||!C||I.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(n=>{var u=0;const e=n.list||[];let t=[];for(;u0&&(z.value=z.value.concat(t))}).catch(n=>{console.log(n)})},E=n=>{_.value=!0,Pe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,style:n,page:g.value,page_size:O.value}).then(u=>{_.value=!1,u.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(u.list):(f.value=u.list,window.scrollTo(0,0)),B.value=Math.ceil(u.pager.total_rows/O.value)}).catch(u=>{_.value=!1,g.value>1&&g.value--})},te=()=>{_.value=!0,Se({username:N.value,style:"post",page:g.value,page_size:O.value}).then(n=>{_.value=!1,n.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(n.list):(f.value=n.list||[],window.scrollTo(0,0)),B.value=Math.ceil(n.pager.total_rows/O.value)}).catch(n=>{f.value=[],g.value>1&&g.value--,_.value=!1})},ue=n=>{T.push({name:"post",query:{id:n.id}})},K=()=>{switch(G.value){case 1:E("newest");break;case 2:E("hots");break;case 3:E("following");break;case 21:r.query.q?E("search"):te();break}},ce=()=>{g.value{M(),P(),E("newest")}),Ne(()=>({path:r.path,query:r.query,refresh:I.state.refresh}),(n,u)=>{if(ee(),n.refresh!==u.refresh){M(),setTimeout(()=>{P(),K()},0);return}u.path!=="/post"&&n.path==="/"&&(M(),setTimeout(()=>{P(),K()},0))}),(n,u)=>{const e=gt,t=Gt,s=dt,o=De,c=vt,v=mt,j=xe,pe=_t,de=Ee,ve=Ve,me=Be,_e=Ue,fe=pt,ge=ft,he=Te;return p(),y("div",null,[a(e,{title:d.value},null,8,["title"]),a(fe,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(s,null,{default:i(()=>[a(t,{onPostSuccess:ue})]),_:1}),ie.value?(p(),x(s,{key:0},{default:i(()=>[a(A(At),{modelValue:z.value,"onUpdate:modelValue":u[0]||(u[0]=w=>z.value=w),"wheel-blocks":U.value,"init-blocks":F.value,onClick:re,tag:"div","sub-tag":"div"},{default:i(w=>[b("div",Yt,[a(c,{value:"1",offset:[-4,48],dot:"",show:w.slotData.show},{default:i(()=>[a(o,{round:"",size:48,src:w.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),b("div",Lt,[a(v,{"line-clamp":2},{default:i(()=>[S(se(w.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),_.value&&f.value.length===0?(p(),y("div",Mt,[a(j,{num:O.value},null,8,["num"])])):k("",!0),b("div",null,[f.value.length===0?(p(),y("div",Wt,[a(pe,{size:"large",description:"暂无数据"})])):k("",!0),A(I).state.desktopModelShow?(p(),y("div",Kt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(de,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))])):(p(),y("div",jt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(ve,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),a(me,{show:L.value,user:Z.value,onSuccess:ae},null,8,["show","user"]),a(_e,{show:W.value,user:q,onSuccess:le},null,8,["show","user"])]),_:1}),B.value>0?(p(),x(he,{key:0,justify:"center"},{default:i(()=>[a(A(yt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:u[1]||(u[1]=w=>ce())},{spinner:i(()=>[b("div",Qt,[D.value?k("",!0):(p(),x(ge,{key:0,size:14})),b("span",Ht,se(D.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Rs=We(Zt,[["__scopeId","data-v-c53a3615"]]);export{Rs as default}; +import{W as Ue}from"./whisper-add-friend-622dcaa8.js";import{_ as Be}from"./whisper-7e17488b.js";import{_ as Ee,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-b1622c74.js";import{_ as xe}from"./post-skeleton-52d6bc96.js";import{d as Ce,H as l,c as we,b as Ie,e as p,f as y,bf as A,j as b,k as a,w as i,q as x,Y as k,y as ke,A as S,x as se,F as ye,u as Ae,R as Fe,E as Ne}from"./@vue-a481fc63.js";import{u as ze}from"./vuex-44de225f.js";import{l as be}from"./lodash-e0b37ac3.js";import{g as Re,a as qe,c as Ge,b as Oe,d as Pe,e as Se,u as Ye,f as Le,h as Me,_ as We}from"./index-3c78935c.js";import{p as Ke}from"./content-b9c58eb8.js";import{V,P as Q}from"./IEnum-5453a777.js";import{I as je,V as Qe,A as He,d as Ze,E as Je}from"./@vicons-f0266f88.js";import{o as De,v as Xe,j as $e,e as et,w as tt,x as st,y as at,z as nt,A as ot,B as lt,C as it,a as Te,D as rt,E as ut,F as ct,G as pt,H as dt,l as vt,I as mt,J as _t,k as ft}from"./naive-ui-eecf2ec3.js";import{_ as gt}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{b as ht,u as wt}from"./vue-router-e5a2430e.js";import{W as yt}from"./v3-infinite-loading-2c58ec2f.js";import{S as At}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const kt=H=>{const R=new FileReader,C=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),I=()=>{const r=new Uint8Array(R.result).subarray(0,4);let T="";for(let m=0;m{R.onloadend=()=>{const m=H.type;r(m===""||m==="application/octet-stream"?I():C(m))},R.readAsArrayBuffer(H.slice(0,4))})},bt={key:0,class:"compose-wrap"},Ct={class:"compose-line"},It={class:"compose-user"},zt={class:"compose-line compose-options"},Dt={class:"attachment"},Tt={class:"submit-wrap"},Ut={class:"attachment-list-wrap"},Bt={key:0,class:"attachment-price-wrap"},Et=b("span",null," 附件价格¥",-1),Vt={key:0,class:"eye-wrap"},xt={key:1,class:"link-wrap"},Ft={key:1,class:"compose-wrap"},Nt=b("div",{class:"login-wrap"},[b("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Rt={key:0,class:"login-only-wrap"},qt={key:1,class:"login-wrap"},Gt=Ce({__name:"compose",emits:["post-success"],setup(H,{emit:R}){const C=ze(),I=l([]),r=l(!1),T=l(!1),m=l(!1),F=l(!1),U=l(""),z=l([]),q=l(),Y=l(0),d=l("public/image"),_=l([]),D=l([]),G=l([]),N=l([]),f=l(V.PUBLIC),g=l(V.PUBLIC),O="true".toLowerCase()==="true",B=+"400",L=l("true".toLowerCase()==="true"),W=l("true".toLowerCase()==="true"),Z=l("true".toLowerCase()==="true"),J=l("false".toLowerCase()==="true"),ae=l("true".toLowerCase()==="true"),ne="/v1/attachment",oe=we(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),le=we(()=>{let e=[{value:V.PUBLIC,label:"公开"},{value:V.PRIVATE,label:"私密"},{value:V.Following,label:"关注可见"}];return O&&e.push({value:V.FRIEND,label:"好友可见"}),e}),X=()=>{m.value=!m.value,m.value&&F.value&&(F.value=!1)},$=()=>{F.value=!F.value,F.value&&m.value&&(m.value=!1)},ee=be.debounce(e=>{Re({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),ie=be.debounce(e=>{qe({k:e}).then(t=>{let s=[];t.suggest.map(o=>{s.push({label:o,value:o})}),I.value=s,r.value=!1}).catch(t=>{r.value=!1})},200),M=(e,t)=>{r.value||(r.value=!0,t==="@"?ee(e):ie(e))},re=e=>{e.length>B?U.value=e.substring(0,B):U.value=e},P=e=>{d.value=e},E=e=>{for(let c=0;c30&&(e[c].name=s.substring(0,18)+"..."+s.substring(s.length-9)+"."+o)}_.value=e},te=async e=>{var t,s,o,c,v;return d.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):d.value==="image"&&((s=e.file.file)==null?void 0:s.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):d.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=e.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):d.value==="public/video"&&((c=e.file.file)==null?void 0:c.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):d.value==="attachment"&&!await kt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):d.value==="attachment"&&((v=e.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ue=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);o.code===0&&(d.value==="public/image"&&D.value.push({id:e.id,content:o.data.content}),d.value==="public/video"&&G.value.push({id:e.id,content:o.data.content}),d.value==="attachment"&&N.value.push({id:e.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},K=({file:e,event:t})=>{var s;try{let o=JSON.parse((s=t.target)==null?void 0:s.response);if(o.code!==0){let c=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(v=>{c+=":"+v}),window.$message.error(c)}}catch{window.$message.error("上传失败")}},ce=({file:e})=>{let t=D.value.findIndex(s=>s.id===e.id);t>-1&&D.value.splice(t,1),t=G.value.findIndex(s=>s.id===e.id),t>-1&&G.value.splice(t,1),t=N.value.findIndex(s=>s.id===e.id),t>-1&&N.value.splice(t,1)},n=()=>{if(U.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Ke(U.value);const s=[];let o=100;s.push({content:U.value,type:Q.TEXT,sort:o}),D.value.map(c=>{o++,s.push({content:c.content,type:Q.IMAGEURL,sort:o})}),G.value.map(c=>{o++,s.push({content:c.content,type:Q.VIDEOURL,sort:o})}),N.value.map(c=>{o++,s.push({content:c.content,type:Q.ATTACHMENT,sort:o})}),z.value.length>0&&z.value.map(c=>{o++,s.push({content:c,type:Q.LINKURL,sort:o})}),T.value=!0,Ge({contents:s,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+Y.value*100,visibility:f.value}).then(c=>{var v;window.$message.success("发布成功"),T.value=!1,R("post-success",c),m.value=!1,F.value=!1,(v=q.value)==null||v.clear(),_.value=[],U.value="",z.value=[],D.value=[],G.value=[],N.value=[],f.value=g.value}).catch(c=>{T.value=!1})},u=e=>{C.commit("triggerAuth",!0),C.commit("triggerAuthKey",e)};return Ie(()=>{const e="friend".toLowerCase();O&&e==="friend"?g.value=V.FRIEND:e==="following"?g.value=V.Following:e==="public"?g.value=V.PUBLIC:g.value=V.PRIVATE,f.value=g.value}),(e,t)=>{const s=De,o=Xe,c=$e,v=et,j=tt,pe=st,de=at,ve=nt,me=ot,_e=lt,fe=it,ge=Te,he=rt,w=ut;return p(),y("div",null,[A(C).state.userInfo.id>0?(p(),y("div",bt,[b("div",Ct,[b("div",It,[a(s,{round:"",size:30,src:A(C).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:U.value,prefix:["@","#"],options:I.value,onSearch:M,"onUpdate:value":re,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(_e,{ref_key:"uploadRef",ref:q,abstract:"","list-type":"image",multiple:!0,max:9,action:ne,headers:{Authorization:oe.value},data:{type:d.value},"file-list":_.value,onBeforeUpload:te,onFinish:ue,onError:K,onRemove:ce,"onUpdate:fileList":E},{default:i(()=>[b("div",zt,[b("div",Dt,[a(j,{abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("public/image"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(je))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),W.value?(p(),x(j,{key:0,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value!=="public/video"||_.value.length===9,onClick:()=>{P("public/video"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),Z.value?(p(),x(j,{key:1,abstract:""},{default:i(({handleClick:h})=>[a(v,{disabled:_.value.length>0&&d.value==="public/video"||_.value.length===9,onClick:()=>{P("attachment"),h()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(He))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(v,{quaternary:"",circle:"",type:"primary",onClick:ke(X,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Ze))]),_:1})]),_:1},8,["onClick"]),ae.value?(p(),x(v,{key:2,quaternary:"",circle:"",type:"primary",onClick:ke($,["stop"])},{icon:i(()=>[a(c,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(A(Je))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),b("div",Tt,[a(de,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(pe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:U.value.length/A(B)*100},null,8,["percentage"])]),default:i(()=>[S(" "+se(U.value.length)+" / "+se(A(B)),1)]),_:1}),a(v,{loading:T.value,onClick:n,type:"primary",secondary:"",round:""},{default:i(()=>[S(" 发布 ")]),_:1},8,["loading"])])]),b("div",Ut,[a(ve),N.value.length>0?(p(),y("div",Bt,[J.value?(p(),x(me,{key:0,value:Y.value,"onUpdate:value":t[0]||(t[0]=h=>Y.value=h),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[Et]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),F.value?(p(),y("div",Vt,[a(he,{value:f.value,"onUpdate:value":t[1]||(t[1]=h=>f.value=h),name:"radiogroup"},{default:i(()=>[a(ge,null,{default:i(()=>[(p(!0),y(ye,null,Ae(le.value,h=>(p(),x(fe,{key:h.value,value:h.value,label:h.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),m.value?(p(),y("div",xt,[a(w,{value:z.value,"onUpdate:value":t[2]||(t[2]=h=>z.value=h),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[S(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(p(),y("div",Ft,[Nt,L.value?k("",!0):(p(),y("div",Rt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1})])),L.value?(p(),y("div",qt,[a(v,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=h=>u("signin"))},{default:i(()=>[S(" 登录 ")]),_:1}),a(v,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=h=>u("signup"))},{default:i(()=>[S(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Ot="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lVcLoICKagF0AfqQvwRhugBldeF1RrbaPFt1g3QcDo5G1S+2WsNx28YmhLjN4wvYVutvM+SASjgqor6dxjcbicXcabwK1DCOJDvG/KOAdTVVLn6Oxgq/FxoIORGo1ueJ3kZwEg8qJ/PYAoMkRPsolYzTW7MN1nLywVRhoup+DMwRN5geaGIpzzb53V9XYDazvUoL3wEQ1gGg/I8VFI357wm14t1x2Rp6TD5GTarGhjCOow1pzpYzeQR7HS2S3J2JUtLxZMkQoEP0LGft7s9BbV4OxjVobVTwOmUhIjCYPGYINxWGQLfIeVYJSxW4b3l2S7J2gLqzyTnKgq3VXotBCr4v/w7ARuOJOBYl8h63cMXl8DskQHwI6rgl40tZXtNX8v6JkV5RlJ64SH/PKPDy/Wd0NIp8rrWrwZIcn0N/plp9pppV6nhTGopFv7V4CGbjiXh0X2xvArf7zAckm2Kp24xe83UAFzlT4KHvI8uh2p+sv+XfQ9S8hfNcoOMJ4za72Gvh4Lsbw7Hs75+kcahssS2ASnXwDKdeMcj+tL05zMtovCfgUfEsFfzEtZ83ST0lKkM7p9UAq9eXgpXlPdbHfDh9Cd6GaDhVOJb6Ps9m0LyTnMXnExklj7V+JdmRGDeqAAovpnNah0jFnTJXnJOLwOwoHIXeERbQsD7/0lkPD8qxOHpqWEYGex/bscMkdIfOvdxz6+irBeTruXgEZuOJ02D7v2TtAFT+Aac3V4nZbDnYfedyHBY6OUgy87/Zk7fn1mhwrThA2zcR0KgNK4v63749a9LiQVeTVanoFsf0zOenzvKnsTqBGbQFFsS4mx8qQgy7E0pnsUTqcNN+Gc13TcMsKtVhoGJO8AjjsZ1U/czrayw2t+tG207kYTdbSlDM0ongG1/UkQxWtm8UUHDKK6hsO/TghRatWP8whHDU9fYOEnOMm0mPZ/yAIOygPVC2YqxhHpTR+O5szgy+AGUL+j2TksXzL8gCD8cG4KI6oIh0A01xFPX4b2Pz5Y653PAZ1h1D1TLnz7QAasOdvZZ+OmQMd49moD79kRhT7s7S8m44HONv8YjJqeDhwR5ZmmbuY1cUM3f1VZc4VGceAqNSFKI00hG6+DQAFvQF+Gjm8BDRpj4X6qVdgpx5PPpc8r6cDEUP37dEDfEQCfBpGz2OikVtbo9XgmhIHjJSEy2yOe3J3vX+h0nk7C0iIEW0o1uviAAM88L9NKPTuPn7D2dgs1YyDuztJpXGzqN91wyTAGHYNNPxas417RrwQfMMNF3PsIC6u46WoHixxIcJXsF5YvFY0IZ4h0F91kjAvDEpWF4FrNsyrbToRb4chZdyi6CocBsrovUJPABZoMpFEzf/qoLrECu5tFLwnBnlWYaW9KhRO+FmrCpwkou8L2jzsUDKdhEzhkfDj6AFE5yGen8CQtg+8n8/fHdWPAzz7OWP5ALfHpK2DQ+UO/IqVaA9aOcYzSoAB9AbuP2cZn+nn78yn91wobWvlvCtDIFFl5UWDwjI9xVnTnpj8ahdzvUNdVBjuWYkfnCBRHkhr5tUnvJCK83dcGD/4gZmlG2GnlrkTMjrjs/YNoKax0yANa58/HXstHgEOQ69p/WLb0nkiMDq4/q8MyX5ls80NsoF6BbMZgZl6bBOAFKEZXq/3cdsZ3fo8t4q8laAC0GKrjNx53pu7c6NzFgNHdKgl7f4nw26RZWs/K8kaA6psDFnOxAu0zEQd2a08oOcIAyN1RFl1hS6ZBSwCClnt1pCsaBzVSGeUYApoyTuorFshV1/kIa2Dzs5ZwrN+fzL6bg96Ws2SGOYBBmzQyk7QagwY50A1BLvm9SSVEjUSQXbzIJtgsvDGIypxhjAfUx86B5Cn35/ZNLwDdIdgSDsDgODjDdRNshaaHYbuK6FvOeFfUmSHRbNb0UlmNCZWZkkqtplMwvYMU/hN+bNYMDkLRgJnK93hiHE4nCunWky9TlkVcsGh2Ehy42b2mkLfmof9DGhRSnwAHox1NBpENdul/s67BshM/bkrCmKZ739eS3bzGRJagV7m73xwaKKPS2c4Wr9eAQ5JezqYw/39sBe0/1XRAkR7+JBf/8l9Yn65K2ZCYt+MUNMY4uCCC+DRyCWgHN5wyYZBskcj2GLYHGcUmyOJU8uxqh+0ZGIgHux3tisL61MEWS5GgakEmn1ictAEcdPlHHaVpTo4Nz8GlE6d4JGg5umLsPCozdY7mUO5CxyE3ZNTWdAvPraZJIGxqb5gqNDHk6405Wa1oLR0EIo5r8KzgIzbshI/TV/aSCp4FxO9cFkAs0a4Fmk4BdRcoPaV6Q8dUEyE/BYW7GeLDiUppkW1yGfHYilbXEyCwrL2So01YYq6U/hgGYgM3gApQbvDKjFBZh78TqfFsKpg9iEkXjuFa1GV/KUpwbZW5kS00RdUtVp0i5MTmXpIDl4zVj0Jzk489xgOVQTAezXinV3CuwxtNADeUVhWTQNAMifbYFUeHtjGsZDIHR+TEKfA76osMd+ga8eyu4BBXAkjEh40Y1lOaHdk9RpN4LzeGxI0juP5OZuFFMMOueuoaEtWPY2c3De2o8Y/wDKYVrBjgXqtmVJQrewHY+Mln0MTni3cxoAyZ7NnbqqQZRDdY6JU17BSV6ZhOvrqzwcM0Bg2QsqrzX/bDHADWMJRiDtTBAIKnDLPcg90PdYs8QsPrcHXh7OUKeSv0KBgBU+KQ3mW1tQNPQXV0LkIYI8DXnPu5lgKphoX2oju6CfgoFc5pU+8Ae8xX2FNhpDYBXoNiya2LaGQVq5kViJTqq30I/4wvUd+79Ipp1bUC3LhXxcKhUKvBC+nMZfbHqEoX2hWuAfgbV+FwLM36EuccMDxd4Swl1E0NqxnkEGQZAfUJIKX8CAwQKulTz51/o7RR8qcoVZs+bZiMTIuq7/TkWdENC3HNTI5a1I7vBSr3drPYTWdukiCfvYZpaCz7EWDRxNPvrNBS6GEfjSAD0x9YG7Imsr0AOGmL6a349BYMG5zfgQA1NACPNaAzW9smliiH4FaobOQFN7p4QVh7O9nrOr2kcRVIi9rEBeCCDO7C9sSi7OtfRJ33Wk8ZOORc1Is/3juuPcMav7+vIkz4lQdr3Eg3wBAxhCcng8XzOm8lLkx0fVp/Df7kDhsgPKXe8pfHn87k071BFG1LLkNzDQFbBENmRsL89wWddnuf5MkPb19tLPKWnvjl5WGh/vm+wNCxk/GPG5w+0cQObSNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",Pt="/assets/discover-tweets-ab101944.jpeg",St="/assets/following-tweets-e36b4410.jpeg",Yt={class:"slide-bar-item"},Lt={class:"slide-bar-item-title slide-bar-user-link"},Mt={key:1,class:"skeleton-wrap"},Wt={key:0,class:"empty-wrap"},Kt={key:1},jt={key:2},Qt={class:"load-more-wrap"},Ht={class:"load-more-spinner"},Zt=Ce({__name:"Home",setup(H){const R="true".toLowerCase()==="true",C="true".toLowerCase()==="true",I=ze(),r=ht(),T=wt(),m=ct(),F=l(9),U=l(8),z=l([{title:"最新动态",style:1,username:"",avatar:Ot,show:!0},{title:"热门推荐",style:2,username:"",avatar:Pt,show:!1},{title:"正在关注",style:3,username:"",avatar:St,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),q=Fe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=l(null),d=l("泡泡广场"),_=l(!1),D=l(!1),G=l(1),N=l(""),f=l([]),g=l(1),O=l(20),B=l(0),L=l(!1),W=l(!1),Z=l({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=n=>{Z.value=n,L.value=!0},ae=()=>{L.value=!1},ne=()=>{W.value=!0},oe=n=>{m.warning({title:"删除好友",content:"将好友 “"+n.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{Me({user_id:q.id}).then(u=>{window.$message.success("操作成功"),n.user.is_friend=!1}).catch(u=>{})}})},le=()=>{W.value=!1,Y.value=null},X=n=>{Y.value=n,q.id=n.user.id,q.username=n.user.username,q.nickname=n.user.nickname,n.user.is_friend?oe(n):ne()},$=n=>{m.success({title:"提示",content:"确定"+(n.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.user.is_following?Ye({user_id:n.user.id}).then(u=>{window.$message.success("操作成功"),n.user.is_following=!1}).catch(u=>{}):Le({user_id:n.user.id}).then(u=>{window.$message.success("关注成功"),n.user.is_following=!0}).catch(u=>{})}})},ee=()=>{d.value="泡泡广场",r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?d.value="#"+decodeURIComponent(r.query.q):d.value="搜索: "+decodeURIComponent(r.query.q))},ie=we(()=>R&&C&&I.state.desktopModelShow&&I.state.userInfo.id>0),M=()=>{_.value=!1,D.value=!1,f.value=[],g.value=1,B.value=0},re=(n,u)=>{switch(M(),G.value=n.style,r.query.q&&(r.query.q=null,ee()),n.style){case 1:E("newest");break;case 2:E("hots");break;case 3:r.query.q=null,E("following");break;case 21:N.value=n.username,te();break}z.value[u].show=!1},P=()=>{z.value=z.value.slice(0,3),!(!R||!C||I.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(n=>{var u=0;const e=n.list||[];let t=[];for(;u0&&(z.value=z.value.concat(t))}).catch(n=>{console.log(n)})},E=n=>{_.value=!0,Pe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,style:n,page:g.value,page_size:O.value}).then(u=>{_.value=!1,u.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(u.list):(f.value=u.list,window.scrollTo(0,0)),B.value=Math.ceil(u.pager.total_rows/O.value)}).catch(u=>{_.value=!1,g.value>1&&g.value--})},te=()=>{_.value=!0,Se({username:N.value,style:"post",page:g.value,page_size:O.value}).then(n=>{_.value=!1,n.list.length===0&&(D.value=!0),g.value>1?f.value=f.value.concat(n.list):(f.value=n.list||[],window.scrollTo(0,0)),B.value=Math.ceil(n.pager.total_rows/O.value)}).catch(n=>{f.value=[],g.value>1&&g.value--,_.value=!1})},ue=n=>{T.push({name:"post",query:{id:n.id}})},K=()=>{switch(G.value){case 1:E("newest");break;case 2:E("hots");break;case 3:E("following");break;case 21:r.query.q?E("search"):te();break}},ce=()=>{g.value{M(),P(),E("newest")}),Ne(()=>({path:r.path,query:r.query,refresh:I.state.refresh}),(n,u)=>{if(ee(),n.refresh!==u.refresh){M(),setTimeout(()=>{P(),K()},0);return}u.path!=="/post"&&n.path==="/"&&(M(),setTimeout(()=>{P(),K()},0))}),(n,u)=>{const e=gt,t=Gt,s=dt,o=De,c=vt,v=mt,j=xe,pe=_t,de=Ee,ve=Ve,me=Be,_e=Ue,fe=pt,ge=ft,he=Te;return p(),y("div",null,[a(e,{title:d.value},null,8,["title"]),a(fe,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(s,null,{default:i(()=>[a(t,{onPostSuccess:ue})]),_:1}),ie.value?(p(),x(s,{key:0},{default:i(()=>[a(A(At),{modelValue:z.value,"onUpdate:modelValue":u[0]||(u[0]=w=>z.value=w),"wheel-blocks":U.value,"init-blocks":F.value,onClick:re,tag:"div","sub-tag":"div"},{default:i(w=>[b("div",Yt,[a(c,{value:"1",offset:[-4,48],dot:"",show:w.slotData.show},{default:i(()=>[a(o,{round:"",size:48,src:w.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),b("div",Lt,[a(v,{"line-clamp":2},{default:i(()=>[S(se(w.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),_.value&&f.value.length===0?(p(),y("div",Mt,[a(j,{num:O.value},null,8,["num"])])):k("",!0),b("div",null,[f.value.length===0?(p(),y("div",Wt,[a(pe,{size:"large",description:"暂无数据"})])):k("",!0),A(I).state.desktopModelShow?(p(),y("div",Kt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(de,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))])):(p(),y("div",jt,[(p(!0),y(ye,null,Ae(f.value,w=>(p(),x(s,{key:w.id},{default:i(()=>[a(ve,{post:w,isOwner:A(I).state.userInfo.id==w.user_id,addFollowAction:!0,onSendWhisper:J,onHandleFollowAction:$,onHandleFriendAction:X},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),a(me,{show:L.value,user:Z.value,onSuccess:ae},null,8,["show","user"]),a(_e,{show:W.value,user:q,onSuccess:le},null,8,["show","user"])]),_:1}),B.value>0?(p(),x(he,{key:0,justify:"center"},{default:i(()=>[a(A(yt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:u[1]||(u[1]=w=>ce())},{spinner:i(()=>[b("div",Qt,[D.value?k("",!0):(p(),x(ge,{key:0,size:14})),b("span",Ht,se(D.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Rs=We(Zt,[["__scopeId","data-v-c53a3615"]]);export{Rs as default}; diff --git a/web/dist/assets/Messages-0f6694f9.css b/web/dist/assets/Messages-0f6694f9.css deleted file mode 100644 index 9206bb89..00000000 --- a/web/dist/assets/Messages-0f6694f9.css +++ /dev/null @@ -1 +0,0 @@ -.message-item[data-v-529aa194]{padding:16px}.message-item.unread[data-v-529aa194]{background:#fcfffc}.message-item .sender-wrap[data-v-529aa194]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-529aa194]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-529aa194]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-529aa194]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-529aa194]{margin-left:6px}.message-item .brief-wrap[data-v-529aa194]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-529aa194],.message-item .brief-wrap .whisper-content-wrap[data-v-529aa194],.message-item .brief-wrap .requesting-friend-wrap[data-v-529aa194]{display:flex;width:100%}.message-item .view-link[data-v-529aa194]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-529aa194]{margin-left:8px;align-items:center}.dark .message-item[data-v-529aa194]{background-color:#101014bf}.dark .message-item.unread[data-v-529aa194]{background:#0f180b}.dark .message-item .brief-wrap[data-v-529aa194]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.load-more[data-v-77b4139c]{margin:20px}.load-more .load-more-wrap[data-v-77b4139c]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-77b4139c]{font-size:14px;opacity:.65}.title[data-v-77b4139c]{padding-top:4px;opacity:.9}.title-action[data-v-77b4139c]{display:flex;align-items:center;margin-left:20px}.title-filter[data-v-77b4139c]{margin-right:20px}.dark .empty-wrap[data-v-77b4139c],.dark .messages-wrap[data-v-77b4139c],.dark .pagination-wrap[data-v-77b4139c]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-2d3ee462.js b/web/dist/assets/Messages-2d3ee462.js new file mode 100644 index 00000000..d25fada5 --- /dev/null +++ b/web/dist/assets/Messages-2d3ee462.js @@ -0,0 +1 @@ +import{d as E,c as A,r as _e,e as a,f as u,k as s,w as t,bf as o,j as b,y as O,A as d,x as f,Y as _,q as M,l as de,h as V,u as ee,F as se,H as g,b as pe}from"./@vue-a481fc63.js";import{u as me}from"./vuex-44de225f.js";import{u as ge,b as fe}from"./vue-router-e5a2430e.js";import{J as ve,O as ke,P as ye,Q as he,u as we,f as be,_ as G,R as $e}from"./index-3c78935c.js";import{K as Z,k as Ie,N as Ce,O as Se,Q as x,U as Me,r as F,s as qe,t as ze,X as R,Y as Oe,Z as j,_ as U,R as B}from"./@vicons-f0266f88.js";import{F as Re,j as p,o as Ae,M as Fe,l as Te,e as ne,P as te,T as Ne,O as Pe,U as We,a as je,G as Ue,Q as Be,J as Ve,k as De,H as He}from"./naive-ui-eecf2ec3.js";import{_ as Qe}from"./whisper-7e17488b.js";import{_ as Je}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{W as Ye}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 Ee={class:"sender-wrap"},Ge={key:0,class:"nickname"},Ke={key:0,class:"username"},Le={key:1,class:"nickname"},Xe={key:0,class:"username"},Ze={key:2,class:"nickname"},xe={class:"timestamp"},es={class:"timestamp-txt"},ss={key:0,class:"brief-content"},ns={key:1,class:"whisper-content-wrap"},ts={key:2,class:"requesting-friend-wrap"},as={key:2,class:"status-info"},os={key:3,class:"status-info"},ls="https://assets.paopao.info/public/avatar/default/admin.png",rs=E({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(D,{emit:$}){const c=D,m=ge(),r=me(),q=Re(),v=e=>()=>V(p,null,{default:()=>V(e)}),k=A(()=>{let e=[{label:"私信",key:"whisper",icon:v(F)}],n=c.message.type==4&&c.message.sender_user_id==r.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return r.state.userInfo.id!=n.id&&(n.is_following?e.push({label:"取消关注",key:"unfollow",icon:v(qe)}):e.push({label:"关注",key:"follow",icon:v(ze)})),e}),y=e=>{let n=e.type==4&&e.sender_user_id==r.state.userInfo.id?e.receiver_user:e.sender_user;q.success({title:"提示",content:"确定"+(n.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.is_following?we({user_id:n.id}).then(h=>{window.$message.success("操作成功"),n.is_following=!1,setTimeout(()=>{$("reload")},50)}).catch(h=>{}):be({user_id:n.id}).then(h=>{window.$message.success("关注成功"),n.is_following=!0,setTimeout(()=>{$("reload")},50)}).catch(h=>{})}})},T=e=>{switch(e){case"whisper":const n=c.message;if(n.type!=99){let h=n.type==4&&n.sender_user_id==r.state.userInfo.id?n.receiver_user:n.sender_user;$("send-whisper",h)}break;case"follow":case"unfollow":y(c.message);break}},I=A(()=>c.message.type!==4||c.message.sender_user_id!==r.state.userInfo.id),N=A(()=>c.message.type==4&&c.message.receiver_user_id==r.state.userInfo.id),z=A(()=>c.message.type==4&&c.message.sender_user_id==r.state.userInfo.id),i=e=>{S(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?m.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},H=e=>{S(e),ke({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},P=e=>{S(e),ye({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},S=e=>{c.message.receiver_user_id==r.state.userInfo.id&&e.is_read===0&&he({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const h=Ae,w=_e("router-link"),W=Fe,l=Te,K=ne,Q=te,J=Ne,Y=Pe;return a(),u("div",{class:de(["message-item",{unread:I.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=C=>S(e.message))},[s(Y,{"content-indented":""},{avatar:t(()=>[s(h,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(r).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:ls},null,8,["src"])]),header:t(()=>[b("div",Ee,[e.message.type!=4&&e.message.sender_user.id>0||N.value?(a(),u("span",Ge,[s(w,{onClick:n[0]||(n[0]=O(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(f(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(r).state.desktopModelShow?(a(),u("span",Ke," @"+f(e.message.sender_user.username),1)):_("",!0)])):z.value?(a(),u("span",Le,[s(w,{onClick:n[1]||(n[1]=O(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(f(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(r).state.desktopModelShow?(a(),u("span",Xe," @"+f(e.message.receiver_user.username),1)):_("",!0)])):(a(),u("span",Ze," 系统 ")),z.value?(a(),M(W,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[s(o(p),{component:o(Z)},null,8,["component"])]),default:t(()=>[d(" 私信已发送 ")]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(r).state.userInfo.id?(a(),M(W,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[s(o(p),{component:o(Z)},null,8,["component"])]),default:t(()=>[d(" 私信已接收 ")]),_:1})):_("",!0)])]),"header-extra":t(()=>[b("span",xe,[I.value&&e.message.is_read===0?(a(),M(l,{key:0,dot:"",processing:""})):_("",!0),b("span",es,f(o(ve)(e.message.created_on)),1),s(Q,{placement:"bottom-end",trigger:"click",size:"small",options:k.value,onSelect:T},{default:t(()=>[s(K,{quaternary:"",circle:""},{icon:t(()=>[s(o(p),null,{default:t(()=>[s(o(Ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[s(J,{"show-icon":!1,class:"brief-wrap",type:!I.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),u("div",ss,[d(f(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),u("span",{key:0,onClick:n[2]||(n[2]=O(C=>i(e.message),["stop"])),class:"hash-link view-link"},[s(o(p),null,{default:t(()=>[s(o(Ce))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),u("div",ns,f(e.message.content),1)):_("",!0),e.message.type===5?(a(),u("div",ts,[d(f(e.message.content)+" ",1),e.message.reply_id===1?(a(),u("span",{key:0,onClick:n[3]||(n[3]=O(C=>H(e.message),["stop"])),class:"hash-link view-link"},[s(o(p),null,{default:t(()=>[s(o(Se))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),u("span",{key:1,onClick:n[4]||(n[4]=O(C=>P(e.message),["stop"])),class:"hash-link view-link"},[s(o(p),null,{default:t(()=>[s(o(x))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),u("span",as,[s(o(p),null,{default:t(()=>[s(o(Me))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),u("span",os,[s(o(p),null,{default:t(()=>[s(o(x))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const is=G(rs,[["__scopeId","data-v-2507cd8e"]]),us={class:"content"},cs=E({__name:"message-skeleton",props:{num:{default:1}},setup(D){return($,c)=>{const m=We;return a(!0),u(se,null,ee(new Array($.num),r=>(a(),u("div",{class:"skeleton-item",key:r},[b("div",us,[s(m,{text:"",repeat:2}),s(m,{text:"",style:{width:"60%"}})])]))),128)}}});const _s=G(cs,[["__scopeId","data-v-01d2e871"]]),ds={key:0,class:"skeleton-wrap"},ps={key:1},ms={class:"title title-action"},gs={class:"title title-filter"},fs={key:0,class:"empty-wrap"},vs={key:1},ks={class:"load-more-wrap"},ys={class:"load-more-spinner"},hs=E({__name:"Messages",setup(D){const $=fe(),c=g(!1),m=g(!1),r=g(+$.query.p||1),q=g(20),v=g(0),k=g([]),y=g("所有消息"),T=g("all"),I=g(!1),N=g({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),z=()=>{m.value=!1,r.value=1,v.value=0,k.value=[]},i=l=>()=>V(p,null,{default:()=>V(l)}),H=A(()=>{let l;switch(y.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:i(U)},{label:"我的私信",key:"whisper",icon:i(F)},{label:"好友申请",key:"requesting",icon:i(B)},{label:"未读消息",key:"unread",icon:i(R)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:i(j)},{label:"我的私信",key:"whisper",icon:i(F)},{label:"好友申请",key:"requesting",icon:i(B)},{label:"未读消息",key:"unread",icon:i(R)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:i(j)},{label:"系统消息",key:"system",icon:i(U)},{label:"好友申请",key:"requesting",icon:i(B)},{label:"未读消息",key:"unread",icon:i(R)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:i(j)},{label:"系统消息",key:"system",icon:i(U)},{label:"我的私信",key:"whisper",icon:i(F)},{label:"未读消息",key:"unread",icon:i(R)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:i(j)},{label:"系统消息",key:"system",icon:i(U)},{label:"我的私信",key:"whisper",icon:i(F)},{label:"好友申请",key:"requesting",icon:i(B)}];break;default:l=[];break}return l}),P=l=>{switch(l){case"all":y.value="所有消息";break;case"system":y.value="系统消息";break;case"whisper":y.value="我的私信";break;case"requesting":y.value="好友申请";break;case"unread":y.value="未读消息";break}T.value=l,z(),w()},S=()=>{P("unread")},e=()=>{z(),w()},n=l=>{N.value=l,I.value=!0},h=()=>{I.value=!1},w=()=>{c.value=!0,$e({style:T.value,page:r.value,page_size:q.value}).then(l=>{c.value=!1,l.list.length===0&&(m.value=!0),r.value>1?k.value=k.value.concat(l.list):(k.value=l.list,window.scrollTo(0,0)),v.value=Math.ceil(l.pager.total_rows/q.value)}).catch(l=>{c.value=!1,r.value>1&&r.value--})},W=()=>{r.value{w()}),(l,K)=>{const Q=Je,J=Qe,Y=_s,C=ne,ae=Be,oe=te,L=je,le=Ve,re=is,ie=He,ue=Ue,ce=De;return a(),u("div",null,[s(Q,{title:"消息"}),s(ue,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[s(J,{show:I.value,user:N.value,onSuccess:h},null,8,["show","user"]),c.value&&k.value.length===0?(a(),u("div",ds,[s(Y,{num:q.value},null,8,["num"])])):(a(),u("div",ps,[s(L,{justify:"space-between"},{default:t(()=>[b("div",ms,[s(C,{text:"",size:"small",onClick:S},{icon:t(()=>[s(o(p),null,{default:t(()=>[s(o(R))]),_:1})]),default:t(()=>[d(" 0 条未读 ")]),_:1}),s(ae,{vertical:""}),s(C,{text:"",size:"small",onClick:e},{default:t(()=>[d("全标已读")]),_:1})]),b("div",gs,[s(oe,{placement:"bottom-end",trigger:"click",size:"small",options:H.value,onSelect:P},{default:t(()=>[s(C,{text:""},{icon:t(()=>[s(o(p),null,{default:t(()=>[s(o(Oe))]),_:1})]),default:t(()=>[d(" "+f(y.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value.length===0?(a(),u("div",fs,[s(le,{size:"large",description:"暂无数据"})])):(a(),u("div",vs,[(a(!0),u(se,null,ee(k.value,X=>(a(),M(ie,{key:X.id},{default:t(()=>[s(re,{message:X,onSendWhisper:n,onReload:w},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),v.value>0?(a(),M(L,{key:0,justify:"center"},{default:t(()=>[s(o(Ye),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:W},{spinner:t(()=>[b("div",ks,[m.value?_("",!0):(a(),M(ce,{key:0,size:14})),b("span",ys,f(m.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Ys=G(hs,[["__scopeId","data-v-77b4139c"]]);export{Ys as default}; diff --git a/web/dist/assets/Messages-333688e8.css b/web/dist/assets/Messages-333688e8.css new file mode 100644 index 00000000..fae7bb6c --- /dev/null +++ b/web/dist/assets/Messages-333688e8.css @@ -0,0 +1 @@ +.message-item[data-v-2507cd8e]{padding:16px}.message-item.unread[data-v-2507cd8e]{background:#fcfffc}.message-item .sender-wrap[data-v-2507cd8e]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-2507cd8e]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-2507cd8e]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-2507cd8e]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-2507cd8e]{margin-left:6px}.message-item .brief-wrap[data-v-2507cd8e]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-2507cd8e],.message-item .brief-wrap .whisper-content-wrap[data-v-2507cd8e],.message-item .brief-wrap .requesting-friend-wrap[data-v-2507cd8e]{display:flex;width:100%}.message-item .view-link[data-v-2507cd8e]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-2507cd8e]{margin-left:8px;align-items:center}.dark .message-item[data-v-2507cd8e]{background-color:#101014bf}.dark .message-item.unread[data-v-2507cd8e]{background:#0f180b}.dark .message-item .brief-wrap[data-v-2507cd8e]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.load-more[data-v-77b4139c]{margin:20px}.load-more .load-more-wrap[data-v-77b4139c]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-77b4139c]{font-size:14px;opacity:.65}.title[data-v-77b4139c]{padding-top:4px;opacity:.9}.title-action[data-v-77b4139c]{display:flex;align-items:center;margin-left:20px}.title-filter[data-v-77b4139c]{margin-right:20px}.dark .empty-wrap[data-v-77b4139c],.dark .messages-wrap[data-v-77b4139c],.dark .pagination-wrap[data-v-77b4139c]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-b0181f35.js b/web/dist/assets/Messages-b0181f35.js deleted file mode 100644 index 3d8b2cd7..00000000 --- a/web/dist/assets/Messages-b0181f35.js +++ /dev/null @@ -1 +0,0 @@ -import{d as K,c as $,r as _e,e as a,f as u,k as n,w as t,bf as o,j as h,y as R,A as d,x as p,Y as _,q as I,l as de,h as D,u as ne,F as te,H as v,b as pe}from"./@vue-a481fc63.js";import{u as me}from"./vuex-44de225f.js";import{u as ge,b as fe}from"./vue-router-e5a2430e.js";import{J as ve,O as ke,P as ye,Q as he,u as we,f as be,_ as X,R as $e}from"./index-cb47660d.js";import{K as ee,k as Ie,N as Se,O as Ce,Q as se,U as Me,r as A,s as ze,t as qe,X as T,Y as Oe,Z as U,_ as B,R as V}from"./@vicons-f0266f88.js";import{F as Re,j as m,o as Te,M as Ae,l as Fe,e as ae,P as oe,T as Ne,O as Pe,U as We,a as je,G as Ue,Q as Be,J as Ve,k as De,H as He}from"./naive-ui-eecf2ec3.js";import{_ as Le}from"./whisper-7f52b83e.js";import{_ as Qe}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{W as Je}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 Ye={class:"sender-wrap"},Ee={key:0,class:"nickname"},Ge={key:0,class:"username"},Ke={key:1,class:"nickname"},Xe={key:0,class:"username"},Ze={key:2,class:"nickname"},xe={class:"timestamp"},es={class:"timestamp-txt"},ss={key:0,class:"brief-content"},ns={key:1,class:"whisper-content-wrap"},ts={key:2,class:"requesting-friend-wrap"},as={key:2,class:"status-info"},os={key:3,class:"status-info"},ls="https://assets.paopao.info/public/avatar/default/admin.png",rs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(H,{emit:w}){const c=H,g=ge(),l=me(),M=Re(),b=$(()=>l.state.desktopModelShow?"已发送":"私信已发送"),k=$(()=>l.state.desktopModelShow?"已接收":"私信已接收"),f=e=>()=>D(m,null,{default:()=>D(e)}),F=$(()=>{let e=[{label:"私信",key:"whisper",icon:f(A)}],s=c.message.type==4&&c.message.sender_user_id==l.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return l.state.userInfo.id!=s.id&&(s.is_following?e.push({label:"取消关注",key:"unfollow",icon:f(ze)}):e.push({label:"关注",key:"follow",icon:f(qe)})),e}),z=e=>{let s=e.type==4&&e.sender_user_id==l.state.userInfo.id?e.receiver_user:e.sender_user;M.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.is_following?we({user_id:s.id}).then(y=>{window.$message.success("操作成功"),s.is_following=!1,setTimeout(()=>{w("reload")},50)}).catch(y=>{}):be({user_id:s.id}).then(y=>{window.$message.success("关注成功"),s.is_following=!0,setTimeout(()=>{w("reload")},50)}).catch(y=>{})}})},N=e=>{switch(e){case"whisper":const s=c.message;if(s.type!=99){let y=s.type==4&&s.sender_user_id==l.state.userInfo.id?s.receiver_user:s.sender_user;w("send-whisper",y)}break;case"follow":case"unfollow":z(c.message);break}},S=$(()=>c.message.type!==4||c.message.sender_user_id!==l.state.userInfo.id),i=$(()=>c.message.type==4&&c.message.receiver_user_id==l.state.userInfo.id),P=$(()=>c.message.type==4&&c.message.sender_user_id==l.state.userInfo.id),W=e=>{C(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},L=e=>{C(e),ke({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},Q=e=>{C(e),ye({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},C=e=>{c.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&he({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const y=Te,r=_e("router-link"),j=Ae,J=Fe,Y=ae,E=oe,q=Ne,G=Pe;return a(),u("div",{class:de(["message-item",{unread:S.value&&e.message.is_read===0}]),onClick:s[5]||(s[5]=O=>C(e.message))},[n(G,{"content-indented":""},{avatar:t(()=>[n(y,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:ls},null,8,["src"])]),header:t(()=>[h("div",Ye,[e.message.type!=4&&e.message.sender_user.id>0||i.value?(a(),u("span",Ee,[n(r,{onClick:s[0]||(s[0]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[d(p(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(l).state.desktopModelShow?(a(),u("span",Ge," @"+p(e.message.sender_user.username),1)):_("",!0)])):P.value?(a(),u("span",Ke,[n(r,{onClick:s[1]||(s[1]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[d(p(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(l).state.desktopModelShow?(a(),u("span",Xe," @"+p(e.message.receiver_user.username),1)):_("",!0)])):(a(),u("span",Ze," 系统 ")),e.message.type==4&&o(l).state.desktopModelShow?(a(),I(j,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[d(" 私信 ")]),_:1})):_("",!0),P.value?(a(),I(j,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[n(o(m),{component:o(ee)},null,8,["component"])]),default:t(()=>[d(p(b.value)+" ",1)]),_:1})):_("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(a(),I(j,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[n(o(m),{component:o(ee)},null,8,["component"])]),default:t(()=>[d(p(k.value)+" ",1)]),_:1})):_("",!0)])]),"header-extra":t(()=>[h("span",xe,[S.value&&e.message.is_read===0?(a(),I(J,{key:0,dot:"",processing:""})):_("",!0),h("span",es,p(o(ve)(e.message.created_on)),1),n(E,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:N},{default:t(()=>[n(Y,{quaternary:"",circle:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[n(q,{"show-icon":!1,class:"brief-wrap",type:!S.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),u("div",ss,[d(p(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),u("span",{key:0,onClick:s[2]||(s[2]=R(O=>W(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(Se))]),_:1}),d(" 查看详情 ")])):_("",!0)])):_("",!0),e.message.type===4?(a(),u("div",ns,p(e.message.content),1)):_("",!0),e.message.type===5?(a(),u("div",ts,[d(p(e.message.content)+" ",1),e.message.reply_id===1?(a(),u("span",{key:0,onClick:s[3]||(s[3]=R(O=>L(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(Ce))]),_:1}),d(" 同意 ")])):_("",!0),e.message.reply_id===1?(a(),u("span",{key:1,onClick:s[4]||(s[4]=R(O=>Q(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(se))]),_:1}),d(" 拒绝 ")])):_("",!0),e.message.reply_id===2?(a(),u("span",as,[n(o(m),null,{default:t(()=>[n(o(Me))]),_:1}),d(" 已同意 ")])):_("",!0),e.message.reply_id===3?(a(),u("span",os,[n(o(m),null,{default:t(()=>[n(o(se))]),_:1}),d(" 已拒绝 ")])):_("",!0)])):_("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const is=X(rs,[["__scopeId","data-v-529aa194"]]),us={class:"content"},cs=K({__name:"message-skeleton",props:{num:{default:1}},setup(H){return(w,c)=>{const g=We;return a(!0),u(te,null,ne(new Array(w.num),l=>(a(),u("div",{class:"skeleton-item",key:l},[h("div",us,[n(g,{text:"",repeat:2}),n(g,{text:"",style:{width:"60%"}})])]))),128)}}});const _s=X(cs,[["__scopeId","data-v-01d2e871"]]),ds={key:0,class:"skeleton-wrap"},ps={key:1},ms={class:"title title-action"},gs={class:"title title-filter"},fs={key:0,class:"empty-wrap"},vs={key:1},ks={class:"load-more-wrap"},ys={class:"load-more-spinner"},hs=K({__name:"Messages",setup(H){const w=fe(),c=v(!1),g=v(!1),l=v(+w.query.p||1),M=v(20),b=v(0),k=v([]),f=v("所有消息"),F=v("all"),z=v(!1),N=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),S=()=>{g.value=!1,l.value=1,b.value=0,k.value=[]},i=r=>()=>D(m,null,{default:()=>D(r)}),P=$(()=>{let r;switch(f.value){case"所有消息":r=[{label:"系统消息",key:"system",icon:i(B)},{label:"我的私信",key:"whisper",icon:i(A)},{label:"好友申请",key:"requesting",icon:i(V)},{label:"未读消息",key:"unread",icon:i(T)}];break;case"系统消息":r=[{label:"所有消息",key:"all",icon:i(U)},{label:"我的私信",key:"whisper",icon:i(A)},{label:"好友申请",key:"requesting",icon:i(V)},{label:"未读消息",key:"unread",icon:i(T)}];break;case"我的私信":r=[{label:"所有消息",key:"all",icon:i(U)},{label:"系统消息",key:"system",icon:i(B)},{label:"好友申请",key:"requesting",icon:i(V)},{label:"未读消息",key:"unread",icon:i(T)}];break;case"好友申请":r=[{label:"所有消息",key:"all",icon:i(U)},{label:"系统消息",key:"system",icon:i(B)},{label:"我的私信",key:"whisper",icon:i(A)},{label:"未读消息",key:"unread",icon:i(T)}];break;case"未读消息":r=[{label:"所有消息",key:"all",icon:i(U)},{label:"系统消息",key:"system",icon:i(B)},{label:"我的私信",key:"whisper",icon:i(A)},{label:"好友申请",key:"requesting",icon:i(V)}];break;default:r=[];break}return r}),W=r=>{switch(r){case"all":f.value="所有消息";break;case"system":f.value="系统消息";break;case"whisper":f.value="我的私信";break;case"requesting":f.value="好友申请";break;case"unread":f.value="未读消息";break}F.value=r,S(),s()},L=()=>{W("unread")},Q=()=>{S(),s()},C=r=>{N.value=r,z.value=!0},e=()=>{z.value=!1},s=()=>{c.value=!0,$e({style:F.value,page:l.value,page_size:M.value}).then(r=>{c.value=!1,r.list.length===0&&(g.value=!0),l.value>1?k.value=k.value.concat(r.list):(k.value=r.list,window.scrollTo(0,0)),b.value=Math.ceil(r.pager.total_rows/M.value)}).catch(r=>{c.value=!1,l.value>1&&l.value--})},y=()=>{l.value{s()}),(r,j)=>{const J=Qe,Y=Le,E=_s,q=ae,G=Be,O=oe,Z=je,le=Ve,re=is,ie=He,ue=Ue,ce=De;return a(),u("div",null,[n(J,{title:"消息"}),n(ue,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[n(Y,{show:z.value,user:N.value,onSuccess:e},null,8,["show","user"]),c.value&&k.value.length===0?(a(),u("div",ds,[n(E,{num:M.value},null,8,["num"])])):(a(),u("div",ps,[n(Z,{justify:"space-between"},{default:t(()=>[h("div",ms,[n(q,{text:"",size:"small",onClick:L},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(T))]),_:1})]),default:t(()=>[d(" 0 条未读 ")]),_:1}),n(G,{vertical:""}),n(q,{text:"",size:"small",onClick:Q},{default:t(()=>[d("全标已读")]),_:1})]),h("div",gs,[n(O,{placement:"bottom-end",trigger:"click",size:"small",options:P.value,onSelect:W},{default:t(()=>[n(q,{text:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Oe))]),_:1})]),default:t(()=>[d(" "+p(f.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),k.value.length===0?(a(),u("div",fs,[n(le,{size:"large",description:"暂无数据"})])):(a(),u("div",vs,[(a(!0),u(te,null,ne(k.value,x=>(a(),I(ie,{key:x.id},{default:t(()=>[n(re,{message:x,onSendWhisper:C,onReload:s},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),b.value>0?(a(),I(Z,{key:0,justify:"center"},{default:t(()=>[n(o(Je),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:y},{spinner:t(()=>[h("div",ks,[g.value?_("",!0):(a(),I(ce,{key:0,size:14})),h("span",ys,p(g.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):_("",!0)])}}});const Js=X(hs,[["__scopeId","data-v-77b4139c"]]);export{Js as default}; diff --git a/web/dist/assets/Post-94d5e02e.js b/web/dist/assets/Post-f693e2a8.js similarity index 98% rename from web/dist/assets/Post-94d5e02e.js rename to web/dist/assets/Post-f693e2a8.js index 60ad3a6b..44b52c32 100644 --- a/web/dist/assets/Post-94d5e02e.js +++ b/web/dist/assets/Post-f693e2a8.js @@ -1 +1 @@ -import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-cb47660d.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-5f7e0179.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-67280cce.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-7f52b83e.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-21e170f1"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-21e170f1"]]);export{fn as default}; +import{d as oe,H as r,r as ke,e as o,f as _,j as d,k as t,w as n,A as T,x as R,q as x,Y as u,bf as a,y as Y,c as ue,al as Ke,F as me,u as ve,$ as ze,a0 as Re,b as Se,h as xe,E as Ge}from"./@vue-a481fc63.js";import{u as ce}from"./vuex-44de225f.js";import{i as he,t as Qe,j as Xe,k as Ze,_ as re,l as et,m as tt,n as st,o as ot,p as nt,g as at,q as lt,r as it,s as ut,v as ct,w as rt,x as _t,y as pt,z as dt,A as mt,B as vt,u as ht,f as ft,C as Ie,D as ye}from"./index-3c78935c.js";import{Y as se,V as ee}from"./IEnum-5453a777.js";import{T as Oe,e as fe,f as Le,g as ge,h as Ae,i as gt,j as yt,I as kt,k as wt,l as bt,m as $t,n as Ct,o as xt,p as It,q as Pt,r as Tt,s as Ut,t as ie,u as zt,v as Rt,w as St,x as Pe,F as Te,E as pe,y as de,z as Ue}from"./@vicons-f0266f88.js";import{j as J,e as _e,K as De,I as Ot,b as Lt,L as At,o as we,M as Me,O as Ee,v as Dt,w as Mt,x as Et,y as Nt,z as qt,B as Bt,F as Ht,P as Ft,i as jt,Q as Vt,a as Ne,G as Yt,J as Wt,k as Jt,H as Kt,f as Gt,g as Qt}from"./naive-ui-eecf2ec3.js";import{p as be,_ as qe,a as Xt,b as Zt,c as es}from"./content-b9c58eb8.js";import{u as Be,b as ts}from"./vue-router-e5a2430e.js";import{_ as ss}from"./post-skeleton-52d6bc96.js";import{l as os}from"./lodash-e0b37ac3.js";import{_ as ns}from"./whisper-7e17488b.js";import{c as as}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as ls}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{W as is}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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"./paopao-video-player-2fe58954.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";const us={class:"reply-item"},cs={class:"header-wrap"},rs={class:"username"},_s={class:"reply-name"},ps={class:"timestamp"},ds={class:"base-wrap"},ms={class:"content"},vs={class:"reply-switch"},hs={class:"time-item"},fs={class:"actions"},gs={class:"upvote-count"},ys=["onClick"],ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=["onClick"],$s=oe({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:q}){const l=E,m=ce(),v=r(l.reply.is_thumbs_up==se.YES),g=r(l.reply.is_thumbs_down==se.YES),$=r(l.reply.thumbs_up_count),D=()=>{Qe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{v.value=!v.value,v.value?($.value++,g.value=!1):$.value--}).catch(y=>{console.log(y)})},i=()=>{Xe({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(y=>{g.value=!g.value,g.value&&v.value&&($.value--,v.value=!1)}).catch(y=>{console.log(y)})},S=()=>{q("focusReply",l.reply)},L=()=>{Ze({id:l.reply.id}).then(y=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(y=>{console.log(y)})};return(y,A)=>{const M=ke("router-link"),U=J,p=_e,z=De,w=Ot;return o(),_("div",us,[d("div",cs,[d("div",rs,[t(M,{class:"user-link",to:{name:"user",query:{s:l.reply.user.username}}},{default:n(()=>[T(R(l.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,R(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),x(M,{key:0,class:"user-link",to:{name:"user",query:{s:l.reply.at_user.username}}},{default:n(()=>[T(R(l.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),d("div",ps,[T(R(l.reply.ip_loc)+" ",1),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===l.reply.user.id?(o(),x(z,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:L},{trigger:n(()=>[t(p,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(U,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条回复? ")]),_:1})):u("",!0)])]),d("div",ds,[d("div",ms,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[T(R(l.reply.content),1)]),_:1})]),d("div",vs,[d("span",hs,R(a(he)(l.reply.created_on)),1),d("div",fs,[a(m).state.userLogined?u("",!0):(o(),_("div",{key:0,class:"action-item",onClick:A[0]||(A[0]=Y(()=>{},["stop"]))},[t(U,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",gs,R($.value),1)])),a(m).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(D,["stop"])},[t(U,{size:"medium"},{default:n(()=>[v.value?u("",!0):(o(),x(a(fe),{key:0})),v.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",ks,R($.value>0?$.value:"赞"),1)],8,ys)):u("",!0),a(m).state.userLogined?u("",!0):(o(),_("div",ws,[t(U,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(m).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(i,["stop"])},[t(U,{size:"medium"},{default:n(()=>[g.value?u("",!0):(o(),x(a(ge),{key:0})),g.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,bs)):u("",!0),a(m).state.userLogined?(o(),_("span",{key:4,class:"show opacity-item reply-btn",onClick:S}," 回复 ")):u("",!0)])])])])}}});const Cs=re($s,[["__scopeId","data-v-eccdbbd8"]]),xs={class:"reply-compose-wrap"},Is={class:"reply-switch"},Ps={class:"time-item"},Ts={class:"actions"},Us={key:0,class:"action-item"},zs={class:"upvote-count"},Rs=["onClick"],Ss={class:"upvote-count"},Os={key:2,class:"action-item"},Ls=["onClick"],As={key:0,class:"reply-input-wrap"},Ds=oe({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:q,emit:l}){const m=E,v=ce(),g=r(),$=r(!1),D=r(""),i=r(!1),S=+"300",L=r(m.comment.is_thumbs_up==se.YES),y=r(m.comment.is_thumbs_down==se.YES),A=r(m.comment.thumbs_up_count),M=()=>{et({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{L.value=!L.value,L.value?(A.value++,y.value=!1):A.value--}).catch(w=>{console.log(w)})},U=()=>{tt({tweet_id:m.comment.post_id,comment_id:m.comment.id}).then(w=>{y.value=!y.value,y.value&&L.value&&(A.value--,L.value=!1)}).catch(w=>{console.log(w)})},p=w=>{$.value=w,w?setTimeout(()=>{var O;(O=g.value)==null||O.focus()},10):(i.value=!1,D.value="",l("reset"))},z=()=>{i.value=!0,st({comment_id:m.comment.id,at_user_id:m.atUserid,content:D.value}).then(w=>{p(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{i.value=!1})};return q({switchReply:p}),(w,O)=>{const N=J,s=Lt,h=_e,F=At;return o(),_("div",xs,[d("div",Is,[d("span",Ps,R(a(he)(w.comment.created_on)),1),d("div",Ts,[a(v).state.userLogined?u("",!0):(o(),_("div",Us,[t(N,{size:"medium"},{default:n(()=>[t(a(fe))]),_:1}),d("span",zs,R(A.value),1)])),a(v).state.userLogined?(o(),_("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(N,{size:"medium"},{default:n(()=>[L.value?u("",!0):(o(),x(a(fe),{key:0})),L.value?(o(),x(a(Le),{key:1,class:"show"})):u("",!0)]),_:1}),d("span",Ss,R(A.value>0?A.value:"赞"),1)],8,Rs)):u("",!0),a(v).state.userLogined?u("",!0):(o(),_("div",Os,[t(N,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1})])),a(v).state.userLogined?(o(),_("div",{key:3,class:"action-item hover",onClick:Y(U,["stop"])},[t(N,{size:"medium"},{default:n(()=>[y.value?u("",!0):(o(),x(a(ge),{key:0})),y.value?(o(),x(a(Ae),{key:1,class:"show"})):u("",!0)]),_:1})],8,Ls)):u("",!0),a(v).state.userLogined&&!$.value?(o(),_("span",{key:4,class:"show reply-btn",onClick:O[0]||(O[0]=B=>p(!0))}," 回复 ")):u("",!0),a(v).state.userLogined&&$.value?(o(),_("span",{key:5,class:"hide reply-btn",onClick:O[1]||(O[1]=B=>p(!1))}," 取消 ")):u("",!0)])]),$.value?(o(),_("div",As,[t(F,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:g,size:"small",placeholder:m.atUsername?"@"+m.atUsername:"请输入回复内容..",maxlength:a(S),value:D.value,"onUpdate:value":O[2]||(O[2]=B=>D.value=B),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(h,{type:"primary",size:"small",ghost:"",loading:i.value,onClick:z},{default:n(()=>[T(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const Ms=re(Ds,[["__scopeId","data-v-f9af7a93"]]),Es={class:"comment-item"},Ns={class:"nickname-wrap"},qs={class:"username-wrap"},Bs={class:"opt-wrap"},Hs={class:"timestamp"},Fs=["innerHTML"],js={class:"reply-wrap"},Vs=oe({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m=ce(),v=Be(),g=r(0),$=r(""),D=r(),i=ue(()=>{let p=Object.assign({texts:[],imgs:[]},l.comment);return p.contents.map(z=>{(+z.type==1||+z.type==2)&&p.texts.push(z),+z.type==3&&p.imgs.push(z)}),p}),S=(p,z)=>{let w=p.target;if(w.dataset.detail){const O=w.dataset.detail.split(":");O.length===2&&(m.commit("refresh"),O[0]==="tag"?window.$message.warning("评论内的无效话题"):v.push({name:"user",query:{s:O[1]}}))}},L=p=>{var z,w;g.value=p.user_id,$.value=((z=p.user)==null?void 0:z.username)||"",(w=D.value)==null||w.switchReply(!0)},y=()=>{q("reload")},A=()=>{g.value=0,$.value=""},M=()=>{ot({id:i.value.id}).then(p=>{window.$message.success("删除成功"),setTimeout(()=>{y()},50)}).catch(p=>{})},U=()=>{nt({id:i.value.id}).then(p=>{i.value.is_essence=p.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{y()},50)}).catch(p=>{})};return(p,z)=>{const w=we,O=ke("router-link"),N=Me,s=J,h=_e,F=De,B=qe,G=Ms,W=Cs,Q=Ee;return o(),_("div",Es,[t(Q,{"content-indented":""},Ke({avatar:n(()=>[t(w,{round:"",size:30,src:i.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ns,[t(O,{onClick:z[0]||(z[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:i.value.user.username}}},{default:n(()=>[T(R(i.value.user.nickname),1)]),_:1},8,["to"])]),d("span",qs," @"+R(i.value.user.username),1),i.value.is_essence==a(se).YES?(o(),x(N,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 精选 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",Bs,[d("span",Hs,R(i.value.ip_loc),1),a(m).state.userInfo.id===p.postUserId?(o(),x(F,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:U},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[i.value.is_essence==a(se).NO?(o(),x(s,{key:0},{default:n(()=>[t(a(gt))]),_:1})):(o(),x(s,{key:1},{default:n(()=>[t(a(yt))]),_:1}))]),_:1})]),default:n(()=>[T(" "+R(i.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):u("",!0),a(m).state.userInfo.is_admin||a(m).state.userInfo.id===i.value.user.id?(o(),x(F,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(h,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Oe))]),_:1})]),_:1})]),default:n(()=>[T(" 是否删除这条评论? ")]),_:1})):u("",!0)])]),footer:n(()=>[i.value.imgs.length>0?(o(),x(B,{key:0,imgs:i.value.imgs},null,8,["imgs"])):u("",!0),t(G,{ref_key:"replyComposeRef",ref:D,comment:i.value,"at-userid":g.value,"at-username":$.value,onReload:y,onReset:A},null,8,["comment","at-userid","at-username"]),d("div",js,[(o(!0),_(me,null,ve(i.value.replies,b=>(o(),x(W,{key:b.id,reply:b,"tweet-id":i.value.post_id,onFocusReply:L,onReload:y},null,8,["reply","tweet-id"]))),128))])]),_:2},[i.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),_(me,null,ve(i.value.texts,b=>(o(),_("span",{key:b.id,class:"comment-text",onClick:z[1]||(z[1]=Y(I=>S(I,i.value.id),["stop"])),innerHTML:a(be)(b.content).content},null,8,Fs))),128))]),key:"0"}:void 0]),1024)])}}});const Ys=re(Vs,[["__scopeId","data-v-e1f04c6b"]]),Ws=E=>(ze("data-v-d9073453"),E=E(),Re(),E),Js={key:0,class:"compose-wrap"},Ks={class:"compose-line"},Gs={class:"compose-user"},Qs={class:"compose-line compose-options"},Xs={class:"attachment"},Zs={class:"submit-wrap"},eo={class:"attachment-list-wrap"},to={key:1,class:"compose-wrap"},so=Ws(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),oo={key:0,class:"login-only-wrap"},no={key:1,class:"login-wrap"},ao=oe({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:q}){const l=E,m=ce(),v=r([]),g=r(!1),$=r(!1),D=r(!1),i=r(""),S=r(),L=r("public/image"),y=r([]),A=r([]),M=r("true".toLowerCase()==="true"),U=+"300",p="/v1/attachment",z=ue(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),w=os.debounce(f=>{at({k:f}).then(k=>{let C=[];k.suggest.map(P=>{C.push({label:P,value:P})}),v.value=C,$.value=!1}).catch(k=>{$.value=!1})},200),O=(f,k)=>{$.value||($.value=!0,k==="@"&&w(f))},N=f=>{f.length>U?i.value=f.substring(0,U):i.value=f},s=f=>{L.value=f},h=f=>{for(let H=0;H30&&(f[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+P)}y.value=f},F=async f=>{var k,C;return L.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((k=f.file.file)==null?void 0:k.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):L.value==="image"&&((C=f.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},B=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);P.code===0&&L.value==="public/image"&&A.value.push({id:f.id,content:P.data.content})}catch{window.$message.error("上传失败")}},G=({file:f,event:k})=>{var C;try{let P=JSON.parse((C=k.target)==null?void 0:C.response);if(P.code!==0){let H=P.msg||"上传失败";P.details&&P.details.length>0&&P.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},W=({file:f})=>{let k=A.value.findIndex(C=>C.id===f.id);k>-1&&A.value.splice(k,1)},Q=()=>{g.value=!0},b=()=>{var f;g.value=!1,(f=S.value)==null||f.clear(),y.value=[],i.value="",A.value=[]},I=()=>{if(i.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:f}=be(i.value);const k=[];let C=100;k.push({content:i.value,type:2,sort:C}),A.value.map(P=>{C++,k.push({content:P.content,type:3,sort:C})}),D.value=!0,lt({contents:k,post_id:l.postId,users:Array.from(new Set(f))}).then(P=>{window.$message.success("发布成功"),D.value=!1,q("post-success"),b()}).catch(P=>{D.value=!1})},X=f=>{m.commit("triggerAuth",!0),m.commit("triggerAuthKey",f)};return(f,k)=>{const C=we,P=Dt,H=J,e=_e,c=Mt,j=Et,ne=Nt,Z=qt,ae=Bt;return o(),_("div",null,[a(m).state.userInfo.id>0?(o(),_("div",Js,[d("div",Ks,[d("div",Gs,[t(C,{round:"",size:30,src:a(m).state.userInfo.avatar},null,8,["src"])]),t(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:v.value,prefix:["@"],loading:$.value,value:i.value,disabled:l.lock===1,"onUpdate:value":N,onSearch:O,onFocus:Q,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),g.value?(o(),x(ae,{key:0,ref_key:"uploadRef",ref:S,abstract:"","list-type":"image",multiple:!0,max:9,action:p,headers:{Authorization:z.value},data:{type:L.value},"file-list":y.value,onBeforeUpload:F,onFinish:B,onError:G,onRemove:W,"onUpdate:fileList":h},{default:n(()=>[d("div",Qs,[d("div",Xs,[t(c,{abstract:""},{default:n(({handleClick:K})=>[t(e,{disabled:y.value.length>0&&L.value==="public/video"||y.value.length===9,onClick:()=>{s("public/image"),K()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(kt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ne,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(j,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:i.value.length/a(U)*100},null,8,["percentage"])]),default:n(()=>[T(" "+R(i.value.length)+" / "+R(a(U)),1)]),_:1})]),d("div",Zs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:b},{default:n(()=>[T(" 取消 ")]),_:1}),t(e,{loading:D.value,onClick:I,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[T(" 发布 ")]),_:1},8,["loading"])])]),d("div",eo,[t(Z)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(o(),_("div",to,[so,M.value?u("",!0):(o(),_("div",oo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[0]||(k[0]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1})])),M.value?(o(),_("div",no,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:k[1]||(k[1]=K=>X("signin"))},{default:n(()=>[T(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:k[2]||(k[2]=K=>X("signup"))},{default:n(()=>[T(" 注册 ")]),_:1})])):u("",!0)]))])}}});const lo=re(ao,[["__scopeId","data-v-d9073453"]]),io={class:"username-wrap"},uo={class:"options"},co={key:0},ro=["innerHTML"],_o={class:"timestamp"},po={key:0},mo={key:1},vo={class:"opts-wrap"},ho=["onClick"],fo={class:"opt-item"},go=["onClick"],yo=["onClick"],ko=oe({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:q}){const l=E,m="true".toLowerCase()==="true",v=ce(),g=Be(),$=Ht(),D=r(!1),i=r(!1),S=r(!1),L=r(!1),y=r(!1),A=r(!1),M=r(!1),U=r(!1),p=r(ee.PUBLIC),z=r(!1),w=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=e=>{w.value=e,z.value=!0},N=()=>{z.value=!1},s=ue({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{l.post.upvote_count=e.upvote_count,l.post.comment_count=e.comment_count,l.post.collection_count=e.collection_count,l.post.is_essence=e.is_essence}}),h=e=>()=>xe(J,null,{default:()=>xe(e)}),F=ue(()=>{var j;let e=[];if(!v.state.userInfo.is_admin&&v.state.userInfo.id!=l.post.user.id)return e.push({label:"私信",key:"whisper",icon:h(Tt)}),l.post.user.is_following?e.push({label:"取消关注",key:"unfollow",icon:h(Ut)}):e.push({label:"关注",key:"follow",icon:h(ie)}),e;e.push({label:"删除",key:"delete",icon:h(zt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:h(Rt)}):e.push({label:"解锁",key:"unlock",icon:h(St)}),v.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:h(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:h(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:h(Te)}):e.push({label:"取消亮点",key:"unhighlight",icon:h(Te)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:h(pe),children:[{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:h(de),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:m&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:h(Ue),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)},{label:"关注可见",key:"vfollowing",icon:h(ie)}]}:c={label:"关注可见",key:"vfollowing",icon:h(ie),children:[{label:"公开",key:"vpublic",icon:h(pe)},{label:"私密",key:"vprivate",icon:h(de)}]},m&&s.value.visibility!==ee.FRIEND&&((j=c.children)==null||j.push({label:"好友可见",key:"vfriend",icon:h(Ue)})),e.push(c),e}),B=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ht({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):ft({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(c=>{})}})},G=e=>{g.push({name:"post",query:{id:e}})},W=(e,c)=>{if(e.target.dataset.detail){const j=e.target.dataset.detail.split(":");if(j.length===2){v.commit("refresh"),j[0]==="tag"?g.push({name:"home",query:{q:j[1],t:"tag"}}):g.push({name:"user",query:{s:j[1]}});return}}G(c)},Q=e=>{switch(e){case"whisper":O(l.post.user);break;case"follow":case"unfollow":B(l.post);break;case"delete":S.value=!0;break;case"lock":case"unlock":L.value=!0;break;case"stick":case"unstick":y.value=!0;break;case"highlight":case"unhighlight":A.value=!0;break;case"vpublic":p.value=0,M.value=!0;break;case"vprivate":p.value=1,M.value=!0;break;case"vfriend":p.value=2,M.value=!0;break;case"vfollowing":p.value=3,M.value=!0;break}},b=()=>{ct({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{v.commit("refresh")},50)}).catch(e=>{U.value=!1})},I=()=>{rt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{U.value=!1})},X=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{U.value=!1})},f=()=>{pt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{U.value=!1})},k=()=>{dt({id:s.value.id,visibility:p.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{U.value=!1})},C=()=>{mt({id:s.value.id}).then(e=>{D.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},P=()=>{vt({id:s.value.id}).then(e=>{i.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{as(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Se(()=>{v.state.userInfo.id>0&&(it({id:s.value.id}).then(e=>{D.value=e.status}).catch(e=>{console.log(e)}),ut({id:s.value.id}).then(e=>{i.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const j=we,ne=ke("router-link"),Z=Me,ae=_e,K=Ft,le=jt,He=ns,$e=Xt,Fe=qe,je=Zt,Ve=es,Ce=Vt,Ye=Ne,We=Ee;return o(),_("div",{class:"detail-item",onClick:c[7]||(c[7]=V=>G(s.value.id))},[t(We,null,{avatar:n(()=>[t(j,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(ne,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[T(R(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",io," @"+R(s.value.user.username),1),s.value.is_top?(o(),x(Z,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[T(" 置顶 ")]),_:1})):u("",!0),s.value.visibility==a(ee).PRIVATE?(o(),x(Z,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[T(" 私密 ")]),_:1})):u("",!0),s.value.visibility==a(ee).FRIEND?(o(),x(Z,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[T(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":n(()=>[d("div",uo,[t(K,{placement:"bottom-end",trigger:"click",size:"small",options:F.value,onSelect:Q},{default:n(()=>[t(ae,{quaternary:"",circle:""},{icon:n(()=>[t(a(J),null,{default:n(()=>[t(a(wt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(le,{show:S.value,"onUpdate:show":c[1]||(c[1]=V=>S.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:b},null,8,["show"]),t(le,{show:L.value,"onUpdate:show":c[2]||(c[2]=V=>L.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:I},null,8,["show","content"]),t(le,{show:y.value,"onUpdate:show":c[3]||(c[3]=V=>y.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:X},null,8,["show","content"]),t(le,{show:A.value,"onUpdate:show":c[4]||(c[4]=V=>A.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:f},null,8,["show","content"]),t(le,{show:M.value,"onUpdate:show":c[5]||(c[5]=V=>M.value=V),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(p.value==0?"公开":p.value==1?"私密":p.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show","content"]),t(He,{show:z.value,user:w.value,onSuccess:N},null,8,["show","user"])]),footer:n(()=>[t($e,{attachments:s.value.attachments},null,8,["attachments"]),t($e,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(Fe,{imgs:s.value.imgs},null,8,["imgs"]),t(je,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ve,{links:s.value.links},null,8,["links"]),d("div",_o,[T(" 发布于 "+R(a(he)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),_("span",po,[t(Ce,{vertical:""}),T(" "+R(s.value.ip_loc),1)])):u("",!0),!a(v).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),_("span",mo,[t(Ce,{vertical:""}),T(" 最后回复 "+R(a(he)(s.value.latest_replied_on)),1)])):u("",!0)])]),action:n(()=>[d("div",vo,[t(Ye,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[D.value?u("",!0):(o(),x(a(bt),{key:0})),D.value?(o(),x(a($t),{key:1,color:"red"})):u("",!0)]),_:1}),T(" "+R(s.value.upvote_count),1)],8,ho),d("div",fo,[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Ct))]),_:1}),T(" "+R(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(P,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[i.value?u("",!0):(o(),x(a(xt),{key:0})),i.value?(o(),x(a(It),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),T(" "+R(s.value.collection_count),1)],8,go),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(J),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),T(" "+R(s.value.share_count),1)],8,yo)]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),_("div",co,[(o(!0),_(me,null,ve(s.value.texts,V=>(o(),_("span",{key:V.id,class:"post-text",onClick:c[6]||(c[6]=Y(Je=>W(Je,s.value.id),["stop"])),innerHTML:a(be)(V.content).content},null,8,ro))),128))])):u("",!0)]),_:1})])}}});const wo=E=>(ze("data-v-21e170f1"),E=E(),Re(),E),bo={key:0,class:"detail-wrap"},$o={key:1,class:"empty-wrap"},Co={key:0,class:"comment-opts-wrap"},xo=wo(()=>d("span",{class:"comment-title-item"},"评论",-1)),Io={key:2},Po={key:0,class:"skeleton-wrap"},To={key:1},Uo={key:0,class:"empty-wrap"},zo={key:0,class:"load-more-spinner"},Ro={key:1,class:"load-more-spinner"},So={key:2,class:"load-more-spinner"},Oo={key:3,class:"load-more-spinner"},Lo={key:4,class:"load-more-spinner"},Ao={key:5,class:"load-more-spinner"},te=20,Do=oe({__name:"Post",setup(E){const q=ts(),l=r({}),m=r(!1),v=r(!1),g=r([]),$=ue(()=>+q.query.id),D=r("default"),i=r(!0);let S={loading(){},loaded(){},complete(){},error(){}};const L=b=>{D.value=b,b==="default"&&(i.value=!0),W(S)},y=b=>{Ie({id:b}).then(I=>{l.value=I}).catch(I=>{})},A=()=>{l.value={id:0},m.value=!0,Ie({id:$.value}).then(b=>{m.value=!1,l.value=b,W(S)}).catch(b=>{m.value=!1})};let M=1;const U=r(!1),p=r([]),z=b=>{U.value||ye({id:l.value.id,style:"default",page:M,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(M===1?p.value=I.list:p.value.push(...I.list),g.value=p.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let w=1,O=r(!1);const N=r([]),s=b=>{O.value||ye({id:l.value.id,style:"hots",page:w,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(w===1?N.value=I.list:N.value.push(...I.list),g.value=N.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})};let h=1,F=r(!1);const B=r([]),G=b=>{F.value||ye({id:l.value.id,style:"newest",page:h,page_size:te}).then(I=>{b!==null&&(S=b),I.list.length0&&(h===1?B.value=I.list:B.value.push(...I.list),g.value=B.value),S.loaded(),v.value=!1}).catch(I=>{v.value=!1,S.error()})},W=b=>{$.value<1||(g.value.length===0&&(v.value=!0),D.value==="default"?(g.value=p.value,z(b)):D.value==="hots"?(g.value=N.value,s(b)):(g.value=B.value,G(b)),v.value=!1)},Q=()=>{M=1,U.value=!1,p.value=[],w=1,O.value=!1,N.value=[],h=1,F.value=!1,B.value=[],W(S)};return Se(()=>{A()}),Ge($,()=>{$.value>0&&q.name==="post"&&A()}),(b,I)=>{const X=ls,f=ko,k=Wt,C=Jt,P=Kt,H=Gt,e=Qt,c=lo,j=ss,ne=Ys,Z=Ne,ae=Yt;return o(),_("div",null,[t(X,{title:"泡泡详情",back:!0}),t(ae,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(P,null,{default:n(()=>[t(C,{show:m.value},{default:n(()=>[l.value.id>1?(o(),_("div",bo,[t(f,{post:l.value,onReload:y},null,8,["post"])])):(o(),_("div",$o,[t(k,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),_("div",Co,[t(e,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":L},{prefix:n(()=>[xo]),default:n(()=>[t(H,{name:"default",tab:"推荐"}),t(H,{name:"hots",tab:"热门"}),t(H,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),l.value.id>0?(o(),x(P,{key:1},{default:n(()=>[t(c,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:Q},null,8,["lock","post-id"])]),_:1})):u("",!0),l.value.id>0?(o(),_("div",Io,[v.value?(o(),_("div",Po,[t(j,{num:5})])):(o(),_("div",To,[g.value.length===0?(o(),_("div",Uo,[t(k,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(o(!0),_(me,null,ve(g.value,K=>(o(),x(P,{key:K.id},{default:n(()=>[t(ne,{comment:K,postUserId:l.value.user_id,onReload:Q},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):u("",!0),g.value.length>=te?(o(),x(Z,{key:3,justify:"center"},{default:n(()=>[t(a(is),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:W},{spinner:n(()=>[i.value&&U.value?(o(),_("span",zo)):u("",!0),!i.value&&a(O)?(o(),_("span",Ro)):u("",!0),!i.value&&a(F)?(o(),_("span",So)):u("",!0),i.value&&!U.value?(o(),_("span",Oo,"加载评论")):u("",!0),!i.value&&!a(O)?(o(),_("span",Lo,"加载评论")):u("",!0),!i.value&&!a(F)?(o(),_("span",Ao,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const fn=re(Do,[["__scopeId","data-v-21e170f1"]]);export{fn as default}; diff --git a/web/dist/assets/Profile-636f310e.js b/web/dist/assets/Profile-3c9035fa.js similarity index 95% rename from web/dist/assets/Profile-636f310e.js rename to web/dist/assets/Profile-3c9035fa.js index 95f099a1..3451f089 100644 --- a/web/dist/assets/Profile-636f310e.js +++ b/web/dist/assets/Profile-3c9035fa.js @@ -1 +1 @@ -import{_ as ge}from"./whisper-7f52b83e.js";import{_ as we,a as ke}from"./post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js";import{_ as ye}from"./post-skeleton-67280cce.js";import{_ as be}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{d as Ie,H as i,b as Pe,E as Oe,r as Te,f as n,k as r,bf as u,q as f,w as _,Y as d,e as a,j as p,x as O,A as W,y as ae,F as b,u as I}from"./@vue-a481fc63.js";import{u as Fe}from"./vuex-44de225f.js";import{b as Ae}from"./vue-router-e5a2430e.js";import{e as x,K as Me,u as xe,f as ze,_ as qe}from"./index-cb47660d.js";import{W as $e}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ce,G as Se,a as Le,o as Ue,M as Be,f as De,g as He,J as Ne,k as Ve,H as We}from"./naive-ui-eecf2ec3.js";import"./content-5f7e0179.js";import"./@vicons-f0266f88.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-7c8d4b48.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 je={class:"profile-baseinfo"},Ee={class:"avatar"},Re={class:"base-info"},Ge={class:"username"},Je={class:"userinfo"},Ke={class:"info-item"},Ye={class:"info-item"},Qe={class:"userinfo"},Xe={class:"info-item"},Ze={class:"info-item"},et={key:0,class:"skeleton-wrap"},tt={key:1},at={key:0,class:"empty-wrap"},st={key:1},lt={key:0},ot={key:1},nt={key:2},ut={key:3},it={key:4},rt={key:2},ct={key:0},_t={key:1},vt={key:2},dt={key:3},mt={key:4},ft={class:"load-more-wrap"},pt={class:"load-more-spinner"},ht=Ie({__name:"Profile",setup(gt){const o=Fe(),T=Ae(),se=Ce(),v=i(!1),P=i(!1),l=i([]),z=i([]),q=i([]),$=i([]),C=i([]),S=i([]),m=i("post"),j=i(+T.query.p||1),E=i(1),R=i(1),G=i(1),J=i(1),s=i(+T.query.p||1),g=i(20),c=i(0),K=i(0),Y=i(0),Q=i(0),X=i(0),Z=i(0),L=i(!1),ee=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{ee.value=e,L.value=!0},le=()=>{L.value=!1},k=e=>{se.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?xe({user_id:e.user.id}).then(h=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(h=>{}):ze({user_id:e.user.id}).then(h=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(h=>{})}})},U=()=>{switch(m.value){case"post":B();break;case"comment":D();break;case"highlight":H();break;case"media":N();break;case"star":V();break}},B=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,K.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},D=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),q.value=l.value,Y.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},H=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),$.value=l.value,Q.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},N=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),C.value=l.value,X.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},V=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),S.value=l.value,Z.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},oe=e=>{switch(m.value=e,m.value){case"post":l.value=z.value,s.value=j.value,c.value=K.value,B();break;case"comment":l.value=q.value,s.value=E.value,c.value=Y.value,D();break;case"highlight":l.value=$.value,s.value=R.value,c.value=Q.value,H();break;case"media":l.value=C.value,s.value=G.value,c.value=X.value,N();break;case"star":l.value=S.value,s.value=J.value,c.value=Z.value,V();break}},ne=()=>{switch(m.value){case"post":j.value=s.value,B();break;case"comment":E.value=s.value,D();break;case"highlight":R.value=s.value,H();break;case"media":G.value=s.value,N();break;case"star":J.value=s.value,V();break}},ue=()=>{s.value{U()}),Oe(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,h)=>{if(e.refresh!==h.refresh){s.value=+T.query.p||1,setTimeout(()=>{U()},0);return}h.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{U()},0))}),(e,h)=>{const ie=be,re=Ue,ce=Be,te=Te("router-link"),F=De,_e=He,ve=ye,de=Ne,A=we,y=We,M=ke,me=ge,fe=Se,pe=Ve,he=Le;return a(),n("div",null,[r(ie,{title:"主页"}),u(o).state.userInfo.id>0?(a(),f(fe,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[p("div",je,[p("div",Ee,[r(re,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),p("div",Re,[p("div",Ge,[p("strong",null,O(u(o).state.userInfo.nickname),1),p("span",null," @"+O(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(a(),f(ce,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[W(" 管理员 ")]),_:1})):d("",!0)]),p("div",Je,[p("span",Ke,"UID. "+O(u(o).state.userInfo.id),1),p("span",Ye,O(u(Me)(u(o).state.userInfo.created_on))+" 加入",1)]),p("div",Qe,[p("span",Xe,[r(te,{onClick:h[0]||(h[0]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[W(" 关注  "+O(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),p("span",Ze,[r(te,{onClick:h[1]||(h[1]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[W(" 粉丝  "+O(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),r(_e,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":oe},{default:_(()=>[r(F,{name:"post",tab:"泡泡"}),r(F,{name:"comment",tab:"评论"}),r(F,{name:"highlight",tab:"亮点"}),r(F,{name:"media",tab:"图文"}),r(F,{name:"star",tab:"喜欢"})]),_:1}),v.value&&l.value.length===0?(a(),n("div",et,[r(ve,{num:g.value},null,8,["num"])])):(a(),n("div",tt,[l.value.length===0?(a(),n("div",at,[r(de,{size:"large",description:"暂无数据"})])):d("",!0),u(o).state.desktopModelShow?(a(),n("div",st,[m.value==="post"?(a(),n("div",lt,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",ot,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",nt,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",ut,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",it,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(a(),n("div",rt,[m.value==="post"?(a(),n("div",ct,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",_t,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",vt,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",dt,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",mt,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))])),r(me,{show:L.value,user:ee.value,onSuccess:le},null,8,["show","user"])]),_:1})):d("",!0),c.value>0?(a(),f(he,{key:1,justify:"center"},{default:_(()=>[r(u($e),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:h[2]||(h[2]=t=>ue())},{spinner:_(()=>[p("div",ft,[P.value?d("",!0):(a(),f(pe,{key:0,size:14})),p("span",pt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Qt=qe(ht,[["__scopeId","data-v-4727fe2e"]]);export{Qt as default}; +import{_ as ge}from"./whisper-7e17488b.js";import{_ as we,a as ke}from"./post-item.vue_vue_type_style_index_0_lang-b1622c74.js";import{_ as ye}from"./post-skeleton-52d6bc96.js";import{_ as be}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{d as Ie,H as i,b as Pe,E as Oe,r as Te,f as n,k as r,bf as u,q as f,w as _,Y as d,e as a,j as p,x as O,A as W,y as ae,F as b,u as I}from"./@vue-a481fc63.js";import{u as Fe}from"./vuex-44de225f.js";import{b as Ae}from"./vue-router-e5a2430e.js";import{e as x,K as Me,u as xe,f as ze,_ as qe}from"./index-3c78935c.js";import{W as $e}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ce,G as Se,a as Le,o as Ue,M as Be,f as De,g as He,J as Ne,k as Ve,H as We}from"./naive-ui-eecf2ec3.js";import"./content-b9c58eb8.js";import"./@vicons-f0266f88.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-7c8d4b48.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 je={class:"profile-baseinfo"},Ee={class:"avatar"},Re={class:"base-info"},Ge={class:"username"},Je={class:"userinfo"},Ke={class:"info-item"},Ye={class:"info-item"},Qe={class:"userinfo"},Xe={class:"info-item"},Ze={class:"info-item"},et={key:0,class:"skeleton-wrap"},tt={key:1},at={key:0,class:"empty-wrap"},st={key:1},lt={key:0},ot={key:1},nt={key:2},ut={key:3},it={key:4},rt={key:2},ct={key:0},_t={key:1},vt={key:2},dt={key:3},mt={key:4},ft={class:"load-more-wrap"},pt={class:"load-more-spinner"},ht=Ie({__name:"Profile",setup(gt){const o=Fe(),T=Ae(),se=Ce(),v=i(!1),P=i(!1),l=i([]),z=i([]),q=i([]),$=i([]),C=i([]),S=i([]),m=i("post"),j=i(+T.query.p||1),E=i(1),R=i(1),G=i(1),J=i(1),s=i(+T.query.p||1),g=i(20),c=i(0),K=i(0),Y=i(0),Q=i(0),X=i(0),Z=i(0),L=i(!1),ee=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=e=>{ee.value=e,L.value=!0},le=()=>{L.value=!1},k=e=>{se.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?xe({user_id:e.user.id}).then(h=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(h=>{}):ze({user_id:e.user.id}).then(h=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(h=>{})}})},U=()=>{switch(m.value){case"post":B();break;case"comment":D();break;case"highlight":H();break;case"media":N();break;case"star":V();break}},B=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,K.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},D=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),q.value=l.value,Y.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},H=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),$.value=l.value,Q.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},N=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),C.value=l.value,X.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},V=()=>{v.value=!0,x({username:o.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{v.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),c.value=Math.ceil(e.pager.total_rows/g.value),S.value=l.value,Z.value=c.value}).catch(e=>{l.value=[],s.value>1&&s.value--,v.value=!1})},oe=e=>{switch(m.value=e,m.value){case"post":l.value=z.value,s.value=j.value,c.value=K.value,B();break;case"comment":l.value=q.value,s.value=E.value,c.value=Y.value,D();break;case"highlight":l.value=$.value,s.value=R.value,c.value=Q.value,H();break;case"media":l.value=C.value,s.value=G.value,c.value=X.value,N();break;case"star":l.value=S.value,s.value=J.value,c.value=Z.value,V();break}},ne=()=>{switch(m.value){case"post":j.value=s.value,B();break;case"comment":E.value=s.value,D();break;case"highlight":R.value=s.value,H();break;case"media":G.value=s.value,N();break;case"star":J.value=s.value,V();break}},ue=()=>{s.value{U()}),Oe(()=>({path:T.path,query:T.query,refresh:o.state.refresh}),(e,h)=>{if(e.refresh!==h.refresh){s.value=+T.query.p||1,setTimeout(()=>{U()},0);return}h.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{U()},0))}),(e,h)=>{const ie=be,re=Ue,ce=Be,te=Te("router-link"),F=De,_e=He,ve=ye,de=Ne,A=we,y=We,M=ke,me=ge,fe=Se,pe=Ve,he=Le;return a(),n("div",null,[r(ie,{title:"主页"}),u(o).state.userInfo.id>0?(a(),f(fe,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[p("div",je,[p("div",Ee,[r(re,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),p("div",Re,[p("div",Ge,[p("strong",null,O(u(o).state.userInfo.nickname),1),p("span",null," @"+O(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(a(),f(ce,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[W(" 管理员 ")]),_:1})):d("",!0)]),p("div",Je,[p("span",Ke,"UID. "+O(u(o).state.userInfo.id),1),p("span",Ye,O(u(Me)(u(o).state.userInfo.created_on))+" 加入",1)]),p("div",Qe,[p("span",Xe,[r(te,{onClick:h[0]||(h[0]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[W(" 关注  "+O(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),p("span",Ze,[r(te,{onClick:h[1]||(h[1]=ae(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[W(" 粉丝  "+O(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),r(_e,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":oe},{default:_(()=>[r(F,{name:"post",tab:"泡泡"}),r(F,{name:"comment",tab:"评论"}),r(F,{name:"highlight",tab:"亮点"}),r(F,{name:"media",tab:"图文"}),r(F,{name:"star",tab:"喜欢"})]),_:1}),v.value&&l.value.length===0?(a(),n("div",et,[r(ve,{num:g.value},null,8,["num"])])):(a(),n("div",tt,[l.value.length===0?(a(),n("div",at,[r(de,{size:"large",description:"暂无数据"})])):d("",!0),u(o).state.desktopModelShow?(a(),n("div",st,[m.value==="post"?(a(),n("div",lt,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",ot,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",nt,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",ut,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",it,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(A,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(a(),n("div",rt,[m.value==="post"?(a(),n("div",ct,[(a(!0),n(b,null,I(z.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="comment"?(a(),n("div",_t,[(a(!0),n(b,null,I(q.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="highlight"?(a(),n("div",vt,[(a(!0),n(b,null,I($.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="media"?(a(),n("div",dt,[(a(!0),n(b,null,I(C.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),m.value==="star"?(a(),n("div",mt,[(a(!0),n(b,null,I(S.value,t=>(a(),f(y,{key:t.id},{default:_(()=>[r(M,{post:t,isOwner:u(o).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))])),r(me,{show:L.value,user:ee.value,onSuccess:le},null,8,["show","user"])]),_:1})):d("",!0),c.value>0?(a(),f(he,{key:1,justify:"center"},{default:_(()=>[r(u($e),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:h[2]||(h[2]=t=>ue())},{spinner:_(()=>[p("div",ft,[P.value?d("",!0):(a(),f(pe,{key:0,size:14})),p("span",pt,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const Qt=qe(ht,[["__scopeId","data-v-4727fe2e"]]);export{Qt as default}; diff --git a/web/dist/assets/Setting-795c1b9a.js b/web/dist/assets/Setting-0bb3d354.js similarity index 98% rename from web/dist/assets/Setting-795c1b9a.js rename to web/dist/assets/Setting-0bb3d354.js index 97f36b74..dbb5ac0c 100644 --- a/web/dist/assets/Setting-795c1b9a.js +++ b/web/dist/assets/Setting-0bb3d354.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{d as ye,H as d,R as Q,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as p,x as S,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{a2 as X,a3 as Ue,a4 as Re,a5 as Se,a6 as qe,a7 as Ae,a8 as Be,_ as Ne}from"./index-cb47660d.js";import{a2 as ze}from"./@vicons-f0266f88.js";import{h as xe,o as De,e as Ke,B as Fe,b as Te,j as je,T as Oe,$ as Ve,L as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.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-7c8d4b48.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 T=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ge={class:"base-line avatar"},He={class:"base-line"},Je=T(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},Qe=T(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=T(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=T(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},pt={class:"captcha-img-wrap"},ct={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(B){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),R=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),H=d(),J=d(),Y=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=M.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Re({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Se({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&O()}))})},j=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},pe=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},ce=()=>{if(!(I.value>0&&R.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{R.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,R.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),O()}),(n,e)=>{const v=we,f=De,c=Ke,K=Fe,h=Te,ge=je,F=xe,Z=Oe,w=Ve,he=Ee,V=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",He,[Je,C.value?_("",!0):(r(),g("div",Ye,S(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:pe,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[Qe,p(" @"+S(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[p(S(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:j},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:R.value,loading:P.value,onClick:ce},{default:s(()=>[p(S(I.value>0&&R.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[p(S(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:H,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",pt,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",ct,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:O},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:de},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),U.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{d as ye,H as d,R as Q,b as ke,f as g,k as t,w as s,q as b,Y as _,e as r,j as m,bf as u,A as p,x as S,O as be,D as Ce,Z as q,y as A,$ as Ie,a0 as $e}from"./@vue-a481fc63.js";import{u as Pe}from"./vuex-44de225f.js";import{a2 as X,a3 as Ue,a4 as Re,a5 as Se,a6 as qe,a7 as Ae,a8 as Be,_ as Ne}from"./index-3c78935c.js";import{a2 as ze}from"./@vicons-f0266f88.js";import{h as xe,o as De,e as Ke,B as Fe,b as Te,j as je,T as Oe,$ as Ve,L as Ee,a0 as Le,a1 as Me,d as We}from"./naive-ui-eecf2ec3.js";import"./vue-router-e5a2430e.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-7c8d4b48.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 T=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),Ge={class:"base-line avatar"},He={class:"base-line"},Je=T(()=>m("span",{class:"base-label"},"昵称",-1)),Ye={key:0},Ze={class:"base-line"},Qe=T(()=>m("span",{class:"base-label"},"用户名",-1)),Xe={key:0},et={key:1},tt=T(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=T(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},pt={class:"captcha-img-wrap"},ct={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(B){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),N=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),z=d(!1),x=d(!1),M=d(),W=d(),C=d(!1),D=d(!1),U=d(!1),R=d(!1),I=d(60),y=d(!1),k=d(!1),G=d(),H=d(),J=d(),Y=d(),a=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return N.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):N.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&N.value==="public/avatar"&&Ue({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=M.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Y.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(D.value=!0,Re({password:a.password,old_password:a.old_password}).then(f=>{D.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(z.value=!0,Se({phone:a.phone,captcha:a.phone_captcha}).then(f=>{z.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{z.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(x.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{x.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{x.value=!1,f.code===20012&&O()}))})},j=()=>{X().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},O=()=>{X().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},pe=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},ce=()=>{if(!(I.value>0&&R.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Be({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{R.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,R.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&j(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),j(),O()}),(n,e)=>{const v=we,f=De,c=Ke,K=Fe,h=Te,ge=je,F=xe,Z=Oe,w=Ve,he=Ee,V=Le,E=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Ge,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(K,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",He,[Je,C.value?_("",!0):(r(),g("div",Ye,S(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:pe,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(ze))]),_:1})]),_:1})):_("",!0)]),m("div",Ze,[Qe,p(" @"+S(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",Xe,[p(S(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:G,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:j},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(c,{type:"primary",ghost:"",disabled:R.value,loading:P.value,onClick:ce},{default:s(()=>[p(S(I.value>0&&R.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",lt,[t(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[p(S(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:H,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",pt,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",ct,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:O},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:x.value,onClick:de},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),U.value?_("",!0):(r(),b(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Y,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(A(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",ft,[t(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),t(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:ie},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Ot=Ne(gt,[["__scopeId","data-v-a681720e"]]);export{Ot as default}; diff --git a/web/dist/assets/Topic-c5d2b7a7.js b/web/dist/assets/Topic-dc498894.js similarity index 95% rename from web/dist/assets/Topic-c5d2b7a7.js rename to web/dist/assets/Topic-dc498894.js index d8b351c2..ebed0fe4 100644 --- a/web/dist/assets/Topic-c5d2b7a7.js +++ b/web/dist/assets/Topic-dc498894.js @@ -1 +1 @@ -import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-cb47660d.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{E as U,F as A,G as M,H as O,I as x,_ as z}from"./index-3c78935c.js";import{D}from"./@vicons-f0266f88.js";import{d as q,H as _,c as T,b as B,r as G,e as c,f as u,k as n,w as s,q as $,A as C,x as h,Y as r,bf as w,E as H,al as j,F as P,u as Y}from"./@vue-a481fc63.js";import{o as J,M as V,j as K,e as Q,P as R,O as W,G as X,f as Z,g as ee,a as oe,k as te}from"./naive-ui-eecf2ec3.js";import{_ as ne}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{u as se}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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 ae={key:0,class:"tag-item"},ce={key:0,class:"tag-quote"},le={key:1,class:"tag-quote tag-follow"},ie={key:0,class:"options"},_e=q({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(F){const o=F,m=_(!1),g=T(()=>o.tag.user?o.tag.user.avatar:U),i=T(()=>{let e=[];return o.tag.is_following===0?e.push({label:"关注",key:"follow"}):(o.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":O({topic_id:o.tag.id}).then(t=>{o.tag.is_following=1,window.$message.success("关注成功")}).catch(t=>{console.log(t)});break;case"unfollow":M({topic_id:o.tag.id}).then(t=>{o.tag.is_following=0,window.$message.success("取消关注")}).catch(t=>{console.log(t)});break;case"stick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("置顶成功")}).catch(t=>{console.log(t)});break;case"unstick":A({topic_id:o.tag.id}).then(t=>{o.tag.is_top=t.top_status,window.$message.success("取消置顶")}).catch(t=>{console.log(t)});break}};return B(()=>{m.value=!1}),(e,t)=>{const d=G("router-link"),k=J,a=V,f=K,v=Q,p=R,y=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),u("div",ae,[n(y,null,{header:s(()=>[(c(),$(a,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(k,{src:g.value},null,8,["src"])]),default:s(()=>[n(d,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[C(" #"+h(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?r("",!0):(c(),u("span",ce,"("+h(e.tag.quote_num)+")",1)),e.showAction?(c(),u("span",le,"("+h(e.tag.quote_num)+")",1)):r("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),u("div",ie,[n(p,{placement:"bottom-end",trigger:"click",size:"small",options:i.value,onSelect:l},{default:s(()=>[n(v,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(f,null,{default:s(()=>[n(w(D))]),_:1})]),_:1})]),_:1},8,["options"])])):r("",!0)]),_:1})])):r("",!0)}}});const ue=q({__name:"Topic",setup(F){const o=se(),m=_([]),g=_("hot"),i=_(!1),l=_(!1),e=_(!1);H(l,()=>{l.value||(window.$message.success("保存成功"),o.commit("refreshTopicFollow"))});const t=T({get:()=>{let a="编辑";return l.value&&(a="保存"),a},set:a=>{}}),d=()=>{i.value=!0,x({type:g.value,num:50}).then(a=>{m.value=a.topics,i.value=!1}).catch(a=>{console.log(a),i.value=!1})},k=a=>{g.value=a,a=="follow"?e.value=!0:e.value=!1,d()};return B(()=>{d()}),(a,f)=>{const v=ne,p=Z,y=V,E=ee,I=_e,L=oe,N=te,S=X;return c(),u("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(E,{type:"line",animated:"","onUpdate:value":k},j({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),w(o).state.userLogined?(c(),$(p,{key:0,name:"follow",tab:"关注"})):r("",!0)]),_:2},[w(o).state.userLogined?{name:"suffix",fn:s(()=>[n(y,{checked:l.value,"onUpdate:checked":f[0]||(f[0]=b=>l.value=b),checkable:""},{default:s(()=>[C(h(t.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(N,{show:i.value},{default:s(()=>[n(L,null,{default:s(()=>[(c(!0),u(P,null,Y(m.value,b=>(c(),$(I,{tag:b,showAction:w(o).state.userLogined&&l.value,checkFollowing:e.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=z(ue,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-3f0d7b73.js b/web/dist/assets/User-aa917c46.js similarity index 97% rename from web/dist/assets/User-3f0d7b73.js rename to web/dist/assets/User-aa917c46.js index c27c955b..f7cd9c5b 100644 --- a/web/dist/assets/User-3f0d7b73.js +++ b/web/dist/assets/User-aa917c46.js @@ -1 +1 @@ -import{_ as De,a as He}from"./post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js";import{_ as Ne}from"./post-skeleton-67280cce.js";import{_ as Re}from"./whisper-7f52b83e.js";import{_ as Ve}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{d as je,H as i,R as Ee,c as Ge,b as Je,E as Ke,r as Ye,f as u,k as n,w as r,q as g,Y as d,e as s,j as h,x as A,bf as c,A as D,y as ce,F,u as I,h as ve}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{L as Ze,K as ea,e as H,h as aa,u as _e,f as de,M as sa,_ as ta}from"./index-cb47660d.js";import{W as la}from"./whisper-add-friend-70019d63.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as na,r as ua,G as me,s as ia,t as ra,J as ca,R as va}from"./@vicons-f0266f88.js";import{F as _a,G as da,a as ma,j as fe,o as fa,M as pa,e as ga,P as ha,k as wa,f as ka,g as ya,J as ba,H as Pa}from"./naive-ui-eecf2ec3.js";import"./content-5f7e0179.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-7c8d4b48.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 Oa={key:0,class:"profile-baseinfo"},Fa={class:"avatar"},Ia={class:"base-info"},Ta={class:"username"},xa={class:"userinfo"},Aa={class:"info-item"},$a={class:"info-item"},za={class:"userinfo"},Ua={class:"info-item"},qa={class:"info-item"},Ca={key:0,class:"user-opts"},Ma={key:0,class:"skeleton-wrap"},Sa={key:1},Wa={key:0,class:"empty-wrap"},La={key:1},Ba={key:0},Da={key:1},Ha={key:2},Na={key:3},Ra={key:4},Va={key:2},ja={key:0},Ea={key:1},Ga={key:2},Ja={key:3},Ka={key:4},Ya={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=je({__name:"User",setup(Za){const N=_a(),_=Qe(),$=Xe(),ue="true".toLowerCase()==="true",m=i(!1),y=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}),p=i(!1),R=i(!1),j=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),C=i([]),M=i([]),T=i($.query.s||""),o=i(+$.query.p||1),f=i("post"),E=i(+$.query.p||1),G=i(1),J=i(1),K=i(1),Y=i(1),k=i(20),v=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,R.value=!0},P=e=>{N.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?_e({user_id:e.user.id}).then(w=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(w=>{}):de({user_id:e.user.id}).then(w=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(w=>{})}})},pe=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],C.value=[],M.value=[],f.value="post",o.value=1,E.value=1,G.value=1,J.value=1,K.value=1,Y.value=1,v.value=0,Q.value=0,X.value=0,Z.value=0,ee.value=0,ae.value=0},ge=()=>{switch(f.value){case"post":V();break;case"comment":se();break;case"highlight":te();break;case"media":le();break;case"star":oe();break}},V=()=>{m.value=!0,H({username:T.value,style:"post",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Q.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},se=()=>{m.value=!0,H({username:T.value,style:"comment",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,X.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},te=()=>{m.value=!0,H({username:T.value,style:"highlight",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,Z.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},le=()=>{m.value=!0,H({username:T.value,style:"media",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},oe=()=>{m.value=!0,H({username:T.value,style:"star",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},he=e=>{switch(f.value=e,f.value){case"post":l.value=z.value,o.value=E.value,v.value=Q.value,V();break;case"comment":l.value=U.value,o.value=G.value,v.value=X.value,se();break;case"highlight":l.value=q.value,o.value=J.value,v.value=Z.value,te();break;case"media":l.value=C.value,o.value=K.value,v.value=ee.value,le();break;case"star":l.value=M.value,o.value=Y.value,v.value=ae.value,oe();break}},S=()=>{p.value=!0,Ze({username:T.value}).then(e=>{p.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=>{p.value=!1,console.log(e)})},we=()=>{switch(f.value){case"post":E.value=o.value,V();break;case"comment":G.value=o.value,se();break;case"highlight":J.value=o.value,te();break;case"media":K.value=o.value,le();break;case"star":Y.value=o.value,oe();break}},ke=()=>{R.value=!0},ye=()=>{j.value=!0},be=()=>{R.value=!1},Pe=()=>{j.value=!1},x=e=>()=>ve(fe,null,{default:()=>ve(e)}),Oe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:x(ua)}];return _.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:x(me)}):e.push({label:"解封",key:"deblocking",icon:x(me)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:x(ia)}):e.push({label:"关注",key:"follow",icon:x(ra)}),ue&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:x(ca)}):e.push({label:"添加朋友",key:"requesting",icon:x(va)})),e}),Fe=e=>{switch(e){case"whisper":ke();break;case"delete":Ie();break;case"requesting":ye();break;case"follow":case"unfollow":Te();break;case"banned":case"deblocking":xe();break}},Ie=()=>{N.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,aa({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,V()}).catch(e=>{p.value=!1,console.log(e)})}})},Te=()=>{N.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?_e({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("取消关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)}):de({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},xe=()=>{N.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,sa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},Ae=()=>{o.value{S()}),Ke(()=>({path:$.path,query:$.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&(T.value=$.query.s||"",pe(),S())}),(e,w)=>{const $e=Ve,ze=fa,ne=pa,ie=Ye("router-link"),Ue=ga,qe=ha,Ce=Re,re=wa,W=ka,Me=ya,Se=Ne,We=ba,L=De,O=Pa,B=He,Le=da,Be=ma;return s(),u("div",null,[n($e,{title:"用户详情"}),n(Le,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[n(re,{show:p.value},{default:r(()=>[a.id>0?(s(),u("div",Oa,[h("div",Fa,[n(ze,{size:72,src:a.avatar},null,8,["src"])]),h("div",Ia,[h("div",Ta,[h("strong",null,A(a.nickname),1),h("span",null," @"+A(a.username),1),ue&&c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_friend?(s(),g(ne,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[D(" 好友 ")]),_:1})):d("",!0),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_following?(s(),g(ne,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[D(" 已关注 ")]),_:1})):d("",!0),a.is_admin?(s(),g(ne,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[D(" 管理员 ")]),_:1})):d("",!0)]),h("div",xa,[h("span",Aa,"UID. "+A(a.id),1),h("span",$a,A(c(ea)(a.created_on))+" 加入",1)]),h("div",za,[h("span",Ua,[n(ie,{onClick:w[0]||(w[0]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[D(" 关注  "+A(a.follows),1)]),_:1},8,["to"])]),h("span",qa,[n(ie,{onClick:w[1]||(w[1]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[D(" 粉丝  "+A(a.followings),1)]),_:1},8,["to"])])])]),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username?(s(),u("div",Ca,[n(qe,{placement:"bottom-end",trigger:"click",size:"small",options:Oe.value,onSelect:Fe},{default:r(()=>[n(Ue,{quaternary:"",circle:""},{icon:r(()=>[n(c(fe),null,{default:r(()=>[n(c(na))]),_:1})]),_:1})]),_:1},8,["options"])])):d("",!0)])):d("",!0),n(Ce,{show:R.value,user:a,onSuccess:be},null,8,["show","user"]),n(la,{show:j.value,user:a,onSuccess:Pe},null,8,["show","user"])]),_:1},8,["show"]),n(Me,{class:"profile-tabs-wrap",type:"line",animated:"",value:f.value,"onUpdate:value":he},{default:r(()=>[n(W,{name:"post",tab:"泡泡"}),n(W,{name:"comment",tab:"评论"}),n(W,{name:"highlight",tab:"亮点"}),n(W,{name:"media",tab:"图文"}),n(W,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),m.value&&l.value.length===0?(s(),u("div",Ma,[n(Se,{num:k.value},null,8,["num"])])):(s(),u("div",Sa,[l.value.length===0?(s(),u("div",Wa,[n(We,{size:"large",description:"暂无数据"})])):d("",!0),c(_).state.desktopModelShow?(s(),u("div",La,[f.value==="post"?(s(),u("div",Ba,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Da,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ha,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Na,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Ra,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(s(),u("div",Va,[f.value==="post"?(s(),u("div",ja,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Ea,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ga,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Ja,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Ka,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))]))]),_:1}),v.value>0?(s(),g(Be,{key:0,justify:"center"},{default:r(()=>[n(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=t=>Ae())},{spinner:r(()=>[h("div",Ya,[y.value?d("",!0):(s(),g(re,{key:0,size:14})),h("span",Qa,A(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const qs=ta(Xa,[["__scopeId","data-v-8046429c"]]);export{qs as default}; +import{_ as De,a as He}from"./post-item.vue_vue_type_style_index_0_lang-b1622c74.js";import{_ as Ne}from"./post-skeleton-52d6bc96.js";import{_ as Re}from"./whisper-7e17488b.js";import{_ as Ve}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{d as je,H as i,R as Ee,c as Ge,b as Je,E as Ke,r as Ye,f as u,k as n,w as r,q as g,Y as d,e as s,j as h,x as A,bf as c,A as D,y as ce,F,u as I,h as ve}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{L as Ze,K as ea,e as H,h as aa,u as _e,f as de,M as sa,_ as ta}from"./index-3c78935c.js";import{W as la}from"./whisper-add-friend-622dcaa8.js";import{W as oa}from"./v3-infinite-loading-2c58ec2f.js";import{k as na,r as ua,G as me,s as ia,t as ra,J as ca,R as va}from"./@vicons-f0266f88.js";import{F as _a,G as da,a as ma,j as fe,o as fa,M as pa,e as ga,P as ha,k as wa,f as ka,g as ya,J as ba,H as Pa}from"./naive-ui-eecf2ec3.js";import"./content-b9c58eb8.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-7c8d4b48.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 Oa={key:0,class:"profile-baseinfo"},Fa={class:"avatar"},Ia={class:"base-info"},Ta={class:"username"},xa={class:"userinfo"},Aa={class:"info-item"},$a={class:"info-item"},za={class:"userinfo"},Ua={class:"info-item"},qa={class:"info-item"},Ca={key:0,class:"user-opts"},Ma={key:0,class:"skeleton-wrap"},Sa={key:1},Wa={key:0,class:"empty-wrap"},La={key:1},Ba={key:0},Da={key:1},Ha={key:2},Na={key:3},Ra={key:4},Va={key:2},ja={key:0},Ea={key:1},Ga={key:2},Ja={key:3},Ka={key:4},Ya={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=je({__name:"User",setup(Za){const N=_a(),_=Qe(),$=Xe(),ue="true".toLowerCase()==="true",m=i(!1),y=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}),p=i(!1),R=i(!1),j=i(!1),l=i([]),z=i([]),U=i([]),q=i([]),C=i([]),M=i([]),T=i($.query.s||""),o=i(+$.query.p||1),f=i("post"),E=i(+$.query.p||1),G=i(1),J=i(1),K=i(1),Y=i(1),k=i(20),v=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,R.value=!0},P=e=>{N.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?_e({user_id:e.user.id}).then(w=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(w=>{}):de({user_id:e.user.id}).then(w=>{window.$message.success("关注成功"),e.user.is_following=!0}).catch(w=>{})}})},pe=()=>{y.value=!1,l.value=[],z.value=[],U.value=[],q.value=[],C.value=[],M.value=[],f.value="post",o.value=1,E.value=1,G.value=1,J.value=1,K.value=1,Y.value=1,v.value=0,Q.value=0,X.value=0,Z.value=0,ee.value=0,ae.value=0},ge=()=>{switch(f.value){case"post":V();break;case"comment":se();break;case"highlight":te();break;case"media":le();break;case"star":oe();break}},V=()=>{m.value=!0,H({username:T.value,style:"post",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Q.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},se=()=>{m.value=!0,H({username:T.value,style:"comment",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,X.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},te=()=>{m.value=!0,H({username:T.value,style:"highlight",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,Z.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},le=()=>{m.value=!0,H({username:T.value,style:"media",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),C.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},oe=()=>{m.value=!0,H({username:T.value,style:"star",page:o.value,page_size:k.value}).then(e=>{m.value=!1,e.list.length===0&&(y.value=!0),o.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],o.value>1&&o.value--,m.value=!1})},he=e=>{switch(f.value=e,f.value){case"post":l.value=z.value,o.value=E.value,v.value=Q.value,V();break;case"comment":l.value=U.value,o.value=G.value,v.value=X.value,se();break;case"highlight":l.value=q.value,o.value=J.value,v.value=Z.value,te();break;case"media":l.value=C.value,o.value=K.value,v.value=ee.value,le();break;case"star":l.value=M.value,o.value=Y.value,v.value=ae.value,oe();break}},S=()=>{p.value=!0,Ze({username:T.value}).then(e=>{p.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=>{p.value=!1,console.log(e)})},we=()=>{switch(f.value){case"post":E.value=o.value,V();break;case"comment":G.value=o.value,se();break;case"highlight":J.value=o.value,te();break;case"media":K.value=o.value,le();break;case"star":Y.value=o.value,oe();break}},ke=()=>{R.value=!0},ye=()=>{j.value=!0},be=()=>{R.value=!1},Pe=()=>{j.value=!1},x=e=>()=>ve(fe,null,{default:()=>ve(e)}),Oe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:x(ua)}];return _.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:x(me)}):e.push({label:"解封",key:"deblocking",icon:x(me)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:x(ia)}):e.push({label:"关注",key:"follow",icon:x(ra)}),ue&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:x(ca)}):e.push({label:"添加朋友",key:"requesting",icon:x(va)})),e}),Fe=e=>{switch(e){case"whisper":ke();break;case"delete":Ie();break;case"requesting":ye();break;case"follow":case"unfollow":Te();break;case"banned":case"deblocking":xe();break}},Ie=()=>{N.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,aa({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,V()}).catch(e=>{p.value=!1,console.log(e)})}})},Te=()=>{N.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?_e({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("取消关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)}):de({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("关注成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},xe=()=>{N.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,sa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),S()}).catch(e=>{p.value=!1,console.log(e)})}})},Ae=()=>{o.value{S()}),Ke(()=>({path:$.path,query:$.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&(T.value=$.query.s||"",pe(),S())}),(e,w)=>{const $e=Ve,ze=fa,ne=pa,ie=Ye("router-link"),Ue=ga,qe=ha,Ce=Re,re=wa,W=ka,Me=ya,Se=Ne,We=ba,L=De,O=Pa,B=He,Le=da,Be=ma;return s(),u("div",null,[n($e,{title:"用户详情"}),n(Le,{class:"main-content-wrap profile-wrap",bordered:""},{default:r(()=>[n(re,{show:p.value},{default:r(()=>[a.id>0?(s(),u("div",Oa,[h("div",Fa,[n(ze,{size:72,src:a.avatar},null,8,["src"])]),h("div",Ia,[h("div",Ta,[h("strong",null,A(a.nickname),1),h("span",null," @"+A(a.username),1),ue&&c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_friend?(s(),g(ne,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:r(()=>[D(" 好友 ")]),_:1})):d("",!0),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username&&a.is_following?(s(),g(ne,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:r(()=>[D(" 已关注 ")]),_:1})):d("",!0),a.is_admin?(s(),g(ne,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:r(()=>[D(" 管理员 ")]),_:1})):d("",!0)]),h("div",xa,[h("span",Aa,"UID. "+A(a.id),1),h("span",$a,A(c(ea)(a.created_on))+" 加入",1)]),h("div",za,[h("span",Ua,[n(ie,{onClick:w[0]||(w[0]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:r(()=>[D(" 关注  "+A(a.follows),1)]),_:1},8,["to"])]),h("span",qa,[n(ie,{onClick:w[1]||(w[1]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:r(()=>[D(" 粉丝  "+A(a.followings),1)]),_:1},8,["to"])])])]),c(_).state.userInfo.id>0&&c(_).state.userInfo.username!=a.username?(s(),u("div",Ca,[n(qe,{placement:"bottom-end",trigger:"click",size:"small",options:Oe.value,onSelect:Fe},{default:r(()=>[n(Ue,{quaternary:"",circle:""},{icon:r(()=>[n(c(fe),null,{default:r(()=>[n(c(na))]),_:1})]),_:1})]),_:1},8,["options"])])):d("",!0)])):d("",!0),n(Ce,{show:R.value,user:a,onSuccess:be},null,8,["show","user"]),n(la,{show:j.value,user:a,onSuccess:Pe},null,8,["show","user"])]),_:1},8,["show"]),n(Me,{class:"profile-tabs-wrap",type:"line",animated:"",value:f.value,"onUpdate:value":he},{default:r(()=>[n(W,{name:"post",tab:"泡泡"}),n(W,{name:"comment",tab:"评论"}),n(W,{name:"highlight",tab:"亮点"}),n(W,{name:"media",tab:"图文"}),n(W,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),m.value&&l.value.length===0?(s(),u("div",Ma,[n(Se,{num:k.value},null,8,["num"])])):(s(),u("div",Sa,[l.value.length===0?(s(),u("div",Wa,[n(We,{size:"large",description:"暂无数据"})])):d("",!0),c(_).state.desktopModelShow?(s(),u("div",La,[f.value==="post"?(s(),u("div",Ba,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Da,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ha,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Na,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Ra,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(L,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)])):(s(),u("div",Va,[f.value==="post"?(s(),u("div",ja,[(s(!0),u(F,null,I(z.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="comment"?(s(),u("div",Ea,[(s(!0),u(F,null,I(U.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="highlight"?(s(),u("div",Ga,[(s(!0),u(F,null,I(q.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="media"?(s(),u("div",Ja,[(s(!0),u(F,null,I(C.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0),f.value==="star"?(s(),u("div",Ka,[(s(!0),u(F,null,I(M.value,t=>(s(),g(O,{key:t.id},{default:r(()=>[n(B,{post:t,isOwner:c(_).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):d("",!0)]))]))]),_:1}),v.value>0?(s(),g(Be,{key:0,justify:"center"},{default:r(()=>[n(c(oa),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=t=>Ae())},{spinner:r(()=>[h("div",Ya,[y.value?d("",!0):(s(),g(re,{key:0,size:14})),h("span",Qa,A(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}});const qs=ta(Xa,[["__scopeId","data-v-8046429c"]]);export{qs as default}; diff --git a/web/dist/assets/Wallet-68eb1215.js b/web/dist/assets/Wallet-f83d4c82.js similarity index 95% rename from web/dist/assets/Wallet-68eb1215.js rename to web/dist/assets/Wallet-f83d4c82.js index aeb9bd2f..0763825c 100644 --- a/web/dist/assets/Wallet-68eb1215.js +++ b/web/dist/assets/Wallet-f83d4c82.js @@ -1 +1 @@ -import{_ as G}from"./post-skeleton-67280cce.js";import{_ as K}from"./main-nav.vue_vue_type_style_index_0_lang-830cbb44.js";import{d as Q,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{Z as _e,$ as re,a0 as ue,a1 as pe,J as de,_ as me}from"./index-cb47660d.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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 B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Q({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=K,d=fe,F=ye,f=we,$=ke,L=be,U=G,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,Z=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(Z,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; +import{_ as G}from"./post-skeleton-52d6bc96.js";import{_ as K}from"./main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js";import{d as Q,H as c,b as X,f as _,k as e,w as o,e as n,bf as y,Y as w,j as a,A as k,F as q,u as z,O as ee,D as te,x as r,q as N,l as oe,y as ae,$ as ne,a0 as se}from"./@vue-a481fc63.js";import{u as le}from"./vuex-44de225f.js";import{b as ce}from"./vue-router-e5a2430e.js";import{b as ie}from"./qrcode-9719fc56.js";import{Z as _e,$ as re,a0 as ue,a1 as pe,J as de,_ as me}from"./index-3c78935c.js";import{a1 as ge}from"./@vicons-f0266f88.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-eecf2ec3.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.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 B=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Be={key:1},Oe={key:0,class:"empty-wrap"},Pe={class:"bill-line"},Te={key:0,class:"amount-options"},We={key:1,style:{"margin-top":"10px"}},De={class:"qrcode-wrap"},Ee=B(()=>a("canvas",{id:"qrcode-container"},null,-1)),Fe={class:"pay-tips"},Le={class:"pay-sub-tips"},Ue=B(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Ve=Q({__name:"Wallet",setup(m){const i=le(),O=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+O.query.p||1),C=c(20),S=c(0),P=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},T=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},W=()=>{g.value=!0},D=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},E=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=K,d=fe,F=ye,f=we,$=ke,L=be,U=G,V=xe,M=Re,j=ve,H=Ce,J=Se,Y=Ie,Z=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),_("div",ze,[e(L,{page:x.value,"onUpdate:page":T,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",$e,[e(F,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:W},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:E},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",Ne,[e(U,{num:C.value},null,8,["num"])])):(n(),_("div",Be,[b.value.length===0?(n(),_("div",Oe,[e(V,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(q,null,z(b.value,t=>(n(),N(M,{key:t.id},{default:o(()=>[a("div",Pe,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(de)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(Z,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Y,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Te,[e($,{align:"baseline"},{default:o(()=>[(n(!0),_(q,null,z(P.value,t=>(n(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",We,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:D},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",De,[Ee,a("div",Fe," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Le,[e(J,{value:100,type:"info",dot:"",processing:""}),Ue])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const ft=me(Ve,[["__scopeId","data-v-870bd246"]]);export{ft as default}; diff --git a/web/dist/assets/content-5f7e0179.js b/web/dist/assets/content-b9c58eb8.js similarity index 98% rename from web/dist/assets/content-5f7e0179.js rename to web/dist/assets/content-b9c58eb8.js index af8a9ab8..0de11b6a 100644 --- a/web/dist/assets/content-5f7e0179.js +++ b/web/dist/assets/content-b9c58eb8.js @@ -1 +1 @@ -import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as z,X as F,e as L,i as T}from"./naive-ui-eecf2ec3.js";import{_ as B,U as M,V as O}from"./index-cb47660d.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},q={class:"link-txt-wrap"},H=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",S,$(n.content),1)],8,H)])]))),128))])}}});const ot=B(W,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=z,_=A,f=V,w=F;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=L,i=T;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(U))]),_:1})]),default:o(()=>[D(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; +import{d as h,e,f as r,F as a,u as m,k as s,w as o,bf as c,j as C,y as k,x as $,q as d,Y as g,H as j,A as D,h as b}from"./@vue-a481fc63.js";import{$ as N,a0 as U}from"./@vicons-f0266f88.js";import{j as I,V as A,W as V,m as z,X as F,e as L,i as T}from"./naive-ui-eecf2ec3.js";import{_ as B,U as M,V as O}from"./index-3c78935c.js";import{e as P}from"./paopao-video-player-2fe58954.js";const R={class:"link-wrap"},q={class:"link-txt-wrap"},H=["href"],S={class:"link-txt"},W=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=I;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(N))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",S,$(n.content),1)],8,H)])]))),128))])}}});const ot=B(W,[["__scopeId","data-v-36eef76b"]]),X={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=A,n=V;return l.videos.length>0?(e(),r("div",X,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),Y={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=z,_=A,f=V,w=F;return e(),r("div",Y,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const Z={class:"attachment-wrap"},G=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),M({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{O({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=I,t=L,i=T;return e(),r("div",Z,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(U))]),_:1})]),default:o(()=>[D(" "+$(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=B(G,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/index-cb47660d.js b/web/dist/assets/index-3c78935c.js similarity index 88% rename from web/dist/assets/index-cb47660d.js rename to web/dist/assets/index-3c78935c.js index 23aef571..0b98dc96 100644 --- a/web/dist/assets/index-cb47660d.js +++ b/web/dist/assets/index-3c78935c.js @@ -1 +1 @@ -import{d as Y,H as k,R as oe,b as G,e as w,q as K,w as a,j as y,k as s,f as E,A as U,Z as q,y as N,Y as M,bf as f,c as J,E as Z,r as me,F as se,u as ne,x as A,h as P,a5 as Pe,s as re,l as Le,ag as Oe}from"./@vue-a481fc63.js";import{c as Te,a as Ae,u as pe,b as Ee}from"./vue-router-e5a2430e.js";import{c as Ie,u as B}from"./vuex-44de225f.js";import{a as Re}from"./axios-4a70c6fc.js";import{_ as Ce,N as $e,a as _e,b as he,c as Me,d as Se,e as ge,f as Ue,g as De,h as fe,i as xe,j as W,k as qe,u as Ne,l as Ke,m as Fe,n as Ve,o as ze,p as He,q as We,r as Ye,s as Be,t as je}from"./naive-ui-eecf2ec3.js";import{h as D}from"./moment-2ab8298d.js";import{S as Qe,M as Ze,L as Ge,C as Je,B as Xe,P as et,W as tt,a as ot,H as ae,b as le,c as ue}from"./@vicons-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();const st="modulepreload",nt=function(e){return"/"+e},ie={},T=function(t,r,c){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(n=>{if(n=nt(n),n in ie)return;ie[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":st,m||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),m)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},rt=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-3866e81c.js"),["assets/Home-3866e81c.js","assets/whisper-add-friend-70019d63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-7f52b83e.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js","assets/content-5f7e0179.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-a97c2703.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-94d5e02e.js"),["assets/Post-94d5e02e.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-5f7e0179.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-7f52b83e.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-137ee336.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-c5d2b7a7.js"),["assets/Topic-c5d2b7a7.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-3a865c5e.js"),["assets/Anouncement-3a865c5e.js","assets/post-skeleton-67280cce.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-636f310e.js"),["assets/Profile-636f310e.js","assets/whisper-7f52b83e.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js","assets/content-5f7e0179.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-5fc46d20.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-3f0d7b73.js"),["assets/User-3f0d7b73.js","assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js","assets/content-5f7e0179.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/whisper-7f52b83e.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-70019d63.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-4853e1bd.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-b0181f35.js"),["assets/Messages-b0181f35.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-7f52b83e.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-0f6694f9.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-24e69e36.js"),["assets/Collection-24e69e36.js","assets/whisper-7f52b83e.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js","assets/content-5f7e0179.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-a1f12801.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-76036e1a.js"),["assets/Contacts-76036e1a.js","assets/whisper-7f52b83e.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-04523b47.js"),["assets/Following-04523b47.js","assets/whisper-7f52b83e.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-67280cce.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-68eb1215.js"),["assets/Wallet-68eb1215.js","assets/post-skeleton-67280cce.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-795c1b9a.js"),["assets/Setting-795c1b9a.js","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-449569c0.js"),["assets/404-449569c0.js","assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],ve=Te({history:Ae(),routes:rt});ve.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const at=Ie({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,is_admin:!1}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),X=Re.create({baseURL:"",timeout:3e4});X.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));X.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return X(e)}const ce=e=>o({method:"post",url:"/v1/auth/login",data:e}),lt=e=>o({method:"post",url:"/v1/auth/register",data:e}),Q=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),ut={class:"auth-wrap"},it={key:0},ct=Y({__name:"auth",setup(e){const t=k("true".toLowerCase()==="true"),r=B(),c=k(!1),i=k(),n=oe({username:"",password:""}),m=k(),d=oe({username:"",password:"",repassword:""}),S={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},v=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(I=>{I||(c.value=!0,ce({username:n.username,password:n.password}).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),Q(R)}).then(h=>{window.$message.success("登录成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),r.commit("refresh"),n.username="",n.password=""}).catch(h=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(I=>{I||(c.value=!0,lt({username:d.username,password:d.password}).then(h=>ce({username:d.username,password:d.password})).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),Q(R)}).then(h=>{window.$message.success("注册成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(h=>{c.value=!1}))})};return G(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Q(_).then(u=>{r.commit("updateUserinfo",u),r.commit("triggerAuth",!1)}).catch(u=>{r.commit("userLogout")}):r.commit("userLogout")}),(_,u)=>{const I=Ce,h=$e,R=_e,C=he,L=Me,x=Se,l=ge,O=Ue,F=De,H=fe,V=xe;return w(),K(V,{show:f(r).state.authModalShow,"onUpdate:show":u[7]||(u[7]=p=>f(r).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",ut,[s(H,{bordered:!1},{default:a(()=>[t.value?M("",!0):(w(),E("div",it,[s(R,{justify:"center"},{default:a(()=>[s(h,null,{default:a(()=>[s(I,{type:"success"},{default:a(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[0]||(u[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),K(F,{key:1,"default-value":f(r).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(O,{name:"signin",tab:"登录"},{default:a(()=>[s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[2]||(u[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(O,{name:"signup",tab:"注册"},{default:a(()=>[s(x,{ref_key:"registerRef",ref:m,model:d,rules:S},{default:a(()=>[s(L,{label:"用户名",path:"username"},{default:a(()=>[s(C,{value:d.username,"onUpdate:value":u[4]||(u[4]=p=>d.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=p=>d.password=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"重复密码",path:"repassword"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=p=>d.repassword=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const we=(e,t)=>{const r=e.__vccOpts||e;for(const[c,i]of t)r[c]=i;return r},dt=we(ct,[["__scopeId","data-v-053dfa44"]]),io=e=>o({method:"get",url:"/v1/posts",params:e}),mt=e=>o({method:"get",url:"/v1/tags",params:e}),co=e=>o({method:"get",url:"/v1/post",params:e}),mo=e=>o({method:"get",url:"/v1/post/star",params:e}),po=e=>o({method:"post",url:"/v1/post/star",data:e}),_o=e=>o({method:"get",url:"/v1/post/collection",params:e}),ho=e=>o({method:"post",url:"/v1/post/collection",data:e}),go=e=>o({method:"get",url:"/v1/post/comments",params:e}),fo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),vo=e=>o({method:"post",url:"/v1/post",data:e}),wo=e=>o({method:"delete",url:"/v1/post",data:e}),yo=e=>o({method:"post",url:"/v1/post/lock",data:e}),bo=e=>o({method:"post",url:"/v1/post/stick",data:e}),ko=e=>o({method:"post",url:"/v1/post/highlight",data:e}),Po=e=>o({method:"post",url:"/v1/post/visibility",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),Oo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Ao=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Eo=e=>o({method:"post",url:"/v1/post/comment",data:e}),Io=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Co=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),$o=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Uo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Do=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),xo=e=>o({method:"post",url:"/v1/captcha",data:e}),qo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),No=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Ko=e=>o({method:"post",url:"/v1/friend/add",data:e}),Fo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Vo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ho=e=>o({method:"get",url:"/v1/user/followings",params:e}),Wo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Yo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),jo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Zo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Go=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Jo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),es=e=>o({method:"get",url:"/v1/user/collections",params:e}),ts=e=>o({method:"get",url:"/v1/user/profile",params:e}),os=e=>o({method:"get",url:"/v1/user/posts",params:e}),ss=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ns=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rs=e=>o({method:"get",url:"/v1/user/recharge",params:e}),as=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ls=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),us=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),is=e=>o({method:"get",url:"/v1/attachment",params:e}),cs=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),pt=()=>o({method:"get",url:"/v1/admin/site/status"});D.locale("zh-cn");const _t=e=>D.unix(e).fromNow(),ds=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},ms=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},ps=e=>D.unix(e).utc(!0).format("YYYY年MM月"),ht={key:0,class:"rightbar-wrap"},gt={class:"search-wrap"},ft={class:"post-num"},vt={class:"post-num"},wt={class:"copyright"},yt=["href"],bt=["href"],kt={class:"site-info-item"},Pt=Y({__name:"rightbar",setup(e){const t=k([]),r=k([]),c=k(!1),i=k(""),n=B(),m=pe(),d=k(0),S=k(0),v=k(0),b=k(0),_=k(null),u="2023 paopao.info",I="Roc's Me",h="",R="泡泡(PaoPao)开源社区",C="https://www.paopao.info",L=+"6",x=+"12",l=()=>{pt().then(g=>{d.value=g.register_user_count,S.value=g.online_user_count,v.value=g.history_max_online,b.value=g.server_up_time}).catch(g=>{}),p.disconnect()},O=()=>{c.value=!0,mt({type:"hot_extral",num:x,extral_num:L}).then(g=>{t.value=g.topics,r.value=g.extral_topics??[],V.value=!0,c.value=!1}).catch(g=>{c.value=!1})},F=g=>g>=1e3?(g/1e3).toFixed(1)+"k":g,H=()=>{m.push({name:"home",query:{q:i.value}})},V=J({get:()=>n.state.userLogined&&r.value.length!==0,set:g=>{}});Z(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(g,z)=>{(g.refreshTopicFollow!==z.refreshTopicFollow||g.userLogined)&&O(),n.state.userInfo.is_admin&&l()});const p=new IntersectionObserver(g=>{g.forEach(z=>{z.isIntersecting&&l()})},{root:null,rootMargin:"0px",threshold:1});return G(()=>{_.value&&p.observe(_.value),O()}),(g,z)=>{const ye=W,be=he,ee=me("router-link"),te=qe,j=fe,ke=_e;return f(n).state.collapsedRight?M("",!0):(w(),E("div",ht,[y("div",gt,[s(be,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":z[0]||(z[0]=$=>i.value=$),onKeyup:q(N(H,["prevent"]),["enter"])},{prefix:a(()=>[s(ye,{component:f(Qe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),V.value?(w(),K(j,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(r.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",ft,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),s(j,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(t.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",vt,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(j,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",wt,"© "+A(f(u)),1),y("div",null,[s(ke,null,{default:a(()=>[y("a",{href:f(h),target:"_blank",class:"hash-link"},A(f(I)),9,yt),y("a",{href:f(C),target:"_blank",class:"hash-link"},A(f(R)),9,bt)]),_:1})])]),_:1}),f(n).state.userInfo.is_admin?(w(),E("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:_},[y("span",kt,A(d.value)+" 注册用户,"+A(S.value)+" 人在线,最高在线 "+A(v.value)+" 人,站点上线于 "+A(f(_t)(b.value)),1)],512)):M("",!0)]))}}});const Lt=we(Pt,[["__scopeId","data-v-0a6cd0b6"]]),Ot="/assets/logo-52afee68.png",Tt={class:"sidebar-wrap"},At={class:"logo-wrap"},Et={key:0,class:"user-wrap"},It={class:"user-info"},Rt={class:"nickname"},Ct={class:"nickname-txt"},$t={class:"username"},Mt={class:"user-mini-wrap"},St={key:1,class:"user-wrap"},Ut={key:0,class:"login-only-wrap"},Dt={key:1,class:"login-wrap"},xt=Y({__name:"sidebar",setup(e){const t=B(),r=Ee(),c=pe(),i=k(!1),n=k(r.name||""),m=k(),d="true".toLowerCase()==="true",S="false".toLowerCase()==="true",v="false".toLocaleLowerCase()==="true",b=k("true".toLowerCase()==="true"),_=+"5000";Z(r,()=>{n.value=r.name}),Z(t.state,()=>{t.state.userInfo.id>0?m.value||(de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)}),m.value=setInterval(()=>{de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)})},_)):m.value&&clearInterval(m.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=J(()=>{const l=[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}];return S&&l.push({label:"公告",key:"anouncement",icon:()=>P(Ze),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>P(Ge),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>P(Je),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>P(Xe),href:"/collection"}),d&&l.push({label:"好友",key:"contacts",icon:()=>P(et),href:"/contacts"}),v&&l.push({label:"钱包",key:"wallet",icon:()=>P(tt),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>P(ot),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}]}),I=l=>"href"in l?P("div",{},l.label):l.label,h=l=>l.key==="messages"?P(Ke,{dot:!0,show:i.value,processing:!0},{default:()=>P(W,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):P(W,null,{default:l.icon}),R=(l,O={})=>{n.value=l,c.push({name:l,query:{t:new Date().getTime()}})},C=()=>{r.path==="/"&&t.commit("refresh"),R("home")},L=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},x=()=>{t.commit("userLogout"),t.commit("refresh"),C()};return window.$store=t,window.$message=Ne(),(l,O)=>{const F=Fe,H=Ve,V=ze,p=ge;return w(),E("div",Tt,[y("div",At,[s(F,{class:"logo-img",width:"36",src:f(Ot),"preview-disabled":!0,onClick:C},null,8,["src"])]),s(H,{accordion:!0,"icon-size":24,options:u.value,"render-label":I,"render-icon":h,value:n.value,"onUpdate:value":R},null,8,["options","value"]),f(t).state.userInfo.id>0?(w(),E("div",Et,[s(V,{class:"user-avatar",round:"",size:34,src:f(t).state.userInfo.avatar},null,8,["src"]),y("div",It,[y("div",Rt,[y("span",Ct,A(f(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:x},{icon:a(()=>[s(f(W),null,{default:a(()=>[s(f(ue))]),_:1})]),_:1})]),y("div",$t,"@"+A(f(t).state.userInfo.username),1)]),y("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:x},{icon:a(()=>[s(f(W),{size:24},{default:a(()=>[s(f(ue))]),_:1})]),_:1})])])):(w(),E("div",St,[b.value?M("",!0):(w(),E("div",Ut,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[0]||(O[0]=g=>L("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),b.value?(w(),E("div",Dt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[1]||(O[1]=g=>L("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:O[2]||(O[2]=g=>L("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):M("",!0)]))])}}});const qt={"has-sider":"",class:"main-wrap",position:"static"},Nt={key:0},Kt={class:"content-wrap"},Ft=Y({__name:"App",setup(e){const t=B(),r=J(()=>t.state.theme==="dark"?We:null);return(c,i)=>{const n=xt,m=me("router-view"),d=Lt,S=dt,v=Ye,b=Be,_=je,u=He;return w(),K(u,{theme:r.value},{default:a(()=>[s(b,null,{default:a(()=>[s(v,null,{default:a(()=>{var I;return[y("div",{class:Le(["app-container",{dark:((I=r.value)==null?void 0:I.name)==="dark",mobile:!f(t).state.desktopModelShow}])},[y("div",qt,[f(t).state.desktopModelShow?(w(),E("div",Nt,[s(n)])):M("",!0),y("div",Kt,[s(m,{class:"app-wrap"},{default:a(({Component:h})=>[(w(),K(Pe,null,[c.$route.meta.keepAlive?(w(),K(re(h),{key:0})):M("",!0)],1024)),c.$route.meta.keepAlive?M("",!0):(w(),K(re(h),{key:0}))]),_:1})]),s(d)]),s(S)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});Oe(Ft).use(ve).use(at).mount("#app");export{ss as $,po as A,ho as B,co as C,go as D,Ot as E,Mo as F,Uo as G,So as H,mt as I,_t as J,ps as K,ts as L,cs as M,No as N,Ko as O,Wo as P,Xo as Q,Jo as R,es as S,ms as T,us as U,is as V,zo as W,Ho as X,qo as Y,Q as Z,we as _,ls as a,ns as a0,rs as a1,Do as a2,Go as a3,Qo as a4,Bo as a5,jo as a6,Zo as a7,xo as a8,xt as a9,fo as b,vo as c,io as d,os as e,Fo as f,as as g,Yo as h,ds as i,Ao as j,$o as k,Lo as l,Oo as m,Co as n,Io as o,Ro as p,Eo as q,mo as r,_o as s,To as t,Vo as u,wo as v,yo as w,bo as x,ko as y,Po as z}; +import{d as Y,H as k,R as oe,b as G,e as w,q as K,w as a,j as y,k as s,f as E,A as U,Z as q,y as N,Y as M,bf as f,c as J,E as Z,r as me,F as se,u as ne,x as A,h as P,a5 as Pe,s as re,l as Le,ag as Oe}from"./@vue-a481fc63.js";import{c as Te,a as Ae,u as pe,b as Ee}from"./vue-router-e5a2430e.js";import{c as Ie,u as B}from"./vuex-44de225f.js";import{a as Re}from"./axios-4a70c6fc.js";import{_ as Ce,N as $e,a as _e,b as he,c as Me,d as Se,e as ge,f as Ue,g as De,h as fe,i as xe,j as W,k as qe,u as Ne,l as Ke,m as Fe,n as Ve,o as ze,p as He,q as We,r as Ye,s as Be,t as je}from"./naive-ui-eecf2ec3.js";import{h as D}from"./moment-2ab8298d.js";import{S as Qe,M as Ze,L as Ge,C as Je,B as Xe,P as et,W as tt,a as ot,H as ae,b as le,c as ue}from"./@vicons-f0266f88.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.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";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))c(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function c(i){if(i.ep)return;i.ep=!0;const n=r(i);fetch(i.href,n)}})();const st="modulepreload",nt=function(e){return"/"+e},ie={},T=function(t,r,c){if(!r||r.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(r.map(n=>{if(n=nt(n),n in ie)return;ie[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!c)for(let b=i.length-1;b>=0;b--){const _=i[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":st,m||(v.as="script",v.crossOrigin=""),v.href=n,document.head.appendChild(v),m)return new Promise((b,_)=>{v.addEventListener("load",b),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},rt=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>T(()=>import("./Home-332e3a1d.js"),["assets/Home-332e3a1d.js","assets/whisper-add-friend-622dcaa8.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-add-friend-01aea97d.css","assets/whisper-7e17488b.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js","assets/content-b9c58eb8.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/@opentiny-d73a2d67.js","assets/vue-1e3b54ec.js","assets/xss-a5544f63.js","assets/cssfilter-af71ba68.js","assets/@opentiny-0f942bd4.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Home-a97c2703.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>T(()=>import("./Post-f693e2a8.js"),["assets/Post-f693e2a8.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/IEnum-5453a777.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-b9c58eb8.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/whisper-7e17488b.js","assets/whisper-61451957.css","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Post-137ee336.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>T(()=>import("./Topic-dc498894.js"),["assets/Topic-dc498894.js","assets/@vicons-f0266f88.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>T(()=>import("./Anouncement-e019b785.js"),["assets/Anouncement-e019b785.js","assets/post-skeleton-52d6bc96.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>T(()=>import("./Profile-3c9035fa.js"),["assets/Profile-3c9035fa.js","assets/whisper-7e17488b.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js","assets/content-b9c58eb8.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Profile-5fc46d20.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>T(()=>import("./User-aa917c46.js"),["assets/User-aa917c46.js","assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js","assets/content-b9c58eb8.js","assets/@vue-a481fc63.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/whisper-7e17488b.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/whisper-add-friend-622dcaa8.js","assets/whisper-add-friend-01aea97d.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/User-4853e1bd.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>T(()=>import("./Messages-2d3ee462.js"),["assets/Messages-2d3ee462.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-7e17488b.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Messages-333688e8.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>T(()=>import("./Collection-cc8d06f9.js"),["assets/Collection-cc8d06f9.js","assets/whisper-7e17488b.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js","assets/content-b9c58eb8.js","assets/@vicons-f0266f88.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Collection-a1f12801.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>T(()=>import("./Contacts-f9e04885.js"),["assets/Contacts-f9e04885.js","assets/whisper-7e17488b.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/@vicons-f0266f88.js","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Contacts-c993e2de.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>T(()=>import("./Following-6ce98032.js"),["assets/Following-6ce98032.js","assets/whisper-7e17488b.js","assets/@vue-a481fc63.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/whisper-61451957.css","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/post-skeleton-52d6bc96.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Following-c2ff25f8.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>T(()=>import("./Wallet-f83d4c82.js"),["assets/Wallet-f83d4c82.js","assets/post-skeleton-52d6bc96.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-7c8d4b48.js","assets/evtd-b614532e.js","assets/@css-render-7124a1a5.js","assets/vooks-6d99783e.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-f0266f88.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>T(()=>import("./Setting-0bb3d354.js"),["assets/Setting-0bb3d354.js","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>T(()=>import("./404-fd38b229.js"),["assets/404-fd38b229.js","assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-f0266f88.js","assets/naive-ui-eecf2ec3.js","assets/seemly-76b7b838.js","assets/vueuc-7c8d4b48.js","assets/@css-render-7124a1a5.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/moment-2ab8298d.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],ve=Te({history:Ae(),routes:rt});ve.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const at=Ie({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,is_admin:!1}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),X=Re.create({baseURL:"",timeout:3e4});X.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));X.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return X(e)}const ce=e=>o({method:"post",url:"/v1/auth/login",data:e}),lt=e=>o({method:"post",url:"/v1/auth/register",data:e}),Q=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),ut={class:"auth-wrap"},it={key:0},ct=Y({__name:"auth",setup(e){const t=k("true".toLowerCase()==="true"),r=B(),c=k(!1),i=k(),n=oe({username:"",password:""}),m=k(),d=oe({username:"",password:"",repassword:""}),S={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},v=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=i.value)==null||u.validate(I=>{I||(c.value=!0,ce({username:n.username,password:n.password}).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),Q(R)}).then(h=>{window.$message.success("登录成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),r.commit("refresh"),n.username="",n.password=""}).catch(h=>{c.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(I=>{I||(c.value=!0,lt({username:d.username,password:d.password}).then(h=>ce({username:d.username,password:d.password})).then(h=>{const R=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",R),Q(R)}).then(h=>{window.$message.success("注册成功"),c.value=!1,r.commit("updateUserinfo",h),r.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(h=>{c.value=!1}))})};return G(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?Q(_).then(u=>{r.commit("updateUserinfo",u),r.commit("triggerAuth",!1)}).catch(u=>{r.commit("userLogout")}):r.commit("userLogout")}),(_,u)=>{const I=Ce,h=$e,R=_e,C=he,L=Me,x=Se,l=ge,O=Ue,F=De,H=fe,V=xe;return w(),K(V,{show:f(r).state.authModalShow,"onUpdate:show":u[7]||(u[7]=p=>f(r).state.authModalShow=p),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[y("div",ut,[s(H,{bordered:!1},{default:a(()=>[t.value?M("",!0):(w(),E("div",it,[s(R,{justify:"center"},{default:a(()=>[s(h,null,{default:a(()=>[s(I,{type:"success"},{default:a(()=>[U("账号登录")]),_:1})]),_:1})]),_:1}),s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[0]||(u[0]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),K(F,{key:1,"default-value":f(r).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(O,{name:"signin",tab:"登录"},{default:a(()=>[s(x,{ref_key:"loginRef",ref:i,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(L,{label:"账户",path:"username"},{default:a(()=>[s(C,{value:n.username,"onUpdate:value":u[2]||(u[2]=p=>n.username=p),placeholder:"请输入用户名",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=p=>n.password=p),placeholder:"请输入账户密码",onKeyup:q(N(v,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:v},{default:a(()=>[U(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(O,{name:"signup",tab:"注册"},{default:a(()=>[s(x,{ref_key:"registerRef",ref:m,model:d,rules:S},{default:a(()=>[s(L,{label:"用户名",path:"username"},{default:a(()=>[s(C,{value:d.username,"onUpdate:value":u[4]||(u[4]=p=>d.username=p),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(L,{label:"密码",path:"password"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=p=>d.password=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(L,{label:"重复密码",path:"repassword"},{default:a(()=>[s(C,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=p=>d.repassword=p),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:c.value,onClick:b},{default:a(()=>[U(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const we=(e,t)=>{const r=e.__vccOpts||e;for(const[c,i]of t)r[c]=i;return r},dt=we(ct,[["__scopeId","data-v-053dfa44"]]),io=e=>o({method:"get",url:"/v1/posts",params:e}),mt=e=>o({method:"get",url:"/v1/tags",params:e}),co=e=>o({method:"get",url:"/v1/post",params:e}),mo=e=>o({method:"get",url:"/v1/post/star",params:e}),po=e=>o({method:"post",url:"/v1/post/star",data:e}),_o=e=>o({method:"get",url:"/v1/post/collection",params:e}),ho=e=>o({method:"post",url:"/v1/post/collection",data:e}),go=e=>o({method:"get",url:"/v1/post/comments",params:e}),fo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),vo=e=>o({method:"post",url:"/v1/post",data:e}),wo=e=>o({method:"delete",url:"/v1/post",data:e}),yo=e=>o({method:"post",url:"/v1/post/lock",data:e}),bo=e=>o({method:"post",url:"/v1/post/stick",data:e}),ko=e=>o({method:"post",url:"/v1/post/highlight",data:e}),Po=e=>o({method:"post",url:"/v1/post/visibility",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),Oo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),Ao=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Eo=e=>o({method:"post",url:"/v1/post/comment",data:e}),Io=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Co=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),$o=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Mo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Uo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Do=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),xo=e=>o({method:"post",url:"/v1/captcha",data:e}),qo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),No=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),Ko=e=>o({method:"post",url:"/v1/friend/add",data:e}),Fo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Vo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),zo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ho=e=>o({method:"get",url:"/v1/user/followings",params:e}),Wo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Yo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),jo=e=>o({method:"post",url:"/v1/user/activate",data:e}),Qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Zo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Go=e=>o({method:"post",url:"/v1/user/avatar",data:e}),de=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Jo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),es=e=>o({method:"get",url:"/v1/user/collections",params:e}),ts=e=>o({method:"get",url:"/v1/user/profile",params:e}),os=e=>o({method:"get",url:"/v1/user/posts",params:e}),ss=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),ns=e=>o({method:"post",url:"/v1/user/recharge",data:e}),rs=e=>o({method:"get",url:"/v1/user/recharge",params:e}),as=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ls=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),us=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),is=e=>o({method:"get",url:"/v1/attachment",params:e}),cs=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),pt=()=>o({method:"get",url:"/v1/admin/site/status"});D.locale("zh-cn");const _t=e=>D.unix(e).fromNow(),ds=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},ms=e=>{let t=D.unix(e),r=D();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):D().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},ps=e=>D.unix(e).utc(!0).format("YYYY年MM月"),ht={key:0,class:"rightbar-wrap"},gt={class:"search-wrap"},ft={class:"post-num"},vt={class:"post-num"},wt={class:"copyright"},yt=["href"],bt=["href"],kt={class:"site-info-item"},Pt=Y({__name:"rightbar",setup(e){const t=k([]),r=k([]),c=k(!1),i=k(""),n=B(),m=pe(),d=k(0),S=k(0),v=k(0),b=k(0),_=k(null),u="2023 paopao.info",I="Roc's Me",h="",R="泡泡(PaoPao)开源社区",C="https://www.paopao.info",L=+"6",x=+"12",l=()=>{pt().then(g=>{d.value=g.register_user_count,S.value=g.online_user_count,v.value=g.history_max_online,b.value=g.server_up_time}).catch(g=>{}),p.disconnect()},O=()=>{c.value=!0,mt({type:"hot_extral",num:x,extral_num:L}).then(g=>{t.value=g.topics,r.value=g.extral_topics??[],V.value=!0,c.value=!1}).catch(g=>{c.value=!1})},F=g=>g>=1e3?(g/1e3).toFixed(1)+"k":g,H=()=>{m.push({name:"home",query:{q:i.value}})},V=J({get:()=>n.state.userLogined&&r.value.length!==0,set:g=>{}});Z(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(g,z)=>{(g.refreshTopicFollow!==z.refreshTopicFollow||g.userLogined)&&O(),n.state.userInfo.is_admin&&l()});const p=new IntersectionObserver(g=>{g.forEach(z=>{z.isIntersecting&&l()})},{root:null,rootMargin:"0px",threshold:1});return G(()=>{_.value&&p.observe(_.value),O()}),(g,z)=>{const ye=W,be=he,ee=me("router-link"),te=qe,j=fe,ke=_e;return f(n).state.collapsedRight?M("",!0):(w(),E("div",ht,[y("div",gt,[s(be,{round:"",clearable:"",placeholder:"搜一搜...",value:i.value,"onUpdate:value":z[0]||(z[0]=$=>i.value=$),onKeyup:q(N(H,["prevent"]),["enter"])},{prefix:a(()=>[s(ye,{component:f(Qe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),V.value?(w(),K(j,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(r.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",ft,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),s(j,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(te,{show:c.value},{default:a(()=>[(w(!0),E(se,null,ne(t.value,$=>(w(),E("div",{class:"hot-tag-item",key:$.id},[s(ee,{class:"hash-link",to:{name:"home",query:{q:$.tag,t:"tag"}}},{default:a(()=>[U(" #"+A($.tag),1)]),_:2},1032,["to"]),y("div",vt,A(F($.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(j,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[y("div",wt,"© "+A(f(u)),1),y("div",null,[s(ke,null,{default:a(()=>[y("a",{href:f(h),target:"_blank",class:"hash-link"},A(f(I)),9,yt),y("a",{href:f(C),target:"_blank",class:"hash-link"},A(f(R)),9,bt)]),_:1})])]),_:1}),f(n).state.userInfo.is_admin?(w(),E("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:_},[y("span",kt,A(d.value)+" 注册用户,"+A(S.value)+" 人在线,最高在线 "+A(v.value)+" 人,站点上线于 "+A(f(_t)(b.value)),1)],512)):M("",!0)]))}}});const Lt=we(Pt,[["__scopeId","data-v-0a6cd0b6"]]),Ot="/assets/logo-52afee68.png",Tt={class:"sidebar-wrap"},At={class:"logo-wrap"},Et={key:0,class:"user-wrap"},It={class:"user-info"},Rt={class:"nickname"},Ct={class:"nickname-txt"},$t={class:"username"},Mt={class:"user-mini-wrap"},St={key:1,class:"user-wrap"},Ut={key:0,class:"login-only-wrap"},Dt={key:1,class:"login-wrap"},xt=Y({__name:"sidebar",setup(e){const t=B(),r=Ee(),c=pe(),i=k(!1),n=k(r.name||""),m=k(),d="true".toLowerCase()==="true",S="false".toLowerCase()==="true",v="false".toLocaleLowerCase()==="true",b=k("true".toLowerCase()==="true"),_=+"5000";Z(r,()=>{n.value=r.name}),Z(t.state,()=>{t.state.userInfo.id>0?m.value||(de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)}),m.value=setInterval(()=>{de().then(l=>{i.value=l.count>0}).catch(l=>{console.log(l)})},_)):m.value&&clearInterval(m.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=J(()=>{const l=[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}];return S&&l.push({label:"公告",key:"anouncement",icon:()=>P(Ze),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>P(Ge),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>P(Je),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>P(Xe),href:"/collection"}),d&&l.push({label:"好友",key:"contacts",icon:()=>P(et),href:"/contacts"}),v&&l.push({label:"钱包",key:"wallet",icon:()=>P(tt),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>P(ot),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>P(ae),href:"/"},{label:"话题",key:"topic",icon:()=>P(le),href:"/topic"}]}),I=l=>"href"in l?P("div",{},l.label):l.label,h=l=>l.key==="messages"?P(Ke,{dot:!0,show:i.value,processing:!0},{default:()=>P(W,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):P(W,null,{default:l.icon}),R=(l,O={})=>{n.value=l,c.push({name:l,query:{t:new Date().getTime()}})},C=()=>{r.path==="/"&&t.commit("refresh"),R("home")},L=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},x=()=>{t.commit("userLogout"),t.commit("refresh"),C()};return window.$store=t,window.$message=Ne(),(l,O)=>{const F=Fe,H=Ve,V=ze,p=ge;return w(),E("div",Tt,[y("div",At,[s(F,{class:"logo-img",width:"36",src:f(Ot),"preview-disabled":!0,onClick:C},null,8,["src"])]),s(H,{accordion:!0,"icon-size":24,options:u.value,"render-label":I,"render-icon":h,value:n.value,"onUpdate:value":R},null,8,["options","value"]),f(t).state.userInfo.id>0?(w(),E("div",Et,[s(V,{class:"user-avatar",round:"",size:34,src:f(t).state.userInfo.avatar},null,8,["src"]),y("div",It,[y("div",Rt,[y("span",Ct,A(f(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:x},{icon:a(()=>[s(f(W),null,{default:a(()=>[s(f(ue))]),_:1})]),_:1})]),y("div",$t,"@"+A(f(t).state.userInfo.username),1)]),y("div",Mt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:x},{icon:a(()=>[s(f(W),{size:24},{default:a(()=>[s(f(ue))]),_:1})]),_:1})])])):(w(),E("div",St,[b.value?M("",!0):(w(),E("div",Ut,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[0]||(O[0]=g=>L("signin"))},{default:a(()=>[U(" 登录 ")]),_:1})])),b.value?(w(),E("div",Dt,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:O[1]||(O[1]=g=>L("signin"))},{default:a(()=>[U(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:O[2]||(O[2]=g=>L("signup"))},{default:a(()=>[U(" 注册 ")]),_:1})])):M("",!0)]))])}}});const qt={"has-sider":"",class:"main-wrap",position:"static"},Nt={key:0},Kt={class:"content-wrap"},Ft=Y({__name:"App",setup(e){const t=B(),r=J(()=>t.state.theme==="dark"?We:null);return(c,i)=>{const n=xt,m=me("router-view"),d=Lt,S=dt,v=Ye,b=Be,_=je,u=He;return w(),K(u,{theme:r.value},{default:a(()=>[s(b,null,{default:a(()=>[s(v,null,{default:a(()=>{var I;return[y("div",{class:Le(["app-container",{dark:((I=r.value)==null?void 0:I.name)==="dark",mobile:!f(t).state.desktopModelShow}])},[y("div",qt,[f(t).state.desktopModelShow?(w(),E("div",Nt,[s(n)])):M("",!0),y("div",Kt,[s(m,{class:"app-wrap"},{default:a(({Component:h})=>[(w(),K(Pe,null,[c.$route.meta.keepAlive?(w(),K(re(h),{key:0})):M("",!0)],1024)),c.$route.meta.keepAlive?M("",!0):(w(),K(re(h),{key:0}))]),_:1})]),s(d)]),s(S)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});Oe(Ft).use(ve).use(at).mount("#app");export{ss as $,po as A,ho as B,co as C,go as D,Ot as E,Mo as F,Uo as G,So as H,mt as I,_t as J,ps as K,ts as L,cs as M,No as N,Ko as O,Wo as P,Xo as Q,Jo as R,es as S,ms as T,us as U,is as V,zo as W,Ho as X,qo as Y,Q as Z,we as _,ls as a,ns as a0,rs as a1,Do as a2,Go as a3,Qo as a4,Bo as a5,jo as a6,Zo as a7,xo as a8,xt as a9,fo as b,vo as c,io as d,os as e,Fo as f,as as g,Yo as h,ds as i,Ao as j,$o as k,Lo as l,Oo as m,Co as n,Io as o,Ro as p,Eo as q,mo as r,_o as s,To as t,Vo as u,wo as v,yo as w,bo as x,ko as y,Po as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js index 603e6365..def69d56 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-830cbb44.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-a6e1ffe5.js @@ -1 +1 @@ -import{a9 as A}from"./index-cb47660d.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; +import{a9 as A}from"./index-3c78935c.js";import{u as B}from"./vuex-44de225f.js";import{u as E}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{a3 as C,a4 as N,a5 as P,a6 as D}from"./@vicons-f0266f88.js";import{u as R,a3 as x,a4 as H,j as I,e as V,a5 as $,h as j}from"./naive-ui-eecf2ec3.js";import{d as q,H as h,b as F,e as n,f,bf as a,k as e,w as t,Y as c,j as L,q as _,A as U,x as Y,F as G}from"./@vue-a481fc63.js";const J={key:0},K={class:"navbar"},ae=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const i=w,o=B(),m=E(),l=h(!1),g=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=x,M=H,r=I,p=V,O=$,S=j;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),_(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(N))]),_:1})]),_:1})):c("",!0),U(" "+Y(i.title)+" ",1),i.theme?(n(),_(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js similarity index 98% rename from web/dist/assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js rename to web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js index a4089b50..d9fb9ec7 100644 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-d4d48fa6.js +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-b1622c74.js @@ -1 +1 @@ -import{p as R,a as V,_ as E,b as J,c as W}from"./content-5f7e0179.js";import{d as Y,c as x,r as G,e as l,f as b,k as n,al as K,w as s,j as u,F as Q,u as U,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{T as ee,A as te,B as oe}from"./index-cb47660d.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=Y({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=G("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=W,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=Y({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=G("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=W,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; +import{p as R,a as V,_ as E,b as J,c as W}from"./content-b9c58eb8.js";import{d as Y,c as x,r as G,e as l,f as b,k as n,al as K,w as s,j as u,F as Q,u as U,y as v,bf as i,A as p,x as _,q as c,Y as r,h as $}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{T as ee,A as te,B as oe}from"./index-3c78935c.js";import{c as se}from"./copy-to-clipboard-4ef7d3eb.js";import{k as ne,l as ae,n as le,o as ie,r as ue,s as ce,t as re,J as pe,R as _e,q as de}from"./@vicons-f0266f88.js";import{j as h,o as me,M as ve,e as he,P as fe,a as ke,O as ge}from"./naive-ui-eecf2ec3.js";const ye={class:"post-item"},we={class:"nickname-wrap"},be={class:"username-wrap"},Ce={class:"timestamp-mobile"},xe={class:"item-header-extra"},$e=["innerHTML"],Oe=["onClick"],qe=["onClick"],Ve=Y({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=G("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=W,H=ke,I=ge;return l(),b("div",ye,[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",we,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",be," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Ce,_(i(ee)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",xe,[n(L,{placement:"bottom-end",trigger:"click",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Oe),u("div",{class:"opt-item",onClick:o[3]||(o[3]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:o[2]||(o[2]=f=>y(e.value.id))},[(l(!0),b(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,$e))),128))])]),key:"0"}:void 0]),1024)])}}});const ze={class:"nickname-wrap"},Te={class:"username-wrap"},Be={class:"item-header-extra"},Pe={class:"timestamp"},Ae=["innerHTML"],Fe=["onClick"],Se=["onClick"],Ee=Y({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(O,{emit:k}){const a=O,g=Z(),q=X(),d=t=>()=>$(h,null,{default:()=>$(t)}),z=x(()=>{let t=[];return a.isOwner||t.push({label:"私信",key:"whisper",icon:d(ue)}),!a.isOwner&&a.addFollowAction&&(a.post.user.is_following?t.push({label:"取消关注",key:"unfollow",icon:d(ce)}):t.push({label:"关注",key:"follow",icon:d(re)})),!a.isOwner&&a.addFriendAction&&(a.post.user.is_friend?t.push({label:"删除好友",key:"delete",icon:d(pe)}):t.push({label:"添加朋友",key:"requesting",icon:d(_e)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(de)}),t}),T=async t=>{switch(t){case"copyTweetLink":se(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":k("send-whisper",a.post.user);break;case"delete":case"requesting":k("handle-friend-action",a.post);break;case"follow":case"unfollow":k("handle-follow-action",a.post);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},a.post);return t.contents.map(o=>{(+o.type==1||+o.type==2)&&t.texts.push(o),+o.type==3&&t.imgs.push(o),+o.type==4&&t.videos.push(o),+o.type==6&&t.links.push(o),+o.type==7&&t.attachments.push(o),+o.type==8&&t.charge_attachments.push(o)}),t},set:t=>{a.post.upvote_count=t.upvote_count,a.post.collection_count=t.collection_count}}),B=()=>{te({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{oe({id:e.value.id}).then(t=>{t.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count>0?e.value.collection_count-1:0}}).catch(t=>{console.log(t)})},y=t=>{g.push({name:"post",query:{id:t}})},A=(t,o)=>{if(t.target.dataset.detail){const m=t.target.dataset.detail.split(":");if(m.length===2){q.commit("refresh"),m[0]==="tag"?g.push({name:"home",query:{q:m[1],t:"tag"}}):g.push({name:"user",query:{s:m[1]}});return}}y(o)};return(t,o)=>{const m=me,F=G("router-link"),w=ve,S=he,L=fe,C=V,M=E,j=J,D=W,H=ke,I=ge;return l(),b("div",{class:"post-item",onClick:o[3]||(o[3]=f=>y(e.value.id))},[n(I,{"content-indented":""},K({avatar:s(()=>[n(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ze,[n(F,{onClick:o[0]||(o[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[p(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Te," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[p(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[p(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[p(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":s(()=>[u("div",Be,[u("span",Pe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(ee)(e.value.created_on)),1),n(L,{placement:"bottom-end",trigger:"hover",size:"small",options:z.value,onSelect:T},{default:s(()=>[n(S,{quaternary:"",circle:""},{icon:s(()=>[n(i(h),null,{default:s(()=>[n(i(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(l(),c(C,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(C,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(M,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(j,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(D,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:s(()=>[n(H,{justify:"space-between"},{default:s(()=>[u("div",{class:"opt-item hover",onClick:v(B,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ae))]),_:1}),p(" "+_(e.value.upvote_count),1)],8,Fe),u("div",{class:"opt-item hover",onClick:o[2]||(o[2]=v(f=>y(e.value.id),["stop"]))},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(le))]),_:1}),p(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:v(P,["stop"])},[n(i(h),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(i(ie))]),_:1}),p(" "+_(e.value.collection_count),1)],8,Se)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(l(!0),b(Q,null,U(e.value.texts,f=>(l(),b("span",{key:f.id,class:"post-text hover",onClick:o[1]||(o[1]=v(N=>A(N,e.value.id),["stop"])),innerHTML:i(R)(f.content).content},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Ve as a}; diff --git a/web/dist/assets/post-skeleton-67280cce.js b/web/dist/assets/post-skeleton-52d6bc96.js similarity index 88% rename from web/dist/assets/post-skeleton-67280cce.js rename to web/dist/assets/post-skeleton-52d6bc96.js index f37bccfc..54dce3b5 100644 --- a/web/dist/assets/post-skeleton-67280cce.js +++ b/web/dist/assets/post-skeleton-52d6bc96.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-cb47660d.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; +import{U as r}from"./naive-ui-eecf2ec3.js";import{d as c,e as s,f as n,u as p,j as o,k as t,F as l}from"./@vue-a481fc63.js";import{_ as i}from"./index-3c78935c.js";const m={class:"user"},u={class:"content"},d=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(d,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/whisper-7f52b83e.js b/web/dist/assets/whisper-7e17488b.js similarity index 95% rename from web/dist/assets/whisper-7f52b83e.js rename to web/dist/assets/whisper-7e17488b.js index b95c291c..9da5007f 100644 --- a/web/dist/assets/whisper-7f52b83e.js +++ b/web/dist/assets/whisper-7e17488b.js @@ -1 +1 @@ -import{Y as b,_ as k}from"./index-cb47660d.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as z,b as I,e as R,i as S}from"./naive-ui-eecf2ec3.js";const T={class:"whisper-wrap"},W={class:"whisper-line"},$={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=z,v=I,g=R,y=S;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",T,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",W,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",$,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; +import{Y as b,_ as k}from"./index-3c78935c.js";import{d as B,H as p,e as C,q as N,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";import{S as U,I as V,T as z,b as I,e as R,i as S}from"./naive-ui-eecf2ec3.js";const T={class:"whisper-wrap"},W={class:"whisper-line"},$={class:"whisper-line send-wrap"},j=B({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),c=()=>{u("success")},m=()=>{t.value=!0,b({user_id:d.user.id,content:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",c()}).catch(e=>{t.value=!1})};return(e,l)=>{const h=U,w=V,f=z,v=I,g=R,y=S;return C(),N(y,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",T,[n(f,{"show-icon":!1},{default:s(()=>[_(" 即将发送私信给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",W,[n(v,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=x=>o.value=x),maxlength:"200","show-count":""},null,8,["value"])]),a("div",$,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(j,[["__scopeId","data-v-0cbfe47c"]]);export{H as _}; diff --git a/web/dist/assets/whisper-add-friend-70019d63.js b/web/dist/assets/whisper-add-friend-622dcaa8.js similarity index 95% rename from web/dist/assets/whisper-add-friend-70019d63.js rename to web/dist/assets/whisper-add-friend-622dcaa8.js index f90cee85..d06b6b95 100644 --- a/web/dist/assets/whisper-add-friend-70019d63.js +++ b/web/dist/assets/whisper-add-friend-622dcaa8.js @@ -1 +1 @@ -import{N as b,_ as k}from"./index-cb47660d.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; +import{N as b,_ as k}from"./index-3c78935c.js";import{S as B,I as N,T as A,b as C,e as F,i as V}from"./naive-ui-eecf2ec3.js";import{d as W,H as i,e as q,q as z,w as s,j as a,k as n,A as _,x as r}from"./@vue-a481fc63.js";const I={class:"whisper-wrap"},R={class:"whisper-line"},S={class:"whisper-line send-wrap"},T=W({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:d}){const u=p,o=i(""),t=i(!1),l=()=>{d("success")},m=()=>{t.value=!0,b({user_id:u.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",l()}).catch(e=>{t.value=!1})};return(e,c)=>{const h=B,w=N,f=A,g=C,v=F,y=V;return q(),z(y,{show:e.show,"onUpdate:show":l,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",I,[n(f,{"show-icon":!1},{default:s(()=>[_(" 发送添加朋友申请给: "),n(w,{style:{"max-width":"100%"}},{default:s(()=>[n(h,{type:"success"},{default:s(()=>[_(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",R,[n(g,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=x=>o.value=x),maxlength:"120","show-count":""},null,8,["value"])]),a("div",S,[n(v,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const H=k(T,[["__scopeId","data-v-60be56a2"]]);export{H as W}; diff --git a/web/dist/index.html b/web/dist/index.html index 94e7df2a..f16ba932 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/message-item.vue b/web/src/components/message-item.vue index a98c8f19..69351409 100644 --- a/web/src/components/message-item.vue +++ b/web/src/components/message-item.vue @@ -40,24 +40,6 @@ 系统 - - 私信 - - - {{ sentTagLabel }} + 私信已发送 @@ -77,7 +59,7 @@ size="small" round > - {{ receivedTagLabel }} + 私信已接收 @@ -184,22 +166,6 @@ const props = withDefaults( {} ); -const sentTagLabel = computed(() => { - if (store.state.desktopModelShow) { - return '已发送' - } else { - return '私信已发送' - } -}); - -const receivedTagLabel = computed(() => { - if (store.state.desktopModelShow) { - return '已接收' - } else { - return '私信已接收' - } -}); - const renderIcon = (icon: Component) => { return () => { return h(NIcon, null, {