From 882b4312b39e16b270a7988274a2ccde3c226f3e Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sat, 2 Sep 2023 14:06:17 +0800 Subject: [PATCH] frontend: add send whisper quickly in some home/contacts/following/user/profile page --- .../{404-26f331db.js => 404-adb7b71a.js} | 2 +- ...nt-9930cc6a.js => Anouncement-d10e74f5.js} | 2 +- web/dist/assets/Collection-1c56688e.js | 1 + web/dist/assets/Collection-5c3a44e2.css | 1 + web/dist/assets/Collection-a3f9d0d9.js | 1 - web/dist/assets/Collection-b97b3cf7.css | 1 - web/dist/assets/Contacts-7fa3e0d6.css | 1 + web/dist/assets/Contacts-839dbc08.js | 1 - web/dist/assets/Contacts-84714976.js | 1 + web/dist/assets/Contacts-baa2e9bb.css | 1 - web/dist/assets/Following-31b77f3b.css | 1 - web/dist/assets/Following-3e74fdde.js | 1 + web/dist/assets/Following-6aa7d36c.css | 1 + web/dist/assets/Following-be24e2b8.js | 1 - .../{Home-7d19114d.css => Home-2f8b5a0d.css} | 2 +- web/dist/assets/Home-d28a50f3.js | 1 - web/dist/assets/Home-fc1d3b7f.js | 1 + web/dist/assets/Messages-1e4acdf3.css | 1 - web/dist/assets/Messages-3c6066fb.css | 1 + web/dist/assets/Messages-4104caea.js | 1 - web/dist/assets/Messages-f8e13906.js | 1 + .../{Post-2d267990.js => Post-78da1f3b.js} | 2 +- web/dist/assets/Profile-03eea9fe.js | 1 + web/dist/assets/Profile-389382b2.js | 1 - web/dist/assets/Profile-88292227.css | 1 + web/dist/assets/Profile-ab12b2fa.css | 1 - ...etting-07adc927.js => Setting-f3723e49.js} | 2 +- .../{Topic-60f034a7.js => Topic-98177f3e.js} | 2 +- web/dist/assets/User-917e7989.css | 1 - web/dist/assets/User-e6eae837.css | 1 + web/dist/assets/User-f262d052.js | 1 + web/dist/assets/User-faa58349.js | 1 - ...{Wallet-41e3f3be.js => Wallet-e4139554.js} | 2 +- ...ontent-d5264b98.js => content-218c067c.js} | 2 +- web/dist/assets/index-757c547c.js | 1 - web/dist/assets/index-d9eb4c9e.js | 1 + ...e_vue_type_style_index_0_lang-52b53177.js} | 2 +- ...ue_vue_type_style_index_0_lang-a10065a5.js | 1 + ...ue_vue_type_style_index_0_lang-cf11e2c5.js | 1 - ...-c82f8a59.js => post-skeleton-7039dc67.js} | 2 +- web/dist/assets/whisper-5fc7c61f.js | 1 + web/dist/assets/whisper-61451957.css | 1 + web/dist/index.html | 2 +- web/src/components/contact-item.vue | 174 +++++++++++++----- web/src/components/follow-item.vue | 65 ++++--- web/src/components/message-item.vue | 64 ++++++- web/src/components/mobile-post-item.vue | 36 +++- web/src/components/post-detail.vue | 2 +- web/src/components/post-item.vue | 35 +++- web/src/views/Collection.vue | 31 +++- web/src/views/Contacts.vue | 31 +++- web/src/views/Following.vue | 39 +++- web/src/views/Home.vue | 29 ++- web/src/views/Messages.vue | 26 ++- web/src/views/Profile.vue | 29 ++- web/src/views/User.vue | 12 +- 56 files changed, 492 insertions(+), 135 deletions(-) rename web/dist/assets/{404-26f331db.js => 404-adb7b71a.js} (84%) rename web/dist/assets/{Anouncement-9930cc6a.js => Anouncement-d10e74f5.js} (91%) create mode 100644 web/dist/assets/Collection-1c56688e.js create mode 100644 web/dist/assets/Collection-5c3a44e2.css delete mode 100644 web/dist/assets/Collection-a3f9d0d9.js delete mode 100644 web/dist/assets/Collection-b97b3cf7.css create mode 100644 web/dist/assets/Contacts-7fa3e0d6.css delete mode 100644 web/dist/assets/Contacts-839dbc08.js create mode 100644 web/dist/assets/Contacts-84714976.js delete mode 100644 web/dist/assets/Contacts-baa2e9bb.css delete mode 100644 web/dist/assets/Following-31b77f3b.css create mode 100644 web/dist/assets/Following-3e74fdde.js create mode 100644 web/dist/assets/Following-6aa7d36c.css delete mode 100644 web/dist/assets/Following-be24e2b8.js rename web/dist/assets/{Home-7d19114d.css => Home-2f8b5a0d.css} (62%) delete mode 100644 web/dist/assets/Home-d28a50f3.js create mode 100644 web/dist/assets/Home-fc1d3b7f.js delete mode 100644 web/dist/assets/Messages-1e4acdf3.css create mode 100644 web/dist/assets/Messages-3c6066fb.css delete mode 100644 web/dist/assets/Messages-4104caea.js create mode 100644 web/dist/assets/Messages-f8e13906.js rename web/dist/assets/{Post-2d267990.js => Post-78da1f3b.js} (64%) create mode 100644 web/dist/assets/Profile-03eea9fe.js delete mode 100644 web/dist/assets/Profile-389382b2.js create mode 100644 web/dist/assets/Profile-88292227.css delete mode 100644 web/dist/assets/Profile-ab12b2fa.css rename web/dist/assets/{Setting-07adc927.js => Setting-f3723e49.js} (97%) rename web/dist/assets/{Topic-60f034a7.js => Topic-98177f3e.js} (97%) delete mode 100644 web/dist/assets/User-917e7989.css create mode 100644 web/dist/assets/User-e6eae837.css create mode 100644 web/dist/assets/User-f262d052.js delete mode 100644 web/dist/assets/User-faa58349.js rename web/dist/assets/{Wallet-41e3f3be.js => Wallet-e4139554.js} (96%) rename web/dist/assets/{content-d5264b98.js => content-218c067c.js} (86%) delete mode 100644 web/dist/assets/index-757c547c.js create mode 100644 web/dist/assets/index-d9eb4c9e.js rename web/dist/assets/{main-nav.vue_vue_type_style_index_0_lang-048bd56b.js => main-nav.vue_vue_type_style_index_0_lang-52b53177.js} (96%) create mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a10065a5.js delete mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js rename web/dist/assets/{post-skeleton-c82f8a59.js => post-skeleton-7039dc67.js} (88%) create mode 100644 web/dist/assets/whisper-5fc7c61f.js create mode 100644 web/dist/assets/whisper-61451957.css diff --git a/web/dist/assets/404-26f331db.js b/web/dist/assets/404-adb7b71a.js similarity index 84% rename from web/dist/assets/404-26f331db.js rename to web/dist/assets/404-adb7b71a.js index 5f82cb24..79e20e23 100644 --- a/web/dist/assets/404-26f331db.js +++ b/web/dist/assets/404-adb7b71a.js @@ -1 +1 @@ -import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as a}from"./vue-router-e5a2430e.js";import{F as i,e as c,a2 as u}from"./naive-ui-d8de3dda.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-757c547c.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-1a3558c6.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as a}from"./vue-router-e5a2430e.js";import{F as i,e as c,a2 as u}from"./naive-ui-d8de3dda.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-d9eb4c9e.js";import"./vuex-44de225f.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-1a3558c6.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;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 M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/Anouncement-9930cc6a.js b/web/dist/assets/Anouncement-d10e74f5.js similarity index 91% rename from web/dist/assets/Anouncement-9930cc6a.js rename to web/dist/assets/Anouncement-d10e74f5.js index a38e564a..c594446d 100644 --- a/web/dist/assets/Anouncement-9930cc6a.js +++ b/web/dist/assets/Anouncement-d10e74f5.js @@ -1 +1 @@ -import{_ as F}from"./post-skeleton-c82f8a59.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{a as R}from"./formatTime-4210fcd1.js";import{F as S,Q as V,I as q,G as I}from"./naive-ui-d8de3dda.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as H}from"./@vue-a481fc63.js";import{_ as L}from"./index-757c547c.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-1a3558c6.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={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),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return j(()=>{}),(c,J)=>{const k=N,y=V,x=F,w=q,B=I,C=S;return e(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(e(),o("div",M,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",O,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(D,null,E(r.value,t=>(e(),G(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:H({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const yt=L(Y,[["__scopeId","data-v-d4d04859"]]);export{yt as default}; +import{_ as F}from"./post-skeleton-7039dc67.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as z}from"./vuex-44de225f.js";import{b as A}from"./vue-router-e5a2430e.js";import{a as R}from"./formatTime-4210fcd1.js";import{F as S,Q as V,I as q,G as I}from"./naive-ui-d8de3dda.js";import{d as P,H as n,b as j,f as o,k as a,w as p,e,bf as u,Y as l,F as D,u as E,q as G,j as s,x as _,l as H}from"./@vue-a481fc63.js";import{_ as L}from"./index-d9eb4c9e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./@vicons-1a3558c6.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const M={key:0,class:"pagination-wrap"},O={key:0,class:"skeleton-wrap"},Q={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),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return j(()=>{}),(c,J)=>{const k=N,y=V,x=F,w=q,B=I,C=S;return e(),o("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(e(),o("div",M,[a(y,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",O,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(D,null,E(r.value,t=>(e(),G(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:H({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(R)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const yt=L(Y,[["__scopeId","data-v-d4d04859"]]);export{yt as default}; diff --git a/web/dist/assets/Collection-1c56688e.js b/web/dist/assets/Collection-1c56688e.js new file mode 100644 index 00000000..3d2da651 --- /dev/null +++ b/web/dist/assets/Collection-1c56688e.js @@ -0,0 +1 @@ +import{_ as q}from"./whisper-5fc7c61f.js";import{_ as I,a as V}from"./post-item.vue_vue_type_style_index_0_lang-a10065a5.js";import{_ as W}from"./post-skeleton-7039dc67.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as G}from"./vuex-44de225f.js";import{b as H}from"./vue-router-e5a2430e.js";import{N as L,_ as Q}from"./index-d9eb4c9e.js";import{d as T,H as s,b as U,f as o,k as n,w as u,bf as h,Y as w,e,F as k,u as y,q as C}from"./@vue-a481fc63.js";import{F as Y,Q as j,I as A,G as D}from"./naive-ui-d8de3dda.js";import"./content-218c067c.js";import"./@vicons-1a3558c6.js";import"./paopao-video-player-2fe58954.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const J={key:0,class:"skeleton-wrap"},K={key:1},O={key:0,class:"empty-wrap"},X={key:1},Z={key:2},ee={key:0,class:"pagination-wrap"},oe=T({__name:"Collection",setup(te){const m=G(),S=H(),_=s(!1),i=s([]),l=s(+S.query.p||1),p=s(20),r=s(0),c=s(!1),d=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),f=t=>{d.value=t,c.value=!0},b=()=>{c.value=!1},v=()=>{_.value=!0,L({page:l.value,page_size:p.value}).then(t=>{_.value=!1,i.value=t.list,r.value=Math.ceil(t.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(t=>{_.value=!1})},x=t=>{l.value=t,v()};return U(()=>{v()}),(t,ne)=>{const $=E,z=W,B=A,F=I,g=D,M=V,N=q,P=Y,R=j;return e(),o("div",null,[n($,{title:"收藏"}),n(P,{class:"main-content-wrap",bordered:""},{default:u(()=>[_.value?(e(),o("div",J,[n(z,{num:p.value},null,8,["num"])])):(e(),o("div",K,[i.value.length===0?(e(),o("div",O,[n(B,{size:"large",description:"暂无数据"})])):w("",!0),h(m).state.desktopModelShow?(e(),o("div",X,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(F,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))])):(e(),o("div",Z,[(e(!0),o(k,null,y(i.value,a=>(e(),C(g,{key:a.id},{default:u(()=>[n(M,{post:a,onSendWhisper:f},null,8,["post"])]),_:2},1024))),128))]))])),n(N,{show:c.value,user:d.value,onSuccess:b},null,8,["show","user"])]),_:1}),r.value>0?(e(),o("div",ee,[n(R,{page:l.value,"onUpdate:page":x,"page-slot":h(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):w("",!0)])}}});const Ve=Q(oe,[["__scopeId","data-v-760779af"]]);export{Ve as default}; diff --git a/web/dist/assets/Collection-5c3a44e2.css b/web/dist/assets/Collection-5c3a44e2.css new file mode 100644 index 00000000..317e31eb --- /dev/null +++ b/web/dist/assets/Collection-5c3a44e2.css @@ -0,0 +1 @@ +.pagination-wrap[data-v-760779af]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-760779af],.dark .empty-wrap[data-v-760779af],.dark .skeleton-wrap[data-v-760779af]{background-color:#101014bf} diff --git a/web/dist/assets/Collection-a3f9d0d9.js b/web/dist/assets/Collection-a3f9d0d9.js deleted file mode 100644 index 3ba916e5..00000000 --- a/web/dist/assets/Collection-a3f9d0d9.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as P,a as S}from"./post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js";import{_ as $}from"./post-skeleton-c82f8a59.js";import{_ as q}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as I}from"./vuex-44de225f.js";import{b as N}from"./vue-router-e5a2430e.js";import{O as R,_ as V}from"./index-757c547c.js";import{d as E,H as a,b as G,f as o,k as e,w as c,bf as g,Y as v,e as t,F as f,u as k,q as h}from"./@vue-a481fc63.js";import{F as H,Q as L,I as O,G as Q}from"./naive-ui-d8de3dda.js";import"./content-d5264b98.js";import"./@vicons-1a3558c6.js";import"./paopao-video-player-2fe58954.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const T={key:0,class:"skeleton-wrap"},U={key:1},Y={key:0,class:"empty-wrap"},j={key:1},A={key:2},D={key:0,class:"pagination-wrap"},J=E({__name:"Collection",setup(K){const m=I(),y=N(),_=a(!1),i=a([]),p=a(+y.query.p||1),l=a(20),r=a(0),u=()=>{_.value=!0,R({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return G(()=>{u()}),(n,W)=>{const b=q,C=$,x=O,z=P,d=Q,B=S,F=H,M=L;return t(),o("div",null,[e(b,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",T,[e(C,{num:l.value},null,8,["num"])])):(t(),o("div",U,[i.value.length===0?(t(),o("div",Y,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",j,[(t(!0),o(f,null,k(i.value,s=>(t(),h(d,{key:s.id},{default:c(()=>[e(z,{post:s},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",A,[(t(!0),o(f,null,k(i.value,s=>(t(),h(d,{key:s.id},{default:c(()=>[e(B,{post:s},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",D,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Pt=V(J,[["__scopeId","data-v-a5302c9b"]]);export{Pt as default}; diff --git a/web/dist/assets/Collection-b97b3cf7.css b/web/dist/assets/Collection-b97b3cf7.css deleted file mode 100644 index 82f9e2e5..00000000 --- a/web/dist/assets/Collection-b97b3cf7.css +++ /dev/null @@ -1 +0,0 @@ -.pagination-wrap[data-v-a5302c9b]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-a5302c9b],.dark .empty-wrap[data-v-a5302c9b],.dark .skeleton-wrap[data-v-a5302c9b]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts-7fa3e0d6.css b/web/dist/assets/Contacts-7fa3e0d6.css new file mode 100644 index 00000000..e44f7e87 --- /dev/null +++ b/web/dist/assets/Contacts-7fa3e0d6.css @@ -0,0 +1 @@ +.contact-item[data-v-d62f19da]{width:100%;box-sizing:border-box;padding:12px 16px}.contact-item[data-v-d62f19da]:hover{background:#f7f9f9}.contact-item .nickname-wrap[data-v-d62f19da],.contact-item .username-wrap[data-v-d62f19da]{line-height:16px;font-size:16px}.contact-item .top-tag[data-v-d62f19da]{transform:scale(.75)}.contact-item .user-info .info-item[data-v-d62f19da]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.contact-item .item-header-extra[data-v-d62f19da]{display:flex;align-items:center;opacity:.75}.dark .contact-item[data-v-d62f19da]{background-color:#101014bf}.dark .contact-item[data-v-d62f19da]:hover{background:#18181c}.pagination-wrap[data-v-e20fef94]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-e20fef94],.dark .empty-wrap[data-v-e20fef94],.dark .skeleton-wrap[data-v-e20fef94]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts-839dbc08.js b/web/dist/assets/Contacts-839dbc08.js deleted file mode 100644 index 08c34f81..00000000 --- a/web/dist/assets/Contacts-839dbc08.js +++ /dev/null @@ -1 +0,0 @@ -import{u as P,b as R}from"./vue-router-e5a2430e.js";import{b as S}from"./formatTime-4210fcd1.js";import{d as k,e as o,f as s,j as e,k as a,x as l,bf as b,H as c,b as U,w as f,Y as h,F as y,u as V,q as x}from"./@vue-a481fc63.js";import{o as M,F as T,Q as j,I as E,G}from"./naive-ui-d8de3dda.js";import{_ as w,b as H}from"./index-757c547c.js";import{_ as L}from"./post-skeleton-c82f8a59.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as Y}from"./vuex-44de225f.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./axios-4a70c6fc.js";import"./@vicons-1a3558c6.js";/* empty css */const A={class:"avatar"},J={class:"base-info"},K={class:"username"},O={class:"user-info"},W={class:"info-item"},X={class:"info-item"},Z=k({__name:"contact-item",props:{contact:{}},setup(C){const u=P(),m=t=>{u.push({name:"user",query:{s:t}})};return(t,n)=>{const _=M;return o(),s("div",{class:"contact-item",onClick:n[0]||(n[0]=i=>m(t.contact.username))},[e("div",A,[a(_,{size:54,src:t.contact.avatar},null,8,["src"])]),e("div",J,[e("div",K,[e("strong",null,l(t.contact.nickname),1),e("span",null," @"+l(t.contact.username),1)]),e("div",O,[e("span",W,"UID. "+l(t.contact.user_id),1),e("span",X,l(b(S)(t.contact.created_on))+" 加入",1)])])])}}});const tt=w(Z,[["__scopeId","data-v-644d2c15"]]),et={key:0,class:"skeleton-wrap"},ot={key:1},nt={key:0,class:"empty-wrap"},st={key:0,class:"pagination-wrap"},at=k({__name:"Contacts",setup(C){const u=Y(),m=R(),t=c(!1),n=c([]),_=c(+m.query.p||1),i=c(20),d=c(0),$=r=>{_.value=r,v()};U(()=>{v()});const v=(r=!1)=>{n.value.length===0&&(t.value=!0),H({page:_.value,page_size:i.value}).then(p=>{t.value=!1,n.value=p.list,d.value=Math.ceil(p.pager.total_rows/i.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(r,p)=>{const I=Q,z=L,B=E,q=tt,D=G,F=T,N=j;return o(),s(y,null,[e("div",null,[a(I,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(o(),s("div",et,[a(z,{num:i.value},null,8,["num"])])):(o(),s("div",ot,[n.value.length===0?(o(),s("div",nt,[a(B,{size:"large",description:"暂无数据"})])):h("",!0),(o(!0),s(y,null,V(n.value,g=>(o(),x(D,{key:g.user_id},{default:f(()=>[a(q,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(o(),s("div",st,[a(N,{page:_.value,"onUpdate:page":$,"page-slot":b(u).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const Nt=w(at,[["__scopeId","data-v-3b2bf978"]]);export{Nt as default}; diff --git a/web/dist/assets/Contacts-84714976.js b/web/dist/assets/Contacts-84714976.js new file mode 100644 index 00000000..84f21f9e --- /dev/null +++ b/web/dist/assets/Contacts-84714976.js @@ -0,0 +1 @@ +import{_ as T}from"./whisper-5fc7c61f.js";import{d as N,c as j,r as A,e as s,f as c,k as t,w as n,j as i,y as H,A as L,x as v,bf as g,h as I,H as a,b as U,Y as S,F as x,u as W,q as E}from"./@vue-a481fc63.js";import{b as G}from"./formatTime-4210fcd1.js";import{i as Q,x as Y}from"./@vicons-1a3558c6.js";import{j as z,o as J,e as K,O as X,L as Z,F as ee,Q as te,I as ne,G as oe}from"./naive-ui-d8de3dda.js";import{_ as q,b as se}from"./index-d9eb4c9e.js";import{_ as ae}from"./post-skeleton-7039dc67.js";import{_ as ce}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as ie}from"./vuex-44de225f.js";import{b as _e}from"./vue-router-e5a2430e.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./axios-4a70c6fc.js";/* empty css */const re={class:"contact-item"},le={class:"nickname-wrap"},pe={class:"username-wrap"},ue={class:"user-info"},me={class:"info-item"},de={class:"info-item"},fe={class:"item-header-extra"},ve=N({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(b,{emit:h}){const _=b,r=e=>()=>I(z,null,{default:()=>I(e)}),l=j(()=>[{label:"私信",key:"whisper",icon:r(Y)}]),u=e=>{switch(e){case"whisper":const o={id:_.contact.user_id,avatar:_.contact.avatar,username:_.contact.username,nickname:_.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};h("send-whisper",o);break}};return(e,o)=>{const m=J,d=A("router-link"),w=K,k=X,y=Z;return s(),c("div",re,[t(y,{"content-indented":""},{avatar:n(()=>[t(m,{size:54,src:e.contact.avatar},null,8,["src"])]),header:n(()=>[i("span",le,[t(d,{onClick:o[0]||(o[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:n(()=>[L(v(e.contact.nickname),1)]),_:1},8,["to"])]),i("span",pe," @"+v(e.contact.username),1),i("div",ue,[i("span",me," UID. "+v(e.contact.user_id),1),i("span",de,v(g(G)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":n(()=>[i("div",fe,[t(k,{placement:"bottom-end",trigger:"click",size:"small",options:l.value,onSelect:u},{default:n(()=>[t(w,{quaternary:"",circle:""},{icon:n(()=>[t(g(z),null,{default:n(()=>[t(g(Q))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const ge=q(ve,[["__scopeId","data-v-d62f19da"]]),he={key:0,class:"skeleton-wrap"},we={key:1},ke={key:0,class:"empty-wrap"},ye={key:0,class:"pagination-wrap"},be=N({__name:"Contacts",setup(b){const h=ie(),_=_e(),r=a(!1),l=a([]),u=a(+_.query.p||1),e=a(20),o=a(0),m=a(!1),d=a({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),w=p=>{d.value=p,m.value=!0},k=()=>{m.value=!1},y=p=>{u.value=p,C()};U(()=>{C()});const C=(p=!1)=>{l.value.length===0&&(r.value=!0),se({page:u.value,page_size:e.value}).then(f=>{r.value=!1,l.value=f.list,o.value=Math.ceil(f.pager.total_rows/e.value),p&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(f=>{r.value=!1})};return(p,f)=>{const B=ce,F=ae,M=ne,P=ge,V=oe,D=T,O=ee,R=te;return s(),c(x,null,[i("div",null,[t(B,{title:"好友"}),t(O,{class:"main-content-wrap",bordered:""},{default:n(()=>[r.value?(s(),c("div",he,[t(F,{num:e.value},null,8,["num"])])):(s(),c("div",we,[l.value.length===0?(s(),c("div",ke,[t(M,{size:"large",description:"暂无数据"})])):S("",!0),(s(!0),c(x,null,W(l.value,$=>(s(),E(V,{class:"list-item",key:$.user_id},{default:n(()=>[t(P,{contact:$,onSendWhisper:w},null,8,["contact"])]),_:2},1024))),128))])),t(D,{show:m.value,user:d.value,onSuccess:k},null,8,["show","user"])]),_:1})]),o.value>0?(s(),c("div",ye,[t(R,{page:u.value,"onUpdate:page":y,"page-slot":g(h).state.collapsedRight?5:8,"page-count":o.value},null,8,["page","page-slot","page-count"])])):S("",!0)],64)}}});const Ye=q(be,[["__scopeId","data-v-e20fef94"]]);export{Ye as default}; diff --git a/web/dist/assets/Contacts-baa2e9bb.css b/web/dist/assets/Contacts-baa2e9bb.css deleted file mode 100644 index 6b7ec561..00000000 --- a/web/dist/assets/Contacts-baa2e9bb.css +++ /dev/null @@ -1 +0,0 @@ -.contact-item[data-v-644d2c15]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-644d2c15]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-644d2c15]{width:54px}.contact-item .base-info[data-v-644d2c15]{position:relative;margin-left:12px;padding-top:2px;width:calc(100% - 66px)}.contact-item .base-info .username[data-v-644d2c15]{line-height:16px;font-size:16px}.contact-item .base-info .user-info[data-v-644d2c15]{margin-top:6px}.contact-item .base-info .user-info .info-item[data-v-644d2c15]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.dark .contact-item[data-v-644d2c15]{background-color:#101014bf}.dark .contact-item[data-v-644d2c15]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf} diff --git a/web/dist/assets/Following-31b77f3b.css b/web/dist/assets/Following-31b77f3b.css deleted file mode 100644 index 2096523b..00000000 --- a/web/dist/assets/Following-31b77f3b.css +++ /dev/null @@ -1 +0,0 @@ -.follow-item[data-v-64f1874c]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-64f1874c]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-64f1874c],.follow-item .username-wrap[data-v-64f1874c]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-64f1874c]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-64f1874c]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-64f1874c]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-64f1874c]{background-color:#101014bf}.dark .follow-item[data-v-64f1874c]:hover{background:#18181c}.main-content-wrap[data-v-1f0f223d]{padding:20px}.pagination-wrap[data-v-1f0f223d]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-1f0f223d],.dark .empty-wrap[data-v-1f0f223d],.dark .skeleton-wrap[data-v-1f0f223d]{background-color:#101014bf} diff --git a/web/dist/assets/Following-3e74fdde.js b/web/dist/assets/Following-3e74fdde.js new file mode 100644 index 00000000..224bb3bc --- /dev/null +++ b/web/dist/assets/Following-3e74fdde.js @@ -0,0 +1 @@ +import{_ as Y}from"./whisper-5fc7c61f.js";import{d as B,c as J,r as K,e as _,f as u,k as o,w as t,j as p,y as X,A as S,x as k,q as N,Y as U,bf as g,h as C,H as r,b as Z,F as M,u as ee}from"./@vue-a481fc63.js";import{u as oe,b as ne}from"./vue-router-e5a2430e.js";import{G as te,H as se,_ as O,Q as ae,R as le}from"./index-d9eb4c9e.js";import{b as ce}from"./formatTime-4210fcd1.js";import{i as ie,x as _e,z as re,u as ue}from"./@vicons-1a3558c6.js";import{T as pe,j as P,o as me,M as de,e as fe,O as ge,L as we,F as ve,Q as he,f as ke,g as ye,I as be,G as $e}from"./naive-ui-d8de3dda.js";import{_ as Fe}from"./post-skeleton-7039dc67.js";import{_ as ze}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as Te}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./moment-2ab8298d.js";const Ue={class:"follow-item"},qe={class:"nickname-wrap"},xe={class:"username-wrap"},Ie={class:"user-info"},Se={class:"info-item"},Ce={class:"info-item"},Me={class:"item-header-extra"},Pe=B({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(q,{emit:y}){const n=q,c=pe();oe();const s=e=>()=>C(P,null,{default:()=>C(e)}),b=()=>{c.success({title:"提示",content:"确定"+(n.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{n.contact.is_following?te({user_id:n.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),n.contact.is_following=!1}).catch(e=>{console.log(e)}):se({user_id:n.contact.user_id}).then(e=>{window.$message.success("关注成功"),n.contact.is_following=!0}).catch(e=>{console.log(e)})}})},w=J(()=>{let e=[{label:"私信",key:"whisper",icon:s(_e)}];return n.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:s(re)}):e.push({label:"关注",key:"follow",icon:s(ue)}),e}),m=e=>{switch(e){case"follow":case"unfollow":b();break;case"whisper":const a={id:n.contact.user_id,avatar:n.contact.avatar,username:n.contact.username,nickname:n.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};y("send-whisper",a);break}};return(e,a)=>{const d=me,f=K("router-link"),v=de,$=fe,F=ge,z=we;return _(),u("div",Ue,[o(z,{"content-indented":""},{avatar:t(()=>[o(d,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",qe,[o(f,{onClick:a[0]||(a[0]=X(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[S(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",xe," @"+k(e.contact.username),1),e.contact.is_following?(_(),N(v,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[S(" 已关注 ")]),_:1})):U("",!0),p("div",Ie,[p("span",Se," UID. "+k(e.contact.user_id),1),p("span",Ce,k(g(ce)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Me,[o(F,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:m},{default:t(()=>[o($,{quaternary:"",circle:""},{icon:t(()=>[o(g(P),null,{default:t(()=>[o(g(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Be=O(Pe,[["__scopeId","data-v-1fb7364a"]]),Ne={key:0,class:"skeleton-wrap"},Oe={key:1},Re={key:0,class:"empty-wrap"},De={key:0,class:"pagination-wrap"},Ve=B({__name:"Following",setup(q){const y=Te(),n=ne(),c=r(!1),s=r([]),b=n.query.n||"粉丝详情",w=n.query.s||"",m=r(n.query.t||"follows"),e=r(+n.query.p||1),a=r(20),d=r(0),f=r(!1),v=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),$=l=>{v.value=l,f.value=!0},F=()=>{f.value=!1},z=l=>{e.value=l,T()},R=l=>{m.value=l,T()},T=()=>{m.value==="follows"?D(w):m.value==="followings"&&V(w)},D=(l,h=!1)=>{s.value.length===0&&(c.value=!0),ae({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})},V=(l,h=!1)=>{s.value.length===0&&(c.value=!0),le({username:l,page:e.value,page_size:a.value}).then(i=>{c.value=!1,s.value=i.list||[],d.value=Math.ceil(i.pager.total_rows/a.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{c.value=!1})};return Z(()=>{T()}),(l,h)=>{const i=ze,x=ke,H=ye,W=Fe,j=be,A=Be,G=$e,L=Y,Q=ve,E=he;return _(),u(M,null,[p("div",null,[o(i,{title:g(b),back:!0},null,8,["title"]),o(Q,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(H,{type:"line",animated:"","default-value":m.value,"onUpdate:value":R},{default:t(()=>[o(x,{name:"follows",tab:"正在关注"}),o(x,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),c.value?(_(),u("div",Ne,[o(W,{num:a.value},null,8,["num"])])):(_(),u("div",Oe,[s.value.length===0?(_(),u("div",Re,[o(j,{size:"large",description:"暂无数据"})])):U("",!0),(_(!0),u(M,null,ee(s.value,I=>(_(),N(G,{key:I.user_id},{default:t(()=>[o(A,{contact:I,onSendWhisper:$},null,8,["contact"])]),_:2},1024))),128))])),o(L,{show:f.value,user:v.value,onSuccess:F},null,8,["show","user"])]),_:1})]),d.value>0?(_(),u("div",De,[o(E,{page:e.value,"onUpdate:page":z,"page-slot":g(y).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):U("",!0)],64)}}});const mo=O(Ve,[["__scopeId","data-v-0a10234f"]]);export{mo as default}; diff --git a/web/dist/assets/Following-6aa7d36c.css b/web/dist/assets/Following-6aa7d36c.css new file mode 100644 index 00000000..9509846e --- /dev/null +++ b/web/dist/assets/Following-6aa7d36c.css @@ -0,0 +1 @@ +.follow-item[data-v-1fb7364a]{display:border-box;width:100%;padding:12px 16px}.follow-item[data-v-1fb7364a]:hover{background:#f7f9f9}.follow-item .nickname-wrap[data-v-1fb7364a],.follow-item .username-wrap[data-v-1fb7364a]{line-height:16px;font-size:16px}.follow-item .top-tag[data-v-1fb7364a]{transform:scale(.75)}.follow-item .user-info .info-item[data-v-1fb7364a]{font-size:14px;line-height:14px;margin-right:8px;opacity:.75}.follow-item .item-header-extra[data-v-1fb7364a]{display:flex;align-items:center;opacity:.75}.dark .follow-item[data-v-1fb7364a]{background-color:#101014bf}.dark .follow-item[data-v-1fb7364a]:hover{background:#18181c}.main-content-wrap[data-v-0a10234f]{padding:20px}.pagination-wrap[data-v-0a10234f]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-0a10234f],.dark .empty-wrap[data-v-0a10234f],.dark .skeleton-wrap[data-v-0a10234f]{background-color:#101014bf} diff --git a/web/dist/assets/Following-be24e2b8.js b/web/dist/assets/Following-be24e2b8.js deleted file mode 100644 index 2e395681..00000000 --- a/web/dist/assets/Following-be24e2b8.js +++ /dev/null @@ -1 +0,0 @@ -import{d as B,c as L,r as E,e as l,f as r,k as o,w as t,j as p,y as G,A as q,x as k,q as N,Y as z,bf as v,h as x,H as f,b as Q,F as C,u as W}from"./@vue-a481fc63.js";import{u as Y,b as J}from"./vue-router-e5a2430e.js";import{H as K,I as X,_ as S,R as Z,S as ee}from"./index-757c547c.js";import{b as oe}from"./formatTime-4210fcd1.js";import{i as te,z as ne,u as se}from"./@vicons-1a3558c6.js";import{T as ae,j as M,o as le,M as ce,e as _e,O as ie,L as ue,F as re,Q as pe,f as me,g as de,I as fe,G as ge}from"./naive-ui-d8de3dda.js";import{_ as ve}from"./post-skeleton-c82f8a59.js";import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as he}from"./vuex-44de225f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./moment-2ab8298d.js";const ke={class:"follow-item"},ye={class:"nickname-wrap"},be={class:"username-wrap"},Fe={class:"user-info"},$e={class:"info-item"},ze={class:"info-item"},Te={class:"item-header-extra"},Ie=B({__name:"follow-item",props:{contact:{}},setup(T){const s=T,m=ae();Y();const n=e=>()=>x(M,null,{default:()=>x(e)}),c=()=>{m.success({title:"提示",content:"确定"+(s.contact.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.contact.is_following?K({user_id:s.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),s.contact.is_following=!1}).catch(e=>{console.log(e)}):X({user_id:s.contact.user_id}).then(e=>{window.$message.success("关注成功"),s.contact.is_following=!0}).catch(e=>{console.log(e)})}})},y=e=>{switch(e){case"follow":case"unfollow":c();break}},w=L(()=>{let e=[];return s.contact.is_following?e.push({label:"取消关注",key:"unfollow",icon:n(ne)}):e.push({label:"关注",key:"follow",icon:n(se)}),e});return(e,i)=>{const u=le,d=E("router-link"),b=ce,F=_e,g=ie,$=ue;return l(),r("div",ke,[o($,{"content-indented":""},{avatar:t(()=>[o(u,{size:54,src:e.contact.avatar},null,8,["src"])]),header:t(()=>[p("span",ye,[o(d,{onClick:i[0]||(i[0]=G(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:t(()=>[q(k(e.contact.nickname),1)]),_:1},8,["to"])]),p("span",be," @"+k(e.contact.username),1),e.contact.is_following?(l(),N(b,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:t(()=>[q(" 已关注 ")]),_:1})):z("",!0),p("div",Fe,[p("span",$e," UID. "+k(e.contact.user_id),1),p("span",ze,k(v(oe)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":t(()=>[p("div",Te,[o(g,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:y},{default:t(()=>[o(F,{quaternary:"",circle:""},{icon:t(()=>[o(v(M),null,{default:t(()=>[o(v(te))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}});const Ue=S(Ie,[["__scopeId","data-v-64f1874c"]]),qe={key:0,class:"skeleton-wrap"},xe={key:1},Ce={key:0,class:"empty-wrap"},Me={key:0,class:"pagination-wrap"},Be=B({__name:"Following",setup(T){const s=he(),m=J(),n=f(!1),c=f([]),y=m.query.n||"粉丝详情",w=m.query.s||"",e=f(m.query.t||"follows"),i=f(+m.query.p||1),u=f(20),d=f(0),b=_=>{i.value=_,g()},F=_=>{e.value=_,g()},g=()=>{e.value==="follows"?$(w):e.value==="followings"&&D(w)},$=(_,h=!1)=>{c.value.length===0&&(n.value=!0),Z({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})},D=(_,h=!1)=>{c.value.length===0&&(n.value=!0),ee({username:_,page:i.value,page_size:u.value}).then(a=>{n.value=!1,c.value=a.list||[],d.value=Math.ceil(a.pager.total_rows/u.value),h&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(a=>{n.value=!1})};return Q(()=>{g()}),(_,h)=>{const a=we,I=me,O=de,P=ve,R=fe,V=Ue,H=ge,j=re,A=pe;return l(),r(C,null,[p("div",null,[o(a,{title:v(y),back:!0},null,8,["title"]),o(j,{class:"main-content-wrap",bordered:""},{default:t(()=>[o(O,{type:"line",animated:"","default-value":e.value,"onUpdate:value":F},{default:t(()=>[o(I,{name:"follows",tab:"正在关注"}),o(I,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),n.value?(l(),r("div",qe,[o(P,{num:u.value},null,8,["num"])])):(l(),r("div",xe,[c.value.length===0?(l(),r("div",Ce,[o(R,{size:"large",description:"暂无数据"})])):z("",!0),(l(!0),r(C,null,W(c.value,U=>(l(),N(H,{key:U.user_id},{default:t(()=>[o(V,{contact:U},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),d.value>0?(l(),r("div",Me,[o(A,{page:i.value,"onUpdate:page":b,"page-slot":v(s).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):z("",!0)],64)}}});const ao=S(Be,[["__scopeId","data-v-1f0f223d"]]);export{ao as default}; diff --git a/web/dist/assets/Home-7d19114d.css b/web/dist/assets/Home-2f8b5a0d.css similarity index 62% rename from web/dist/assets/Home-7d19114d.css rename to web/dist/assets/Home-2f8b5a0d.css index 1fe6c2b4..de87f753 100644 --- a/web/dist/assets/Home-7d19114d.css +++ b/web/dist/assets/Home-2f8b5a0d.css @@ -1 +1 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-26704746]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-26704746]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-26704746]{opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-26704746]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-26704746]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-26704746]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-26704746]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-26704746]{margin:20px}.load-more .load-more-wrap[data-v-26704746]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-26704746]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-26704746],.dark .pagination-wrap[data-v-26704746],.dark .empty-wrap[data-v-26704746],.dark .skeleton-wrap[data-v-26704746]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-26704746]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-26704746]{color:#63e2b7;opacity:.8} +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-df7db3f0]{color:#18a058;opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item[data-v-df7db3f0]{cursor:pointer}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-avatar[data-v-df7db3f0]{opacity:.8}.tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-df7db3f0]{color:#18a058;opacity:.8}.tiny-slide-bar[data-v-df7db3f0]{margin-top:-30px;margin-bottom:-30px}.tiny-slide-bar .slide-bar-item[data-v-df7db3f0]{min-height:170px;width:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:8px}.tiny-slide-bar .slide-bar-item .slide-bar-item-title[data-v-df7db3f0]{justify-content:center;font-size:12px;margin-top:4px;height:40px}.load-more[data-v-df7db3f0]{margin:20px}.load-more .load-more-wrap[data-v-df7db3f0]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-df7db3f0]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-df7db3f0],.dark .pagination-wrap[data-v-df7db3f0],.dark .empty-wrap[data-v-df7db3f0],.dark .skeleton-wrap[data-v-df7db3f0]{background-color:#101014bf}.dark .tiny-slide-bar .tiny-slide-bar__list>div.tiny-slide-bar__select .slide-bar-item .slide-bar-item-title[data-v-df7db3f0]{color:#63e2b7;opacity:.8}.dark .tiny-slide-bar .tiny-slide-bar__list>div:hover .slide-bar-item .slide-bar-item-title[data-v-df7db3f0]{color:#63e2b7;opacity:.8} diff --git a/web/dist/assets/Home-d28a50f3.js b/web/dist/assets/Home-d28a50f3.js deleted file mode 100644 index 78f5417e..00000000 --- a/web/dist/assets/Home-d28a50f3.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Ue,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js";import{_ as Ee}from"./post-skeleton-c82f8a59.js";import{d as _e,H as i,c as ce,b as ge,e as c,f as y,bf as V,j as C,k as a,w as n,q as G,Y as b,y as ve,A as M,x as X,F as pe,u as de,E as Te}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as Ne,a as xe,c as Ge,b as Re,d as Oe,e as Pe,_ as Fe}from"./index-757c547c.js";import{p as Le}from"./content-d5264b98.js";import{V as U,P as H}from"./IEnum-5453a777.js";import{I as Ye,V as qe,A as Me,d as Se,E as Ke}from"./@vicons-1a3558c6.js";import{o as he,v as Qe,j as We,e as je,w as He,x as Ze,y as Je,z as Xe,A as $e,B as et,C as tt,a as we,D as at,E as st,F as ot,G as nt,l as lt,H as it,I as rt,k as ut}from"./naive-ui-d8de3dda.js";import{_ as ct}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{b as pt,u as dt}from"./vue-router-e5a2430e.js";import{W as vt}from"./v3-infinite-loading-2c58ec2f.js";import{S as mt}from"./@opentiny-d73a2d67.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 _t=Z=>{const O=new FileReader,z=r=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(r),E=()=>{const r=new Uint8Array(O.result).subarray(0,4);let T="";for(let _=0;_{O.onloadend=()=>{const _=Z.type;r(_===""||_==="application/octet-stream"?E():z(_))},O.readAsArrayBuffer(Z.slice(0,4))})},gt={key:0,class:"compose-wrap"},ft={class:"compose-line"},ht={class:"compose-user"},wt={class:"compose-line compose-options"},yt={class:"attachment"},At={class:"submit-wrap"},kt={class:"attachment-list-wrap"},bt={key:0,class:"attachment-price-wrap"},Ct=C("span",null," 附件价格¥",-1),zt={key:0,class:"eye-wrap"},It={key:1,class:"link-wrap"},Dt={key:1,class:"compose-wrap"},Bt=C("div",{class:"login-wrap"},[C("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ut={key:0,class:"login-only-wrap"},Vt={key:1,class:"login-wrap"},Et=_e({__name:"compose",emits:["post-success"],setup(Z,{emit:O}){const z=fe(),E=i([]),r=i(!1),T=i(!1),_=i(!1),R=i(!1),g=i(""),A=i([]),x=i(),F=i(0),f=i("public/image"),u=i([]),h=i([]),B=i([]),I=i([]),L=i(U.PUBLIC),P=i(U.PUBLIC),Y="true".toLowerCase()==="true",S=+"400",K=i("true".toLowerCase()==="true"),q=i("true".toLowerCase()==="true"),J=i("true".toLowerCase()==="true"),$=i("false".toLowerCase()==="true"),W=i("true".toLowerCase()==="true"),ee="/v1/attachment",l=i(),d=ce(()=>{let e=[{value:U.PUBLIC,label:"公开"},{value:U.PRIVATE,label:"私密"},{value:U.Following,label:"关注可见"}];return Y&&e.push({value:U.FRIEND,label:"好友可见"}),e}),N=()=>{_.value=!_.value,_.value&&R.value&&(R.value=!1)},k=()=>{R.value=!R.value,R.value&&_.value&&(_.value=!1)},D=me.debounce(e=>{Ne({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),E.value=o,r.value=!1}).catch(t=>{r.value=!1})},200),te=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),E.value=o,r.value=!1}).catch(t=>{r.value=!1})},200),ae=(e,t)=>{r.value||(r.value=!0,t==="@"?D(e):te(e))},se=e=>{e.length>S?g.value=e.substring(0,S):g.value=e},j=e=>{f.value=e},oe=e=>{for(let v=0;v30&&(e[v].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}u.value=e},ne=async e=>{var t,o,s,v,p;return f.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):f.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((v=e.file.file)==null?void 0:v.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await _t(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((p=e.file.file)==null?void 0:p.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(f.value==="public/image"&&h.value.push({id:e.id,content:s.data.content}),f.value==="public/video"&&B.value.push({id:e.id,content:s.data.content}),f.value==="attachment"&&I.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},ie=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let v=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(p=>{v+=":"+p}),window.$message.error(v)}}catch{window.$message.error("上传失败")}},re=({file:e})=>{let t=h.value.findIndex(o=>o.id===e.id);t>-1&&h.value.splice(t,1),t=B.value.findIndex(o=>o.id===e.id),t>-1&&B.value.splice(t,1),t=I.value.findIndex(o=>o.id===e.id),t>-1&&I.value.splice(t,1)},ue=()=>{if(g.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Le(g.value);const o=[];let s=100;o.push({content:g.value,type:H.TEXT,sort:s}),h.value.map(p=>{s++,o.push({content:p.content,type:H.IMAGEURL,sort:s})}),B.value.map(p=>{s++,o.push({content:p.content,type:H.VIDEOURL,sort:s})}),I.value.map(p=>{s++,o.push({content:p.content,type:H.ATTACHMENT,sort:s})}),A.value.length>0&&A.value.map(p=>{s++,o.push({content:p,type:H.LINKURL,sort:s})}),T.value=!0;let v=L.value;v==U.Following&&(v=U.PUBLIC),Ge({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+F.value*100,visibility:v}).then(p=>{var Q;window.$message.success("发布成功"),T.value=!1,O("post-success",p),_.value=!1,R.value=!1,(Q=x.value)==null||Q.clear(),u.value=[],g.value="",A.value=[],h.value=[],B.value=[],I.value=[],L.value=P.value}).catch(p=>{T.value=!1})},w=e=>{z.commit("triggerAuth",!0),z.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();Y&&e==="friend"?P.value=U.FRIEND:e==="following"?P.value=U.Following:e==="public"?P.value=U.PUBLIC:P.value=U.PRIVATE,L.value=P.value,l.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(e,t)=>{const o=he,s=Qe,v=We,p=je,Q=He,ye=Ze,Ae=Je,ke=Xe,be=$e,Ce=et,ze=tt,Ie=we,De=at,Be=st;return c(),y("div",null,[V(z).state.userInfo.id>0?(c(),y("div",gt,[C("div",ft,[C("div",ht,[a(o,{round:"",size:30,src:V(z).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:r.value,value:g.value,prefix:["@","#"],options:E.value,onSearch:ae,"onUpdate:value":se,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:x,abstract:"","list-type":"image",multiple:!0,max:9,action:ee,headers:{Authorization:l.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:ne,onFinish:le,onError:ie,onRemove:re,"onUpdate:fileList":oe},{default:n(()=>[C("div",wt,[C("div",yt,[a(Q,{abstract:""},{default:n(({handleClick:m})=>[a(p,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{j("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[a(v,{size:"20",color:"var(--primary-color)"},{default:n(()=>[a(V(Ye))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),q.value?(c(),G(Q,{key:0,abstract:""},{default:n(({handleClick:m})=>[a(p,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{j("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[a(v,{size:"20",color:"var(--primary-color)"},{default:n(()=>[a(V(qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),J.value?(c(),G(Q,{key:1,abstract:""},{default:n(({handleClick:m})=>[a(p,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{j("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[a(v,{size:"20",color:"var(--primary-color)"},{default:n(()=>[a(V(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),a(p,{quaternary:"",circle:"",type:"primary",onClick:ve(N,["stop"])},{icon:n(()=>[a(v,{size:"20",color:"var(--primary-color)"},{default:n(()=>[a(V(Se))]),_:1})]),_:1},8,["onClick"]),W.value?(c(),G(p,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(k,["stop"])},{icon:n(()=>[a(v,{size:"20",color:"var(--primary-color)"},{default:n(()=>[a(V(Ke))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),C("div",At,[a(Ae,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/V(S)*100},null,8,["percentage"])]),default:n(()=>[M(" "+X(g.value.length)+" / "+X(V(S)),1)]),_:1}),a(p,{loading:T.value,onClick:ue,type:"primary",secondary:"",round:""},{default:n(()=>[M(" 发布 ")]),_:1},8,["loading"])])]),C("div",kt,[a(ke),I.value.length>0?(c(),y("div",bt,[$.value?(c(),G(be,{key:0,value:F.value,"onUpdate:value":t[0]||(t[0]=m=>F.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:n(()=>[Ct]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),R.value?(c(),y("div",zt,[a(De,{value:L.value,"onUpdate:value":t[1]||(t[1]=m=>L.value=m),name:"radiogroup"},{default:n(()=>[a(Ie,null,{default:n(()=>[(c(!0),y(pe,null,de(d.value,m=>(c(),G(ze,{key:m.value,value:m.value,label:m.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),_.value?(c(),y("div",It,[a(Be,{value:A.value,"onUpdate:value":t[2]||(t[2]=m=>A.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":n(()=>[M(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(c(),y("div",Dt,[Bt,K.value?b("",!0):(c(),y("div",Ut,[a(p,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=m=>w("signin"))},{default:n(()=>[M(" 登录 ")]),_:1})])),K.value?(c(),y("div",Vt,[a(p,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=m=>w("signin"))},{default:n(()=>[M(" 登录 ")]),_:1}),a(p,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=m=>w("signup"))},{default:n(()=>[M(" 注册 ")]),_:1})])):b("",!0)]))])}}});const Tt="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=",Nt={class:"slide-bar-item"},xt={class:"slide-bar-item-title slide-bar-user-link"},Gt={key:1,class:"skeleton-wrap"},Rt={key:0,class:"empty-wrap"},Ot={key:1},Pt={key:2},Ft={class:"load-more-wrap"},Lt={class:"load-more-spinner"},Yt=_e({__name:"Home",setup(Z){const O="true".toLowerCase()==="true",z="true".toLowerCase()==="true",E=fe(),r=pt(),T=dt(),_=i(9),R=i(8),g=i([{title:"最新动态",style:1,username:"",avatar:Tt,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},{title:"",style:1,username:"",avatar:"",show:!0}]),A=i(!1),x=i(!1),F=i(1),f=i(""),u=i([]),h=i(1),B=i(20),I=i(0),L=ce(()=>{let l="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?l="#"+decodeURIComponent(r.query.q):l="搜索: "+decodeURIComponent(r.query.q)),l}),P=ce(()=>O&&z&&E.state.desktopModelShow&&E.state.userInfo.id>0),Y=()=>{A.value=!1,x.value=!1,u.value=[],h.value=1,I.value=0},S=(l,d)=>{switch(Y(),F.value=l.style,l.style){case 1:q();break;case 2:q();break;case 21:f.value=l.username,J();break}g.value[d].show=!1},K=()=>{g.value=g.value.slice(0,1),!(!O||!z||E.state.userInfo.id===0)&&Re({page:1,page_size:50}).then(l=>{var d=0;const N=l.list||[];let k=[];for(;d0&&(g.value=g.value.concat(k))}).catch(l=>{console.log(l)})},q=()=>{A.value=!0,Oe({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:h.value,page_size:B.value}).then(l=>{A.value=!1,l.list.length===0&&(x.value=!0),h.value>1?u.value=u.value.concat(l.list):(u.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/B.value)}).catch(l=>{A.value=!1,h.value>1&&h.value--})},J=()=>{A.value=!0,Pe({username:f.value,style:"post",page:h.value,page_size:B.value}).then(l=>{A.value=!1,l.list.length===0&&(x.value=!0),h.value>1?u.value=u.value.concat(l.list):(u.value=l.list||[],window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/B.value)}).catch(l=>{u.value=[],h.value>1&&h.value--,A.value=!1})},$=l=>{if(F.value!=1){T.push({name:"post",query:{id:l.id}});return}let d=[],N=u.value.length;N==B.value&&N--;for(var k=0;k{switch(F.value){case 1:q();break;case 2:q();break;case 21:J();break}},ee=()=>{h.value{Y(),K(),q()}),Te(()=>({path:r.path,query:r.query,refresh:E.state.refresh}),(l,d)=>{if(l.refresh!==d.refresh){Y(),setTimeout(()=>{K(),W()},0);return}d.path!=="/post"&&l.path==="/"&&(Y(),setTimeout(()=>{K(),W()},0))}),(l,d)=>{const N=ct,k=Et,D=nt,te=he,ae=lt,se=it,j=Ee,oe=rt,ne=Ue,le=Ve,ie=ot,re=ut,ue=we;return c(),y("div",null,[a(N,{title:L.value},null,8,["title"]),a(ie,{class:"main-content-wrap",bordered:""},{default:n(()=>[a(D,null,{default:n(()=>[a(k,{onPostSuccess:$})]),_:1}),P.value?(c(),G(D,{key:0},{default:n(()=>[a(V(mt),{modelValue:g.value,"onUpdate:modelValue":d[0]||(d[0]=w=>g.value=w),"wheel-blocks":R.value,"init-blocks":_.value,onClick:S,tag:"div","sub-tag":"div"},{default:n(w=>[C("div",Nt,[a(ae,{value:"1",offset:[-4,48],dot:"",show:w.slotData.show},{default:n(()=>[a(te,{round:"",size:48,src:w.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),C("div",xt,[a(se,{"line-clamp":2},{default:n(()=>[M(X(w.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),A.value&&u.value.length===0?(c(),y("div",Gt,[a(j,{num:B.value},null,8,["num"])])):b("",!0),C("div",null,[u.value.length===0?(c(),y("div",Rt,[a(oe,{size:"large",description:"暂无数据"})])):b("",!0),V(E).state.desktopModelShow?(c(),y("div",Ot,[(c(!0),y(pe,null,de(u.value,w=>(c(),G(D,{key:w.id},{default:n(()=>[a(ne,{post:w},null,8,["post"])]),_:2},1024))),128))])):(c(),y("div",Pt,[(c(!0),y(pe,null,de(u.value,w=>(c(),G(D,{key:w.id},{default:n(()=>[a(le,{post:w},null,8,["post"])]),_:2},1024))),128))]))])]),_:1}),I.value>0?(c(),G(ue,{key:0,justify:"center"},{default:n(()=>[a(V(vt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:d[1]||(d[1]=w=>ee())},{spinner:n(()=>[C("div",Ft,[x.value?b("",!0):(c(),G(re,{key:0,size:14})),C("span",Lt,X(x.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Ia=Fe(Yt,[["__scopeId","data-v-26704746"]]);export{Ia as default}; diff --git a/web/dist/assets/Home-fc1d3b7f.js b/web/dist/assets/Home-fc1d3b7f.js new file mode 100644 index 00000000..8774221c --- /dev/null +++ b/web/dist/assets/Home-fc1d3b7f.js @@ -0,0 +1 @@ +import{_ as Ue}from"./whisper-5fc7c61f.js";import{_ as Ve,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-a10065a5.js";import{_ as Te}from"./post-skeleton-7039dc67.js";import{d as _e,H as n,c as ce,b as ge,e as p,f as w,bf as U,j as C,k as a,w as i,q as x,Y as b,y as ve,A as Y,x as $,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as Ge,b as Oe,d as Pe,e as Fe,_ as Le}from"./index-d9eb4c9e.js";import{p as Ye}from"./content-218c067c.js";import{V as B,P as Z}from"./IEnum-5453a777.js";import{I as Se,V as qe,A as Me,d as Ke,E as We}from"./@vicons-1a3558c6.js";import{o as he,v as Qe,j as je,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}from"./@opentiny-d73a2d67.js";import"./formatTime-4210fcd1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 gt=J=>{const P=new FileReader,z=u=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(u),V=()=>{const u=new Uint8Array(P.result).subarray(0,4);let E="";for(let _=0;_{P.onloadend=()=>{const _=J.type;u(_===""||_==="application/octet-stream"?V():z(_))},P.readAsArrayBuffer(J.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},At={class:"attachment"},kt={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=C("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Ut=C("div",{class:"login-wrap"},[C("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Vt={key:0,class:"login-only-wrap"},Et={key:1,class:"login-wrap"},Tt=_e({__name:"compose",emits:["post-success"],setup(J,{emit:P}){const z=fe(),V=n([]),u=n(!1),E=n(!1),_=n(!1),R=n(!1),g=n(""),A=n([]),N=n(),F=n(0),f=n("public/image"),c=n([]),h=n([]),D=n([]),I=n([]),G=n(B.PUBLIC),O=n(B.PUBLIC),K="true".toLowerCase()==="true",S=+"400",X=n("true".toLowerCase()==="true"),ee=n("true".toLowerCase()==="true"),q=n("true".toLowerCase()==="true"),te=n("false".toLowerCase()==="true"),W=n("true".toLowerCase()==="true"),L="/v1/attachment",Q=n(),ae=ce(()=>{let e=[{value:B.PUBLIC,label:"公开"},{value:B.PRIVATE,label:"私密"},{value:B.Following,label:"关注可见"}];return K&&e.push({value:B.FRIEND,label:"好友可见"}),e}),j=()=>{_.value=!_.value,_.value&&R.value&&(R.value=!1)},se=()=>{R.value=!R.value,R.value&&_.value&&(_.value=!1)},l=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),V.value=o,u.value=!1}).catch(t=>{u.value=!1})},200),v=me.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),V.value=o,u.value=!1}).catch(t=>{u.value=!1})},200),T=(e,t)=>{u.value||(u.value=!0,t==="@"?l(e):v(e))},k=e=>{e.length>S?g.value=e.substring(0,S):g.value=e},y=e=>{f.value=e},oe=e=>{for(let r=0;r30&&(e[r].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}c.value=e},ne=async e=>{var t,o,s,r,d;return f.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):f.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((r=e.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((d=e.file.file)==null?void 0:d.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(f.value==="public/image"&&h.value.push({id:e.id,content:s.data.content}),f.value==="public/video"&&D.value.push({id:e.id,content:s.data.content}),f.value==="attachment"&&I.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},ie=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let r=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(d=>{r+=":"+d}),window.$message.error(r)}}catch{window.$message.error("上传失败")}},re=({file:e})=>{let t=h.value.findIndex(o=>o.id===e.id);t>-1&&h.value.splice(t,1),t=D.value.findIndex(o=>o.id===e.id),t>-1&&D.value.splice(t,1),t=I.value.findIndex(o=>o.id===e.id),t>-1&&I.value.splice(t,1)},ue=()=>{if(g.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Ye(g.value);const o=[];let s=100;o.push({content:g.value,type:Z.TEXT,sort:s}),h.value.map(d=>{s++,o.push({content:d.content,type:Z.IMAGEURL,sort:s})}),D.value.map(d=>{s++,o.push({content:d.content,type:Z.VIDEOURL,sort:s})}),I.value.map(d=>{s++,o.push({content:d.content,type:Z.ATTACHMENT,sort:s})}),A.value.length>0&&A.value.map(d=>{s++,o.push({content:d,type:Z.LINKURL,sort:s})}),E.value=!0;let r=G.value;r==B.Following&&(r=B.PUBLIC),Ge({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+F.value*100,visibility:r}).then(d=>{var M;window.$message.success("发布成功"),E.value=!1,P("post-success",d),_.value=!1,R.value=!1,(M=N.value)==null||M.clear(),c.value=[],g.value="",A.value=[],h.value=[],D.value=[],I.value=[],G.value=O.value}).catch(d=>{E.value=!1})},H=e=>{z.commit("triggerAuth",!0),z.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();K&&e==="friend"?O.value=B.FRIEND:e==="following"?O.value=B.Following:e==="public"?O.value=B.PUBLIC:O.value=B.PRIVATE,G.value=O.value,Q.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(e,t)=>{const o=he,s=Qe,r=je,d=He,M=Ze,ye=Je,Ae=Xe,ke=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return p(),w("div",null,[U(z).state.userInfo.id>0?(p(),w("div",ft,[C("div",ht,[C("div",wt,[a(o,{round:"",size:30,src:U(z).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:u.value,value:g.value,prefix:["@","#"],options:V.value,onSearch:T,"onUpdate:value":k,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:N,abstract:"","list-type":"image",multiple:!0,max:9,action:L,headers:{Authorization:Q.value},data:{type:f.value},"file-list":c.value,onBeforeUpload:ne,onFinish:le,onError:ie,onRemove:re,"onUpdate:fileList":oe},{default:i(()=>[C("div",yt,[C("div",At,[a(M,{abstract:""},{default:i(({handleClick:m})=>[a(d,{disabled:c.value.length>0&&f.value==="public/video"||c.value.length===9,onClick:()=>{y("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),ee.value?(p(),x(M,{key:0,abstract:""},{default:i(({handleClick:m})=>[a(d,{disabled:c.value.length>0&&f.value!=="public/video"||c.value.length===9,onClick:()=>{y("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(qe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),q.value?(p(),x(M,{key:1,abstract:""},{default:i(({handleClick:m})=>[a(d,{disabled:c.value.length>0&&f.value==="public/video"||c.value.length===9,onClick:()=>{y("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:i(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):b("",!0),a(d,{quaternary:"",circle:"",type:"primary",onClick:ve(j,["stop"])},{icon:i(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(Ke))]),_:1})]),_:1},8,["onClick"]),W.value?(p(),x(d,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(se,["stop"])},{icon:i(()=>[a(r,{size:"20",color:"var(--primary-color)"},{default:i(()=>[a(U(We))]),_:1})]),_:1},8,["onClick"])):b("",!0)]),C("div",kt,[a(Ae,{trigger:"hover",placement:"bottom"},{trigger:i(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/U(S)*100},null,8,["percentage"])]),default:i(()=>[Y(" "+$(g.value.length)+" / "+$(U(S)),1)]),_:1}),a(d,{loading:E.value,onClick:ue,type:"primary",secondary:"",round:""},{default:i(()=>[Y(" 发布 ")]),_:1},8,["loading"])])]),C("div",bt,[a(ke),I.value.length>0?(p(),w("div",Ct,[te.value?(p(),x(be,{key:0,value:F.value,"onUpdate:value":t[0]||(t[0]=m=>F.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:i(()=>[zt]),_:1},8,["value"])):b("",!0)])):b("",!0)])]),_:1},8,["headers","data","file-list"]),R.value?(p(),w("div",It,[a(De,{value:G.value,"onUpdate:value":t[1]||(t[1]=m=>G.value=m),name:"radiogroup"},{default:i(()=>[a(Ie,null,{default:i(()=>[(p(!0),w(pe,null,de(ae.value,m=>(p(),x(ze,{key:m.value,value:m.value,label:m.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):b("",!0),_.value?(p(),w("div",Dt,[a(Be,{value:A.value,"onUpdate:value":t[2]||(t[2]=m=>A.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":i(()=>[Y(" 创建链接 ")]),_:1},8,["value"])])):b("",!0)])):(p(),w("div",Bt,[Ut,X.value?b("",!0):(p(),w("div",Vt,[a(d,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=m=>H("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1})])),X.value?(p(),w("div",Et,[a(d,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=m=>H("signin"))},{default:i(()=>[Y(" 登录 ")]),_:1}),a(d,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=m=>H("signup"))},{default:i(()=>[Y(" 注册 ")]),_:1})])):b("",!0)]))])}}});const Nt="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=",xt={class:"slide-bar-item"},Rt={class:"slide-bar-item-title slide-bar-user-link"},Gt={key:1,class:"skeleton-wrap"},Ot={key:0,class:"empty-wrap"},Pt={key:1},Ft={key:2},Lt={class:"load-more-wrap"},Yt={class:"load-more-spinner"},St=_e({__name:"Home",setup(J){const P="true".toLowerCase()==="true",z="true".toLowerCase()==="true",V=fe(),u=dt(),E=vt(),_=n(9),R=n(8),g=n([{title:"最新动态",style:1,username:"",avatar:Nt,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},{title:"",style:1,username:"",avatar:"",show:!0}]),A=n(!1),N=n(!1),F=n(1),f=n(""),c=n([]),h=n(1),D=n(20),I=n(0),G=n(!1),O=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),K=l=>{O.value=l,G.value=!0},S=()=>{G.value=!1},X=ce(()=>{let l="泡泡广场";return u.query&&u.query.q&&(u.query.t&&u.query.t==="tag"?l="#"+decodeURIComponent(u.query.q):l="搜索: "+decodeURIComponent(u.query.q)),l}),ee=ce(()=>P&&z&&V.state.desktopModelShow&&V.state.userInfo.id>0),q=()=>{A.value=!1,N.value=!1,c.value=[],h.value=1,I.value=0},te=(l,v)=>{switch(q(),F.value=l.style,l.style){case 1:L();break;case 2:L();break;case 21:f.value=l.username,Q();break}g.value[v].show=!1},W=()=>{g.value=g.value.slice(0,1),!(!P||!z||V.state.userInfo.id===0)&&Oe({page:1,page_size:50}).then(l=>{var v=0;const T=l.list||[];let k=[];for(;v0&&(g.value=g.value.concat(k))}).catch(l=>{console.log(l)})},L=()=>{A.value=!0,Pe({query:u.query.q?decodeURIComponent(u.query.q):null,type:u.query.t,page:h.value,page_size:D.value}).then(l=>{A.value=!1,l.list.length===0&&(N.value=!0),h.value>1?c.value=c.value.concat(l.list):(c.value=l.list,window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/D.value)}).catch(l=>{A.value=!1,h.value>1&&h.value--})},Q=()=>{A.value=!0,Fe({username:f.value,style:"post",page:h.value,page_size:D.value}).then(l=>{A.value=!1,l.list.length===0&&(N.value=!0),h.value>1?c.value=c.value.concat(l.list):(c.value=l.list||[],window.scrollTo(0,0)),I.value=Math.ceil(l.pager.total_rows/D.value)}).catch(l=>{c.value=[],h.value>1&&h.value--,A.value=!1})},ae=l=>{if(F.value!=1){E.push({name:"post",query:{id:l.id}});return}let v=[],T=c.value.length;T==D.value&&T--;for(var k=0;k{switch(F.value){case 1:L();break;case 2:L();break;case 21:Q();break}},se=()=>{h.value{q(),W(),L()}),Ne(()=>({path:u.path,query:u.query,refresh:V.state.refresh}),(l,v)=>{if(l.refresh!==v.refresh){q(),setTimeout(()=>{W(),j()},0);return}v.path!=="/post"&&l.path==="/"&&(q(),setTimeout(()=>{W(),j()},0))}),(l,v)=>{const T=pt,k=Tt,y=lt,oe=he,ne=it,le=rt,ie=Te,re=ut,ue=Ve,H=Ee,e=Ue,t=nt,o=ct,s=we;return p(),w("div",null,[a(T,{title:X.value},null,8,["title"]),a(t,{class:"main-content-wrap",bordered:""},{default:i(()=>[a(y,null,{default:i(()=>[a(k,{onPostSuccess:ae})]),_:1}),ee.value?(p(),x(y,{key:0},{default:i(()=>[a(U(_t),{modelValue:g.value,"onUpdate:modelValue":v[0]||(v[0]=r=>g.value=r),"wheel-blocks":R.value,"init-blocks":_.value,onClick:te,tag:"div","sub-tag":"div"},{default:i(r=>[C("div",xt,[a(ne,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:i(()=>[a(oe,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),C("div",Rt,[a(le,{"line-clamp":2},{default:i(()=>[Y($(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):b("",!0),A.value&&c.value.length===0?(p(),w("div",Gt,[a(ie,{num:D.value},null,8,["num"])])):b("",!0),C("div",null,[c.value.length===0?(p(),w("div",Ot,[a(re,{size:"large",description:"暂无数据"})])):b("",!0),U(V).state.desktopModelShow?(p(),w("div",Pt,[(p(!0),w(pe,null,de(c.value,r=>(p(),x(y,{key:r.id},{default:i(()=>[a(ue,{post:r,onSendWhisper:K},null,8,["post"])]),_:2},1024))),128))])):(p(),w("div",Ft,[(p(!0),w(pe,null,de(c.value,r=>(p(),x(y,{key:r.id},{default:i(()=>[a(H,{post:r,onSendWhisper:K},null,8,["post"])]),_:2},1024))),128))]))]),a(e,{show:G.value,user:O.value,onSuccess:S},null,8,["show","user"])]),_:1}),I.value>0?(p(),x(s,{key:0,justify:"center"},{default:i(()=>[a(U(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:v[1]||(v[1]=r=>se())},{spinner:i(()=>[C("div",Lt,[N.value?b("",!0):(p(),x(o,{key:0,size:14})),C("span",Yt,$(N.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)])}}});const Ba=Le(St,[["__scopeId","data-v-df7db3f0"]]);export{Ba as default}; diff --git a/web/dist/assets/Messages-1e4acdf3.css b/web/dist/assets/Messages-1e4acdf3.css deleted file mode 100644 index 1813ff11..00000000 --- a/web/dist/assets/Messages-1e4acdf3.css +++ /dev/null @@ -1 +0,0 @@ -.message-item[data-v-b2ee6429]{padding:16px}.message-item.unread[data-v-b2ee6429]{background:#fcfffc}.message-item .sender-wrap[data-v-b2ee6429]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-b2ee6429]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-b2ee6429]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-b2ee6429]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-b2ee6429]{margin-left:6px}.message-item .brief-wrap[data-v-b2ee6429]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-b2ee6429],.message-item .brief-wrap .whisper-content-wrap[data-v-b2ee6429],.message-item .brief-wrap .requesting-friend-wrap[data-v-b2ee6429]{display:flex;width:100%}.message-item .view-link[data-v-b2ee6429]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-b2ee6429]{margin-left:8px;align-items:center}.dark .message-item[data-v-b2ee6429]{background-color:#101014bf}.dark .message-item.unread[data-v-b2ee6429]{background:#0f180b}.dark .message-item .brief-wrap[data-v-b2ee6429]{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}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-3c6066fb.css b/web/dist/assets/Messages-3c6066fb.css new file mode 100644 index 00000000..5556a0f5 --- /dev/null +++ b/web/dist/assets/Messages-3c6066fb.css @@ -0,0 +1 @@ +.message-item[data-v-2e510758]{padding:16px}.message-item.unread[data-v-2e510758]{background:#fcfffc}.message-item .sender-wrap[data-v-2e510758]{display:flex;align-items:center}.message-item .sender-wrap .top-tag[data-v-2e510758]{transform:scale(.75)}.message-item .sender-wrap .username[data-v-2e510758]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-2e510758]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-2e510758]{margin-left:6px}.message-item .brief-wrap[data-v-2e510758]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-2e510758],.message-item .brief-wrap .whisper-content-wrap[data-v-2e510758],.message-item .brief-wrap .requesting-friend-wrap[data-v-2e510758]{display:flex;width:100%}.message-item .view-link[data-v-2e510758]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-2e510758]{margin-left:8px;align-items:center}.dark .message-item[data-v-2e510758]{background-color:#101014bf}.dark .message-item.unread[data-v-2e510758]{background:#0f180b}.dark .message-item .brief-wrap[data-v-2e510758]{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}.pagination-wrap[data-v-b40dcbaf]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-b40dcbaf],.dark .messages-wrap[data-v-b40dcbaf],.dark .pagination-wrap[data-v-b40dcbaf]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-4104caea.js b/web/dist/assets/Messages-4104caea.js deleted file mode 100644 index ac689011..00000000 --- a/web/dist/assets/Messages-4104caea.js +++ /dev/null @@ -1 +0,0 @@ -import{d as j,c as O,r as K,e as n,f as a,k as s,w as o,bf as p,j as v,y as h,A as l,x as c,q as $,Y as i,l as P,u as D,F as L,H as w,b as Q}from"./@vue-a481fc63.js";import{u as W}from"./vuex-44de225f.js";import{u as T,b as U}from"./vue-router-e5a2430e.js";import{K as E,L as G,M as H,_ as A,N as J}from"./index-757c547c.js";import{a as Y}from"./formatTime-4210fcd1.js";import{J as B,K as X,N as Z,O as V,Q as x}from"./@vicons-1a3558c6.js";import{o as ee,M as se,j as ne,l as te,S as ae,L as oe,U as re,F as ie,Q as le,I as _e,G as ue}from"./naive-ui-d8de3dda.js";import{_ as pe}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./moment-2ab8298d.js";const me={class:"sender-wrap"},de={key:0,class:"nickname"},ce={class:"username"},ge={key:1,class:"nickname"},ve={class:"username"},ye={key:2,class:"nickname"},fe={class:"timestamp"},ke={class:"timestamp-txt"},he={key:0,class:"brief-content"},we={key:1,class:"whisper-content-wrap"},$e={key:2,class:"requesting-friend-wrap"},Ce={key:2,class:"status-info"},be={key:3,class:"status-info"},Ie="https://assets.paopao.info/public/avatar/default/admin.png",Me=j({__name:"message-item",props:{message:{}},setup(z){const _=z,C=T(),r=W(),m=O(()=>_.message.type!==4||_.message.sender_user_id!==r.state.userInfo.id),y=O(()=>_.message.type==4&&_.message.receiver_user_id==r.state.userInfo.id),g=O(()=>_.message.type==4&&_.message.sender_user_id==r.state.userInfo.id),f=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?C.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},b=e=>{u(e),E({user_id:e.sender_user_id}).then(t=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(t=>{console.log(t)})},N=e=>{u(e),G({user_id:e.sender_user_id}).then(t=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(t=>{console.log(t)})},u=e=>{_.message.receiver_user_id==r.state.userInfo.id&&e.is_read===0&&H({id:e.id}).then(t=>{e.is_read=1}).catch(t=>{console.log(t)})};return(e,t)=>{const S=ee,I=K("router-link"),k=se,d=ne,F=te,q=ae,M=oe;return n(),a("div",{class:P(["message-item",{unread:m.value&&e.message.is_read===0}]),onClick:t[5]||(t[5]=R=>u(e.message))},[s(M,{"content-indented":""},{avatar:o(()=>[s(S,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==p(r).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:Ie},null,8,["src"])]),header:o(()=>[v("div",me,[e.message.type!=4&&e.message.sender_user.id>0||y.value?(n(),a("span",de,[s(I,{onClick:t[0]||(t[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:o(()=>[l(c(e.message.sender_user.nickname),1)]),_:1},8,["to"]),v("span",ce," @"+c(e.message.sender_user.username),1)])):g.value?(n(),a("span",ge,[s(I,{onClick:t[1]||(t[1]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:o(()=>[l(c(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),v("span",ve," @"+c(e.message.receiver_user.username),1)])):(n(),a("span",ye," 系统 ")),e.message.type==4?(n(),$(k,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:o(()=>[l(" 私信 ")]),_:1})):i("",!0),g.value?(n(),$(k,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:o(()=>[s(d,{component:p(B)},null,8,["component"])]),default:o(()=>[l(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==p(r).state.userInfo.id?(n(),$(k,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:o(()=>[s(d,{component:p(B)},null,8,["component"])]),default:o(()=>[l(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":o(()=>[v("span",fe,[m.value&&e.message.is_read===0?(n(),$(F,{key:0,dot:"",processing:""})):i("",!0),v("span",ke,c(p(Y)(e.message.created_on)),1)])]),description:o(()=>[s(q,{"show-icon":!1,class:"brief-wrap",type:!m.value||e.message.is_read>0?"default":"success"},{default:o(()=>[e.message.type!=4?(n(),a("div",he,[l(c(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(n(),a("span",{key:0,onClick:t[2]||(t[2]=h(R=>f(e.message),["stop"])),class:"hash-link view-link"},[s(d,null,{default:o(()=>[s(p(X))]),_:1}),l(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(n(),a("div",we,c(e.message.content),1)):i("",!0),e.message.type===5?(n(),a("div",$e,[l(c(e.message.content)+" ",1),e.message.reply_id===1?(n(),a("span",{key:0,onClick:t[3]||(t[3]=h(R=>b(e.message),["stop"])),class:"hash-link view-link"},[s(d,null,{default:o(()=>[s(p(Z))]),_:1}),l(" 同意 ")])):i("",!0),e.message.reply_id===1?(n(),a("span",{key:1,onClick:t[4]||(t[4]=h(R=>N(e.message),["stop"])),class:"hash-link view-link"},[s(d,null,{default:o(()=>[s(p(V))]),_:1}),l(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(n(),a("span",Ce,[s(d,null,{default:o(()=>[s(p(x))]),_:1}),l(" 已同意 ")])):i("",!0),e.message.reply_id===3?(n(),a("span",be,[s(d,null,{default:o(()=>[s(p(V))]),_:1}),l(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const ze=A(Me,[["__scopeId","data-v-b2ee6429"]]),Ne={class:"content"},Se=j({__name:"message-skeleton",props:{num:{default:1}},setup(z){return(_,C)=>{const r=re;return n(!0),a(L,null,D(new Array(_.num),m=>(n(),a("div",{class:"skeleton-item",key:m},[v("div",Ne,[s(r,{text:"",repeat:2}),s(r,{text:"",style:{width:"60%"}})])]))),128)}}});const Fe=A(Se,[["__scopeId","data-v-01d2e871"]]),qe={key:0,class:"skeleton-wrap"},Re={key:1},Oe={key:0,class:"empty-wrap"},je={key:0,class:"pagination-wrap"},Ae=j({__name:"Messages",setup(z){const _=U(),C=W(),r=w(!1),m=w(+_.query.p||1),y=w(10),g=w(0),f=w([]),b=()=>{r.value=!0,J({page:m.value,page_size:y.value}).then(u=>{r.value=!1,f.value=u.list,g.value=Math.ceil(u.pager.total_rows/y.value)}).catch(u=>{r.value=!1})},N=u=>{m.value=u,b()};return Q(()=>{b()}),(u,e)=>{const t=pe,S=Fe,I=_e,k=ze,d=ue,F=ie,q=le;return n(),a("div",null,[s(t,{title:"消息"}),s(F,{class:"main-content-wrap messages-wrap",bordered:""},{default:o(()=>[r.value?(n(),a("div",qe,[s(S,{num:y.value},null,8,["num"])])):(n(),a("div",Re,[f.value.length===0?(n(),a("div",Oe,[s(I,{size:"large",description:"暂无数据"})])):i("",!0),(n(!0),a(L,null,D(f.value,M=>(n(),$(d,{key:M.id},{default:o(()=>[s(k,{message:M},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),g.value>0?(n(),a("div",je,[s(q,{page:m.value,"onUpdate:page":N,"page-slot":p(C).state.collapsedRight?5:8,"page-count":g.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const rs=A(Ae,[["__scopeId","data-v-4e7b1342"]]);export{rs as default}; diff --git a/web/dist/assets/Messages-f8e13906.js b/web/dist/assets/Messages-f8e13906.js new file mode 100644 index 00000000..a6076c83 --- /dev/null +++ b/web/dist/assets/Messages-f8e13906.js @@ -0,0 +1 @@ +import{d as D,c as q,r as E,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as G,h as H,u as Q,F as T,H as v,b as Y}from"./@vue-a481fc63.js";import{u as U}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{J as x,K as ee,L as se,_ as L,M as ne}from"./index-d9eb4c9e.js";import{a as te}from"./formatTime-4210fcd1.js";import{J,i as ae,K as oe,N as re,O as K,Q as ie,x as le}from"./@vicons-1a3558c6.js";import{j as d,o as ue,M as _e,l as pe,e as ce,O as de,S as me,L as ge,U as ve,F as fe,Q as ye,I as ke,G as he}from"./naive-ui-d8de3dda.js";import{_ as we}from"./whisper-5fc7c61f.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./moment-2ab8298d.js";const be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Fe={class:"timestamp"},Oe={class:"timestamp-txt"},qe={key:0,class:"brief-content"},Ne={key:1,class:"whisper-content-wrap"},Re={key:2,class:"requesting-friend-wrap"},Ae={key:2,class:"status-info"},We={key:3,class:"status-info"},je="https://assets.paopao.info/public/avatar/default/admin.png",Be=D({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(N,{emit:y}){const p=N,c=X(),l=U(),k=e=>()=>H(d,null,{default:()=>H(e)}),h=q(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=q(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=q(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=q(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),R=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),x({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},A=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&se({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,F=E("router-link"),b=_e,W=pe,j=ce,B=de,P=me,O=ge;return t(),r("div",{class:G(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=V=>u(e.message))},[s(O,{"content-indented":""},{avatar:a(()=>[s($,{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:je},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(F,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(F,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"top-tag",type:"info",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已发送 ")]),_:1})):i("",!0),e.message.type==4&&e.message.receiver_user_id==o(l).state.userInfo.id?(t(),I(b,{key:5,class:"top-tag",type:"warning",size:"small",round:""},{icon:a(()=>[s(o(d),{component:o(J)},null,8,["component"])]),default:a(()=>[_(" 已接收 ")]),_:1})):i("",!0)])]),"header-extra":a(()=>[f("span",Fe,[g.value&&e.message.is_read===0?(t(),I(W,{key:0,dot:"",processing:""})):i("",!0),f("span",Oe,m(o(te)(e.message.created_on)),1),s(B,{placement:"bottom-end",trigger:"click",size:"small",options:h.value,onSelect:w},{default:a(()=>[s(j,{quaternary:"",circle:""},{icon:a(()=>[s(o(d),null,{default:a(()=>[s(o(ae))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:a(()=>[s(P,{"show-icon":!1,class:"brief-wrap",type:!g.value||e.message.is_read>0?"default":"success"},{default:a(()=>[e.message.type!=4?(t(),r("div",qe,[_(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),r("span",{key:0,onClick:n[2]||(n[2]=C(V=>R(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(oe))]),_:1}),_(" 查看详情 ")])):i("",!0)])):i("",!0),e.message.type===4?(t(),r("div",Ne,m(e.message.content),1)):i("",!0),e.message.type===5?(t(),r("div",Re,[_(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),r("span",{key:0,onClick:n[3]||(n[3]=C(V=>z(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(re))]),_:1}),_(" 同意 ")])):i("",!0),e.message.reply_id===1?(t(),r("span",{key:1,onClick:n[4]||(n[4]=C(V=>A(e.message),["stop"])),class:"hash-link view-link"},[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 拒绝 ")])):i("",!0),e.message.reply_id===2?(t(),r("span",Ae,[s(o(d),null,{default:a(()=>[s(o(ie))]),_:1}),_(" 已同意 ")])):i("",!0),e.message.reply_id===3?(t(),r("span",We,[s(o(d),null,{default:a(()=>[s(o(K))]),_:1}),_(" 已拒绝 ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const Pe=L(Be,[["__scopeId","data-v-2e510758"]]),Ve={class:"content"},De=D({__name:"message-skeleton",props:{num:{default:1}},setup(N){return(y,p)=>{const c=ve;return t(!0),r(T,null,Q(new Array(y.num),l=>(t(),r("div",{class:"skeleton-item",key:l},[f("div",Ve,[s(c,{text:"",repeat:2}),s(c,{text:"",style:{width:"60%"}})])]))),128)}}});const Le=L(De,[["__scopeId","data-v-01d2e871"]]),He={key:0,class:"skeleton-wrap"},Je={key:1},Ke={key:0,class:"empty-wrap"},Qe={key:0,class:"pagination-wrap"},Te=D({__name:"Messages",setup(N){const y=Z(),p=U(),c=v(!1),l=v(+y.query.p||1),k=v(10),h=v(0),w=v([]),g=v(!1),M=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=u=>{M.value=u,g.value=!0},R=()=>{g.value=!1},z=()=>{c.value=!0,ne({page:l.value,page_size:k.value}).then(u=>{c.value=!1,w.value=u.list,h.value=Math.ceil(u.pager.total_rows/k.value)}).catch(u=>{c.value=!1})},A=u=>{l.value=u,z()};return Y(()=>{z()}),(u,e)=>{const n=$e,$=we,F=Le,b=ke,W=Pe,j=he,B=fe,P=ye;return t(),r("div",null,[s(n,{title:"消息"}),s(B,{class:"main-content-wrap messages-wrap",bordered:""},{default:a(()=>[s($,{show:g.value,user:M.value,onSuccess:R},null,8,["show","user"]),c.value?(t(),r("div",He,[s(F,{num:k.value},null,8,["num"])])):(t(),r("div",Je,[w.value.length===0?(t(),r("div",Ke,[s(b,{size:"large",description:"暂无数据"})])):i("",!0),(t(!0),r(T,null,Q(w.value,O=>(t(),I(j,{key:O.id},{default:a(()=>[s(W,{message:O,onSendWhisper:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),h.value>0?(t(),r("div",Qe,[s(P,{page:l.value,"onUpdate:page":A,"page-slot":o(p).state.collapsedRight?5:8,"page-count":h.value},null,8,["page","page-slot","page-count"])])):i("",!0)])}}});const ys=L(Te,[["__scopeId","data-v-b40dcbaf"]]);export{ys as default}; diff --git a/web/dist/assets/Post-2d267990.js b/web/dist/assets/Post-78da1f3b.js similarity index 64% rename from web/dist/assets/Post-2d267990.js rename to web/dist/assets/Post-78da1f3b.js index 2880bbd0..2e564ad9 100644 --- a/web/dist/assets/Post-2d267990.js +++ b/web/dist/assets/Post-78da1f3b.js @@ -1 +1 @@ -import{d as Z,H as r,r as ge,e as n,f as c,j as v,k as t,w as a,A as x,x as I,q as P,Y as u,bf as l,y as j,c as ue,al as Ne,F as ce,u as re,b as ye,$ as Te,a0 as Pe,h as be,E as Be}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{f as _e}from"./formatTime-4210fcd1.js";import{t as je,f as Fe,h as He,_ as se,i as Ve,j as Ye,k as Je,l as Ke,g as Ge,m as Qe,n as We,o as Xe,p as Ze,q as et,s as tt,r as st,v as ot,u as nt,w as at,x as lt,y as $e}from"./index-757c547c.js";import{Y as pe,V as W}from"./IEnum-5453a777.js";import{T as ze,e as de,f as Ue,g as me,h as Re,I as it,i as ut,j as ct,k as rt,l as _t,m as pt,n as dt,o as mt,p as vt,q as ht,r as ft,s as Ce,F as xe,E as ae,t as le,u as ie,v as Ie}from"./@vicons-1a3558c6.js";import{j as Y,e as oe,J as Se,H as gt,b as yt,K as kt,o as ke,L as Le,v as wt,w as bt,x as $t,y as Ct,z as xt,B as It,M as Tt,O as Pt,i as zt,P as Ut,a as Oe,F as Rt,I as St,k as Lt,G as Ot,f as At,g as Dt}from"./naive-ui-d8de3dda.js";import{p as we,_ as Ae,a as Mt,b as Et,c as qt}from"./content-d5264b98.js";import{u as De,b as Nt}from"./vue-router-e5a2430e.js";import{_ as Bt}from"./post-skeleton-c82f8a59.js";import{l as jt}from"./lodash-e0b37ac3.js";import{c as Ft}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Ht}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{W as Vt}from"./v3-infinite-loading-2c58ec2f.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 Yt={class:"reply-item"},Jt={class:"header-wrap"},Kt={class:"username"},Gt={class:"reply-name"},Qt={class:"timestamp"},Wt={class:"base-wrap"},Xt={class:"content"},Zt={class:"reply-switch"},es={class:"time-item"},ts={class:"actions"},ss={class:"upvote-count"},os=["onClick"],ns={class:"upvote-count"},as={key:2,class:"action-item"},ls=["onClick"],is=Z({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(A,{emit:D}){const i=A,h=te(),f=r(i.reply.is_thumbs_up==pe.YES),y=r(i.reply.is_thumbs_down==pe.YES),k=r(i.reply.thumbs_up_count),U=()=>{je({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(g=>{f.value=!f.value,f.value?(k.value++,y.value=!1):k.value--}).catch(g=>{console.log(g)})},_=()=>{Fe({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(g=>{y.value=!y.value,y.value&&f.value&&(k.value--,f.value=!1)}).catch(g=>{console.log(g)})},R=()=>{D("focusReply",i.reply)},T=()=>{He({id:i.reply.id}).then(g=>{window.$message.success("删除成功"),setTimeout(()=>{D("reload")},50)}).catch(g=>{console.log(g)})};return(g,b)=>{const O=ge("router-link"),d=Y,e=oe,p=Se,w=gt;return n(),c("div",Yt,[v("div",Jt,[v("div",Kt,[t(O,{class:"user-link",to:{name:"user",query:{s:i.reply.user.username}}},{default:a(()=>[x(I(i.reply.user.username),1)]),_:1},8,["to"]),v("span",Gt,I(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(n(),P(O,{key:0,class:"user-link",to:{name:"user",query:{s:i.reply.at_user.username}}},{default:a(()=>[x(I(i.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),v("div",Qt,[x(I(i.reply.ip_loc)+" ",1),l(h).state.userInfo.is_admin||l(h).state.userInfo.id===i.reply.user.id?(n(),P(p,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:a(()=>[t(e,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(d,null,{default:a(()=>[t(l(ze))]),_:1})]),_:1})]),default:a(()=>[x(" 是否确认删除? ")]),_:1})):u("",!0)])]),v("div",Wt,[v("div",Xt,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:a(()=>[x(I(i.reply.content),1)]),_:1})]),v("div",Zt,[v("span",es,I(l(_e)(i.reply.created_on)),1),v("div",ts,[l(h).state.userLogined?u("",!0):(n(),c("div",{key:0,class:"action-item",onClick:b[0]||(b[0]=j(()=>{},["stop"]))},[t(d,{size:"medium"},{default:a(()=>[t(l(de))]),_:1}),v("span",ss,I(k.value),1)])),l(h).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(d,{size:"medium"},{default:a(()=>[f.value?u("",!0):(n(),P(l(de),{key:0})),f.value?(n(),P(l(Ue),{key:1,class:"show"})):u("",!0)]),_:1}),v("span",ns,I(k.value>0?k.value:"赞"),1)],8,os)):u("",!0),l(h).state.userLogined?u("",!0):(n(),c("div",as,[t(d,{size:"medium"},{default:a(()=>[t(l(me))]),_:1})])),l(h).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(d,{size:"medium"},{default:a(()=>[y.value?u("",!0):(n(),P(l(me),{key:0})),y.value?(n(),P(l(Re),{key:1,class:"show"})):u("",!0)]),_:1})],8,ls)):u("",!0),l(h).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):u("",!0)])])])])}}});const us=se(is,[["__scopeId","data-v-187a4ed3"]]),cs={class:"reply-compose-wrap"},rs={class:"reply-switch"},_s={class:"time-item"},ps={class:"actions"},ds={key:0,class:"action-item"},ms={class:"upvote-count"},vs=["onClick"],hs={class:"upvote-count"},fs={key:2,class:"action-item"},gs=["onClick"],ys={key:0,class:"reply-input-wrap"},ks=Z({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:D,emit:i}){const h=A,f=te(),y=r(),k=r(!1),U=r(""),_=r(!1),R=+"300",T=r(h.comment.is_thumbs_up==pe.YES),g=r(h.comment.is_thumbs_down==pe.YES),b=r(h.comment.thumbs_up_count),O=()=>{Ve({tweet_id:h.comment.post_id,comment_id:h.comment.id}).then(w=>{T.value=!T.value,T.value?(b.value++,g.value=!1):b.value--}).catch(w=>{console.log(w)})},d=()=>{Ye({tweet_id:h.comment.post_id,comment_id:h.comment.id}).then(w=>{g.value=!g.value,g.value&&T.value&&(b.value--,T.value=!1)}).catch(w=>{console.log(w)})},e=w=>{k.value=w,w?setTimeout(()=>{var S;(S=y.value)==null||S.focus()},10):(_.value=!1,U.value="",i("reset"))},p=()=>{_.value=!0,Je({comment_id:h.comment.id,at_user_id:h.atUserid,content:U.value}).then(w=>{e(!1),window.$message.success("评论成功"),i("reload")}).catch(w=>{_.value=!1})};return D({switchReply:e}),(w,S)=>{const q=Y,N=yt,H=oe,z=kt;return n(),c("div",cs,[v("div",rs,[v("span",_s,I(l(_e)(w.comment.created_on)),1),v("div",ps,[l(f).state.userLogined?u("",!0):(n(),c("div",ds,[t(q,{size:"medium"},{default:a(()=>[t(l(de))]),_:1}),v("span",ms,I(b.value),1)])),l(f).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(O,["stop"])},[t(q,{size:"medium"},{default:a(()=>[T.value?u("",!0):(n(),P(l(de),{key:0})),T.value?(n(),P(l(Ue),{key:1,class:"show"})):u("",!0)]),_:1}),v("span",hs,I(b.value>0?b.value:"赞"),1)],8,vs)):u("",!0),l(f).state.userLogined?u("",!0):(n(),c("div",fs,[t(q,{size:"medium"},{default:a(()=>[t(l(me))]),_:1})])),l(f).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(d,["stop"])},[t(q,{size:"medium"},{default:a(()=>[g.value?u("",!0):(n(),P(l(me),{key:0})),g.value?(n(),P(l(Re),{key:1,class:"show"})):u("",!0)]),_:1})],8,gs)):u("",!0),l(f).state.userLogined&&!k.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=L=>e(!0))}," 回复 ")):u("",!0),l(f).state.userLogined&&k.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=L=>e(!1))}," 取消 ")):u("",!0)])]),k.value?(n(),c("div",ys,[t(z,null,{default:a(()=>[t(N,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:h.atUsername?"@"+h.atUsername:"请输入回复内容..",maxlength:l(R),value:U.value,"onUpdate:value":S[2]||(S[2]=L=>U.value=L),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(H,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:p},{default:a(()=>[x(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const ws=se(ks,[["__scopeId","data-v-f9af7a93"]]),bs={class:"comment-item"},$s={class:"nickname-wrap"},Cs={class:"username-wrap"},xs={class:"opt-wrap"},Is={class:"timestamp"},Ts=["innerHTML"],Ps={class:"reply-wrap"},zs=Z({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(A,{emit:D}){const i=A,h=te(),f=De(),y=r(0),k=r(""),U=r(),_=ue(()=>{let d=Object.assign({texts:[],imgs:[]},i.comment);return d.contents.map(e=>{(+e.type==1||+e.type==2)&&d.texts.push(e),+e.type==3&&d.imgs.push(e)}),d}),R=(d,e)=>{let p=d.target;if(p.dataset.detail){const w=p.dataset.detail.split(":");w.length===2&&(h.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):f.push({name:"user",query:{s:w[1]}}))}},T=d=>{var e,p;y.value=d.user_id,k.value=((e=d.user)==null?void 0:e.username)||"",(p=U.value)==null||p.switchReply(!0)},g=()=>{D("reload")},b=()=>{y.value=0,k.value=""},O=()=>{Ke({id:_.value.id}).then(d=>{window.$message.success("删除成功"),setTimeout(()=>{g()},50)}).catch(d=>{})};return(d,e)=>{const p=ke,w=ge("router-link"),S=Y,q=oe,N=Se,H=Ae,z=ws,L=us,K=Le;return n(),c("div",bs,[t(K,{"content-indented":""},Ne({avatar:a(()=>[t(p,{round:"",size:30,src:_.value.user.avatar},null,8,["src"])]),header:a(()=>[v("span",$s,[t(w,{onClick:e[0]||(e[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:_.value.user.username}}},{default:a(()=>[x(I(_.value.user.nickname),1)]),_:1},8,["to"])]),v("span",Cs," @"+I(_.value.user.username),1)]),"header-extra":a(()=>[v("div",xs,[v("span",Is,I(_.value.ip_loc),1),l(h).state.userInfo.is_admin||l(h).state.userInfo.id===_.value.user.id?(n(),P(N,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(S,null,{default:a(()=>[t(l(ze))]),_:1})]),_:1})]),default:a(()=>[x(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:a(()=>[_.value.imgs.length>0?(n(),P(H,{key:0,imgs:_.value.imgs},null,8,["imgs"])):u("",!0),t(z,{ref_key:"replyComposeRef",ref:U,comment:_.value,"at-userid":y.value,"at-username":k.value,onReload:g,onReset:b},null,8,["comment","at-userid","at-username"]),v("div",Ps,[(n(!0),c(ce,null,re(_.value.replies,F=>(n(),P(L,{key:F.id,reply:F,"tweet-id":_.value.post_id,onFocusReply:T,onReload:g},null,8,["reply","tweet-id"]))),128))])]),_:2},[_.value.texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(ce,null,re(_.value.texts,F=>(n(),c("span",{key:F.id,class:"comment-text",onClick:e[1]||(e[1]=j(J=>R(J,_.value.id),["stop"])),innerHTML:l(we)(F.content).content},null,8,Ts))),128))]),key:"0"}:void 0]),1024)])}}});const Us=se(zs,[["__scopeId","data-v-36dac8c8"]]),Rs=A=>(Te("data-v-634e6bfd"),A=A(),Pe(),A),Ss={key:0,class:"compose-wrap"},Ls={class:"compose-line"},Os={class:"compose-user"},As={class:"compose-line compose-options"},Ds={class:"attachment"},Ms={class:"submit-wrap"},Es={class:"attachment-list-wrap"},qs={key:1,class:"compose-wrap"},Ns=Rs(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Bs={key:0,class:"login-only-wrap"},js={key:1,class:"login-wrap"},Fs=Z({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:D}){const i=A,h=te(),f=r([]),y=r(!1),k=r(!1),U=r(!1),_=r(""),R=r(),T=r("public/image"),g=r([]),b=r([]),O=r("true".toLowerCase()==="true"),d=+"300",e="/v1/attachment",p=r(),w=jt.debounce(s=>{Ge({k:s}).then(m=>{let $=[];m.suggest.map(C=>{$.push({label:C,value:C})}),f.value=$,k.value=!1}).catch(m=>{k.value=!1})},200),S=(s,m)=>{k.value||(k.value=!0,m==="@"&&w(s))},q=s=>{s.length>d?_.value=s.substring(0,d):_.value=s},N=s=>{T.value=s},H=s=>{for(let M=0;M30&&(s[M].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+C)}g.value=s},z=async s=>{var m,$;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((m=s.file.file)==null?void 0:m.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&(($=s.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},L=({file:s,event:m})=>{var $;try{let C=JSON.parse(($=m.target)==null?void 0:$.response);C.code===0&&T.value==="public/image"&&b.value.push({id:s.id,content:C.data.content})}catch{window.$message.error("上传失败")}},K=({file:s,event:m})=>{var $;try{let C=JSON.parse(($=m.target)==null?void 0:$.response);if(C.code!==0){let M=C.msg||"上传失败";C.details&&C.details.length>0&&C.details.map(B=>{M+=":"+B}),window.$message.error(M)}}catch{window.$message.error("上传失败")}},F=({file:s})=>{let m=b.value.findIndex($=>$.id===s.id);m>-1&&b.value.splice(m,1)},J=()=>{y.value=!0},X=()=>{var s;y.value=!1,(s=R.value)==null||s.clear(),g.value=[],_.value="",b.value=[]},G=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:s}=we(_.value);const m=[];let $=100;m.push({content:_.value,type:2,sort:$}),b.value.map(C=>{$++,m.push({content:C.content,type:3,sort:$})}),U.value=!0,Qe({contents:m,post_id:i.postId,users:Array.from(new Set(s))}).then(C=>{window.$message.success("发布成功"),U.value=!1,D("post-success"),X()}).catch(C=>{U.value=!1})},o=s=>{h.commit("triggerAuth",!0),h.commit("triggerAuthKey",s)};return ye(()=>{p.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(s,m)=>{const $=ke,C=wt,M=Y,B=oe,V=bt,ne=$t,ve=Ct,he=xt,fe=It;return n(),c("div",null,[l(h).state.userInfo.id>0?(n(),c("div",Ss,[v("div",Ls,[v("div",Os,[t($,{round:"",size:30,src:l(h).state.userInfo.avatar},null,8,["src"])]),t(C,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:k.value,value:_.value,disabled:i.lock===1,"onUpdate:value":q,onSearch:S,onFocus:J,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),P(fe,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:e,headers:{Authorization:p.value},data:{type:T.value},"file-list":g.value,onBeforeUpload:z,onFinish:L,onError:K,onRemove:F,"onUpdate:fileList":H},{default:a(()=>[v("div",As,[v("div",Ds,[t(V,{abstract:""},{default:a(({handleClick:Q})=>[t(B,{disabled:g.value.length>0&&T.value==="public/video"||g.value.length===9,onClick:()=>{N("public/image"),Q()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(M,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(l(it))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ve,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(ne,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/l(d)*100},null,8,["percentage"])]),default:a(()=>[x(" "+I(_.value.length)+" / "+I(l(d)),1)]),_:1})]),v("div",Ms,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:X},{default:a(()=>[x(" 取消 ")]),_:1}),t(B,{loading:U.value,onClick:G,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[x(" 发布 ")]),_:1},8,["loading"])])]),v("div",Es,[t(he)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(n(),c("div",qs,[Ns,O.value?u("",!0):(n(),c("div",Bs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:m[0]||(m[0]=Q=>o("signin"))},{default:a(()=>[x(" 登录 ")]),_:1})])),O.value?(n(),c("div",js,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:m[1]||(m[1]=Q=>o("signin"))},{default:a(()=>[x(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:m[2]||(m[2]=Q=>o("signup"))},{default:a(()=>[x(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Hs=se(Fs,[["__scopeId","data-v-634e6bfd"]]),Vs={class:"username-wrap"},Ys={key:0,class:"options"},Js={key:0},Ks=["innerHTML"],Gs={class:"timestamp"},Qs={key:0},Ws={key:1},Xs={class:"opts-wrap"},Zs=["onClick"],eo={class:"opt-item"},to=["onClick"],so=["onClick"],oo=Z({__name:"post-detail",props:{post:{}},emits:["reload"],setup(A,{emit:D}){const i=A,h="true".toLowerCase()==="true",f=te(),y=De(),k=r(!1),U=r(!1),_=r(!1),R=r(!1),T=r(!1),g=r(!1),b=r(!1),O=r(!1),d=r(W.PUBLIC),e=ue({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o},set:o=>{i.post.upvote_count=o.upvote_count,i.post.comment_count=o.comment_count,i.post.collection_count=o.collection_count,i.post.is_essence=o.is_essence}}),p=o=>()=>be(Y,null,{default:()=>be(o)}),w=ue(()=>{var m;let o=[{label:"删除",key:"delete",icon:p(vt)}];e.value.is_lock===0?o.push({label:"锁定",key:"lock",icon:p(ht)}):o.push({label:"解锁",key:"unlock",icon:p(ft)}),f.state.userInfo.is_admin&&(e.value.is_top===0?o.push({label:"置顶",key:"stick",icon:p(Ce)}):o.push({label:"取消置顶",key:"unstick",icon:p(Ce)})),e.value.is_essence===0?o.push({label:"设为亮点",key:"highlight",icon:p(xe)}):o.push({label:"取消亮点",key:"unhighlight",icon:p(xe)});let s;return e.value.visibility===W.PUBLIC?s={label:"公开",key:"vpublic",icon:p(ae),children:[{label:"私密",key:"vprivate",icon:p(le)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:e.value.visibility===W.PRIVATE?s={label:"私密",key:"vprivate",icon:p(le),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:h&&e.value.visibility===W.FRIEND?s={label:"好友可见",key:"vfriend",icon:p(Ie),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"私密",key:"vprivate",icon:p(le)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:s={label:"关注可见",key:"vfollowing",icon:p(ie),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"私密",key:"vprivate",icon:p(le)}]},h&&e.value.visibility!==W.FRIEND&&((m=s.children)==null||m.push({label:"好友可见",key:"vfriend",icon:p(Ie)})),o.push(s),o}),S=o=>{y.push({name:"post",query:{id:o}})},q=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){f.commit("refresh"),m[0]==="tag"?y.push({name:"home",query:{q:m[1],t:"tag"}}):y.push({name:"user",query:{s:m[1]}});return}}S(s)},N=o=>{switch(o){case"delete":_.value=!0;break;case"lock":case"unlock":R.value=!0;break;case"stick":case"unstick":T.value=!0;break;case"highlight":case"unhighlight":g.value=!0;break;case"vpublic":d.value=0,b.value=!0;break;case"vprivate":d.value=1,b.value=!0;break;case"vfriend":d.value=2,b.value=!0;break;case"vfollowing":d.value=3,b.value=!0;break}},H=()=>{Ze({id:e.value.id}).then(o=>{window.$message.success("删除成功"),y.replace("/"),setTimeout(()=>{f.commit("refresh")},50)}).catch(o=>{O.value=!1})},z=()=>{et({id:e.value.id}).then(o=>{D("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{O.value=!1})},L=()=>{tt({id:e.value.id}).then(o=>{D("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{O.value=!1})},K=()=>{st({id:e.value.id}).then(o=>{e.value={...e.value,is_essence:o.highlight_status},o.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(o=>{O.value=!1})},F=()=>{let o=d.value;o==3&&(o=0),ot({id:e.value.id,visibility:o}).then(s=>{D("reload"),window.$message.success("修改可见性成功")}).catch(s=>{O.value=!1})},J=()=>{nt({id:e.value.id}).then(o=>{k.value=o.status,o.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count-1}}).catch(o=>{console.log(o)})},X=()=>{at({id:e.value.id}).then(o=>{U.value=o.status,o.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count-1}}).catch(o=>{console.log(o)})},G=()=>{Ft(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板")};return ye(()=>{f.state.userInfo.id>0&&(We({id:e.value.id}).then(o=>{k.value=o.status}).catch(o=>{console.log(o)}),Xe({id:e.value.id}).then(o=>{U.value=o.status}).catch(o=>{console.log(o)}))}),(o,s)=>{const m=ke,$=ge("router-link"),C=Tt,M=oe,B=Pt,V=zt,ne=Mt,ve=Ae,he=Et,fe=qt,Q=Ut,Me=Oe,Ee=Le;return n(),c("div",{class:"detail-item",onClick:s[7]||(s[7]=E=>S(e.value.id))},[t(Ee,null,{avatar:a(()=>[t(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:a(()=>[t($,{onClick:s[0]||(s[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:a(()=>[x(I(e.value.user.nickname),1)]),_:1},8,["to"]),v("span",Vs," @"+I(e.value.user.username),1),e.value.is_top?(n(),P(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[x(" 置顶 ")]),_:1})):u("",!0),e.value.visibility==l(W).PRIVATE?(n(),P(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[x(" 私密 ")]),_:1})):u("",!0),e.value.visibility==l(W).FRIEND?(n(),P(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[x(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":a(()=>[l(f).state.userInfo.is_admin||l(f).state.userInfo.id===e.value.user.id?(n(),c("div",Ys,[t(B,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:N},{default:a(()=>[t(M,{quaternary:"",circle:""},{icon:a(()=>[t(l(Y),null,{default:a(()=>[t(l(ut))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0),t(V,{show:_.value,"onUpdate:show":s[1]||(s[1]=E=>_.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:H},null,8,["show"]),t(V,{show:R.value,"onUpdate:show":s[2]||(s[2]=E=>R.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:z},null,8,["show","content"]),t(V,{show:T.value,"onUpdate:show":s[3]||(s[3]=E=>T.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(V,{show:g.value,"onUpdate:show":s[4]||(s[4]=E=>g.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(e.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(V,{show:b.value,"onUpdate:show":s[5]||(s[5]=E=>b.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(d.value==0?"公开":d.value==1?"私密":d.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show","content"])]),footer:a(()=>[t(ne,{attachments:e.value.attachments},null,8,["attachments"]),t(ne,{attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"]),t(ve,{imgs:e.value.imgs},null,8,["imgs"]),t(he,{videos:e.value.videos,full:!0},null,8,["videos"]),t(fe,{links:e.value.links},null,8,["links"]),v("div",Gs,[x(" 发布于 "+I(l(_e)(e.value.created_on))+" ",1),e.value.ip_loc?(n(),c("span",Qs,[t(Q,{vertical:""}),x(" "+I(e.value.ip_loc),1)])):u("",!0),!l(f).state.collapsedLeft&&e.value.created_on!=e.value.latest_replied_on?(n(),c("span",Ws,[t(Q,{vertical:""}),x(" 最后回复 "+I(l(_e)(e.value.latest_replied_on)),1)])):u("",!0)])]),action:a(()=>[v("div",Xs,[t(Me,{justify:"space-between"},{default:a(()=>[v("div",{class:"opt-item hover",onClick:j(J,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[k.value?u("",!0):(n(),P(l(ct),{key:0})),k.value?(n(),P(l(rt),{key:1,color:"red"})):u("",!0)]),_:1}),x(" "+I(e.value.upvote_count),1)],8,Zs),v("div",eo,[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[t(l(_t))]),_:1}),x(" "+I(e.value.comment_count),1)]),v("div",{class:"opt-item hover",onClick:j(X,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[U.value?u("",!0):(n(),P(l(pt),{key:0})),U.value?(n(),P(l(dt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),x(" "+I(e.value.collection_count),1)],8,to),v("div",{class:"opt-item hover",onClick:j(G,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[t(l(mt))]),_:1}),x(" "+I(e.value.share_count),1)],8,so)]),_:1})])]),default:a(()=>[e.value.texts.length>0?(n(),c("div",Js,[(n(!0),c(ce,null,re(e.value.texts,E=>(n(),c("span",{key:E.id,class:"post-text",onClick:s[6]||(s[6]=j(qe=>q(qe,e.value.id),["stop"])),innerHTML:l(we)(E.content).content},null,8,Ks))),128))])):u("",!0)]),_:1})])}}});const no=A=>(Te("data-v-0d01659f"),A=A(),Pe(),A),ao={key:0,class:"detail-wrap"},lo={key:1,class:"empty-wrap"},io={key:0,class:"comment-opts-wrap"},uo=no(()=>v("span",{class:"comment-title-item"},"评论",-1)),co={key:2},ro={key:0,class:"skeleton-wrap"},_o={key:1},po={key:0,class:"empty-wrap"},mo={key:0,class:"load-more-spinner"},vo={key:1,class:"load-more-spinner"},ho={key:2,class:"load-more-spinner"},fo={key:3,class:"load-more-spinner"},ee=20,go=Z({__name:"Post",setup(A){const D=Nt(),i=r({}),h=r(!1),f=r(!1),y=r([]),k=ue(()=>+D.query.id),U=r("default"),_=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const T=z=>{U.value=z,z==="default"&&(_.value=!0),N(R)},g=()=>{i.value={id:0},h.value=!0,lt({id:k.value}).then(z=>{h.value=!1,i.value=z,N(R)}).catch(z=>{h.value=!1})};let b=1;const O=r(!1),d=r([]),e=z=>{O.value||$e({id:i.value.id,sort_strategy:"default",page:b,page_size:ee}).then(L=>{z!==null&&(R=z),L.list.length0&&(b===1?d.value=L.list:d.value.push(...L.list),y.value=d.value),R.loaded(),f.value=!1}).catch(L=>{f.value=!1,R.error()})};let p=1,w=r(!1);const S=r([]),q=z=>{w.value||$e({id:i.value.id,sort_strategy:"newest",page:p,page_size:ee}).then(L=>{z!==null&&(R=z),L.list.length0&&(p===1?S.value=L.list:S.value.push(...L.list),y.value=S.value),R.loaded(),f.value=!1}).catch(L=>{f.value=!1,R.error()})},N=z=>{k.value<1||(y.value.length===0&&(f.value=!0),U.value==="default"?(y.value=d.value,e(z)):(y.value=S.value,q(z)),f.value=!1)},H=()=>{b=1,O.value=!1,d.value=[],p=1,w.value=!1,S.value=[],N(R)};return ye(()=>{g()}),Be(k,()=>{k.value>0&&D.name==="post"&&g()}),(z,L)=>{const K=Ht,F=oo,J=St,X=Lt,G=Ot,o=At,s=Dt,m=Hs,$=Bt,C=Us,M=Oe,B=Rt;return n(),c("div",null,[t(K,{title:"泡泡详情",back:!0}),t(B,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(G,null,{default:a(()=>[t(X,{show:h.value},{default:a(()=>[i.value.id>1?(n(),c("div",ao,[t(F,{post:i.value,onReload:g},null,8,["post"])])):(n(),c("div",lo,[t(J,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(n(),c("div",io,[t(s,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:a(()=>[uo]),default:a(()=>[t(o,{name:"default",tab:"默认"}),t(o,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),i.value.id>0?(n(),P(G,{key:1},{default:a(()=>[t(m,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:H},null,8,["lock","post-id"])]),_:1})):u("",!0),i.value.id>0?(n(),c("div",co,[f.value?(n(),c("div",ro,[t($,{num:5})])):(n(),c("div",_o,[y.value.length===0?(n(),c("div",po,[t(J,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(n(!0),c(ce,null,re(y.value,V=>(n(),P(G,{key:V.id},{default:a(()=>[t(C,{comment:V,onReload:H},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),y.value.length>=ee?(n(),P(M,{key:3,justify:"center"},{default:a(()=>[t(l(Vt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:N},{spinner:a(()=>[_.value&&O.value?(n(),c("span",mo)):u("",!0),!_.value&&l(w)?(n(),c("span",vo)):u("",!0),_.value&&!O.value?(n(),c("span",ho,"加载评论")):u("",!0),!_.value&&!l(w)?(n(),c("span",fo,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const Xo=se(go,[["__scopeId","data-v-0d01659f"]]);export{Xo as default}; +import{d as Z,H as r,r as ge,e as n,f as c,j as v,k as t,w as a,A as x,x as I,q as P,Y as u,bf as l,y as j,c as ue,al as Ne,F as ce,u as re,b as ye,$ as Te,a0 as Pe,h as be,E as Be}from"./@vue-a481fc63.js";import{u as te}from"./vuex-44de225f.js";import{f as _e}from"./formatTime-4210fcd1.js";import{t as je,f as Fe,h as He,_ as se,i as Ve,j as Ye,k as Je,l as Ke,g as Ge,m as Qe,n as We,o as Xe,p as Ze,q as et,s as tt,r as st,v as ot,u as nt,w as at,x as lt,y as $e}from"./index-d9eb4c9e.js";import{Y as pe,V as W}from"./IEnum-5453a777.js";import{T as ze,e as de,f as Ue,g as me,h as Re,I as it,i as ut,j as ct,k as rt,l as _t,m as pt,n as dt,o as mt,p as vt,q as ht,r as ft,s as Ce,F as xe,E as ae,t as le,u as ie,v as Ie}from"./@vicons-1a3558c6.js";import{j as Y,e as oe,J as Se,H as gt,b as yt,K as kt,o as ke,L as Le,v as wt,w as bt,x as $t,y as Ct,z as xt,B as It,M as Tt,O as Pt,i as zt,P as Ut,a as Oe,F as Rt,I as St,k as Lt,G as Ot,f as Dt,g as At}from"./naive-ui-d8de3dda.js";import{p as we,_ as De,a as Mt,b as Et,c as qt}from"./content-218c067c.js";import{u as Ae,b as Nt}from"./vue-router-e5a2430e.js";import{_ as Bt}from"./post-skeleton-7039dc67.js";import{l as jt}from"./lodash-e0b37ac3.js";import{c as Ft}from"./copy-to-clipboard-4ef7d3eb.js";import{_ as Ht}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{W as Vt}from"./v3-infinite-loading-2c58ec2f.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 Yt={class:"reply-item"},Jt={class:"header-wrap"},Kt={class:"username"},Gt={class:"reply-name"},Qt={class:"timestamp"},Wt={class:"base-wrap"},Xt={class:"content"},Zt={class:"reply-switch"},es={class:"time-item"},ts={class:"actions"},ss={class:"upvote-count"},os=["onClick"],ns={class:"upvote-count"},as={key:2,class:"action-item"},ls=["onClick"],is=Z({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(D,{emit:A}){const i=D,h=te(),f=r(i.reply.is_thumbs_up==pe.YES),y=r(i.reply.is_thumbs_down==pe.YES),k=r(i.reply.thumbs_up_count),U=()=>{je({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(g=>{f.value=!f.value,f.value?(k.value++,y.value=!1):k.value--}).catch(g=>{console.log(g)})},_=()=>{Fe({tweet_id:i.tweetId,comment_id:i.reply.comment_id,reply_id:i.reply.id}).then(g=>{y.value=!y.value,y.value&&f.value&&(k.value--,f.value=!1)}).catch(g=>{console.log(g)})},R=()=>{A("focusReply",i.reply)},T=()=>{He({id:i.reply.id}).then(g=>{window.$message.success("删除成功"),setTimeout(()=>{A("reload")},50)}).catch(g=>{console.log(g)})};return(g,b)=>{const O=ge("router-link"),d=Y,e=oe,p=Se,w=gt;return n(),c("div",Yt,[v("div",Jt,[v("div",Kt,[t(O,{class:"user-link",to:{name:"user",query:{s:i.reply.user.username}}},{default:a(()=>[x(I(i.reply.user.username),1)]),_:1},8,["to"]),v("span",Gt,I(i.reply.at_user_id>0?"回复":":"),1),i.reply.at_user_id>0?(n(),P(O,{key:0,class:"user-link",to:{name:"user",query:{s:i.reply.at_user.username}}},{default:a(()=>[x(I(i.reply.at_user.username),1)]),_:1},8,["to"])):u("",!0)]),v("div",Qt,[x(I(i.reply.ip_loc)+" ",1),l(h).state.userInfo.is_admin||l(h).state.userInfo.id===i.reply.user.id?(n(),P(p,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:a(()=>[t(e,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(d,null,{default:a(()=>[t(l(ze))]),_:1})]),_:1})]),default:a(()=>[x(" 是否确认删除? ")]),_:1})):u("",!0)])]),v("div",Wt,[v("div",Xt,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:a(()=>[x(I(i.reply.content),1)]),_:1})]),v("div",Zt,[v("span",es,I(l(_e)(i.reply.created_on)),1),v("div",ts,[l(h).state.userLogined?u("",!0):(n(),c("div",{key:0,class:"action-item",onClick:b[0]||(b[0]=j(()=>{},["stop"]))},[t(d,{size:"medium"},{default:a(()=>[t(l(de))]),_:1}),v("span",ss,I(k.value),1)])),l(h).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(U,["stop"])},[t(d,{size:"medium"},{default:a(()=>[f.value?u("",!0):(n(),P(l(de),{key:0})),f.value?(n(),P(l(Ue),{key:1,class:"show"})):u("",!0)]),_:1}),v("span",ns,I(k.value>0?k.value:"赞"),1)],8,os)):u("",!0),l(h).state.userLogined?u("",!0):(n(),c("div",as,[t(d,{size:"medium"},{default:a(()=>[t(l(me))]),_:1})])),l(h).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(_,["stop"])},[t(d,{size:"medium"},{default:a(()=>[y.value?u("",!0):(n(),P(l(me),{key:0})),y.value?(n(),P(l(Re),{key:1,class:"show"})):u("",!0)]),_:1})],8,ls)):u("",!0),l(h).state.userLogined?(n(),c("span",{key:4,class:"show opacity-item reply-btn",onClick:R}," 回复 ")):u("",!0)])])])])}}});const us=se(is,[["__scopeId","data-v-187a4ed3"]]),cs={class:"reply-compose-wrap"},rs={class:"reply-switch"},_s={class:"time-item"},ps={class:"actions"},ds={key:0,class:"action-item"},ms={class:"upvote-count"},vs=["onClick"],hs={class:"upvote-count"},fs={key:2,class:"action-item"},gs=["onClick"],ys={key:0,class:"reply-input-wrap"},ks=Z({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(D,{expose:A,emit:i}){const h=D,f=te(),y=r(),k=r(!1),U=r(""),_=r(!1),R=+"300",T=r(h.comment.is_thumbs_up==pe.YES),g=r(h.comment.is_thumbs_down==pe.YES),b=r(h.comment.thumbs_up_count),O=()=>{Ve({tweet_id:h.comment.post_id,comment_id:h.comment.id}).then(w=>{T.value=!T.value,T.value?(b.value++,g.value=!1):b.value--}).catch(w=>{console.log(w)})},d=()=>{Ye({tweet_id:h.comment.post_id,comment_id:h.comment.id}).then(w=>{g.value=!g.value,g.value&&T.value&&(b.value--,T.value=!1)}).catch(w=>{console.log(w)})},e=w=>{k.value=w,w?setTimeout(()=>{var S;(S=y.value)==null||S.focus()},10):(_.value=!1,U.value="",i("reset"))},p=()=>{_.value=!0,Je({comment_id:h.comment.id,at_user_id:h.atUserid,content:U.value}).then(w=>{e(!1),window.$message.success("评论成功"),i("reload")}).catch(w=>{_.value=!1})};return A({switchReply:e}),(w,S)=>{const q=Y,N=yt,H=oe,z=kt;return n(),c("div",cs,[v("div",rs,[v("span",_s,I(l(_e)(w.comment.created_on)),1),v("div",ps,[l(f).state.userLogined?u("",!0):(n(),c("div",ds,[t(q,{size:"medium"},{default:a(()=>[t(l(de))]),_:1}),v("span",ms,I(b.value),1)])),l(f).state.userLogined?(n(),c("div",{key:1,class:"action-item hover",onClick:j(O,["stop"])},[t(q,{size:"medium"},{default:a(()=>[T.value?u("",!0):(n(),P(l(de),{key:0})),T.value?(n(),P(l(Ue),{key:1,class:"show"})):u("",!0)]),_:1}),v("span",hs,I(b.value>0?b.value:"赞"),1)],8,vs)):u("",!0),l(f).state.userLogined?u("",!0):(n(),c("div",fs,[t(q,{size:"medium"},{default:a(()=>[t(l(me))]),_:1})])),l(f).state.userLogined?(n(),c("div",{key:3,class:"action-item hover",onClick:j(d,["stop"])},[t(q,{size:"medium"},{default:a(()=>[g.value?u("",!0):(n(),P(l(me),{key:0})),g.value?(n(),P(l(Re),{key:1,class:"show"})):u("",!0)]),_:1})],8,gs)):u("",!0),l(f).state.userLogined&&!k.value?(n(),c("span",{key:4,class:"show reply-btn",onClick:S[0]||(S[0]=L=>e(!0))}," 回复 ")):u("",!0),l(f).state.userLogined&&k.value?(n(),c("span",{key:5,class:"hide reply-btn",onClick:S[1]||(S[1]=L=>e(!1))}," 取消 ")):u("",!0)])]),k.value?(n(),c("div",ys,[t(z,null,{default:a(()=>[t(N,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:h.atUsername?"@"+h.atUsername:"请输入回复内容..",maxlength:l(R),value:U.value,"onUpdate:value":S[2]||(S[2]=L=>U.value=L),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(H,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:p},{default:a(()=>[x(" 回复 ")]),_:1},8,["loading"])]),_:1})])):u("",!0)])}}});const ws=se(ks,[["__scopeId","data-v-f9af7a93"]]),bs={class:"comment-item"},$s={class:"nickname-wrap"},Cs={class:"username-wrap"},xs={class:"opt-wrap"},Is={class:"timestamp"},Ts=["innerHTML"],Ps={class:"reply-wrap"},zs=Z({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(D,{emit:A}){const i=D,h=te(),f=Ae(),y=r(0),k=r(""),U=r(),_=ue(()=>{let d=Object.assign({texts:[],imgs:[]},i.comment);return d.contents.map(e=>{(+e.type==1||+e.type==2)&&d.texts.push(e),+e.type==3&&d.imgs.push(e)}),d}),R=(d,e)=>{let p=d.target;if(p.dataset.detail){const w=p.dataset.detail.split(":");w.length===2&&(h.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):f.push({name:"user",query:{s:w[1]}}))}},T=d=>{var e,p;y.value=d.user_id,k.value=((e=d.user)==null?void 0:e.username)||"",(p=U.value)==null||p.switchReply(!0)},g=()=>{A("reload")},b=()=>{y.value=0,k.value=""},O=()=>{Ke({id:_.value.id}).then(d=>{window.$message.success("删除成功"),setTimeout(()=>{g()},50)}).catch(d=>{})};return(d,e)=>{const p=ke,w=ge("router-link"),S=Y,q=oe,N=Se,H=De,z=ws,L=us,K=Le;return n(),c("div",bs,[t(K,{"content-indented":""},Ne({avatar:a(()=>[t(p,{round:"",size:30,src:_.value.user.avatar},null,8,["src"])]),header:a(()=>[v("span",$s,[t(w,{onClick:e[0]||(e[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:_.value.user.username}}},{default:a(()=>[x(I(_.value.user.nickname),1)]),_:1},8,["to"])]),v("span",Cs," @"+I(_.value.user.username),1)]),"header-extra":a(()=>[v("div",xs,[v("span",Is,I(_.value.ip_loc),1),l(h).state.userInfo.is_admin||l(h).state.userInfo.id===_.value.user.id?(n(),P(N,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:O},{trigger:a(()=>[t(q,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:a(()=>[t(S,null,{default:a(()=>[t(l(ze))]),_:1})]),_:1})]),default:a(()=>[x(" 是否确认删除? ")]),_:1})):u("",!0)])]),footer:a(()=>[_.value.imgs.length>0?(n(),P(H,{key:0,imgs:_.value.imgs},null,8,["imgs"])):u("",!0),t(z,{ref_key:"replyComposeRef",ref:U,comment:_.value,"at-userid":y.value,"at-username":k.value,onReload:g,onReset:b},null,8,["comment","at-userid","at-username"]),v("div",Ps,[(n(!0),c(ce,null,re(_.value.replies,F=>(n(),P(L,{key:F.id,reply:F,"tweet-id":_.value.post_id,onFocusReply:T,onReload:g},null,8,["reply","tweet-id"]))),128))])]),_:2},[_.value.texts.length>0?{name:"description",fn:a(()=>[(n(!0),c(ce,null,re(_.value.texts,F=>(n(),c("span",{key:F.id,class:"comment-text",onClick:e[1]||(e[1]=j(J=>R(J,_.value.id),["stop"])),innerHTML:l(we)(F.content).content},null,8,Ts))),128))]),key:"0"}:void 0]),1024)])}}});const Us=se(zs,[["__scopeId","data-v-36dac8c8"]]),Rs=D=>(Te("data-v-634e6bfd"),D=D(),Pe(),D),Ss={key:0,class:"compose-wrap"},Ls={class:"compose-line"},Os={class:"compose-user"},Ds={class:"compose-line compose-options"},As={class:"attachment"},Ms={class:"submit-wrap"},Es={class:"attachment-list-wrap"},qs={key:1,class:"compose-wrap"},Ns=Rs(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Bs={key:0,class:"login-only-wrap"},js={key:1,class:"login-wrap"},Fs=Z({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(D,{emit:A}){const i=D,h=te(),f=r([]),y=r(!1),k=r(!1),U=r(!1),_=r(""),R=r(),T=r("public/image"),g=r([]),b=r([]),O=r("true".toLowerCase()==="true"),d=+"300",e="/v1/attachment",p=r(),w=jt.debounce(s=>{Ge({k:s}).then(m=>{let $=[];m.suggest.map(C=>{$.push({label:C,value:C})}),f.value=$,k.value=!1}).catch(m=>{k.value=!1})},200),S=(s,m)=>{k.value||(k.value=!0,m==="@"&&w(s))},q=s=>{s.length>d?_.value=s.substring(0,d):_.value=s},N=s=>{T.value=s},H=s=>{for(let M=0;M30&&(s[M].name=$.substring(0,18)+"..."+$.substring($.length-9)+"."+C)}g.value=s},z=async s=>{var m,$;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((m=s.file.file)==null?void 0:m.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&(($=s.file.file)==null?void 0:$.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},L=({file:s,event:m})=>{var $;try{let C=JSON.parse(($=m.target)==null?void 0:$.response);C.code===0&&T.value==="public/image"&&b.value.push({id:s.id,content:C.data.content})}catch{window.$message.error("上传失败")}},K=({file:s,event:m})=>{var $;try{let C=JSON.parse(($=m.target)==null?void 0:$.response);if(C.code!==0){let M=C.msg||"上传失败";C.details&&C.details.length>0&&C.details.map(B=>{M+=":"+B}),window.$message.error(M)}}catch{window.$message.error("上传失败")}},F=({file:s})=>{let m=b.value.findIndex($=>$.id===s.id);m>-1&&b.value.splice(m,1)},J=()=>{y.value=!0},X=()=>{var s;y.value=!1,(s=R.value)==null||s.clear(),g.value=[],_.value="",b.value=[]},G=()=>{if(_.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:s}=we(_.value);const m=[];let $=100;m.push({content:_.value,type:2,sort:$}),b.value.map(C=>{$++,m.push({content:C.content,type:3,sort:$})}),U.value=!0,Qe({contents:m,post_id:i.postId,users:Array.from(new Set(s))}).then(C=>{window.$message.success("发布成功"),U.value=!1,A("post-success"),X()}).catch(C=>{U.value=!1})},o=s=>{h.commit("triggerAuth",!0),h.commit("triggerAuthKey",s)};return ye(()=>{p.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(s,m)=>{const $=ke,C=wt,M=Y,B=oe,V=bt,ne=$t,ve=Ct,he=xt,fe=It;return n(),c("div",null,[l(h).state.userInfo.id>0?(n(),c("div",Ss,[v("div",Ls,[v("div",Os,[t($,{round:"",size:30,src:l(h).state.userInfo.avatar},null,8,["src"])]),t(C,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:k.value,value:_.value,disabled:i.lock===1,"onUpdate:value":q,onSearch:S,onFocus:J,placeholder:i.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(n(),P(fe,{key:0,ref_key:"uploadRef",ref:R,abstract:"","list-type":"image",multiple:!0,max:9,action:e,headers:{Authorization:p.value},data:{type:T.value},"file-list":g.value,onBeforeUpload:z,onFinish:L,onError:K,onRemove:F,"onUpdate:fileList":H},{default:a(()=>[v("div",Ds,[v("div",As,[t(V,{abstract:""},{default:a(({handleClick:Q})=>[t(B,{disabled:g.value.length>0&&T.value==="public/video"||g.value.length===9,onClick:()=>{N("public/image"),Q()},quaternary:"",circle:"",type:"primary"},{icon:a(()=>[t(M,{size:"20",color:"var(--primary-color)"},{default:a(()=>[t(l(it))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(ve,{trigger:"hover",placement:"bottom"},{trigger:a(()=>[t(ne,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:_.value.length/l(d)*100},null,8,["percentage"])]),default:a(()=>[x(" "+I(_.value.length)+" / "+I(l(d)),1)]),_:1})]),v("div",Ms,[t(B,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:X},{default:a(()=>[x(" 取消 ")]),_:1}),t(B,{loading:U.value,onClick:G,type:"primary",secondary:"",size:"small",round:""},{default:a(()=>[x(" 发布 ")]),_:1},8,["loading"])])]),v("div",Es,[t(he)])]),_:1},8,["headers","data","file-list"])):u("",!0)])):(n(),c("div",qs,[Ns,O.value?u("",!0):(n(),c("div",Bs,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:m[0]||(m[0]=Q=>o("signin"))},{default:a(()=>[x(" 登录 ")]),_:1})])),O.value?(n(),c("div",js,[t(B,{strong:"",secondary:"",round:"",type:"primary",onClick:m[1]||(m[1]=Q=>o("signin"))},{default:a(()=>[x(" 登录 ")]),_:1}),t(B,{strong:"",secondary:"",round:"",type:"info",onClick:m[2]||(m[2]=Q=>o("signup"))},{default:a(()=>[x(" 注册 ")]),_:1})])):u("",!0)]))])}}});const Hs=se(Fs,[["__scopeId","data-v-634e6bfd"]]),Vs={class:"username-wrap"},Ys={key:0,class:"options"},Js={key:0},Ks=["innerHTML"],Gs={class:"timestamp"},Qs={key:0},Ws={key:1},Xs={class:"opts-wrap"},Zs=["onClick"],eo={class:"opt-item"},to=["onClick"],so=["onClick"],oo=Z({__name:"post-detail",props:{post:{}},emits:["reload"],setup(D,{emit:A}){const i=D,h="true".toLowerCase()==="true",f=te(),y=Ae(),k=r(!1),U=r(!1),_=r(!1),R=r(!1),T=r(!1),g=r(!1),b=r(!1),O=r(!1),d=r(W.PUBLIC),e=ue({get:()=>{let o=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},i.post);return o.contents.map(s=>{(+s.type==1||+s.type==2)&&o.texts.push(s),+s.type==3&&o.imgs.push(s),+s.type==4&&o.videos.push(s),+s.type==6&&o.links.push(s),+s.type==7&&o.attachments.push(s),+s.type==8&&o.charge_attachments.push(s)}),o},set:o=>{i.post.upvote_count=o.upvote_count,i.post.comment_count=o.comment_count,i.post.collection_count=o.collection_count,i.post.is_essence=o.is_essence}}),p=o=>()=>be(Y,null,{default:()=>be(o)}),w=ue(()=>{var m;let o=[{label:"删除",key:"delete",icon:p(vt)}];e.value.is_lock===0?o.push({label:"锁定",key:"lock",icon:p(ht)}):o.push({label:"解锁",key:"unlock",icon:p(ft)}),f.state.userInfo.is_admin&&(e.value.is_top===0?o.push({label:"置顶",key:"stick",icon:p(Ce)}):o.push({label:"取消置顶",key:"unstick",icon:p(Ce)})),e.value.is_essence===0?o.push({label:"设为亮点",key:"highlight",icon:p(xe)}):o.push({label:"取消亮点",key:"unhighlight",icon:p(xe)});let s;return e.value.visibility===W.PUBLIC?s={label:"公开",key:"vpublic",icon:p(ae),children:[{label:"私密",key:"vprivate",icon:p(le)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:e.value.visibility===W.PRIVATE?s={label:"私密",key:"vprivate",icon:p(le),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:h&&e.value.visibility===W.FRIEND?s={label:"好友可见",key:"vfriend",icon:p(Ie),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"私密",key:"vprivate",icon:p(le)},{label:"关注可见",key:"vfollowing",icon:p(ie)}]}:s={label:"关注可见",key:"vfollowing",icon:p(ie),children:[{label:"公开",key:"vpublic",icon:p(ae)},{label:"私密",key:"vprivate",icon:p(le)}]},h&&e.value.visibility!==W.FRIEND&&((m=s.children)==null||m.push({label:"好友可见",key:"vfriend",icon:p(Ie)})),o.push(s),o}),S=o=>{y.push({name:"post",query:{id:o}})},q=(o,s)=>{if(o.target.dataset.detail){const m=o.target.dataset.detail.split(":");if(m.length===2){f.commit("refresh"),m[0]==="tag"?y.push({name:"home",query:{q:m[1],t:"tag"}}):y.push({name:"user",query:{s:m[1]}});return}}S(s)},N=o=>{switch(o){case"delete":_.value=!0;break;case"lock":case"unlock":R.value=!0;break;case"stick":case"unstick":T.value=!0;break;case"highlight":case"unhighlight":g.value=!0;break;case"vpublic":d.value=0,b.value=!0;break;case"vprivate":d.value=1,b.value=!0;break;case"vfriend":d.value=2,b.value=!0;break;case"vfollowing":d.value=3,b.value=!0;break}},H=()=>{Ze({id:e.value.id}).then(o=>{window.$message.success("删除成功"),y.replace("/"),setTimeout(()=>{f.commit("refresh")},50)}).catch(o=>{O.value=!1})},z=()=>{et({id:e.value.id}).then(o=>{A("reload"),o.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(o=>{O.value=!1})},L=()=>{tt({id:e.value.id}).then(o=>{A("reload"),o.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(o=>{O.value=!1})},K=()=>{st({id:e.value.id}).then(o=>{e.value={...e.value,is_essence:o.highlight_status},o.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(o=>{O.value=!1})},F=()=>{let o=d.value;o==3&&(o=0),ot({id:e.value.id,visibility:o}).then(s=>{A("reload"),window.$message.success("修改可见性成功")}).catch(s=>{O.value=!1})},J=()=>{nt({id:e.value.id}).then(o=>{k.value=o.status,o.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count-1}}).catch(o=>{console.log(o)})},X=()=>{at({id:e.value.id}).then(o=>{U.value=o.status,o.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count-1}}).catch(o=>{console.log(o)})},G=()=>{Ft(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return ye(()=>{f.state.userInfo.id>0&&(We({id:e.value.id}).then(o=>{k.value=o.status}).catch(o=>{console.log(o)}),Xe({id:e.value.id}).then(o=>{U.value=o.status}).catch(o=>{console.log(o)}))}),(o,s)=>{const m=ke,$=ge("router-link"),C=Tt,M=oe,B=Pt,V=zt,ne=Mt,ve=De,he=Et,fe=qt,Q=Ut,Me=Oe,Ee=Le;return n(),c("div",{class:"detail-item",onClick:s[7]||(s[7]=E=>S(e.value.id))},[t(Ee,null,{avatar:a(()=>[t(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:a(()=>[t($,{onClick:s[0]||(s[0]=j(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:a(()=>[x(I(e.value.user.nickname),1)]),_:1},8,["to"]),v("span",Vs," @"+I(e.value.user.username),1),e.value.is_top?(n(),P(C,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:a(()=>[x(" 置顶 ")]),_:1})):u("",!0),e.value.visibility==l(W).PRIVATE?(n(),P(C,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:a(()=>[x(" 私密 ")]),_:1})):u("",!0),e.value.visibility==l(W).FRIEND?(n(),P(C,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:a(()=>[x(" 好友可见 ")]),_:1})):u("",!0)]),"header-extra":a(()=>[l(f).state.userInfo.is_admin||l(f).state.userInfo.id===e.value.user.id?(n(),c("div",Ys,[t(B,{placement:"bottom-end",trigger:"click",size:"small",options:w.value,onSelect:N},{default:a(()=>[t(M,{quaternary:"",circle:""},{icon:a(()=>[t(l(Y),null,{default:a(()=>[t(l(ut))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0),t(V,{show:_.value,"onUpdate:show":s[1]||(s[1]=E=>_.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:H},null,8,["show"]),t(V,{show:R.value,"onUpdate:show":s[2]||(s[2]=E=>R.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:z},null,8,["show","content"]),t(V,{show:T.value,"onUpdate:show":s[3]||(s[3]=E=>T.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:L},null,8,["show","content"]),t(V,{show:g.value,"onUpdate:show":s[4]||(s[4]=E=>g.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(e.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"]),t(V,{show:b.value,"onUpdate:show":s[5]||(s[5]=E=>b.value=E),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(d.value==0?"公开":d.value==1?"私密":d.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:F},null,8,["show","content"])]),footer:a(()=>[t(ne,{attachments:e.value.attachments},null,8,["attachments"]),t(ne,{attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"]),t(ve,{imgs:e.value.imgs},null,8,["imgs"]),t(he,{videos:e.value.videos,full:!0},null,8,["videos"]),t(fe,{links:e.value.links},null,8,["links"]),v("div",Gs,[x(" 发布于 "+I(l(_e)(e.value.created_on))+" ",1),e.value.ip_loc?(n(),c("span",Qs,[t(Q,{vertical:""}),x(" "+I(e.value.ip_loc),1)])):u("",!0),!l(f).state.collapsedLeft&&e.value.created_on!=e.value.latest_replied_on?(n(),c("span",Ws,[t(Q,{vertical:""}),x(" 最后回复 "+I(l(_e)(e.value.latest_replied_on)),1)])):u("",!0)])]),action:a(()=>[v("div",Xs,[t(Me,{justify:"space-between"},{default:a(()=>[v("div",{class:"opt-item hover",onClick:j(J,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[k.value?u("",!0):(n(),P(l(ct),{key:0})),k.value?(n(),P(l(rt),{key:1,color:"red"})):u("",!0)]),_:1}),x(" "+I(e.value.upvote_count),1)],8,Zs),v("div",eo,[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[t(l(_t))]),_:1}),x(" "+I(e.value.comment_count),1)]),v("div",{class:"opt-item hover",onClick:j(X,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[U.value?u("",!0):(n(),P(l(pt),{key:0})),U.value?(n(),P(l(dt),{key:1,color:"#ff7600"})):u("",!0)]),_:1}),x(" "+I(e.value.collection_count),1)],8,to),v("div",{class:"opt-item hover",onClick:j(G,["stop"])},[t(l(Y),{size:"20",class:"opt-item-icon"},{default:a(()=>[t(l(mt))]),_:1}),x(" "+I(e.value.share_count),1)],8,so)]),_:1})])]),default:a(()=>[e.value.texts.length>0?(n(),c("div",Js,[(n(!0),c(ce,null,re(e.value.texts,E=>(n(),c("span",{key:E.id,class:"post-text",onClick:s[6]||(s[6]=j(qe=>q(qe,e.value.id),["stop"])),innerHTML:l(we)(E.content).content},null,8,Ks))),128))])):u("",!0)]),_:1})])}}});const no=D=>(Te("data-v-0d01659f"),D=D(),Pe(),D),ao={key:0,class:"detail-wrap"},lo={key:1,class:"empty-wrap"},io={key:0,class:"comment-opts-wrap"},uo=no(()=>v("span",{class:"comment-title-item"},"评论",-1)),co={key:2},ro={key:0,class:"skeleton-wrap"},_o={key:1},po={key:0,class:"empty-wrap"},mo={key:0,class:"load-more-spinner"},vo={key:1,class:"load-more-spinner"},ho={key:2,class:"load-more-spinner"},fo={key:3,class:"load-more-spinner"},ee=20,go=Z({__name:"Post",setup(D){const A=Nt(),i=r({}),h=r(!1),f=r(!1),y=r([]),k=ue(()=>+A.query.id),U=r("default"),_=r(!0);let R={loading(){},loaded(){},complete(){},error(){}};const T=z=>{U.value=z,z==="default"&&(_.value=!0),N(R)},g=()=>{i.value={id:0},h.value=!0,lt({id:k.value}).then(z=>{h.value=!1,i.value=z,N(R)}).catch(z=>{h.value=!1})};let b=1;const O=r(!1),d=r([]),e=z=>{O.value||$e({id:i.value.id,sort_strategy:"default",page:b,page_size:ee}).then(L=>{z!==null&&(R=z),L.list.length0&&(b===1?d.value=L.list:d.value.push(...L.list),y.value=d.value),R.loaded(),f.value=!1}).catch(L=>{f.value=!1,R.error()})};let p=1,w=r(!1);const S=r([]),q=z=>{w.value||$e({id:i.value.id,sort_strategy:"newest",page:p,page_size:ee}).then(L=>{z!==null&&(R=z),L.list.length0&&(p===1?S.value=L.list:S.value.push(...L.list),y.value=S.value),R.loaded(),f.value=!1}).catch(L=>{f.value=!1,R.error()})},N=z=>{k.value<1||(y.value.length===0&&(f.value=!0),U.value==="default"?(y.value=d.value,e(z)):(y.value=S.value,q(z)),f.value=!1)},H=()=>{b=1,O.value=!1,d.value=[],p=1,w.value=!1,S.value=[],N(R)};return ye(()=>{g()}),Be(k,()=>{k.value>0&&A.name==="post"&&g()}),(z,L)=>{const K=Ht,F=oo,J=St,X=Lt,G=Ot,o=Dt,s=At,m=Hs,$=Bt,C=Us,M=Oe,B=Rt;return n(),c("div",null,[t(K,{title:"泡泡详情",back:!0}),t(B,{class:"main-content-wrap",bordered:""},{default:a(()=>[t(G,null,{default:a(()=>[t(X,{show:h.value},{default:a(()=>[i.value.id>1?(n(),c("div",ao,[t(F,{post:i.value,onReload:g},null,8,["post"])])):(n(),c("div",lo,[t(J,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),i.value.id>0?(n(),c("div",io,[t(s,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:a(()=>[uo]),default:a(()=>[t(o,{name:"default",tab:"默认"}),t(o,{name:"newest",tab:"最新"})]),_:1})])):u("",!0),i.value.id>0?(n(),P(G,{key:1},{default:a(()=>[t(m,{lock:i.value.is_lock,"post-id":i.value.id,onPostSuccess:H},null,8,["lock","post-id"])]),_:1})):u("",!0),i.value.id>0?(n(),c("div",co,[f.value?(n(),c("div",ro,[t($,{num:5})])):(n(),c("div",_o,[y.value.length===0?(n(),c("div",po,[t(J,{size:"large",description:"暂无评论,快来抢沙发"})])):u("",!0),(n(!0),c(ce,null,re(y.value,V=>(n(),P(G,{key:V.id},{default:a(()=>[t(C,{comment:V,onReload:H},null,8,["comment"])]),_:2},1024))),128))]))])):u("",!0),y.value.length>=ee?(n(),P(M,{key:3,justify:"center"},{default:a(()=>[t(l(Vt),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:N},{spinner:a(()=>[_.value&&O.value?(n(),c("span",mo)):u("",!0),!_.value&&l(w)?(n(),c("span",vo)):u("",!0),_.value&&!O.value?(n(),c("span",ho,"加载评论")):u("",!0),!_.value&&!l(w)?(n(),c("span",fo,"加载评论")):u("",!0)]),_:1})]),_:1})):u("",!0)]),_:1})])}}});const Xo=se(go,[["__scopeId","data-v-0d01659f"]]);export{Xo as default}; diff --git a/web/dist/assets/Profile-03eea9fe.js b/web/dist/assets/Profile-03eea9fe.js new file mode 100644 index 00000000..cce950e1 --- /dev/null +++ b/web/dist/assets/Profile-03eea9fe.js @@ -0,0 +1 @@ +import{_ as de}from"./whisper-5fc7c61f.js";import{_ as ge,a as he}from"./post-item.vue_vue_type_style_index_0_lang-a10065a5.js";import{_ as we}from"./post-skeleton-7039dc67.js";import{_ as ke}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{d as ye,H as s,b as be,E as Pe,r as Ie,f,k as u,bf as i,q as w,w as p,Y as y,e as r,j as c,x as d,A as $,y as Q,F as X,u as Z}from"./@vue-a481fc63.js";import{u as Te}from"./vuex-44de225f.js";import{b as Me}from"./vue-router-e5a2430e.js";import{e as b,_ as ze}from"./index-d9eb4c9e.js";import{b as qe}from"./formatTime-4210fcd1.js";import{W as xe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Se,a as $e,o as Ce,M as Le,f as Be,g as Ne,I as Ve,k as De,G as Fe}from"./naive-ui-d8de3dda.js";import"./content-218c067c.js";import"./@vicons-1a3558c6.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const Ue={class:"profile-baseinfo"},We={class:"avatar"},je={class:"base-info"},Ee={class:"username"},He={class:"userinfo"},Re={class:"info-item"},Ae={class:"info-item"},Ge={class:"userinfo"},Ye={class:"info-item"},Je={class:"info-item"},Ke={key:0,class:"skeleton-wrap"},Oe={key:1},Qe={key:0,class:"empty-wrap"},Xe={key:1},Ze={key:2},ea={class:"load-more-wrap"},aa={class:"load-more-spinner"},ta=ye({__name:"Profile",setup(sa){const o=Te(),g=Me(),n=s(!1),_=s(!1),a=s([]),C=s([]),L=s([]),B=s([]),N=s([]),V=s([]),P=s("post"),D=s(+g.query.p||1),F=s(1),U=s(1),W=s(1),j=s(1),t=s(+g.query.p||1),v=s(20),l=s(0),E=s(0),H=s(0),R=s(0),A=s(0),G=s(0),I=s(!1),Y=s({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),J=e=>{Y.value=e,I.value=!0},ee=()=>{I.value=!1},T=()=>{switch(P.value){case"post":M();break;case"comment":z();break;case"highlight":q();break;case"media":x();break;case"star":S();break}},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),C.value=a.value,E.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=a.value,H.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=a.value,R.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),N.value=a.value,A.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},S=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),V.value=a.value,G.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},ae=e=>{switch(P.value=e,P.value){case"post":a.value=C.value,t.value=D.value,l.value=E.value,M();break;case"comment":a.value=L.value,t.value=F.value,l.value=H.value,z();break;case"highlight":a.value=B.value,t.value=U.value,l.value=R.value,q();break;case"media":a.value=N.value,t.value=W.value,l.value=A.value,x();break;case"star":a.value=V.value,t.value=j.value,l.value=G.value,S();break}},te=()=>{switch(P.value){case"post":D.value=t.value,M();break;case"comment":F.value=t.value,z();break;case"highlight":U.value=t.value,q();break;case"media":W.value=t.value,x();break;case"star":j.value=t.value,S();break}},se=()=>{t.value{T()}),Pe(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+g.query.p||1,setTimeout(()=>{T()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+g.query.p||1,setTimeout(()=>{T()},0))}),(e,m)=>{const oe=ke,le=Ce,ne=Le,K=Ie("router-link"),k=Be,ue=Ne,ie=we,re=Ve,ce=ge,O=Fe,ve=he,_e=de,me=Se,pe=De,fe=$e;return r(),f("div",null,[u(oe,{title:"主页"}),i(o).state.userInfo.id>0?(r(),w(me,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Ue,[c("div",We,[u(le,{size:72,src:i(o).state.userInfo.avatar},null,8,["src"])]),c("div",je,[c("div",Ee,[c("strong",null,d(i(o).state.userInfo.nickname),1),c("span",null," @"+d(i(o).state.userInfo.username),1),i(o).state.userInfo.is_admin?(r(),w(ne,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[$(" 管理员 ")]),_:1})):y("",!0)]),c("div",He,[c("span",Re,"UID. "+d(i(o).state.userInfo.id),1),c("span",Ae,d(i(qe)(i(o).state.userInfo.created_on))+" 加入",1)]),c("div",Ge,[c("span",Ye,[u(K,{onClick:m[0]||(m[0]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[$(" 关注  "+d(i(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",Je,[u(K,{onClick:m[1]||(m[1]=Q(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:i(o).state.userInfo.username,n:i(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[$(" 粉丝  "+d(i(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),u(ue,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":ae},{default:p(()=>[u(k,{name:"post",tab:"泡泡"}),u(k,{name:"comment",tab:"评论"}),u(k,{name:"highlight",tab:"亮点"}),u(k,{name:"media",tab:"图文"}),u(k,{name:"star",tab:"喜欢"})]),_:1}),n.value&&a.value.length===0?(r(),f("div",Ke,[u(ie,{num:v.value},null,8,["num"])])):(r(),f("div",Oe,[a.value.length===0?(r(),f("div",Qe,[u(re,{size:"large",description:"暂无数据"})])):y("",!0),i(o).state.desktopModelShow?(r(),f("div",Xe,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ce,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",Ze,[(r(!0),f(X,null,Z(a.value,h=>(r(),w(O,{key:h.id},{default:p(()=>[u(ve,{post:h,onSendWhisper:J},null,8,["post"])]),_:2},1024))),128))]))])),u(_e,{show:I.value,user:Y.value,onSuccess:ee},null,8,["show","user"])]),_:1})):y("",!0),l.value>0?(r(),w(fe,{key:1,justify:"center"},{default:p(()=>[u(i(xe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>se())},{spinner:p(()=>[c("div",ea,[_.value?y("",!0):(r(),w(pe,{key:0,size:14})),c("span",aa,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Da=ze(ta,[["__scopeId","data-v-52df1da9"]]);export{Da as default}; diff --git a/web/dist/assets/Profile-389382b2.js b/web/dist/assets/Profile-389382b2.js deleted file mode 100644 index 15e72217..00000000 --- a/web/dist/assets/Profile-389382b2.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as ve,a as _e}from"./post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js";import{_ as me}from"./post-skeleton-c82f8a59.js";import{_ as pe}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{d as fe,H as s,b as de,E as ge,r as he,f,k as i,bf as u,q as k,w as p,Y as y,e as r,j as c,x as d,A as C,y as J,F as K,u as O}from"./@vue-a481fc63.js";import{u as ke}from"./vuex-44de225f.js";import{b as we}from"./vue-router-e5a2430e.js";import{e as b,_ as ye}from"./index-757c547c.js";import{b as be}from"./formatTime-4210fcd1.js";import{W as Pe}from"./v3-infinite-loading-2c58ec2f.js";import{F as Ie,a as Te,o as Me,M as ze,f as qe,g as xe,I as Ce,k as $e,G as Le}from"./naive-ui-d8de3dda.js";import"./content-d5264b98.js";import"./@vicons-1a3558c6.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const Se={class:"profile-baseinfo"},Be={class:"avatar"},Ne={class:"base-info"},Ve={class:"username"},De={class:"userinfo"},Fe={class:"info-item"},Ue={class:"info-item"},je={class:"userinfo"},Ee={class:"info-item"},He={class:"info-item"},Ae={key:0,class:"skeleton-wrap"},Ge={key:1},Re={key:0,class:"empty-wrap"},We={key:1},Ye={key:2},Je={class:"load-more-wrap"},Ke={class:"load-more-spinner"},Oe=fe({__name:"Profile",setup(Qe){const o=ke(),g=we(),n=s(!1),_=s(!1),a=s([]),$=s([]),L=s([]),S=s([]),B=s([]),N=s([]),P=s("post"),V=s(+g.query.p||1),D=s(1),F=s(1),U=s(1),j=s(1),t=s(+g.query.p||1),v=s(20),l=s(0),E=s(0),H=s(0),A=s(0),G=s(0),R=s(0),I=()=>{switch(P.value){case"post":T();break;case"comment":M();break;case"highlight":z();break;case"media":q();break;case"star":x();break}},T=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"post",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),$.value=a.value,E.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},M=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"comment",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),L.value=a.value,H.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},z=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"highlight",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),S.value=a.value,A.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},q=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"media",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),B.value=a.value,G.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},x=()=>{n.value=!0,b({username:o.state.userInfo.username,style:"star",page:t.value,page_size:v.value}).then(e=>{n.value=!1,e.list.length===0&&(_.value=!0),t.value>1?a.value=a.value.concat(e.list):(a.value=e.list||[],window.scrollTo(0,0)),l.value=Math.ceil(e.pager.total_rows/v.value),N.value=a.value,R.value=l.value}).catch(e=>{a.value=[],t.value>1&&t.value--,n.value=!1})},Q=e=>{switch(P.value=e,P.value){case"post":a.value=$.value,t.value=V.value,l.value=E.value,T();break;case"comment":a.value=L.value,t.value=D.value,l.value=H.value,M();break;case"highlight":a.value=S.value,t.value=F.value,l.value=A.value,z();break;case"media":a.value=B.value,t.value=U.value,l.value=G.value,q();break;case"star":a.value=N.value,t.value=j.value,l.value=R.value,x();break}},X=()=>{switch(P.value){case"post":V.value=t.value,T();break;case"comment":D.value=t.value,M();break;case"highlight":F.value=t.value,z();break;case"media":U.value=t.value,q();break;case"star":j.value=t.value,x();break}},Z=()=>{t.value{I()}),ge(()=>({path:g.path,query:g.query,refresh:o.state.refresh}),(e,m)=>{if(e.refresh!==m.refresh){t.value=+g.query.p||1,setTimeout(()=>{I()},0);return}m.path!=="/post"&&e.path==="/profile"&&(t.value=+g.query.p||1,setTimeout(()=>{I()},0))}),(e,m)=>{const ee=pe,ae=Me,te=ze,W=he("router-link"),w=qe,se=xe,oe=me,le=Ce,ne=ve,Y=Le,ue=_e,ie=Ie,re=$e,ce=Te;return r(),f("div",null,[i(ee,{title:"主页"}),u(o).state.userInfo.id>0?(r(),k(ie,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:p(()=>[c("div",Se,[c("div",Be,[i(ae,{size:72,src:u(o).state.userInfo.avatar},null,8,["src"])]),c("div",Ne,[c("div",Ve,[c("strong",null,d(u(o).state.userInfo.nickname),1),c("span",null," @"+d(u(o).state.userInfo.username),1),u(o).state.userInfo.is_admin?(r(),k(te,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[C(" 管理员 ")]),_:1})):y("",!0)]),c("div",De,[c("span",Fe,"UID. "+d(u(o).state.userInfo.id),1),c("span",Ue,d(u(be)(u(o).state.userInfo.created_on))+" 加入",1)]),c("div",je,[c("span",Ee,[i(W,{onClick:m[0]||(m[0]=J(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"follows"}}},{default:p(()=>[C(" 关注  "+d(u(o).state.userInfo.follows),1)]),_:1},8,["to"])]),c("span",He,[i(W,{onClick:m[1]||(m[1]=J(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:u(o).state.userInfo.username,n:u(o).state.userInfo.nickname,t:"followings"}}},{default:p(()=>[C(" 粉丝  "+d(u(o).state.userInfo.followings),1)]),_:1},8,["to"])])])])]),i(se,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":Q},{default:p(()=>[i(w,{name:"post",tab:"泡泡"}),i(w,{name:"comment",tab:"评论"}),i(w,{name:"highlight",tab:"亮点"}),i(w,{name:"media",tab:"图文"}),i(w,{name:"star",tab:"喜欢"})]),_:1}),n.value&&a.value.length===0?(r(),f("div",Ae,[i(oe,{num:v.value},null,8,["num"])])):(r(),f("div",Ge,[a.value.length===0?(r(),f("div",Re,[i(le,{size:"large",description:"暂无数据"})])):y("",!0),u(o).state.desktopModelShow?(r(),f("div",We,[(r(!0),f(K,null,O(a.value,h=>(r(),k(Y,{key:h.id},{default:p(()=>[i(ne,{post:h},null,8,["post"])]),_:2},1024))),128))])):(r(),f("div",Ye,[(r(!0),f(K,null,O(a.value,h=>(r(),k(Y,{key:h.id},{default:p(()=>[i(ue,{post:h},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):y("",!0),l.value>0?(r(),k(ce,{key:1,justify:"center"},{default:p(()=>[i(u(Pe),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:m[2]||(m[2]=h=>Z())},{spinner:p(()=>[c("div",Je,[_.value?y("",!0):(r(),k(re,{key:0,size:14})),c("span",Ke,d(_.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Ca=ye(Oe,[["__scopeId","data-v-0542f078"]]);export{Ca as default}; diff --git a/web/dist/assets/Profile-88292227.css b/web/dist/assets/Profile-88292227.css new file mode 100644 index 00000000..61883cb7 --- /dev/null +++ b/web/dist/assets/Profile-88292227.css @@ -0,0 +1 @@ +.profile-baseinfo[data-v-52df1da9]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-52df1da9]{width:72px}.profile-baseinfo .base-info[data-v-52df1da9]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-52df1da9]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-52df1da9]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-52df1da9]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-52df1da9]{transform:scale(.75)}.profile-tabs-wrap[data-v-52df1da9]{padding:0 16px}.load-more[data-v-52df1da9]{margin:20px}.load-more .load-more-wrap[data-v-52df1da9]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-52df1da9]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-52df1da9],.dark .pagination-wrap[data-v-52df1da9]{background-color:#101014bf} diff --git a/web/dist/assets/Profile-ab12b2fa.css b/web/dist/assets/Profile-ab12b2fa.css deleted file mode 100644 index 229135cf..00000000 --- a/web/dist/assets/Profile-ab12b2fa.css +++ /dev/null @@ -1 +0,0 @@ -.profile-baseinfo[data-v-0542f078]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-0542f078]{width:72px}.profile-baseinfo .base-info[data-v-0542f078]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-0542f078]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-0542f078]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-0542f078]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-0542f078]{transform:scale(.75)}.profile-tabs-wrap[data-v-0542f078]{padding:0 16px}.load-more[data-v-0542f078]{margin:20px}.load-more .load-more-wrap[data-v-0542f078]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-0542f078]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-0542f078],.dark .pagination-wrap[data-v-0542f078]{background-color:#101014bf} diff --git a/web/dist/assets/Setting-07adc927.js b/web/dist/assets/Setting-f3723e49.js similarity index 97% rename from web/dist/assets/Setting-07adc927.js rename to web/dist/assets/Setting-f3723e49.js index 03950ac8..6458ecea 100644 --- a/web/dist/assets/Setting-07adc927.js +++ b/web/dist/assets/Setting-f3723e49.js @@ -1 +1 @@ -import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{d as ye,H as d,R as X,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 c,x as R,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{X as Q,Y as Se,Z as Ue,$ as Re,a0 as qe,a1 as Ae,a2 as Be,_ as Ne}from"./index-757c547c.js";import{Y as ze}from"./@vicons-1a3558c6.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as Ye}from"./naive-ui-d8de3dda.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),We={class:"base-line avatar"},Ze={class:"base-line"},Ge=j(()=>m("span",{class:"base-label"},"昵称",-1)),He={key:0},Je={class:"base-line"},Xe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},et={key:1},tt=j(()=>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=j(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={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),K=d(!1),M=d(),Y=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),Z=d(),G=d(),H=d(),a=X({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=X({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"&&Se({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}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=H.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(z.value=!0,Re({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=Z.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.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=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{Q().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&U.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=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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=Y.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),O(),T()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=je,ge=Oe,F=Ke,J=Te,w=Ve,he=Ee,V=Le,E=Me,L=Ye;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[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(D,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ze,[Ge,C.value?_("",!0):(r(),g("div",He,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:Y,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:ce,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(p,{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",Je,[Xe,c(" @"+R(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",Qe,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(J,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),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:W,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:O},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(p,{type:"primary",ghost:"",disabled:U.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&U.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(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_: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,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(J,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),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:Z,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",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:T},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),S.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:G,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:H,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(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>S.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_: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-52b53177.js";import{d as ye,H as d,R as X,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 c,x as R,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{X as Q,Y as Se,Z as Ue,$ as Re,a0 as qe,a1 as Ae,a2 as Be,_ as Ne}from"./index-d9eb4c9e.js";import{Y as ze}from"./@vicons-1a3558c6.js";import{h as Ke,o as xe,e as De,B as Fe,b as je,j as Oe,S as Te,$ as Ve,K as Ee,a0 as Le,a1 as Me,d as Ye}from"./naive-ui-d8de3dda.js";import"./vue-router-e5a2430e.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const j=B=>(Ie("data-v-a681720e"),B=B(),$e(),B),We={class:"base-line avatar"},Ze={class:"base-line"},Ge=j(()=>m("span",{class:"base-label"},"昵称",-1)),He={key:0},Je={class:"base-line"},Xe=j(()=>m("span",{class:"base-label"},"用户名",-1)),Qe={key:0},et={key:1},tt=j(()=>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=j(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={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),K=d(!1),M=d(),Y=d(),C=d(!1),x=d(!1),S=d(!1),U=d(!1),I=d(60),y=d(!1),k=d(!1),W=d(),Z=d(),G=d(),H=d(),a=X({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=X({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"&&Se({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}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=H.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{v||(x.value=!0,Ue({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,S.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(z.value=!0,Re({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=Z.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.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=>{K.value=!1,f.code===20012&&T()}))})},O=()=>{Q().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},T=()=>{Q().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Ae({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&U.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=>{U.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,U.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&O(),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=Y.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),O(),T()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=je,ge=Oe,F=Ke,J=Te,w=Ve,he=Ee,V=Le,E=Me,L=Ye;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",We,[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(D,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:N.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ze,[Ge,C.value?_("",!0):(r(),g("div",He,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:Y,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:ce,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(p,{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",Je,[Xe,c(" @"+R(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",Qe,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(J,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),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:W,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:O},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(p,{type:"primary",ghost:"",disabled:U.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&U.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(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_: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,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(J,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),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:Z,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",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:T},null,8,_t)):_("",!0)])])]),_:1}),t(E,{gutter:[0,24]},{default:s(()=>[t(V,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),S.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>S.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),S.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:G,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:H,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(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>S.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_: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-60f034a7.js b/web/dist/assets/Topic-98177f3e.js similarity index 97% rename from web/dist/assets/Topic-60f034a7.js rename to web/dist/assets/Topic-98177f3e.js index 63569bb3..1e7fa1bf 100644 --- a/web/dist/assets/Topic-60f034a7.js +++ b/web/dist/assets/Topic-98177f3e.js @@ -1 +1 @@ -import{z as $,A as I,B as M,C as O,_ as U}from"./index-757c547c.js";import{w as j}from"./@vicons-1a3558c6.js";import{d as F,H as i,c as A,b as q,r as x,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as p,bf as h,E as D,al as H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as ne}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.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":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=J,k=C,a=K,d=P,v=Q,u=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(u,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?p("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):p("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(j))]),_:1})]),_:1})]),_:1},8,["options"])])):p("",!0)]),_:1})])):p("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,u=X,L=C,V=Z,N=ie,S=ee,z=oe,E=W;return c(),_("div",null,[n(v,{title:"话题"}),n(E,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({default:s(()=>[n(u,{name:"hot",tab:"热门"}),n(u,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(u,{key:0,name:"follow",tab:"关注"})):p("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=U(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; +import{z as $,A as I,B as M,C as O,_ as U}from"./index-d9eb4c9e.js";import{w as j}from"./@vicons-1a3558c6.js";import{d as F,H as i,c as A,b as q,r as x,e as c,f as _,k as n,w as s,q as b,A as B,x as f,Y as p,bf as h,E as D,al as H,F as Y,u as G}from"./@vue-a481fc63.js";import{o as J,M as C,j as K,e as P,O as Q,L as R,F as W,f as X,g as Z,a as ee,k as oe}from"./naive-ui-d8de3dda.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{u as ne}from"./vuex-44de225f.js";import"./vue-router-e5a2430e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=F({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.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":M({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":$({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=J,k=C,a=K,d=P,v=Q,u=R;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(u,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[B(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?p("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):p("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(j))]),_:1})]),_:1})]),_:1},8,["options"])])):p("",!0)]),_:1})])):p("",!0)}}});const _e=F({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,O({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,u=X,L=C,V=Z,N=ie,S=ee,z=oe,E=W;return c(),_("div",null,[n(v,{title:"话题"}),n(E,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(V,{type:"line",animated:"","onUpdate:value":k},H({default:s(()=>[n(u,{name:"hot",tab:"热门"}),n(u,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(u,{key:0,name:"follow",tab:"关注"})):p("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(L,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[B(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:l.value},{default:s(()=>[n(S,null,{default:s(()=>[(c(!0),_(Y,null,G(r.value,y=>(c(),b(N,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Ne=U(_e,[["__scopeId","data-v-1fb31ecf"]]);export{Ne as default}; diff --git a/web/dist/assets/User-917e7989.css b/web/dist/assets/User-917e7989.css deleted file mode 100644 index 49cd448b..00000000 --- a/web/dist/assets/User-917e7989.css +++ /dev/null @@ -1 +0,0 @@ -.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-0436abd3]{padding:0 16px}.profile-baseinfo[data-v-0436abd3]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-0436abd3]{width:72px}.profile-baseinfo .base-info[data-v-0436abd3]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-0436abd3]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-0436abd3]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-0436abd3]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-0436abd3]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-0436abd3]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-0436abd3]{margin:20px}.load-more .load-more-wrap[data-v-0436abd3]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-0436abd3]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-0436abd3],.dark .pagination-wrap[data-v-0436abd3]{background-color:#101014bf} diff --git a/web/dist/assets/User-e6eae837.css b/web/dist/assets/User-e6eae837.css new file mode 100644 index 00000000..5896d59b --- /dev/null +++ b/web/dist/assets/User-e6eae837.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-3584e0a9]{padding:0 16px}.profile-baseinfo[data-v-3584e0a9]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-3584e0a9]{width:72px}.profile-baseinfo .base-info[data-v-3584e0a9]{position:relative;margin-left:12px;width:calc(100% - 84px)}.profile-baseinfo .base-info .username[data-v-3584e0a9]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .userinfo[data-v-3584e0a9]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .userinfo .info-item[data-v-3584e0a9]{margin-right:12px}.profile-baseinfo .base-info .top-tag[data-v-3584e0a9]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-3584e0a9]{position:absolute;top:16px;right:16px;opacity:.75}.load-more[data-v-3584e0a9]{margin:20px}.load-more .load-more-wrap[data-v-3584e0a9]{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:14px}.load-more .load-more-wrap .load-more-spinner[data-v-3584e0a9]{font-size:14px;opacity:.65}.dark .profile-wrap[data-v-3584e0a9],.dark .pagination-wrap[data-v-3584e0a9]{background-color:#101014bf} diff --git a/web/dist/assets/User-f262d052.js b/web/dist/assets/User-f262d052.js new file mode 100644 index 00000000..340e26ef --- /dev/null +++ b/web/dist/assets/User-f262d052.js @@ -0,0 +1 @@ +import{_ as Re,a as He}from"./post-item.vue_vue_type_style_index_0_lang-a10065a5.js";import{_ as Ne}from"./post-skeleton-7039dc67.js";import{_ as Ve}from"./whisper-5fc7c61f.js";import{_ as je}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{d as ve,H as l,e as r,q as y,w as n,j as _,k as o,A as b,x as h,R as Ee,c as Ge,b as Ye,E as Je,r as Ke,f as g,Y as k,bf as m,y as ne,F as ue,u as ie,h as ce}from"./@vue-a481fc63.js";import{u as Qe}from"./vuex-44de225f.js";import{b as Xe}from"./vue-router-e5a2430e.js";import{D as Ze,_ as pe,E as ea,e as O,F as aa,G as sa,H as ta,I as la}from"./index-d9eb4c9e.js";import{R as oa,H as na,S as ua,b as ia,e as de,i as ca,T as ra,F as _a,a as va,j as re,o as pa,M as da,O as ma,k as fa,f as ga,g as ha,I as wa,G as ka}from"./naive-ui-d8de3dda.js";import{b as ya}from"./formatTime-4210fcd1.js";import{W as ba}from"./v3-infinite-loading-2c58ec2f.js";import{i as Pa,x as $a,y as _e,z as xa,u as Ta,D as za,G as Ua}from"./@vicons-1a3558c6.js";import"./content-218c067c.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const Fa={class:"whisper-wrap"},Ia={class:"whisper-line"},qa={class:"whisper-line send-wrap"},Ca=ve({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(ae,{emit:F}){const f=ae,p=l(""),P=l(!1),u=()=>{F("success")},v=()=>{P.value=!0,Ze({user_id:f.user.id,greetings:p.value}).then(a=>{window.$message.success("发送成功"),P.value=!1,p.value="",u()}).catch(a=>{P.value=!1})};return(a,c)=>{const T=oa,I=na,s=ua,q=ia,C=de,M=ca;return r(),y(M,{show:a.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",Fa,[o(s,{"show-icon":!1},{default:n(()=>[b(" 发送添加朋友申请给: "),o(I,{style:{"max-width":"100%"}},{default:n(()=>[o(T,{type:"success"},{default:n(()=>[b(h(a.user.nickname)+"@"+h(a.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ia,[o(q,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:p.value,"onUpdate:value":c[0]||(c[0]=S=>p.value=S),maxlength:"120","show-count":""},null,8,["value"])]),_("div",qa,[o(C,{strong:"",secondary:"",type:"primary",loading:P.value,onClick:v},{default:n(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ma=pe(Ca,[["__scopeId","data-v-60be56a2"]]),Sa={key:0,class:"profile-baseinfo"},Wa={class:"avatar"},La={class:"base-info"},Oa={class:"username"},Aa={class:"userinfo"},Da={class:"info-item"},Ba={class:"info-item"},Ra={class:"userinfo"},Ha={class:"info-item"},Na={class:"info-item"},Va={key:0,class:"user-opts"},ja={key:0,class:"skeleton-wrap"},Ea={key:1},Ga={key:0,class:"empty-wrap"},Ya={key:1},Ja={key:2},Ka={class:"load-more-wrap"},Qa={class:"load-more-spinner"},Xa=ve({__name:"User",setup(ae){const F=ra(),f=Qe(),p=Xe(),P="true".toLowerCase()==="true",u=l(!1),v=l(!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}),c=l(!1),T=l(!1),I=l(!1),s=l([]),q=l([]),C=l([]),M=l([]),S=l([]),D=l([]),$=l(p.query.s||""),t=l(+p.query.p||1),z=l("post"),B=l(+p.query.p||1),R=l(1),H=l(1),N=l(1),V=l(1),d=l(20),i=l(0),j=l(0),E=l(0),G=l(0),Y=l(0),J=l(0),se=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,T.value=!0},me=()=>{v.value=!1,s.value=[],q.value=[],C.value=[],M.value=[],S.value=[],D.value=[],z.value="post",t.value=1,B.value=1,R.value=1,H.value=1,N.value=1,V.value=1,i.value=0,j.value=0,E.value=0,G.value=0,Y.value=0,J.value=0},fe=()=>{switch(z.value){case"post":A();break;case"comment":K();break;case"highlight":Q();break;case"media":X();break;case"star":Z();break}},A=()=>{u.value=!0,O({username:$.value,style:"post",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),q.value=s.value,j.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},K=()=>{u.value=!0,O({username:$.value,style:"comment",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),C.value=s.value,E.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,O({username:$.value,style:"highlight",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),M.value=s.value,G.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,O({username:$.value,style:"media",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),S.value=s.value,Y.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,O({username:$.value,style:"star",page:t.value,page_size:d.value}).then(e=>{u.value=!1,e.list.length===0&&(v.value=!0),t.value>1?s.value=s.value.concat(e.list):(s.value=e.list||[],window.scrollTo(0,0)),i.value=Math.ceil(e.pager.total_rows/d.value),D.value=s.value,J.value=i.value}).catch(e=>{s.value=[],t.value>1&&t.value--,u.value=!1})},ge=e=>{switch(z.value=e,z.value){case"post":s.value=q.value,t.value=B.value,i.value=j.value,A();break;case"comment":s.value=C.value,t.value=R.value,i.value=E.value,K();break;case"highlight":s.value=M.value,t.value=H.value,i.value=G.value,Q();break;case"media":s.value=S.value,t.value=N.value,i.value=Y.value,X();break;case"star":s.value=D.value,t.value=V.value,i.value=J.value,Z();break}},W=()=>{c.value=!0,ea({username:$.value}).then(e=>{c.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,fe()}).catch(e=>{c.value=!1,console.log(e)})},he=()=>{switch(z.value){case"post":B.value=t.value,A();break;case"comment":R.value=t.value,K();break;case"highlight":H.value=t.value,Q();break;case"media":N.value=t.value,X();break;case"star":V.value=t.value,Z();break}},we=()=>{T.value=!0},ke=()=>{I.value=!0},ye=()=>{T.value=!1},be=()=>{I.value=!1},x=e=>()=>ce(re,null,{default:()=>ce(e)}),Pe=Ge(()=>{let e=[{label:"私信",key:"whisper",icon:x($a)}];return f.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:x(_e)}):e.push({label:"解封",key:"deblocking",icon:x(_e)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:x(xa)}):e.push({label:"关注",key:"follow",icon:x(Ta)}),P&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:x(za)}):e.push({label:"添加朋友",key:"requesting",icon:x(Ua)})),e}),$e=e=>{switch(e){case"whisper":we();break;case"delete":xe();break;case"requesting":ke();break;case"follow":case"unfollow":Te();break;case"banned":case"deblocking":ze();break}},xe=()=>{F.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,aa({user_id:a.id}).then(e=>{c.value=!1,a.is_friend=!1,A()}).catch(e=>{c.value=!1,console.log(e)})}})},Te=()=>{F.success({title:"提示",content:"确定"+(a.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,a.is_following?sa({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)}):ta({user_id:a.id}).then(e=>{c.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},ze=()=>{F.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{c.value=!0,la({id:a.id,status:a.status===1?2:1}).then(e=>{c.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{c.value=!1,console.log(e)})}})},Ue=()=>{t.value{W()}),Je(()=>({path:p.path,query:p.query}),(e,w)=>{w.path==="/u"&&e.path==="/u"&&($.value=p.query.s||"",me(),W())}),(e,w)=>{const Fe=je,Ie=pa,ee=da,te=Ke("router-link"),qe=de,Ce=ma,Me=Ve,le=fa,L=ga,Se=ha,We=Ne,Le=wa,Oe=Re,oe=ka,Ae=He,De=_a,Be=va;return r(),g("div",null,[o(Fe,{title:"用户详情"}),o(De,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[o(le,{show:c.value},{default:n(()=>[a.id>0?(r(),g("div",Sa,[_("div",Wa,[o(Ie,{size:72,src:a.avatar},null,8,["src"])]),_("div",La,[_("div",Oa,[_("strong",null,h(a.nickname),1),_("span",null," @"+h(a.username),1),P&&m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_friend?(r(),y(ee,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[b(" 好友 ")]),_:1})):k("",!0),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username&&a.is_following?(r(),y(ee,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:n(()=>[b(" 已关注 ")]),_:1})):k("",!0),a.is_admin?(r(),y(ee,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[b(" 管理员 ")]),_:1})):k("",!0)]),_("div",Aa,[_("span",Da,"UID. "+h(a.id),1),_("span",Ba,h(m(ya)(a.created_on))+" 加入",1)]),_("div",Ra,[_("span",Ha,[o(te,{onClick:w[0]||(w[0]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:n(()=>[b(" 关注  "+h(a.follows),1)]),_:1},8,["to"])]),_("span",Na,[o(te,{onClick:w[1]||(w[1]=ne(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:n(()=>[b(" 粉丝  "+h(a.followings),1)]),_:1},8,["to"])])])]),m(f).state.userInfo.id>0&&m(f).state.userInfo.username!=a.username?(r(),g("div",Va,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:Pe.value,onSelect:$e},{default:n(()=>[o(qe,{quaternary:"",circle:""},{icon:n(()=>[o(m(re),null,{default:n(()=>[o(m(Pa))]),_:1})]),_:1})]),_:1},8,["options"])])):k("",!0)])):k("",!0),o(Me,{show:T.value,user:a,onSuccess:ye},null,8,["show","user"]),o(Ma,{show:I.value,user:a,onSuccess:be},null,8,["show","user"])]),_:1},8,["show"]),o(Se,{class:"profile-tabs-wrap",type:"line",animated:"",value:z.value,"onUpdate:value":ge},{default:n(()=>[o(L,{name:"post",tab:"泡泡"}),o(L,{name:"comment",tab:"评论"}),o(L,{name:"highlight",tab:"亮点"}),o(L,{name:"media",tab:"图文"}),o(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&s.value.length===0?(r(),g("div",ja,[o(We,{num:d.value},null,8,["num"])])):(r(),g("div",Ea,[s.value.length===0?(r(),g("div",Ga,[o(Le,{size:"large",description:"暂无数据"})])):k("",!0),m(f).state.desktopModelShow?(r(),g("div",Ya,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Oe,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))])):(r(),g("div",Ja,[(r(!0),g(ue,null,ie(s.value,U=>(r(),y(oe,{key:U.id},{default:n(()=>[o(Ae,{post:U,onSendWhisper:se},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),i.value>0?(r(),y(Be,{key:0,justify:"center"},{default:n(()=>[o(m(ba),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:w[2]||(w[2]=U=>Ue())},{spinner:n(()=>[_("div",Ka,[v.value?k("",!0):(r(),y(le,{key:0,size:14})),_("span",Qa,h(v.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Cs=pe(Xa,[["__scopeId","data-v-3584e0a9"]]);export{Cs as default}; diff --git a/web/dist/assets/User-faa58349.js b/web/dist/assets/User-faa58349.js deleted file mode 100644 index 375ca110..00000000 --- a/web/dist/assets/User-faa58349.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as je,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js";import{_ as Ge}from"./post-skeleton-c82f8a59.js";import{D as Je,_ as ae,E as Ye,F as Ke,e as O,G as Qe,H as Xe,I as Ze,J as es}from"./index-757c547c.js";import{R as de,H as me,S as fe,b as he,e as te,i as ge,T as ss,F as as,a as ts,j as ie,o as ls,M as os,O as ns,k as us,f as is,g as cs,I as rs,G as _s}from"./naive-ui-d8de3dda.js";import{d as le,H as o,e as r,q as y,w as n,j as _,k as l,A as w,x as g,R as vs,c as ps,b as ds,E as ms,r as fs,f as k,Y as P,bf as h,y as ce,F as re,u as _e,h as ve}from"./@vue-a481fc63.js";import{_ as hs}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{u as gs}from"./vuex-44de225f.js";import{b as ws}from"./vue-router-e5a2430e.js";import{b as ks}from"./formatTime-4210fcd1.js";import{W as ys}from"./v3-infinite-loading-2c58ec2f.js";import{i as bs,x as Ps,y as pe,z as $s,u as xs,D as Ts,G as zs}from"./@vicons-1a3558c6.js";import"./content-d5264b98.js";import"./paopao-video-player-2fe58954.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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"./moment-2ab8298d.js";const Us={class:"whisper-wrap"},Is={class:"whisper-line"},Fs={class:"whisper-line send-wrap"},Cs=le({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(R,{emit:$}){const d=R,v=o(""),m=o(!1),u=()=>{$("success")},p=()=>{m.value=!0,Je({user_id:d.user.id,content:v.value}).then(s=>{window.$message.success("发送成功"),m.value=!1,v.value="",u()}).catch(s=>{m.value=!1})};return(s,i)=>{const x=de,T=me,a=fe,z=he,U=te,I=ge;return r(),y(I,{show:s.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",Us,[l(a,{"show-icon":!1},{default:n(()=>[w(" 即将发送私信给: "),l(T,{style:{"max-width":"100%"}},{default:n(()=>[l(x,{type:"success"},{default:n(()=>[w(g(s.user.nickname)+"@"+g(s.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Is,[l(z,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":i[0]||(i[0]=F=>v.value=F),maxlength:"200","show-count":""},null,8,["value"])]),_("div",Fs,[l(U,{strong:"",secondary:"",type:"primary",loading:m.value,onClick:p},{default:n(()=>[w(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Ms=ae(Cs,[["__scopeId","data-v-0cbfe47c"]]),qs={class:"whisper-wrap"},Ss={class:"whisper-line"},Ws={class:"whisper-line send-wrap"},Ls=le({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(R,{emit:$}){const d=R,v=o(""),m=o(!1),u=()=>{$("success")},p=()=>{m.value=!0,Ye({user_id:d.user.id,greetings:v.value}).then(s=>{window.$message.success("发送成功"),m.value=!1,v.value="",u()}).catch(s=>{m.value=!1})};return(s,i)=>{const x=de,T=me,a=fe,z=he,U=te,I=ge;return r(),y(I,{show:s.show,"onUpdate:show":u,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:n(()=>[_("div",qs,[l(a,{"show-icon":!1},{default:n(()=>[w(" 发送添加朋友申请给: "),l(T,{style:{"max-width":"100%"}},{default:n(()=>[l(x,{type:"success"},{default:n(()=>[w(g(s.user.nickname)+"@"+g(s.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",Ss,[l(z,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:v.value,"onUpdate:value":i[0]||(i[0]=F=>v.value=F),maxlength:"120","show-count":""},null,8,["value"])]),_("div",Ws,[l(U,{strong:"",secondary:"",type:"primary",loading:m.value,onClick:p},{default:n(()=>[w(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const Os=ae(Ls,[["__scopeId","data-v-60be56a2"]]),Rs={key:0,class:"profile-baseinfo"},As={class:"avatar"},Bs={class:"base-info"},Ds={class:"username"},Hs={class:"userinfo"},Ns={class:"info-item"},Vs={class:"info-item"},js={class:"userinfo"},Es={class:"info-item"},Gs={class:"info-item"},Js={key:0,class:"user-opts"},Ys={key:0,class:"skeleton-wrap"},Ks={key:1},Qs={key:0,class:"empty-wrap"},Xs={key:1},Zs={key:2},ea={class:"load-more-wrap"},sa={class:"load-more-spinner"},aa=le({__name:"User",setup(R){const $=ss(),d=gs(),v=ws(),m="true".toLowerCase()==="true",u=o(!1),p=o(!1),s=vs({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),i=o(!1),x=o(!1),T=o(!1),a=o([]),z=o([]),U=o([]),I=o([]),F=o([]),B=o([]),C=o(v.query.s||""),t=o(+v.query.p||1),q=o("post"),D=o(+v.query.p||1),H=o(1),N=o(1),V=o(1),j=o(1),f=o(20),c=o(0),E=o(0),G=o(0),J=o(0),Y=o(0),K=o(0),we=()=>{p.value=!1,a.value=[],z.value=[],U.value=[],I.value=[],F.value=[],B.value=[],q.value="post",t.value=1,D.value=1,H.value=1,N.value=1,V.value=1,j.value=1,c.value=0,E.value=0,G.value=0,J.value=0,Y.value=0,K.value=0},ke=()=>{switch(q.value){case"post":A();break;case"comment":Q();break;case"highlight":X();break;case"media":Z();break;case"star":ee();break}},A=()=>{u.value=!0,O({username:C.value,style:"post",page:t.value,page_size:f.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.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/f.value),z.value=a.value,E.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Q=()=>{u.value=!0,O({username:C.value,style:"comment",page:t.value,page_size:f.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.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/f.value),U.value=a.value,G.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},X=()=>{u.value=!0,O({username:C.value,style:"highlight",page:t.value,page_size:f.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.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/f.value),I.value=a.value,J.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},Z=()=>{u.value=!0,O({username:C.value,style:"media",page:t.value,page_size:f.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.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/f.value),F.value=a.value,Y.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},ee=()=>{u.value=!0,O({username:C.value,style:"star",page:t.value,page_size:f.value}).then(e=>{u.value=!1,e.list.length===0&&(p.value=!0),t.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/f.value),B.value=a.value,K.value=c.value}).catch(e=>{a.value=[],t.value>1&&t.value--,u.value=!1})},ye=e=>{switch(q.value=e,q.value){case"post":a.value=z.value,t.value=D.value,c.value=E.value,A();break;case"comment":a.value=U.value,t.value=H.value,c.value=G.value,Q();break;case"highlight":a.value=I.value,t.value=N.value,c.value=J.value,X();break;case"media":a.value=F.value,t.value=V.value,c.value=Y.value,Z();break;case"star":a.value=B.value,t.value=j.value,c.value=K.value,ee();break}},W=()=>{i.value=!0,Ke({username:C.value}).then(e=>{i.value=!1,s.id=e.id,s.avatar=e.avatar,s.username=e.username,s.nickname=e.nickname,s.is_admin=e.is_admin,s.is_friend=e.is_friend,s.created_on=e.created_on,s.is_following=e.is_following,s.follows=e.follows,s.followings=e.followings,s.status=e.status,ke()}).catch(e=>{i.value=!1,console.log(e)})},be=()=>{switch(q.value){case"post":D.value=t.value,A();break;case"comment":H.value=t.value,Q();break;case"highlight":N.value=t.value,X();break;case"media":V.value=t.value,Z();break;case"star":j.value=t.value,ee();break}},Pe=()=>{x.value=!0},$e=()=>{T.value=!0},xe=()=>{x.value=!1},Te=()=>{T.value=!1},M=e=>()=>ve(ie,null,{default:()=>ve(e)}),ze=ps(()=>{let e=[{label:"私信",key:"whisper",icon:M(Ps)}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned",icon:M(pe)}):e.push({label:"解封",key:"deblocking",icon:M(pe)})),s.is_following?e.push({label:"取消关注",key:"unfollow",icon:M($s)}):e.push({label:"关注",key:"follow",icon:M(xs)}),m&&(s.is_friend?e.push({label:"删除好友",key:"delete",icon:M(Ts)}):e.push({label:"添加朋友",key:"requesting",icon:M(zs)})),e}),Ue=e=>{switch(e){case"whisper":Pe();break;case"delete":Ie();break;case"requesting":$e();break;case"follow":case"unfollow":Fe();break;case"banned":case"deblocking":Ce();break}},Ie=()=>{$.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,Qe({user_id:s.id}).then(e=>{i.value=!1,s.is_friend=!1,A()}).catch(e=>{i.value=!1,console.log(e)})}})},Fe=()=>{$.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,s.is_following?Xe({user_id:s.id}).then(e=>{i.value=!1,window.$message.success("取消关注成功"),W()}).catch(e=>{i.value=!1,console.log(e)}):Ze({user_id:s.id}).then(e=>{i.value=!1,window.$message.success("关注成功"),W()}).catch(e=>{i.value=!1,console.log(e)})}})},Ce=()=>{$.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{i.value=!0,es({id:s.id,status:s.status===1?2:1}).then(e=>{i.value=!1,s.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{i.value=!1,console.log(e)})}})},Me=()=>{t.value{W()}),ms(()=>({path:v.path,query:v.query}),(e,b)=>{b.path==="/u"&&e.path==="/u"&&(C.value=v.query.s||"",we(),W())}),(e,b)=>{const qe=hs,Se=ls,se=os,oe=fs("router-link"),We=te,Le=ns,Oe=Ms,ne=us,L=is,Re=cs,Ae=Ge,Be=rs,De=je,ue=_s,He=Ee,Ne=as,Ve=ts;return r(),k("div",null,[l(qe,{title:"用户详情"}),l(Ne,{class:"main-content-wrap profile-wrap",bordered:""},{default:n(()=>[l(ne,{show:i.value},{default:n(()=>[s.id>0?(r(),k("div",Rs,[_("div",As,[l(Se,{size:72,src:s.avatar},null,8,["src"])]),_("div",Bs,[_("div",Ds,[_("strong",null,g(s.nickname),1),_("span",null," @"+g(s.username),1),m&&h(d).state.userInfo.id>0&&h(d).state.userInfo.username!=s.username&&s.is_friend?(r(),y(se,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[w(" 好友 ")]),_:1})):P("",!0),h(d).state.userInfo.id>0&&h(d).state.userInfo.username!=s.username&&s.is_following?(r(),y(se,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:n(()=>[w(" 已关注 ")]),_:1})):P("",!0),s.is_admin?(r(),y(se,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[w(" 管理员 ")]),_:1})):P("",!0)]),_("div",Hs,[_("span",Ns,"UID. "+g(s.id),1),_("span",Vs,g(h(ks)(s.created_on))+" 加入",1)]),_("div",js,[_("span",Es,[l(oe,{onClick:b[0]||(b[0]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"follows"}}},{default:n(()=>[w(" 关注  "+g(s.follows),1)]),_:1},8,["to"])]),_("span",Gs,[l(oe,{onClick:b[1]||(b[1]=ce(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:s.username,n:s.nickname,t:"followings"}}},{default:n(()=>[w(" 粉丝  "+g(s.followings),1)]),_:1},8,["to"])])])]),h(d).state.userInfo.id>0&&h(d).state.userInfo.username!=s.username?(r(),k("div",Js,[l(Le,{placement:"bottom-end",trigger:"click",size:"small",options:ze.value,onSelect:Ue},{default:n(()=>[l(We,{quaternary:"",circle:""},{icon:n(()=>[l(h(ie),null,{default:n(()=>[l(h(bs))]),_:1})]),_:1})]),_:1},8,["options"])])):P("",!0)])):P("",!0),l(Oe,{show:x.value,user:s,onSuccess:xe},null,8,["show","user"]),l(Os,{show:T.value,user:s,onSuccess:Te},null,8,["show","user"])]),_:1},8,["show"]),l(Re,{class:"profile-tabs-wrap",type:"line",animated:"",value:q.value,"onUpdate:value":ye},{default:n(()=>[l(L,{name:"post",tab:"泡泡"}),l(L,{name:"comment",tab:"评论"}),l(L,{name:"highlight",tab:"亮点"}),l(L,{name:"media",tab:"图文"}),l(L,{name:"star",tab:"喜欢"})]),_:1},8,["value"]),u.value&&a.value.length===0?(r(),k("div",Ys,[l(Ae,{num:f.value},null,8,["num"])])):(r(),k("div",Ks,[a.value.length===0?(r(),k("div",Qs,[l(Be,{size:"large",description:"暂无数据"})])):P("",!0),h(d).state.desktopModelShow?(r(),k("div",Xs,[(r(!0),k(re,null,_e(a.value,S=>(r(),y(ue,{key:S.id},{default:n(()=>[l(De,{post:S},null,8,["post"])]),_:2},1024))),128))])):(r(),k("div",Zs,[(r(!0),k(re,null,_e(a.value,S=>(r(),y(ue,{key:S.id},{default:n(()=>[l(He,{post:S},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),c.value>0?(r(),y(Ve,{key:0,justify:"center"},{default:n(()=>[l(h(ys),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:b[2]||(b[2]=S=>Me())},{spinner:n(()=>[_("div",ea,[p.value?P("",!0):(r(),y(ne,{key:0,size:14})),_("span",sa,g(p.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):P("",!0)])}}});const Wa=ae(aa,[["__scopeId","data-v-0436abd3"]]);export{Wa as default}; diff --git a/web/dist/assets/Wallet-41e3f3be.js b/web/dist/assets/Wallet-e4139554.js similarity index 96% rename from web/dist/assets/Wallet-41e3f3be.js rename to web/dist/assets/Wallet-e4139554.js index 83b21338..d689cce0 100644 --- a/web/dist/assets/Wallet-41e3f3be.js +++ b/web/dist/assets/Wallet-e4139554.js @@ -1 +1 @@ -import{_ as K}from"./post-skeleton-c82f8a59.js";import{_ as X}from"./main-nav.vue_vue_type_style_index_0_lang-048bd56b.js";import{d as Z,H as c,b as J,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,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 ne,$ as ae,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{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-757c547c.js";import{a as me}from"./formatTime-4210fcd1.js";import{X as ge}from"./@vicons-1a3558c6.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const T=m=>(ae("data-v-870bd246"),m=m(),se(),m),Re={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Te={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Ue=T(()=>n("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},De={class:"pay-sub-tips"},Ee=T(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Le=Z({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=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 S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=X,d=fe,V=ye,f=we,$=ke,D=be,E=K,L=xe,M=Ae,j=ve,Q=Ce,Y=Ie,G=Se,H=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(D,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[n("div",Re,[n("div",$e,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),n("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(a(),_("div",Ne,[e(E,{num:C.value},null,8,["num"])])):(a(),_("div",Te,[b.value.length===0?(a(),_("div",We,[e(L,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Be,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(H,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(G,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Fe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(B.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(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?(a(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(Q,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Pe,[Ue,n("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",De,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Le,[["__scopeId","data-v-870bd246"]]);export{yt as default}; +import{_ as K}from"./post-skeleton-7039dc67.js";import{_ as X}from"./main-nav.vue_vue_type_style_index_0_lang-52b53177.js";import{d as Z,H as c,b as J,f as _,k as e,w as o,e as a,bf as y,Y as w,j as n,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 ne,$ as ae,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{T as _e,U as re,V as ue,W as pe,_ as de}from"./index-d9eb4c9e.js";import{a as me}from"./formatTime-4210fcd1.js";import{X as ge}from"./@vicons-1a3558c6.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,Q as be,I as xe,j as Ce,l as Ie,h as Se,G as Ae}from"./naive-ui-d8de3dda.js";import"./vooks-6d99783e.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./@css-render-7124a1a5.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const T=m=>(ae("data-v-870bd246"),m=m(),se(),m),Re={class:"balance-wrap"},$e={class:"balance-line"},qe={class:"balance-opts"},ze={key:0,class:"pagination-wrap"},Ne={key:0,class:"skeleton-wrap"},Te={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Oe={key:1,style:{"margin-top":"10px"}},Pe={class:"qrcode-wrap"},Ue=T(()=>n("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},De={class:"pay-sub-tips"},Ee=T(()=>n("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Le=Z({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+W.query.p||1),C=c(20),I=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),A=()=>{h.value=!0,re({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,I.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{x.value=s,A()},R=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),A()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},O=()=>{g.value=!0},P=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 S=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(S),window.$message.success("充值成功"),g.value=!1,p.value="",R())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},U=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{R()}),(s,l)=>{const S=X,d=fe,V=ye,f=we,$=ke,D=be,E=K,L=xe,M=Ae,j=ve,Q=Ce,Y=Ie,G=Se,H=he;return a(),_("div",null,[e(S,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[I.value>1?(a(),_("div",ze,[e(D,{page:x.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":I.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[n("div",Re,[n("div",$e,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),n("div",qe,[e($,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:O},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:U},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(a(),_("div",Ne,[e(E,{num:C.value},null,8,["num"])])):(a(),_("div",Te,[b.value.length===0?(a(),_("div",We,[e(L,{size:"large",description:"暂无数据"})])):w("",!0),(a(!0),_(q,null,z(b.value,t=>(a(),N(M,{key:t.id},{default:o(()=>[n("div",Be,[n("div",null,"NO."+r(t.id),1),n("div",null,r(t.reason),1),n("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),n("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(H,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(G,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(a(),_("div",Fe,[e($,{align:"baseline"},{default:o(()=>[(a(!0),_(q,null,z(B.value,t=>(a(),N(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ne(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?(a(),_("div",Oe,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:P},{icon:o(()=>[e(Q,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(n("div",Pe,[Ue,n("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),n("div",De,[e(Y,{value:100,type:"info",dot:"",processing:""}),Ee])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Le,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/content-d5264b98.js b/web/dist/assets/content-218c067c.js similarity index 86% rename from web/dist/assets/content-d5264b98.js rename to web/dist/assets/content-218c067c.js index 8720f680..9c572009 100644 --- a/web/dist/assets/content-d5264b98.js +++ b/web/dist/assets/content-218c067c.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 I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{R as V,U}from"./@vicons-1a3558c6.js";import{j as $,V as A,W as B,m as z,X as F,e as L,i as P}from"./naive-ui-d8de3dda.js";import{_ as D,P as R,Q as T}from"./index-757c547c.js";import{e as M}from"./paopao-video-player-2fe58954.js";const O={class:"link-wrap"},q={class:"link-txt-wrap"},H=["href"],Q={class:"link-txt"},S=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",O,[(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(V))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",Q,I(n.content),1)],8,H)])]))),128))])}}});const ot=D(S,[["__scopeId","data-v-36eef76b"]]),W={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=B;return l.videos.length>0?(e(),r("div",W,[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(M),{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)}}}),X={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=B,w=F;return e(),r("div",X,[[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 Y={class:"attachment-wrap"},Z=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)+"元")]),R({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{T({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=L,i=P;return e(),r("div",Y,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(G=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(U))]),_:1})]),default:o(()=>[N(" "+I(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=D(Z,[["__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 I,q as d,Y as g,H as j,A as N,h as b}from"./@vue-a481fc63.js";import{R as V,U}from"./@vicons-1a3558c6.js";import{j as $,V as A,W as B,m as z,X as F,e as L,i as O}from"./naive-ui-d8de3dda.js";import{_ as D,O as P,P as R}from"./index-d9eb4c9e.js";import{e as T}from"./paopao-video-player-2fe58954.js";const M={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=$;return e(),r("div",M,[(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(V))]),_:1}),C("div",q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",S,I(n.content),1)],8,H)])]))),128))])}}});const ot=D(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=B;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(T),{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=B,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)+"元")]),P({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{R({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=L,i=O;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(()=>[N(" "+I(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=D(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-757c547c.js b/web/dist/assets/index-757c547c.js deleted file mode 100644 index c3c17bdd..00000000 --- a/web/dist/assets/index-757c547c.js +++ /dev/null @@ -1 +0,0 @@ -import{d as W,H as $,R as Z,b as G,e as w,q as D,w as r,j as y,k as s,f as R,A as S,Z as q,y as K,Y as U,bf as g,c as Q,E as j,r as le,F as J,u as X,x as I,h as k,a5 as he,s as ee,l as ge,ag as fe}from"./@vue-a481fc63.js";import{c as ve,a as we,u as ue,b as ye}from"./vue-router-e5a2430e.js";import{c as be,u as B}from"./vuex-44de225f.js";import{a as ke}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ce,b as ie,c as Oe,d as Ae,e as de,f as Te,g as Ee,h as pe,i as Re,j as V,k as $e,u as Ce,l as Ie,m as Se,n as Ue,o as Me,p as qe,q as Ke,r as De,s as Ne,t as xe}from"./naive-ui-d8de3dda.js";import{S as Fe,M as Ve,L as ze,C as We,B as Be,P as He,W as je,a as Ge,H as te,b as oe,c as se}from"./@vicons-1a3558c6.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=a(c);fetch(c.href,n)}})();const Qe="modulepreload",Ye=function(e){return"/"+e},ne={},O=function(t,a,i){if(!a||a.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(a.map(n=>{if(n=Ye(n),n in ne)return;ne[n]=!0;const d=n.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!d||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${p}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Qe,d||(f.as="script",f.crossOrigin=""),f.href=n,document.head.appendChild(f),d)return new Promise((b,h)=>{f.addEventListener("load",b),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n})},Ze=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>O(()=>import("./Home-d28a50f3.js"),["assets/Home-d28a50f3.js","assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js","assets/content-d5264b98.js","assets/@vue-a481fc63.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.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/Home-7d19114d.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>O(()=>import("./Post-2d267990.js"),["assets/Post-2d267990.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/IEnum-5453a777.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-d5264b98.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-b5b6aab2.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>O(()=>import("./Topic-60f034a7.js"),["assets/Topic-60f034a7.js","assets/@vicons-1a3558c6.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-048bd56b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>O(()=>import("./Anouncement-9930cc6a.js"),["assets/Anouncement-9930cc6a.js","assets/post-skeleton-c82f8a59.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-048bd56b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-1a3558c6.js","assets/main-nav-569a7b0c.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>O(()=>import("./Profile-389382b2.js"),["assets/Profile-389382b2.js","assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js","assets/content-d5264b98.js","assets/@vue-a481fc63.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Profile-ab12b2fa.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>O(()=>import("./User-faa58349.js"),["assets/User-faa58349.js","assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js","assets/content-d5264b98.js","assets/@vue-a481fc63.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/User-917e7989.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>O(()=>import("./Messages-4104caea.js"),["assets/Messages-4104caea.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-048bd56b.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-1e4acdf3.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>O(()=>import("./Collection-a3f9d0d9.js"),["assets/Collection-a3f9d0d9.js","assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js","assets/content-d5264b98.js","assets/@vue-a481fc63.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>O(()=>import("./Contacts-839dbc08.js"),["assets/Contacts-839dbc08.js","assets/vue-router-e5a2430e.js","assets/@vue-a481fc63.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/vuex-44de225f.js","assets/@vicons-1a3558c6.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-baa2e9bb.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>O(()=>import("./Following-be24e2b8.js"),["assets/Following-be24e2b8.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-c82f8a59.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Following-31b77f3b.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>O(()=>import("./Wallet-41e3f3be.js"),["assets/Wallet-41e3f3be.js","assets/post-skeleton-c82f8a59.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-048bd56b.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-1a3558c6.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>O(()=>import("./Setting-07adc927.js"),["assets/Setting-07adc927.js","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>O(()=>import("./404-26f331db.js"),["assets/404-26f331db.js","assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],me=ve({history:we(),routes:Ze});me.beforeEach((e,t,a)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,a()});const Je=be({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}},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},e.userLogined=!1}},actions:{},modules:{}}),Y=ke.create({baseURL:"",timeout:3e4});Y.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Y.interceptors.response.use(e=>{const{data:t={},code:a=0}=(e==null?void 0:e.data)||{};if(+a==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var a;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(((a=t==null?void 0:t.data)==null?void 0:a.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Y(e)}const re=e=>o({method:"post",url:"/v1/auth/login",data:e}),Xe=e=>o({method:"post",url:"/v1/auth/register",data:e}),H=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=W({__name:"auth",setup(e){const t=$("true".toLowerCase()==="true"),a=B(),i=$(!1),c=$(),n=Z({username:"",password:""}),d=$(),p=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!p.password&&p.password.startsWith(u)&&p.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},f=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(A=>{A||(i.value=!0,re({username:n.username,password:n.password}).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("登录成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),a.commit("refresh"),n.username="",n.password=""}).catch(_=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=d.value)==null||u.validate(A=>{A||(i.value=!0,Xe({username:p.username,password:p.password}).then(_=>re({username:p.username,password:p.password})).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("注册成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),p.username="",p.password="",p.repassword=""}).catch(_=>{i.value=!1}))})};return G(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?H(h).then(u=>{a.commit("updateUserinfo",u),a.commit("triggerAuth",!1)}).catch(u=>{a.commit("userLogout")}):a.commit("userLogout")}),(h,u)=>{const A=Pe,_=Le,L=ce,T=ie,P=Oe,v=Ae,l=de,E=Te,F=Ee,N=pe,x=Re;return w(),D(x,{show:g(a).state.authModalShow,"onUpdate:show":u[7]||(u[7]=m=>g(a).state.authModalShow=m),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:r(()=>[y("div",et,[s(N,{bordered:!1},{default:r(()=>[t.value?U("",!0):(w(),R("div",tt,[s(L,{justify:"center"},{default:r(()=>[s(_,null,{default:r(()=>[s(A,{type:"success"},{default:r(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[0]||(u[0]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),D(F,{key:1,"default-value":g(a).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:r(()=>[s(E,{name:"signin",tab:"登录"},{default:r(()=>[s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[2]||(u[2]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(E,{name:"signup",tab:"注册"},{default:r(()=>[s(v,{ref_key:"registerRef",ref:d,model:p,rules:M},{default:r(()=>[s(P,{label:"用户名",path:"username"},{default:r(()=>[s(T,{value:p.username,"onUpdate:value":u[4]||(u[4]=m=>p.username=m),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:p.password,"onUpdate:value":u[5]||(u[5]=m=>p.password=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"重复密码",path:"repassword"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:p.repassword,"onUpdate:value":u[6]||(u[6]=m=>p.repassword=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:r(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const _e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,c]of t)a[i]=c;return a},st=_e(ot,[["__scopeId","data-v-053dfa44"]]),Zt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Jt=e=>o({method:"get",url:"/v1/post",params:e}),Xt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),co=e=>o({method:"post",url:"/v1/post/highlight",data:e}),io=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),bo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=W({__name:"rightbar",setup(e){const t=$([]),a=$([]),i=$(!1),c=$(""),n=B(),d=ue(),p="2023 paopao.info",M="Roc's Me",f="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",A=+"12",_=()=>{i.value=!0,nt({type:"hot_extral",num:A,extral_num:u}).then(v=>{t.value=v.topics,a.value=v.extral_topics??[],P.value=!0,i.value=!1}).catch(v=>{i.value=!1})},L=v=>v>=1e3?(v/1e3).toFixed(1)+"k":v,T=()=>{d.push({name:"home",query:{q:c.value}})},P=Q({get:()=>n.state.userLogined&&a.value.length!==0,set:v=>{}});return j(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(v,l)=>{(v.refreshTopicFollow!==l.refreshTopicFollow||v.userLogined)&&_()}),G(()=>{_()}),(v,l)=>{const E=V,F=ie,N=le("router-link"),x=$e,m=pe,z=ce;return g(n).state.collapsedRight?U("",!0):(w(),R("div",rt,[y("div",at,[s(F,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":l[0]||(l[0]=C=>c.value=C),onKeyup:q(K(T,["prevent"]),["enter"])},{prefix:r(()=>[s(E,{component:g(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),P.value?(w(),D(m,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(a.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",lt,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),s(m,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(t.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",ut,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(m,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:r(()=>[y("div",ct,"© "+I(g(p)),1),y("div",null,[s(z,null,{default:r(()=>[y("a",{href:g(f),target:"_blank",class:"hash-link"},I(g(M)),9,it),y("a",{href:g(h),target:"_blank",class:"hash-link"},I(g(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=_e(pt,[["__scopeId","data-v-52b86ac0"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),To=e=>o({method:"post",url:"/v1/friend/add",data:e}),Eo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Ro=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),$o=e=>o({method:"get",url:"/v1/user/follows",params:e}),Co=e=>o({method:"get",url:"/v1/user/followings",params:e}),Io=e=>o({method:"post",url:"/v1/friend/reject",data:e}),So=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Uo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Mo=e=>o({method:"post",url:"/v1/user/activate",data:e}),qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Ko=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Do=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ae=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),No=e=>o({method:"get",url:"/v1/user/messages",params:e}),xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Fo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Vo=e=>o({method:"get",url:"/v1/user/profile",params:e}),zo=e=>o({method:"get",url:"/v1/user/posts",params:e}),Wo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Bo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Ho=e=>o({method:"get",url:"/v1/user/recharge",params:e}),jo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Go=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Qo=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Yo=e=>o({method:"get",url:"/v1/attachment",params:e}),Zo=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},bt={class:"username"},kt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=W({__name:"sidebar",setup(e){const t=B(),a=ye(),i=ue(),c=$(!1),n=$(a.name||""),d=$(),p="true".toLowerCase()==="true",M="false".toLowerCase()==="true",f="false".toLocaleLowerCase()==="true",b=$("true".toLowerCase()==="true"),h=+"5000";j(a,()=>{n.value=a.name}),j(t.state,()=>{t.state.userInfo.id>0?d.value||(ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)}),d.value=setInterval(()=>{ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)})},h)):d.value&&clearInterval(d.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=Q(()=>{const l=[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}];return M&&l.push({label:"公告",key:"anouncement",icon:()=>k(Ve),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>k(ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>k(We),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>k(Be),href:"/collection"}),p&&l.push({label:"好友",key:"contacts",icon:()=>k(He),href:"/contacts"}),f&&l.push({label:"钱包",key:"wallet",icon:()=>k(je),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}]}),A=l=>"href"in l?k("div",{},l.label):l.label,_=l=>l.key==="messages"?k(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>k(V,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):k(V,null,{default:l.icon}),L=(l,E={})=>{n.value=l,i.push({name:l,query:{t:new Date().getTime()}})},T=()=>{a.path==="/"&&t.commit("refresh"),L("home")},P=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},v=()=>{t.commit("userLogout"),t.commit("refresh"),T()};return window.$store=t,window.$message=Ce(),(l,E)=>{const F=Se,N=Ue,x=Me,m=de;return w(),R("div",ht,[y("div",gt,[s(F,{class:"logo-img",width:"36",src:g(_t),"preview-disabled":!0,onClick:T},null,8,["src"])]),s(N,{accordion:!0,"icon-size":24,options:u.value,"render-label":A,"render-icon":_,value:n.value,"onUpdate:value":L},null,8,["options","value"]),g(t).state.userInfo.id>0?(w(),R("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:g(t).state.userInfo.avatar},null,8,["src"]),y("div",vt,[y("div",wt,[y("span",yt,I(g(t).state.userInfo.nickname),1),s(m,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:v},{icon:r(()=>[s(g(V),null,{default:r(()=>[s(g(se))]),_:1})]),_:1})]),y("div",bt,"@"+I(g(t).state.userInfo.username),1)]),y("div",kt,[s(m,{class:"logout",quaternary:"",circle:"",onClick:v},{icon:r(()=>[s(g(V),{size:24},{default:r(()=>[s(g(se))]),_:1})]),_:1})])])):(w(),R("div",Pt,[b.value?U("",!0):(w(),R("div",Lt,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[0]||(E[0]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1})])),b.value?(w(),R("div",Ot,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[1]||(E[1]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1}),s(m,{strong:"",secondary:"",round:"",type:"info",onClick:E[2]||(E[2]=z=>P("signup"))},{default:r(()=>[S(" 注册 ")]),_:1})])):U("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Et={key:0},Rt={class:"content-wrap"},$t=W({__name:"App",setup(e){const t=B(),a=Q(()=>t.state.theme==="dark"?Ke:null);return(i,c)=>{const n=At,d=le("router-view"),p=mt,M=st,f=De,b=Ne,h=xe,u=qe;return w(),D(u,{theme:a.value},{default:r(()=>[s(b,null,{default:r(()=>[s(f,null,{default:r(()=>{var A;return[y("div",{class:ge(["app-container",{dark:((A=a.value)==null?void 0:A.name)==="dark",mobile:!g(t).state.desktopModelShow}])},[y("div",Tt,[g(t).state.desktopModelShow?(w(),R("div",Et,[s(n)])):U("",!0),y("div",Rt,[s(d,{class:"app-wrap"},{default:r(({Component:_})=>[(w(),D(he,null,[i.$route.meta.keepAlive?(w(),D(ee(_),{key:0})):U("",!0)],1024)),i.$route.meta.keepAlive?U("",!0):(w(),D(ee(_),{key:0}))]),_:1})]),s(p)]),s(M)],2)]}),_:1})]),_:1}),s(h)]),_:1},8,["theme"])}}});fe($t).use(me).use(Je).mount("#app");export{Uo as $,ko as A,bo as B,nt as C,Oo as D,Ao as E,Vo as F,So as G,Ro as H,Eo as I,Zo as J,To as K,Io as L,xo as M,No as N,Fo as O,Qo as P,Yo as Q,$o as R,Co as S,H as T,Wo as U,Bo as V,Ho as W,Po as X,Do as Y,qo as Z,_e as _,Go as a,Mo as a0,Ko as a1,Lo as a2,At as a3,no as b,ro as c,Zt as d,zo as e,ho as f,jo as g,wo as h,po as i,mo as j,vo as k,fo as l,go as m,Xt as n,to as o,ao as p,lo as q,co as r,uo as s,_o as t,eo as u,io as v,oo as w,Jt as x,so as y,yo as z}; diff --git a/web/dist/assets/index-d9eb4c9e.js b/web/dist/assets/index-d9eb4c9e.js new file mode 100644 index 00000000..482abd8a --- /dev/null +++ b/web/dist/assets/index-d9eb4c9e.js @@ -0,0 +1 @@ +import{d as W,H as $,R as Z,b as G,e as w,q as D,w as r,j as y,k as s,f as R,A as S,Z as q,y as K,Y as U,bf as g,c as Q,E as j,r as le,F as J,u as X,x as I,h as k,a5 as he,s as ee,l as ge,ag as fe}from"./@vue-a481fc63.js";import{c as ve,a as we,u as ue,b as ye}from"./vue-router-e5a2430e.js";import{c as be,u as B}from"./vuex-44de225f.js";import{a as ke}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ce,b as ie,c as Oe,d as Ae,e as de,f as Te,g as Ee,h as pe,i as Re,j as V,k as $e,u as Ce,l as Ie,m as Se,n as Ue,o as Me,p as qe,q as Ke,r as De,s as Ne,t as xe}from"./naive-ui-d8de3dda.js";import{S as Fe,M as Ve,L as ze,C as We,B as Be,P as He,W as je,a as Ge,H as te,b as oe,c as se}from"./@vicons-1a3558c6.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function a(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=a(c);fetch(c.href,n)}})();const Qe="modulepreload",Ye=function(e){return"/"+e},ne={},O=function(t,a,i){if(!a||a.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(a.map(n=>{if(n=Ye(n),n in ne)return;ne[n]=!0;const d=n.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const h=c[b];if(h.href===n&&(!d||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${p}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Qe,d||(f.as="script",f.crossOrigin=""),f.href=n,document.head.appendChild(f),d)return new Promise((b,h)=>{f.addEventListener("load",b),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n})},Ze=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>O(()=>import("./Home-fc1d3b7f.js"),["assets/Home-fc1d3b7f.js","assets/whisper-5fc7c61f.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-a10065a5.js","assets/content-218c067c.js","assets/@vicons-1a3558c6.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/IEnum-5453a777.js","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.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/Home-2f8b5a0d.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>O(()=>import("./Post-78da1f3b.js"),["assets/Post-78da1f3b.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/IEnum-5453a777.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-218c067c.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vue-router-e5a2430e.js","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/lodash-e0b37ac3.js","assets/@babel-725317a4.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-b5b6aab2.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>O(()=>import("./Topic-98177f3e.js"),["assets/Topic-98177f3e.js","assets/@vicons-1a3558c6.js","assets/@vue-a481fc63.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-52b53177.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-384e019e.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>O(()=>import("./Anouncement-d10e74f5.js"),["assets/Anouncement-d10e74f5.js","assets/post-skeleton-7039dc67.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-52b53177.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-1a3558c6.js","assets/main-nav-569a7b0c.css","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>O(()=>import("./Profile-03eea9fe.js"),["assets/Profile-03eea9fe.js","assets/whisper-5fc7c61f.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-a10065a5.js","assets/content-218c067c.js","assets/@vicons-1a3558c6.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Profile-88292227.css","assets/vfonts-7afd136d.css"])},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>O(()=>import("./User-f262d052.js"),["assets/User-f262d052.js","assets/post-item.vue_vue_type_style_index_0_lang-a10065a5.js","assets/content-218c067c.js","assets/@vue-a481fc63.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/whisper-5fc7c61f.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-2c58ec2f.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/User-e6eae837.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>O(()=>import("./Messages-f8e13906.js"),["assets/Messages-f8e13906.js","assets/@vue-a481fc63.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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-5fc7c61f.js","assets/whisper-61451957.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-3c6066fb.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>O(()=>import("./Collection-1c56688e.js"),["assets/Collection-1c56688e.js","assets/whisper-5fc7c61f.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-a10065a5.js","assets/content-218c067c.js","assets/@vicons-1a3558c6.js","assets/paopao-video-player-2fe58954.js","assets/content-2fda112b.css","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-4ef7d3eb.js","assets/@babel-725317a4.js","assets/toggle-selection-93f4ad84.js","assets/post-item-d81938d1.css","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-5c3a44e2.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>O(()=>import("./Contacts-84714976.js"),["assets/Contacts-84714976.js","assets/whisper-5fc7c61f.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-1a3558c6.js","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-7fa3e0d6.css","assets/vfonts-7afd136d.css"])},{path:"/following",name:"following",meta:{title:"关注"},component:()=>O(()=>import("./Following-3e74fdde.js"),["assets/Following-3e74fdde.js","assets/whisper-5fc7c61f.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/@vicons-1a3558c6.js","assets/post-skeleton-7039dc67.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/vuex-44de225f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Following-6aa7d36c.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>O(()=>import("./Wallet-e4139554.js"),["assets/Wallet-e4139554.js","assets/post-skeleton-7039dc67.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/@vue-a481fc63.js","assets/vueuc-39372edb.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-52b53177.js","assets/vuex-44de225f.js","assets/vue-router-e5a2430e.js","assets/@vicons-1a3558c6.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-4210fcd1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>O(()=>import("./Setting-f3723e49.js"),["assets/Setting-f3723e49.js","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>O(()=>import("./404-adb7b71a.js"),["assets/404-adb7b71a.js","assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js","assets/vuex-44de225f.js","assets/@vue-a481fc63.js","assets/vue-router-e5a2430e.js","assets/vooks-6d99783e.js","assets/evtd-b614532e.js","assets/@vicons-1a3558c6.js","assets/naive-ui-d8de3dda.js","assets/seemly-76b7b838.js","assets/vueuc-39372edb.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/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],me=ve({history:we(),routes:Ze});me.beforeEach((e,t,a)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,a()});const Je=be({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}},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},e.userLogined=!1}},actions:{},modules:{}}),Y=ke.create({baseURL:"",timeout:3e4});Y.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Y.interceptors.response.use(e=>{const{data:t={},code:a=0}=(e==null?void 0:e.data)||{};if(+a==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var a;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(((a=t==null?void 0:t.data)==null?void 0:a.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Y(e)}const re=e=>o({method:"post",url:"/v1/auth/login",data:e}),Xe=e=>o({method:"post",url:"/v1/auth/register",data:e}),H=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=W({__name:"auth",setup(e){const t=$("true".toLowerCase()==="true"),a=B(),i=$(!1),c=$(),n=Z({username:"",password:""}),d=$(),p=Z({username:"",password:"",repassword:""}),M={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(h,u)=>!!p.password&&p.password.startsWith(u)&&p.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},f=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=c.value)==null||u.validate(A=>{A||(i.value=!0,re({username:n.username,password:n.password}).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("登录成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),a.commit("refresh"),n.username="",n.password=""}).catch(_=>{i.value=!1}))})},b=h=>{var u;h.preventDefault(),h.stopPropagation(),(u=d.value)==null||u.validate(A=>{A||(i.value=!0,Xe({username:p.username,password:p.password}).then(_=>re({username:p.username,password:p.password})).then(_=>{const L=(_==null?void 0:_.token)||"";return localStorage.setItem("PAOPAO_TOKEN",L),H(L)}).then(_=>{window.$message.success("注册成功"),i.value=!1,a.commit("updateUserinfo",_),a.commit("triggerAuth",!1),p.username="",p.password="",p.repassword=""}).catch(_=>{i.value=!1}))})};return G(()=>{const h=localStorage.getItem("PAOPAO_TOKEN")||"";h?H(h).then(u=>{a.commit("updateUserinfo",u),a.commit("triggerAuth",!1)}).catch(u=>{a.commit("userLogout")}):a.commit("userLogout")}),(h,u)=>{const A=Pe,_=Le,L=ce,T=ie,P=Oe,v=Ae,l=de,E=Te,F=Ee,N=pe,x=Re;return w(),D(x,{show:g(a).state.authModalShow,"onUpdate:show":u[7]||(u[7]=m=>g(a).state.authModalShow=m),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:r(()=>[y("div",et,[s(N,{bordered:!1},{default:r(()=>[t.value?U("",!0):(w(),R("div",tt,[s(L,{justify:"center"},{default:r(()=>[s(_,null,{default:r(()=>[s(A,{type:"success"},{default:r(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[0]||(u[0]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(w(),D(F,{key:1,"default-value":g(a).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:r(()=>[s(E,{name:"signin",tab:"登录"},{default:r(()=>[s(v,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:r(()=>[s(P,{label:"账户",path:"username"},{default:r(()=>[s(T,{value:n.username,"onUpdate:value":u[2]||(u[2]=m=>n.username=m),placeholder:"请输入用户名",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=m=>n.password=m),placeholder:"请输入账户密码",onKeyup:q(K(f,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:f},{default:r(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(E,{name:"signup",tab:"注册"},{default:r(()=>[s(v,{ref_key:"registerRef",ref:d,model:p,rules:M},{default:r(()=>[s(P,{label:"用户名",path:"username"},{default:r(()=>[s(T,{value:p.username,"onUpdate:value":u[4]||(u[4]=m=>p.username=m),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(P,{label:"密码",path:"password"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:p.password,"onUpdate:value":u[5]||(u[5]=m=>p.password=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(P,{label:"重复密码",path:"repassword"},{default:r(()=>[s(T,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:p.repassword,"onUpdate:value":u[6]||(u[6]=m=>p.repassword=m),onKeyup:q(K(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(l,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:r(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):U("",!0)]),_:1})])]),_:1},8,["show"])}}});const _e=(e,t)=>{const a=e.__vccOpts||e;for(const[i,c]of t)a[i]=c;return a},st=_e(ot,[["__scopeId","data-v-053dfa44"]]),Zt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Jt=e=>o({method:"get",url:"/v1/post",params:e}),Xt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),co=e=>o({method:"post",url:"/v1/post/highlight",data:e}),io=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),bo=e=>o({method:"post",url:"/v1/topic/follow",data:e}),ko=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=W({__name:"rightbar",setup(e){const t=$([]),a=$([]),i=$(!1),c=$(""),n=B(),d=ue(),p="2023 paopao.info",M="Roc's Me",f="",b="泡泡(PaoPao)开源社区",h="https://www.paopao.info",u=+"6",A=+"12",_=()=>{i.value=!0,nt({type:"hot_extral",num:A,extral_num:u}).then(v=>{t.value=v.topics,a.value=v.extral_topics??[],P.value=!0,i.value=!1}).catch(v=>{i.value=!1})},L=v=>v>=1e3?(v/1e3).toFixed(1)+"k":v,T=()=>{d.push({name:"home",query:{q:c.value}})},P=Q({get:()=>n.state.userLogined&&a.value.length!==0,set:v=>{}});return j(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(v,l)=>{(v.refreshTopicFollow!==l.refreshTopicFollow||v.userLogined)&&_()}),G(()=>{_()}),(v,l)=>{const E=V,F=ie,N=le("router-link"),x=$e,m=pe,z=ce;return g(n).state.collapsedRight?U("",!0):(w(),R("div",rt,[y("div",at,[s(F,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":l[0]||(l[0]=C=>c.value=C),onKeyup:q(K(T,["prevent"]),["enter"])},{prefix:r(()=>[s(E,{component:g(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),P.value?(w(),D(m,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(a.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",lt,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):U("",!0),s(m,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:r(()=>[s(x,{show:i.value},{default:r(()=>[(w(!0),R(J,null,X(t.value,C=>(w(),R("div",{class:"hot-tag-item",key:C.id},[s(N,{class:"hash-link",to:{name:"home",query:{q:C.tag,t:"tag"}}},{default:r(()=>[S(" #"+I(C.tag),1)]),_:2},1032,["to"]),y("div",ut,I(L(C.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(m,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:r(()=>[y("div",ct,"© "+I(g(p)),1),y("div",null,[s(z,null,{default:r(()=>[y("a",{href:g(f),target:"_blank",class:"hash-link"},I(g(M)),9,it),y("a",{href:g(h),target:"_blank",class:"hash-link"},I(g(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=_e(pt,[["__scopeId","data-v-52b86ac0"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),To=e=>o({method:"post",url:"/v1/friend/add",data:e}),Eo=e=>o({method:"post",url:"/v1/user/follow",data:e}),Ro=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),$o=e=>o({method:"get",url:"/v1/user/follows",params:e}),Co=e=>o({method:"get",url:"/v1/user/followings",params:e}),Io=e=>o({method:"post",url:"/v1/friend/reject",data:e}),So=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Uo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Mo=e=>o({method:"post",url:"/v1/user/activate",data:e}),qo=e=>o({method:"post",url:"/v1/user/password",data:e}),Ko=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Do=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ae=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),No=e=>o({method:"get",url:"/v1/user/messages",params:e}),xo=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Fo=e=>o({method:"get",url:"/v1/user/collections",params:e}),Vo=e=>o({method:"get",url:"/v1/user/profile",params:e}),zo=e=>o({method:"get",url:"/v1/user/posts",params:e}),Wo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Bo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Ho=e=>o({method:"get",url:"/v1/user/recharge",params:e}),jo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Go=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Qo=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Yo=e=>o({method:"get",url:"/v1/attachment",params:e}),Zo=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},bt={class:"username"},kt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=W({__name:"sidebar",setup(e){const t=B(),a=ye(),i=ue(),c=$(!1),n=$(a.name||""),d=$(),p="true".toLowerCase()==="true",M="false".toLowerCase()==="true",f="false".toLocaleLowerCase()==="true",b=$("true".toLowerCase()==="true"),h=+"5000";j(a,()=>{n.value=a.name}),j(t.state,()=>{t.state.userInfo.id>0?d.value||(ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)}),d.value=setInterval(()=>{ae().then(l=>{c.value=l.count>0}).catch(l=>{console.log(l)})},h)):d.value&&clearInterval(d.value)}),G(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const u=Q(()=>{const l=[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}];return M&&l.push({label:"公告",key:"anouncement",icon:()=>k(Ve),href:"/anouncement"}),l.push({label:"主页",key:"profile",icon:()=>k(ze),href:"/profile"}),l.push({label:"消息",key:"messages",icon:()=>k(We),href:"/messages"}),l.push({label:"收藏",key:"collection",icon:()=>k(Be),href:"/collection"}),p&&l.push({label:"好友",key:"contacts",icon:()=>k(He),href:"/contacts"}),f&&l.push({label:"钱包",key:"wallet",icon:()=>k(je),href:"/wallet"}),l.push({label:"设置",key:"setting",icon:()=>k(Ge),href:"/setting"}),t.state.userInfo.id>0?l:[{label:"广场",key:"home",icon:()=>k(te),href:"/"},{label:"话题",key:"topic",icon:()=>k(oe),href:"/topic"}]}),A=l=>"href"in l?k("div",{},l.label):l.label,_=l=>l.key==="messages"?k(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>k(V,{color:l.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:l.icon})}):k(V,null,{default:l.icon}),L=(l,E={})=>{n.value=l,i.push({name:l,query:{t:new Date().getTime()}})},T=()=>{a.path==="/"&&t.commit("refresh"),L("home")},P=l=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",l)},v=()=>{t.commit("userLogout"),t.commit("refresh"),T()};return window.$store=t,window.$message=Ce(),(l,E)=>{const F=Se,N=Ue,x=Me,m=de;return w(),R("div",ht,[y("div",gt,[s(F,{class:"logo-img",width:"36",src:g(_t),"preview-disabled":!0,onClick:T},null,8,["src"])]),s(N,{accordion:!0,"icon-size":24,options:u.value,"render-label":A,"render-icon":_,value:n.value,"onUpdate:value":L},null,8,["options","value"]),g(t).state.userInfo.id>0?(w(),R("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:g(t).state.userInfo.avatar},null,8,["src"]),y("div",vt,[y("div",wt,[y("span",yt,I(g(t).state.userInfo.nickname),1),s(m,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:v},{icon:r(()=>[s(g(V),null,{default:r(()=>[s(g(se))]),_:1})]),_:1})]),y("div",bt,"@"+I(g(t).state.userInfo.username),1)]),y("div",kt,[s(m,{class:"logout",quaternary:"",circle:"",onClick:v},{icon:r(()=>[s(g(V),{size:24},{default:r(()=>[s(g(se))]),_:1})]),_:1})])])):(w(),R("div",Pt,[b.value?U("",!0):(w(),R("div",Lt,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[0]||(E[0]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1})])),b.value?(w(),R("div",Ot,[s(m,{strong:"",secondary:"",round:"",type:"primary",onClick:E[1]||(E[1]=z=>P("signin"))},{default:r(()=>[S(" 登录 ")]),_:1}),s(m,{strong:"",secondary:"",round:"",type:"info",onClick:E[2]||(E[2]=z=>P("signup"))},{default:r(()=>[S(" 注册 ")]),_:1})])):U("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Et={key:0},Rt={class:"content-wrap"},$t=W({__name:"App",setup(e){const t=B(),a=Q(()=>t.state.theme==="dark"?Ke:null);return(i,c)=>{const n=At,d=le("router-view"),p=mt,M=st,f=De,b=Ne,h=xe,u=qe;return w(),D(u,{theme:a.value},{default:r(()=>[s(b,null,{default:r(()=>[s(f,null,{default:r(()=>{var A;return[y("div",{class:ge(["app-container",{dark:((A=a.value)==null?void 0:A.name)==="dark",mobile:!g(t).state.desktopModelShow}])},[y("div",Tt,[g(t).state.desktopModelShow?(w(),R("div",Et,[s(n)])):U("",!0),y("div",Rt,[s(d,{class:"app-wrap"},{default:r(({Component:_})=>[(w(),D(he,null,[i.$route.meta.keepAlive?(w(),D(ee(_),{key:0})):U("",!0)],1024)),i.$route.meta.keepAlive?U("",!0):(w(),D(ee(_),{key:0}))]),_:1})]),s(p)]),s(M)],2)]}),_:1})]),_:1}),s(h)]),_:1},8,["theme"])}}});fe($t).use(me).use(Je).mount("#app");export{Uo as $,ko as A,bo as B,nt as C,Ao as D,Vo as E,So as F,Ro as G,Eo as H,Zo as I,To as J,Io as K,xo as L,No as M,Fo as N,Qo as O,Yo as P,$o as Q,Co as R,Oo as S,H as T,Wo as U,Bo as V,Ho as W,Po as X,Do as Y,qo as Z,_e as _,Go as a,Mo as a0,Ko as a1,Lo as a2,At as a3,no as b,ro as c,Zt as d,zo as e,ho as f,jo as g,wo as h,po as i,mo as j,vo as k,fo as l,go as m,Xt as n,to as o,ao as p,lo as q,co as r,uo as s,_o as t,eo as u,io as v,oo as w,Jt as x,so as y,yo as z}; diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js similarity index 96% rename from web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js rename to web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js index 989c6fc7..0419fa18 100644 --- a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-048bd56b.js +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-52b53177.js @@ -1 +1 @@ -import{a3 as B}from"./index-757c547c.js";import{u as E}from"./vuex-44de225f.js";import{u as S}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-1a3558c6.js";import{a3 as R,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-d8de3dda.js";import{d as q,H as h,b as $,e as a,f,bf as o,k as e,w as t,Y as c,j as F,q as _,A as L,x as U,F as Y}from"./@vue-a481fc63.js";const Z={key:0},G={class:"navbar"},oe=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=S(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return $(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark")}),(s,d)=>{const b=B,y=R,O=x,r=H,p=I,M=V,T=j;return a(),f(Y,null,[o(n).state.drawerModelShow?(a(),f("div",Z,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=A=>l.value=A),width:212,placement:k.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[F("div",G,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(N))]),_:1})]),_:1})):c("",!0),L(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; +import{a3 as B}from"./index-d9eb4c9e.js";import{u as E}from"./vuex-44de225f.js";import{u as S}from"./vue-router-e5a2430e.js";import{j as z}from"./vooks-6d99783e.js";import{Z as C,_ as N,$ as P,a0 as D}from"./@vicons-1a3558c6.js";import{a3 as R,a4 as x,j as H,e as I,a5 as V,h as j}from"./naive-ui-d8de3dda.js";import{d as q,H as h,b as $,e as a,f,bf as o,k as e,w as t,Y as c,j as F,q as _,A as L,x as U,F as Y}from"./@vue-a481fc63.js";const Z={key:0},G={class:"navbar"},oe=q({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=E(),m=S(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return $(()=>{localStorage.getItem("PAOPAO_THEME")||u(z()==="dark")}),(s,d)=>{const b=B,y=R,O=x,r=H,p=I,M=V,T=j;return a(),f(Y,null,[o(n).state.drawerModelShow?(a(),f("div",Z,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=A=>l.value=A),width:212,placement:k.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[F("div",G,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(N))]),_:1})]),_:1})):c("",!0),L(" "+U(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a10065a5.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a10065a5.js new file mode 100644 index 00000000..f5c84e6d --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-a10065a5.js @@ -0,0 +1 @@ +import{p as V,a as E,_ as R,b as Y,c as G}from"./content-218c067c.js";import{d as J,c as x,r as K,e as a,f,k as n,al as Q,w as o,j as i,F as U,u as W,y as m,bf as l,A as r,x as p,q as u,Y as c,h as C}from"./@vue-a481fc63.js";import{u as X}from"./vuex-44de225f.js";import{u as Z}from"./vue-router-e5a2430e.js";import{c as ee}from"./formatTime-4210fcd1.js";import{u as te,w as se}from"./index-d9eb4c9e.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as ne,j as ae,l as le,m as ie,x as ue,o as ce}from"./@vicons-1a3558c6.js";import{j as v,o as re,M as pe,e as _e,O as me,a as ve,L as de}from"./naive-ui-d8de3dda.js";const he={class:"post-item"},ge={class:"nickname-wrap"},ke={class:"username-wrap"},ye={class:"timestamp-mobile"},fe={class:"item-header-extra"},we=["innerHTML"],be=["onClick"],xe=["onClick"],Ae=J({__name:"mobile-post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",he,[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",ge,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",ke," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ye,p(l(ee)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":o(()=>[i("div",fe,[n(D,{placement:"bottom-end",trigger:"click",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,be),i("div",{class:"opt-item",onClick:s[3]||(s[3]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,xe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[i("div",{onClick:s[2]||(s[2]=h=>k(e.value.id))},[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,we))),128))])]),key:"0"}:void 0]),1024)])}}});const Ce={class:"nickname-wrap"},$e={class:"username-wrap"},ze={class:"item-header-extra"},Te={class:"timestamp"},qe=["innerHTML"],Pe=["onClick"],Le=["onClick"],Fe=J({__name:"post-item",props:{post:{}},emits:["send-whisper"],setup($,{emit:z}){const d=$,g=Z(),T=X(),w=t=>()=>C(v,null,{default:()=>C(t)}),q=x(()=>{let t=[];return t.push({label:"私信",key:"whisper",icon:w(ue)}),t.push({label:"复制链接",key:"copyTweetLink",icon:w(ce)}),t}),P=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":z("send-whisper",d.post.user);break}},e=x({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},d.post);return t.contents.map(s=>{(+s.type==1||+s.type==2)&&t.texts.push(s),+s.type==3&&t.imgs.push(s),+s.type==4&&t.videos.push(s),+s.type==6&&t.links.push(s),+s.type==7&&t.attachments.push(s),+s.type==8&&t.charge_attachments.push(s)}),t},set:t=>{d.post.upvote_count=t.upvote_count,d.post.collection_count=t.collection_count}}),L=()=>{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)})},O=()=>{se({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)})},k=t=>{g.push({name:"post",query:{id:t}})},S=(t,s)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){T.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(s)};return(t,s)=>{const _=re,j=K("router-link"),y=pe,M=_e,D=me,b=E,H=R,B=Y,I=G,N=ve,A=de;return a(),f("div",{class:"post-item",onClick:s[3]||(s[3]=h=>k(e.value.id))},[n(A,{"content-indented":""},Q({avatar:o(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:o(()=>[i("span",Ce,[n(j,{onClick:s[0]||(s[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:o(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",$e," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:o(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":o(()=>[i("div",ze,[i("span",Te,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(ee)(e.value.created_on)),1),n(D,{placement:"bottom-end",trigger:"hover",size:"small",options:q.value,onSelect:P},{default:o(()=>[n(M,{quaternary:"",circle:""},{icon:o(()=>[n(l(v),null,{default:o(()=>[n(l(ne))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:o(()=>[e.value.attachments.length>0?(a(),u(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(H,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(B,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(I,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:o(()=>[n(N,{justify:"space-between"},{default:o(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Pe),i("div",{class:"opt-item hover",onClick:s[2]||(s[2]=m(h=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(le))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(O,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:o(()=>[n(l(ie))]),_:1}),r(" "+p(e.value.collection_count),1)],8,Le)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:o(()=>[(a(!0),f(U,null,W(e.value.texts,h=>(a(),f("span",{key:h.id,class:"post-text hover",onClick:s[1]||(s[1]=m(F=>S(F,e.value.id),["stop"])),innerHTML:l(V)(h.content).content},null,8,qe))),128))]),key:"0"}:void 0]),1024)])}}});export{Fe as _,Ae as a}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js deleted file mode 100644 index 5eafd4b4..00000000 --- a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-cf11e2c5.js +++ /dev/null @@ -1 +0,0 @@ -import{p as F,a as V,_ as E,b as R,c as Y}from"./content-d5264b98.js";import{d as G,c as C,r as J,e as a,f,k as n,al as K,w as s,j as i,F as Q,u as U,y as m,bf as l,A as r,x as p,q as u,Y as c,h as x}from"./@vue-a481fc63.js";import{u as W}from"./vuex-44de225f.js";import{u as X}from"./vue-router-e5a2430e.js";import{c as Z}from"./formatTime-4210fcd1.js";import{u as ee,w as te}from"./index-757c547c.js";import{c as oe}from"./copy-to-clipboard-4ef7d3eb.js";import{i as se,j as ne,l as ae,m as le,o as ie}from"./@vicons-1a3558c6.js";import{j as v,o as ue,M as ce,e as re,O as pe,a as _e,L as me}from"./naive-ui-d8de3dda.js";const ve={class:"post-item"},de={class:"nickname-wrap"},he={class:"username-wrap"},ge={class:"timestamp-mobile"},ke={class:"item-header-extra"},ye=["innerHTML"],fe=["onClick"],we=["onClick"],Ie=G({__name:"mobile-post-item",props:{post:{}},setup($){const h=$,g=X(),b=W(),z=t=>()=>x(v,null,{default:()=>x(t)}),T=C(()=>[{label:"复制链接",key:"copyTweetLink",icon:z(ie)}]),q=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},h.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=>{h.post.upvote_count=t.upvote_count,h.post.collection_count=t.collection_count}}),L=()=>{ee({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)})},S=()=>{te({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)})},k=t=>{g.push({name:"post",query:{id:t}})},O=(t,o)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){b.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(o)};return(t,o)=>{const _=ue,P=J("router-link"),y=ce,j=re,M=pe,w=V,D=E,H=R,B=Y,I=_e,N=me;return a(),f("div",ve,[n(N,{"content-indented":""},K({avatar:s(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[i("span",de,[n(P,{onClick:o[0]||(o[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",he," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[r(" 好友可见 ")]),_:1})):c("",!0),i("div",null,[i("span",ge,p(l(Z)(e.value.created_on))+" "+p(e.value.ip_loc),1)])]),"header-extra":s(()=>[i("div",ke,[n(M,{placement:"bottom-end",trigger:"click",size:"small",options:T.value,onSelect:q},{default:s(()=>[n(j,{quaternary:"",circle:""},{icon:s(()=>[n(l(v),null,{default:s(()=>[n(l(se))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(a(),u(w,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(w,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(D,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(H,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(B,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[n(I,{justify:"space-between"},{default:s(()=>[i("div",{class:"opt-item",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ne))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,fe),i("div",{class:"opt-item",onClick:o[3]||(o[3]=m(d=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item",onClick:m(S,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(le))]),_:1}),r(" "+p(e.value.collection_count),1)],8,we)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[i("div",{onClick:o[2]||(o[2]=d=>k(e.value.id))},[(a(!0),f(Q,null,U(e.value.texts,d=>(a(),f("span",{key:d.id,class:"post-text",onClick:o[1]||(o[1]=m(A=>O(A,e.value.id),["stop"])),innerHTML:l(F)(d.content).content},null,8,ye))),128))])]),key:"0"}:void 0]),1024)])}}});const Ce={class:"nickname-wrap"},xe={class:"username-wrap"},$e={class:"item-header-extra"},be={class:"timestamp"},ze=["innerHTML"],Te=["onClick"],qe=["onClick"],Ne=G({__name:"post-item",props:{post:{}},setup($){const h=$,g=X(),b=W(),z=t=>()=>x(v,null,{default:()=>x(t)}),T=C(()=>[{label:"复制链接",key:"copyTweetLink",icon:z(ie)}]),q=async t=>{switch(t){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break}},e=C({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},h.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=>{h.post.upvote_count=t.upvote_count,h.post.collection_count=t.collection_count}}),L=()=>{ee({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)})},S=()=>{te({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)})},k=t=>{g.push({name:"post",query:{id:t}})},O=(t,o)=>{if(t.target.dataset.detail){const _=t.target.dataset.detail.split(":");if(_.length===2){b.commit("refresh"),_[0]==="tag"?g.push({name:"home",query:{q:_[1],t:"tag"}}):g.push({name:"user",query:{s:_[1]}});return}}k(o)};return(t,o)=>{const _=ue,P=J("router-link"),y=ce,j=re,M=pe,w=V,D=E,H=R,B=Y,I=_e,N=me;return a(),f("div",{class:"post-item",onClick:o[3]||(o[3]=d=>k(e.value.id))},[n(N,{"content-indented":""},K({avatar:s(()=>[n(_,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[i("span",Ce,[n(P,{onClick:o[0]||(o[0]=m(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:s(()=>[r(p(e.value.user.nickname),1)]),_:1},8,["to"])]),i("span",xe," @"+p(e.value.user.username),1),e.value.is_top?(a(),u(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[r(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(a(),u(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[r(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(a(),u(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[r(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":s(()=>[i("div",$e,[i("span",be,p(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+p(l(Z)(e.value.created_on)),1),n(M,{placement:"bottom-end",trigger:"hover",size:"small",options:T.value,onSelect:q},{default:s(()=>[n(j,{quaternary:"",circle:""},{icon:s(()=>[n(l(v),null,{default:s(()=>[n(l(se))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(a(),u(w,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(a(),u(w,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(a(),u(D,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(a(),u(H,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(a(),u(B,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[n(I,{justify:"space-between"},{default:s(()=>[i("div",{class:"opt-item hover",onClick:m(L,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ne))]),_:1}),r(" "+p(e.value.upvote_count),1)],8,Te),i("div",{class:"opt-item hover",onClick:o[2]||(o[2]=m(d=>k(e.value.id),["stop"]))},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(ae))]),_:1}),r(" "+p(e.value.comment_count),1)]),i("div",{class:"opt-item hover",onClick:m(S,["stop"])},[n(l(v),{size:"18",class:"opt-item-icon"},{default:s(()=>[n(l(le))]),_:1}),r(" "+p(e.value.collection_count),1)],8,qe)]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[(a(!0),f(Q,null,U(e.value.texts,d=>(a(),f("span",{key:d.id,class:"post-text hover",onClick:o[1]||(o[1]=m(A=>O(A,e.value.id),["stop"])),innerHTML:l(F)(d.content).content},null,8,ze))),128))]),key:"0"}:void 0]),1024)])}}});export{Ne as _,Ie as a}; diff --git a/web/dist/assets/post-skeleton-c82f8a59.js b/web/dist/assets/post-skeleton-7039dc67.js similarity index 88% rename from web/dist/assets/post-skeleton-c82f8a59.js rename to web/dist/assets/post-skeleton-7039dc67.js index bb74ab61..9cd2d976 100644 --- a/web/dist/assets/post-skeleton-c82f8a59.js +++ b/web/dist/assets/post-skeleton-7039dc67.js @@ -1 +1 @@ -import{U as r}from"./naive-ui-d8de3dda.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-757c547c.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-d8de3dda.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-d9eb4c9e.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-5fc7c61f.js b/web/dist/assets/whisper-5fc7c61f.js new file mode 100644 index 00000000..9bf834c5 --- /dev/null +++ b/web/dist/assets/whisper-5fc7c61f.js @@ -0,0 +1 @@ +import{S as b,_ as k}from"./index-d9eb4c9e.js";import{R as B,H as C,S as N,b as R,e as S,i as U}from"./naive-ui-d8de3dda.js";import{d as V,H as p,e as $,q as z,w as s,j as a,k as n,A as _,x as i}from"./@vue-a481fc63.js";const H={class:"whisper-wrap"},W={class:"whisper-line"},j={class:"whisper-line send-wrap"},q=V({__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=B,w=C,f=N,v=R,g=S,y=U;return $(),z(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",H,[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",j,[n(g,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:m},{default:s(()=>[_(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const M=k(q,[["__scopeId","data-v-0cbfe47c"]]);export{M as _}; diff --git a/web/dist/assets/whisper-61451957.css b/web/dist/assets/whisper-61451957.css new file mode 100644 index 00000000..a527d616 --- /dev/null +++ b/web/dist/assets/whisper-61451957.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf} diff --git a/web/dist/index.html b/web/dist/index.html index c282c0ce..05ed9f2d 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -8,7 +8,7 @@ 泡泡 - + diff --git a/web/src/components/contact-item.vue b/web/src/components/contact-item.vue index 8a03852e..29bff65e 100644 --- a/web/src/components/contact-item.vue +++ b/web/src/components/contact-item.vue @@ -1,41 +1,128 @@