From 55a3f2f83f22f1736a18e6443c79d1d63b2261c7 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sat, 30 Dec 2023 18:38:03 +0800 Subject: [PATCH] add missing web/dist files --- internal/core/topics.go | 2 +- internal/dao/jinzhu/topics.go | 4 ++-- web/dist/assets/404-x31eybZD.js | 1 + web/dist/assets/Anouncement-BKCrB4N4.js | 1 + web/dist/assets/Collection-zGgLSBDA.js | 1 + web/dist/assets/Contacts-70p5eo25.js | 1 + web/dist/assets/Following-T99T9Q8h.js | 1 + web/dist/assets/Home-28LAfziN.js | 1 + web/dist/assets/Messages-Io0cWkZE.js | 1 + web/dist/assets/Post-Aii8OJYD.js | 1 + web/dist/assets/Profile-ND6y_r-3.js | 1 + web/dist/assets/Setting-lLn2gCo2.js | 1 + web/dist/assets/Topic-0adcrc3O.css | 1 + web/dist/assets/Topic-cLiEWQZV.js | 1 + web/dist/assets/User-PfHpGfJF.js | 1 + web/dist/assets/Wallet-22Q_5kW8.js | 1 + web/dist/assets/content-fOn-h7ea.js | 1 + web/dist/assets/index-8lD1klqH.js | 7 +++++++ .../main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js | 1 + .../post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js | 1 + web/dist/assets/post-skeleton-zm5tFcFD.js | 1 + web/dist/assets/whisper-Vl-V0ytb.js | 1 + web/dist/assets/whisper-add-friend-PONlu7DH.js | 1 + 23 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 web/dist/assets/404-x31eybZD.js create mode 100644 web/dist/assets/Anouncement-BKCrB4N4.js create mode 100644 web/dist/assets/Collection-zGgLSBDA.js create mode 100644 web/dist/assets/Contacts-70p5eo25.js create mode 100644 web/dist/assets/Following-T99T9Q8h.js create mode 100644 web/dist/assets/Home-28LAfziN.js create mode 100644 web/dist/assets/Messages-Io0cWkZE.js create mode 100644 web/dist/assets/Post-Aii8OJYD.js create mode 100644 web/dist/assets/Profile-ND6y_r-3.js create mode 100644 web/dist/assets/Setting-lLn2gCo2.js create mode 100644 web/dist/assets/Topic-0adcrc3O.css create mode 100644 web/dist/assets/Topic-cLiEWQZV.js create mode 100644 web/dist/assets/User-PfHpGfJF.js create mode 100644 web/dist/assets/Wallet-22Q_5kW8.js create mode 100644 web/dist/assets/content-fOn-h7ea.js create mode 100644 web/dist/assets/index-8lD1klqH.js create mode 100644 web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js create mode 100644 web/dist/assets/post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js create mode 100644 web/dist/assets/post-skeleton-zm5tFcFD.js create mode 100644 web/dist/assets/whisper-Vl-V0ytb.js create mode 100644 web/dist/assets/whisper-add-friend-PONlu7DH.js diff --git a/internal/core/topics.go b/internal/core/topics.go index 03d46b1d7..e53bf5d73 100644 --- a/internal/core/topics.go +++ b/internal/core/topics.go @@ -16,7 +16,7 @@ type TopicService interface { TagsByKeyword(keyword string) (cs.TagInfoList, error) GetHotTags(userId int64, limit int, offset int) (cs.TagList, error) GetNewestTags(userId int64, limit int, offset int) (cs.TagList, error) - GetFollowTags(userId int64, is_pin bool, limit int, offset int) (cs.TagList, error) + GetFollowTags(userId int64, isPin bool, limit int, offset int) (cs.TagList, error) FollowTopic(userId int64, topicId int64) error UnfollowTopic(userId int64, topicId int64) error StickTopic(userId int64, topicId int64) (int8, error) diff --git a/internal/dao/jinzhu/topics.go b/internal/dao/jinzhu/topics.go index 1a13e5440..639f32d48 100644 --- a/internal/dao/jinzhu/topics.go +++ b/internal/dao/jinzhu/topics.go @@ -111,13 +111,13 @@ func (s *topicSrv) GetNewestTags(userId int64, limit int, offset int) (cs.TagLis return s.tagsFormatA(userId, tags) } -func (s *topicSrv) GetFollowTags(userId int64, is_pin bool, limit int, offset int) (cs.TagList, error) { +func (s *topicSrv) GetFollowTags(userId int64, isPin bool, limit int, offset int) (cs.TagList, error) { if userId < 0 { return nil, nil } userTopics := []*topicInfo{} db := s.db.Model(&dbr.TopicUser{}).Order("is_top DESC").Limit(limit).Offset(offset) - if is_pin { + if isPin { db = db.Where("user_id=? AND is_pin=1", userId) } else { db = db.Where("user_id=?", userId) diff --git a/web/dist/assets/404-x31eybZD.js b/web/dist/assets/404-x31eybZD.js new file mode 100644 index 000000000..39d38f5cf --- /dev/null +++ b/web/dist/assets/404-x31eybZD.js @@ -0,0 +1 @@ +import{_ as i}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{u as s}from"./vue-router-4Hko0_3l.js";import{G as a,e as c,a2 as u}from"./naive-ui-h5SFsZhx.js";import{d as l,f as d,k as t,w as o,e as f,A as x}from"./@vue-Hd4uXz5f.js";import{_ as g}from"./index-8lD1klqH.js";import"./vuex-qScXS-uk.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./@vicons-V6UxFD2Y.js";import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */const h=l({__name:"404",setup(k){const n=s(),e=()=>{n.push({path:"/"})};return(w,v)=>{const r=i,p=c,_=u,m=a;return f(),d("div",null,[t(r,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(_,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:e},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}}),O=g(h,[["__scopeId","data-v-e62daa85"]]);export{O as default}; diff --git a/web/dist/assets/Anouncement-BKCrB4N4.js b/web/dist/assets/Anouncement-BKCrB4N4.js new file mode 100644 index 000000000..cdc1d3623 --- /dev/null +++ b/web/dist/assets/Anouncement-BKCrB4N4.js @@ -0,0 +1 @@ +import{_ as N}from"./post-skeleton-zm5tFcFD.js";import{_ as R}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{u as z}from"./vuex-qScXS-uk.js";import{b as F}from"./vue-router-4Hko0_3l.js";import{K as S,_ as V}from"./index-8lD1klqH.js";import{G as A,R as H,J as P,H as j}from"./naive-ui-h5SFsZhx.js";import{d as q,H as n,b as D,f as e,k as a,w as p,e as o,bf as u,Z as l,F as E,x as G,t as _,j as s,l as I,v as J}from"./@vue-Hd4uXz5f.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./@vicons-V6UxFD2Y.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const K={key:0,class:"pagination-wrap"},L={key:0,class:"skeleton-wrap"},M={key:1},O={key:0,class:"empty-wrap"},T={class:"bill-line"},U=q({__name:"Anouncement",setup(Z){const d=z(),g=F(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),m=n(0),h=c=>{i.value=c};return D(()=>{}),(c,$)=>{const k=R,y=H,w=N,x=P,B=j,C=A;return o(),e("div",null,[a(k,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[m.value>1?(o(),e("div",K,[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?(o(),e("div",L,[a(w,{num:f.value},null,8,["num"])])):(o(),e("div",M,[r.value.length===0?(o(),e("div",O,[a(x,{size:"large",description:"暂无数据"})])):l("",!0),(o(!0),e(E,null,G(r.value,t=>(o(),J(B,{key:t.id},{default:p(()=>[s("div",T,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:I({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(S)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}}),kt=V(U,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Collection-zGgLSBDA.js b/web/dist/assets/Collection-zGgLSBDA.js new file mode 100644 index 000000000..c73264d78 --- /dev/null +++ b/web/dist/assets/Collection-zGgLSBDA.js @@ -0,0 +1 @@ +import{_ as j}from"./whisper-Vl-V0ytb.js";import{_ as D,a as R}from"./post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js";import{_ as q}from"./post-skeleton-zm5tFcFD.js";import{_ as E}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{u as G}from"./vuex-qScXS-uk.js";import{b as J}from"./vue-router-4Hko0_3l.js";import{W as L}from"./v3-infinite-loading-9ocfqcSa.js";import{U as Z,u as K,f as Q,_ as X}from"./index-8lD1klqH.js";import{d as Y,H as t,b as ee,f as n,k as a,w as u,v as d,Z as h,e as o,bf as f,F as b,x as $,j as z,t as oe}from"./@vue-Hd4uXz5f.js";import{F as se,G as te,a as ne,J as ae,k as ie,H as le}from"./naive-ui-h5SFsZhx.js";import"./content-fOn-h7ea.js";import"./@vicons-V6UxFD2Y.js";import"./paopao-video-player-iTSRV7j7.js";import"./copy-to-clipboard-l6UqHK6O.js";import"./@babel-5-cIlDoe.js";import"./toggle-selection-fekekO1r.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const re={key:0,class:"skeleton-wrap"},_e={key:1},ue={key:0,class:"empty-wrap"},ce={key:1},me={key:2},pe={class:"load-more-wrap"},de={class:"load-more-spinner"},fe=Y({__name:"Collection",setup(ve){const v=G(),A=J(),B=se(),c=t(!1),_=t(!1),s=t([]),l=t(+A.query.p||1),w=t(20),m=t(0),g=t(!1),k=t({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{k.value=e,g.value=!0},I=()=>{g.value=!1},x=e=>{B.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?K({user_id:e.user.id}).then(r=>{window.$message.success("操作成功"),C(e.user_id,!1)}).catch(r=>{}):Q({user_id:e.user.id}).then(r=>{window.$message.success("关注成功"),C(e.user_id,!0)}).catch(r=>{})}})};function C(e,r){for(let p in s.value)s.value[p].user_id==e&&(s.value[p].user.is_following=r)}const F=()=>{c.value=!0,Z({page:l.value,page_size:w.value}).then(e=>{c.value=!1,e.list.length===0&&(_.value=!0),l.value>1?s.value=s.value.concat(e.list):(s.value=e.list,window.scrollTo(0,0)),m.value=Math.ceil(e.pager.total_rows/w.value)}).catch(e=>{c.value=!1,l.value>1&&l.value--})},M=()=>{l.value{F()}),(e,r)=>{const p=E,O=q,P=ae,H=D,S=le,N=R,T=j,U=te,V=ie,W=ne;return o(),n("div",null,[a(p,{title:"收藏"}),a(U,{class:"main-content-wrap",bordered:""},{default:u(()=>[c.value&&s.value.length===0?(o(),n("div",re,[a(O,{num:w.value},null,8,["num"])])):(o(),n("div",_e,[s.value.length===0?(o(),n("div",ue,[a(P,{size:"large",description:"暂无数据"})])):h("",!0),f(v).state.desktopModelShow?(o(),n("div",ce,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(H,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))])):(o(),n("div",me,[(o(!0),n(b,null,$(s.value,i=>(o(),d(S,{key:i.id},{default:u(()=>[a(N,{post:i,isOwner:f(v).state.userInfo.id==i.user_id,addFollowAction:!0,onSendWhisper:y,onHandleFollowAction:x},null,8,["post","isOwner"])]),_:2},1024))),128))]))])),a(T,{show:g.value,user:k.value,onSuccess:I},null,8,["show","user"])]),_:1}),m.value>0?(o(),d(W,{key:0,justify:"center"},{default:u(()=>[a(f(L),{class:"load-more",slots:{complete:"没有更多收藏了",error:"加载出错"},onInfinite:M},{spinner:u(()=>[z("div",pe,[_.value?h("",!0):(o(),d(V,{key:0,size:14})),z("span",de,oe(_.value?"没有更多收藏了":"加载更多"),1)])]),_:1})]),_:1})):h("",!0)])}}}),Ze=X(fe,[["__scopeId","data-v-735372fb"]]);export{Ze as default}; diff --git a/web/dist/assets/Contacts-70p5eo25.js b/web/dist/assets/Contacts-70p5eo25.js new file mode 100644 index 000000000..082dd7126 --- /dev/null +++ b/web/dist/assets/Contacts-70p5eo25.js @@ -0,0 +1 @@ +import{_ as W}from"./whisper-Vl-V0ytb.js";import{d as P,c as A,r as L,e as s,f as p,k as t,w as o,y as R,t as d,A as E,j as a,bf as g,h as S,H as r,b as G,v as C,Z as b,F as M,x as J}from"./@vue-Hd4uXz5f.js";import{L as U,_ as x,Y}from"./index-8lD1klqH.js";import{k as Z,r as K}from"./@vicons-V6UxFD2Y.js";import{j as N,o as Q,e as X,P as ee,O as te,G as ne,a as oe,J as se,k as ae,H as ce}from"./naive-ui-h5SFsZhx.js";import{_ as ie}from"./post-skeleton-zm5tFcFD.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{W as le}from"./v3-infinite-loading-9ocfqcSa.js";import{b as _e}from"./vue-router-4Hko0_3l.js";import"./vuex-qScXS-uk.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const ue={class:"contact-item"},pe={class:"nickname-wrap"},me={class:"username-wrap"},de={class:"user-info"},fe={class:"info-item"},ve={class:"info-item"},he={class:"item-header-extra"},ge=P({__name:"contact-item",props:{contact:{}},emits:["send-whisper"],setup(z,{emit:w}){const _=w,l=e=>()=>S(N,null,{default:()=>S(e)}),n=z,c=A(()=>[{label:"私信 @"+n.contact.username,key:"whisper",icon:l(K)}]),m=e=>{switch(e){case"whisper":const i={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};_("send-whisper",i);break}};return(e,i)=>{const f=Q,k=L("router-link"),y=X,$=ee,v=te;return s(),p("div",ue,[t(v,{"content-indented":""},{avatar:o(()=>[t(f,{size:54,src:e.contact.avatar},null,8,["src"])]),header:o(()=>[a("span",pe,[t(k,{onClick:i[0]||(i[0]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:o(()=>[E(d(e.contact.nickname),1)]),_:1},8,["to"])]),a("span",me," @"+d(e.contact.username),1),a("div",de,[a("span",fe," UID. "+d(e.contact.user_id),1),a("span",ve,d(g(U)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":o(()=>[a("div",he,[t($,{placement:"bottom-end",trigger:"click",size:"small",options:c.value,onSelect:m},{default:o(()=>[t(y,{quaternary:"",circle:""},{icon:o(()=>[t(g(N),null,{default:o(()=>[t(g(Z))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}}),we=x(ge,[["__scopeId","data-v-42e975ce"]]),ke={key:0,class:"skeleton-wrap"},ye={key:1},$e={key:0,class:"empty-wrap"},Ce={class:"load-more-wrap"},be={class:"load-more-spinner"},ze=P({__name:"Contacts",setup(z){const w=_e(),_=r(!1),l=r(!1),n=r([]),c=r(+w.query.p||1),m=r(20),e=r(0),i=r(!1),f=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),k=h=>{f.value=h,i.value=!0},y=()=>{i.value=!1},$=()=>{c.value{v()});const v=(h=!1)=>{n.value.length===0&&(_.value=!0),Y({page:c.value,page_size:m.value}).then(u=>{_.value=!1,u.list.length===0&&(l.value=!0),c.value>1?n.value=n.value.concat(u.list):(n.value=u.list,h&&setTimeout(()=>{window.scrollTo(0,99999)},50)),e.value=Math.ceil(u.pager.total_rows/m.value)}).catch(u=>{_.value=!1,c.value>1&&c.value--})};return(h,u)=>{const B=re,V=ie,j=se,q=we,D=ce,F=W,H=ne,O=ae,T=oe;return s(),p(M,null,[a("div",null,[t(B,{title:"好友"}),t(H,{class:"main-content-wrap",bordered:""},{default:o(()=>[_.value&&n.value.length===0?(s(),p("div",ke,[t(V,{num:m.value},null,8,["num"])])):(s(),p("div",ye,[n.value.length===0?(s(),p("div",$e,[t(j,{size:"large",description:"暂无数据"})])):b("",!0),(s(!0),p(M,null,J(n.value,I=>(s(),C(D,{class:"list-item",key:I.user_id},{default:o(()=>[t(q,{contact:I,onSendWhisper:k},null,8,["contact"])]),_:2},1024))),128))])),t(F,{show:i.value,user:f.value,onSuccess:y},null,8,["show","user"])]),_:1})]),e.value>0?(s(),C(T,{key:0,justify:"center"},{default:o(()=>[t(g(le),{class:"load-more",slots:{complete:"没有更多好友了",error:"加载出错"},onInfinite:$},{spinner:o(()=>[a("div",Ce,[l.value?b("",!0):(s(),C(O,{key:0,size:14})),a("span",be,d(l.value?"没有更多好友了":"加载更多"),1)])]),_:1})]),_:1})):b("",!0)],64)}}}),Qe=x(ze,[["__scopeId","data-v-69277f0c"]]);export{Qe as default}; diff --git a/web/dist/assets/Following-T99T9Q8h.js b/web/dist/assets/Following-T99T9Q8h.js new file mode 100644 index 000000000..3d95436c4 --- /dev/null +++ b/web/dist/assets/Following-T99T9Q8h.js @@ -0,0 +1 @@ +import{_ as Y}from"./whisper-Vl-V0ytb.js";import{d as O,c as D,r as ee,e as r,f as v,k as n,w as l,y as oe,t as w,A as I,j as m,v as $,Z as F,bf as h,h as x,H as p,b as ne,F as B,x as te}from"./@vue-Hd4uXz5f.js";import{L as se,u as ae,f as le,_ as V,Z as ce,$ as ie}from"./index-8lD1klqH.js";import{k as ue,r as re,s as _e,t as pe}from"./@vicons-V6UxFD2Y.js";import{F as me,j as N,o as fe,M as de,e as ve,P as ge,O as we,G as he,a as ke,f as ye,g as be,J as $e,k as Fe,H as ze}from"./naive-ui-h5SFsZhx.js";import{_ as Pe}from"./post-skeleton-zm5tFcFD.js";import{_ as Te}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{W as Me}from"./v3-infinite-loading-9ocfqcSa.js";import{b as Se}from"./vue-router-4Hko0_3l.js";import"./vuex-qScXS-uk.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const Ue={class:"follow-item"},qe={class:"nickname-wrap"},Ce={class:"username-wrap"},Ie={class:"user-info"},xe={class:"info-item"},Be={class:"info-item"},Ne={class:"item-header-extra"},Oe=O({__name:"follow-item",props:{contact:{}},emits:["send-whisper"],setup(U,{emit:d}){const i=me(),_=d,t=e=>()=>x(N,null,{default:()=>x(e)}),z=()=>{i.success({title:"提示",content:"确定"+(o.contact.is_following?"取消关注 @":"关注 @")+o.contact.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{o.contact.is_following?ae({user_id:o.contact.user_id}).then(e=>{window.$message.success("取消关注成功"),o.contact.is_following=!1}).catch(e=>{console.log(e)}):le({user_id:o.contact.user_id}).then(e=>{window.$message.success("关注成功"),o.contact.is_following=!0}).catch(e=>{console.log(e)})}})},o=U,f=D(()=>{let e=[{label:"私信 @"+o.contact.username,key:"whisper",icon:t(re)}];return o.contact.is_following?e.push({label:"取消关注 @"+o.contact.username,key:"unfollow",icon:t(_e)}):e.push({label:"关注 @"+o.contact.username,key:"follow",icon:t(pe)}),e}),s=e=>{switch(e){case"follow":case"unfollow":z();break;case"whisper":const c={id:o.contact.user_id,avatar:o.contact.avatar,username:o.contact.username,nickname:o.contact.nickname,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1};_("send-whisper",c);break}};return(e,c)=>{const g=fe,k=ee("router-link"),P=de,y=ve,T=ge,M=we;return r(),v("div",Ue,[n(M,{"content-indented":""},{avatar:l(()=>[n(g,{size:54,src:e.contact.avatar},null,8,["src"])]),header:l(()=>[m("span",qe,[n(k,{onClick:c[0]||(c[0]=oe(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.contact.username}}},{default:l(()=>[I(w(e.contact.nickname),1)]),_:1},8,["to"])]),m("span",Ce," @"+w(e.contact.username),1),e.contact.is_following?(r(),$(P,{key:0,class:"top-tag",type:"success",size:"small",round:""},{default:l(()=>[I(" 已关注 ")]),_:1})):F("",!0),m("div",Ie,[m("span",xe," UID. "+w(e.contact.user_id),1),m("span",Be,w(h(se)(e.contact.created_on))+" 加入 ",1)])]),"header-extra":l(()=>[m("div",Ne,[n(T,{placement:"bottom-end",trigger:"click",size:"small",options:f.value,onSelect:s},{default:l(()=>[n(y,{quaternary:"",circle:""},{icon:l(()=>[n(h(N),null,{default:l(()=>[n(h(ue))]),_:1})]),_:1})]),_:1},8,["options"])])]),_:1})])}}}),De=V(Oe,[["__scopeId","data-v-5dd79903"]]),Ve={key:0,class:"skeleton-wrap"},We={key:1},je={key:0,class:"empty-wrap"},He={class:"load-more-wrap"},Ae={class:"load-more-spinner"},Le=O({__name:"Following",setup(U){const d=Se(),i=p(!1),_=p(!1),t=p([]),z=d.query.n||"粉丝详情",o=d.query.s||"",f=p(d.query.t||"follows"),s=p(+d.query.p||1),e=p(20),c=p(0),g=p(!1),k=p({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1});function P(u){t.value=[],i.value=!1,_.value=!1,s.value=1,c.value=0,f.value=u}const y=D(()=>f.value=="follows"?"没有更多关注了":"没有更多粉丝了"),T=u=>{k.value=u,g.value=!0},M=()=>{g.value=!1},W=()=>{s.value{P(u),S()},S=()=>{f.value==="follows"?H(o):f.value==="followings"&&A(o)},H=(u,b=!1)=>{t.value.length===0&&(i.value=!0),ce({username:u,page:s.value,page_size:e.value}).then(a=>{i.value=!1,a.list.length===0&&(_.value=!0),s.value>1?t.value=t.value.concat(a.list):(t.value=a.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),c.value=Math.ceil(a.pager.total_rows/e.value)}).catch(a=>{i.value=!1,s.value>1&&s.value--})},A=(u,b=!1)=>{t.value.length===0&&(i.value=!0),ie({username:u,page:s.value,page_size:e.value}).then(a=>{i.value=!1,a.list.length===0&&(_.value=!0),s.value>1?t.value=t.value.concat(a.list):(t.value=a.list,b&&setTimeout(()=>{window.scrollTo(0,99999)},50)),c.value=Math.ceil(a.pager.total_rows/e.value)}).catch(a=>{i.value=!1,s.value>1&&s.value--})};return ne(()=>{S()}),(u,b)=>{const a=Te,q=ye,L=be,R=Pe,Z=$e,E=De,G=ze,J=Y,K=he,Q=Fe,X=ke;return r(),v(B,null,[m("div",null,[n(a,{title:h(z),back:!0},null,8,["title"]),n(K,{class:"main-content-wrap",bordered:""},{default:l(()=>[n(L,{type:"line",animated:"","default-value":f.value,"onUpdate:value":j},{default:l(()=>[n(q,{name:"follows",tab:"正在关注"}),n(q,{name:"followings",tab:"我的粉丝"})]),_:1},8,["default-value"]),i.value&&t.value.length===0?(r(),v("div",Ve,[n(R,{num:e.value},null,8,["num"])])):(r(),v("div",We,[t.value.length===0?(r(),v("div",je,[n(Z,{size:"large",description:"暂无数据"})])):F("",!0),(r(!0),v(B,null,te(t.value,C=>(r(),$(G,{key:C.user_id},{default:l(()=>[n(E,{contact:C,onSendWhisper:T},null,8,["contact"])]),_:2},1024))),128))])),n(J,{show:g.value,user:k.value,onSuccess:M},null,8,["show","user"])]),_:1})]),c.value>0?(r(),$(X,{key:0,justify:"center"},{default:l(()=>[n(h(Me),{class:"load-more",slots:{complete:y.value,error:"加载出错"},onInfinite:W},{spinner:l(()=>[m("div",He,[_.value?F("",!0):(r(),$(Q,{key:0,size:14})),m("span",Ae,w(_.value?y.value:"加载更多"),1)])]),_:1},8,["slots"])]),_:1})):F("",!0)],64)}}}),wo=V(Le,[["__scopeId","data-v-dbf3bbcc"]]);export{wo as default}; diff --git a/web/dist/assets/Home-28LAfziN.js b/web/dist/assets/Home-28LAfziN.js new file mode 100644 index 000000000..cd44532a5 --- /dev/null +++ b/web/dist/assets/Home-28LAfziN.js @@ -0,0 +1 @@ +import{W as Fe}from"./whisper-add-friend-PONlu7DH.js";import{_ as Ne}from"./whisper-Vl-V0ytb.js";import{_ as Re,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js";import{_ as Ge}from"./post-skeleton-zm5tFcFD.js";import{d as ye,H as i,c as le,b as ke,e as r,f as k,bf as w,j as D,k as a,w as o,v as A,Z as g,y as he,t as fe,A as V,F as _e,x as ge,S as Oe,E as Se}from"./@vue-Hd4uXz5f.js";import{u as Ae}from"./vuex-qScXS-uk.js";import{l as we}from"./lodash-8cBkGte7.js";import{g as Pe,a as Me,c as Ye,b as Le,d as We,e as Ke,u as je,f as Qe,h as He,_ as Ze}from"./index-8lD1klqH.js";import{p as Je}from"./content-fOn-h7ea.js";import{V as q,P as X}from"./IEnum-u5OuruSk.js";import{I as Xe,V as $e,A as et,d as tt,E as st}from"./@vicons-V6UxFD2Y.js";import{o as be,v as at,j as nt,e as ze,w as ot,x as lt,y as it,z as rt,A as ut,B as ct,C as pt,a as Te,D as dt,E as vt,F as mt,G as ft,H as _t,l as gt,I as ht,J as wt,k as yt}from"./naive-ui-h5SFsZhx.js";import{_ as kt}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{b as At,u as bt}from"./vue-router-4Hko0_3l.js";import{W as zt}from"./v3-infinite-loading-9ocfqcSa.js";import{S as Tt}from"./@opentiny-dth6RzMU.js";import"./copy-to-clipboard-l6UqHK6O.js";import"./@babel-5-cIlDoe.js";import"./toggle-selection-fekekO1r.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";import"./paopao-video-player-iTSRV7j7.js";import"./vue-VsGwIgVC.js";const Ct=$=>{const _=new FileReader,p=z=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(z),h=()=>{const z=new Uint8Array(_.result).subarray(0,4);let d="";for(let b=0;b{_.onloadend=()=>{const b=$.type;z(b===""||b==="application/octet-stream"?h():p(b))},_.readAsArrayBuffer($.slice(0,4))})},It={key:0,class:"compose-wrap"},Dt={class:"compose-line"},Bt={class:"compose-user"},Ut={class:"compose-line compose-options"},xt={class:"attachment"},Vt={class:"submit-wrap"},Et={class:"attachment-list-wrap"},Ft={key:0,class:"attachment-price-wrap"},Nt=D("span",null," 附件价格¥",-1),Rt={key:0,class:"eye-wrap"},qt={key:1,class:"link-wrap"},Gt={key:1,class:"compose-wrap"},Ot=D("div",{class:"login-wrap"},[D("span",{class:"login-banner"}," 登录后,精彩更多")],-1),St={key:0,class:"login-only-wrap"},Pt={key:1,class:"login-wrap"},Mt=ye({__name:"compose",emits:["post-success"],setup($,{emit:_}){const p=_,h=Ae(),z=i([]),d=i(!1),b=i(!1),N=i(!1),R=i(!1),E=i(""),W=i([]),B=i(),G=i(0),y=i("public/image"),T=i([]),C=i([]),U=i([]),O=i([]),P=i(q.PUBLIC),v=i(q.PUBLIC),x=i("true".toLowerCase()==="true"),K="/v1/attachment",M=le(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),Q=le(()=>{let e=[{value:q.PUBLIC,label:"公开"},{value:q.PRIVATE,label:"私密"},{value:q.Following,label:"关注可见"}];return h.state.profile.useFriendship&&e.push({value:q.FRIEND,label:"好友可见"}),e}),H=()=>{N.value=!N.value,N.value&&R.value&&(R.value=!1)},ee=()=>{R.value=!R.value,R.value&&N.value&&(N.value=!1)},te=we.debounce(e=>{Pe({k:e}).then(t=>{let n=[];t.suggest.map(l=>{n.push({label:l,value:l})}),z.value=n,d.value=!1}).catch(t=>{d.value=!1})},200),ie=we.debounce(e=>{Me({k:e}).then(t=>{let n=[];t.suggest.map(l=>{n.push({label:l,value:l})}),z.value=n,d.value=!1}).catch(t=>{d.value=!1})},200),re=(e,t)=>{d.value||(d.value=!0,t==="@"?te(e):ie(e))},ue=e=>{e.length>h.state.profile.defaultTweetMaxLength?E.value=e.substring(0,h.state.profile.defaultTweetMaxLength):E.value=e},Z=e=>{y.value=e},se=e=>{for(let u=0;u30&&(e[u].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+l)}T.value=e},ae=async e=>{var t,n,l,u,m;return y.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):y.value==="image"&&((n=e.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):y.value==="public/video"&&!["video/mp4","video/quicktime"].includes((l=e.file.file)==null?void 0:l.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):y.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):y.value==="attachment"&&!await Ct(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):y.value==="attachment"&&((m=e.file.file)==null?void 0:m.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ne=({file:e,event:t})=>{var n;try{let l=JSON.parse((n=t.target)==null?void 0:n.response);l.code===0&&(y.value==="public/image"&&C.value.push({id:e.id,content:l.data.content}),y.value==="public/video"&&U.value.push({id:e.id,content:l.data.content}),y.value==="attachment"&&O.value.push({id:e.id,content:l.data.content}))}catch{window.$message.error("上传失败")}},oe=({file:e,event:t})=>{var n;try{let l=JSON.parse((n=t.target)==null?void 0:n.response);if(l.code!==0){let u=l.msg||"上传失败";l.details&&l.details.length>0&&l.details.map(m=>{u+=":"+m}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ce=({file:e})=>{let t=C.value.findIndex(n=>n.id===e.id);t>-1&&C.value.splice(t,1),t=U.value.findIndex(n=>n.id===e.id),t>-1&&U.value.splice(t,1),t=O.value.findIndex(n=>n.id===e.id),t>-1&&O.value.splice(t,1)},pe=()=>{if(E.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Je(E.value);const n=[];let l=100;n.push({content:E.value,type:X.TEXT,sort:l}),C.value.map(u=>{l++,n.push({content:u.content,type:X.IMAGEURL,sort:l})}),U.value.map(u=>{l++,n.push({content:u.content,type:X.VIDEOURL,sort:l})}),O.value.map(u=>{l++,n.push({content:u.content,type:X.ATTACHMENT,sort:l})}),W.value.length>0&&W.value.map(u=>{l++,n.push({content:u,type:X.LINKURL,sort:l})}),b.value=!0,Ye({contents:n,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+G.value*100,visibility:P.value}).then(u=>{var m;window.$message.success("发布成功"),b.value=!1,p("post-success",u),N.value=!1,R.value=!1,(m=B.value)==null||m.clear(),T.value=[],E.value="",W.value=[],C.value=[],U.value=[],O.value=[],P.value=v.value}).catch(u=>{b.value=!1})},Y=e=>{h.commit("triggerAuth",!0),h.commit("triggerAuthKey",e)};return ke(()=>{const e=h.state.profile.defaultTweetVisibility;h.state.profile.useFriendship&&e==="friend"?v.value=q.FRIEND:e==="following"?v.value=q.Following:e==="public"?v.value=q.PUBLIC:v.value=q.PRIVATE,P.value=v.value}),(e,t)=>{const n=be,l=at,u=nt,m=ze,J=ot,s=lt,c=it,S=rt,j=ut,F=ct,de=pt,ve=Te,me=dt,L=vt;return r(),k("div",null,[w(h).state.userInfo.id>0?(r(),k("div",It,[D("div",Dt,[D("div",Bt,[a(n,{round:"",size:30,src:w(h).state.userInfo.avatar},null,8,["src"])]),a(l,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:d.value,value:E.value,prefix:["@","#"],options:z.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(F,{ref_key:"uploadRef",ref:B,abstract:"","list-type":"image",multiple:!0,max:9,action:K,headers:{Authorization:M.value},data:{type:y.value},"file-list":T.value,onBeforeUpload:ae,onFinish:ne,onError:oe,onRemove:ce,"onUpdate:fileList":se},{default:o(()=>[D("div",Ut,[D("div",xt,[a(J,{abstract:""},{default:o(({handleClick:f})=>[a(m,{disabled:T.value.length>0&&y.value==="public/video"||T.value.length===9,onClick:()=>{Z("public/image"),f()},quaternary:"",circle:"",type:"primary"},{icon:o(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:o(()=>[a(w(Xe))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),w(h).state.profile.allowTweetVideo?(r(),A(J,{key:0,abstract:""},{default:o(({handleClick:f})=>[a(m,{disabled:T.value.length>0&&y.value!=="public/video"||T.value.length===9,onClick:()=>{Z("public/video"),f()},quaternary:"",circle:"",type:"primary"},{icon:o(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:o(()=>[a(w($e))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):g("",!0),w(h).state.profile.allowTweetAttachment?(r(),A(J,{key:1,abstract:""},{default:o(({handleClick:f})=>[a(m,{disabled:T.value.length>0&&y.value==="public/video"||T.value.length===9,onClick:()=>{Z("attachment"),f()},quaternary:"",circle:"",type:"primary"},{icon:o(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:o(()=>[a(w(et))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):g("",!0),a(m,{quaternary:"",circle:"",type:"primary",onClick:he(H,["stop"])},{icon:o(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:o(()=>[a(w(tt))]),_:1})]),_:1}),x.value?(r(),A(m,{key:2,quaternary:"",circle:"",type:"primary",onClick:he(ee,["stop"])},{icon:o(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:o(()=>[a(w(st))]),_:1})]),_:1})):g("",!0)]),D("div",Vt,[a(c,{trigger:"hover",placement:"bottom"},{trigger:o(()=>[a(s,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:E.value.length/w(h).state.profile.defaultTweetMaxLength*100},null,8,["percentage"])]),default:o(()=>[V(" 已输入"+fe(E.value.length)+"字 ",1)]),_:1}),a(m,{loading:b.value,onClick:pe,type:"primary",secondary:"",round:""},{default:o(()=>[V(" 发布 ")]),_:1},8,["loading"])])]),D("div",Et,[a(S),O.value.length>0?(r(),k("div",Ft,[w(h).state.profile.allowTweetAttachmentPrice?(r(),A(j,{key:0,value:G.value,"onUpdate:value":t[0]||(t[0]=f=>G.value=f),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:o(()=>[Nt]),_:1},8,["value"])):g("",!0)])):g("",!0)])]),_:1},8,["headers","data","file-list"]),R.value?(r(),k("div",Rt,[a(me,{value:P.value,"onUpdate:value":t[1]||(t[1]=f=>P.value=f),name:"radiogroup"},{default:o(()=>[a(ve,null,{default:o(()=>[(r(!0),k(_e,null,ge(Q.value,f=>(r(),A(de,{key:f.value,value:f.value,label:f.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):g("",!0),N.value?(r(),k("div",qt,[a(L,{value:W.value,"onUpdate:value":t[2]||(t[2]=f=>W.value=f),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":o(()=>[V(" 创建链接 ")]),_:1},8,["value"])])):g("",!0)])):(r(),k("div",Gt,[Ot,w(h).state.profile.allowUserRegister?g("",!0):(r(),k("div",St,[a(m,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=f=>Y("signin"))},{default:o(()=>[V(" 登录 ")]),_:1})])),w(h).state.profile.allowUserRegister?(r(),k("div",Pt,[a(m,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=f=>Y("signin"))},{default:o(()=>[V(" 登录 ")]),_:1}),a(m,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=f=>Y("signup"))},{default:o(()=>[V(" 注册 ")]),_:1})])):g("",!0)]))])}}}),Yt="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=",Lt="/assets/discover-tweets-xonT1u91.jpeg",Wt="/assets/following-tweets-SqHyfFVA.jpeg",Kt={class:"slide-bar-item"},jt={class:"slide-bar-item-title slide-bar-user-link"},Qt={key:1,class:"style-wrap"},Ht={key:2,class:"skeleton-wrap"},Zt={key:0,class:"empty-wrap"},Jt={key:1},Xt={key:2},$t={class:"load-more-wrap"},es={class:"load-more-spinner"},ts=ye({__name:"Home",setup($){const _=Ae(),p=At(),h=bt(),z=mt(),d=i("newest"),b=()=>{d.value="newest",e(B.value[0],0)},N=()=>{d.value="hots",e(B.value[1],1)},R=()=>{d.value="following",e(B.value[2],2)},E=i(9),W=i(8),B=i([{title:"最新动态",style:1,username:"",avatar:Yt,show:!0},{title:"热门推荐",style:2,username:"",avatar:Lt,show:!1},{title:"正在关注",style:3,username:"",avatar:Wt,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),G=Oe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!1,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=i(null),T=i("泡泡广场"),C=i(!1),U=i(!1),O=i(1),P=i(""),v=i([]),x=i(1),K=i(20),M=i(0),Q=i(!1),H=i(!1),ee=i({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),te=s=>{ee.value=s,Q.value=!0},ie=()=>{Q.value=!1},re=()=>{H.value=!0},ue=s=>{z.warning({title:"删除好友",content:"将好友 “"+s.user.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{He({user_id:G.id}).then(c=>{window.$message.success("操作成功"),s.user.is_friend=!1}).catch(c=>{})}})},Z=()=>{H.value=!1,y.value=null},se=s=>{y.value=s,G.id=s.user.id,G.username=s.user.username,G.nickname=s.user.nickname,s.user.is_friend?ue(s):re()},ae=s=>{z.success({title:"提示",content:"确定"+(s.user.is_following?"取消关注 @":"关注 @")+s.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.user.is_following?je({user_id:s.user.id}).then(c=>{window.$message.success("操作成功"),ne(s.user_id,!1)}).catch(c=>{}):Qe({user_id:s.user.id}).then(c=>{window.$message.success("关注成功"),ne(s.user_id,!0)}).catch(c=>{})}})};function ne(s,c){for(let S in v.value)v.value[S].user_id==s&&(v.value[S].user.is_following=c)}const oe=()=>{T.value="泡泡广场",p.query&&p.query.q&&(p.query.t&&p.query.t==="tag"?T.value="#"+decodeURIComponent(p.query.q):T.value="搜索: "+decodeURIComponent(p.query.q))},ce=le(()=>_.state.userInfo.id>0&&!_.state.profile.enableTrendsBar&&_.state.desktopModelShow),pe=le(()=>_.state.profile.useFriendship&&_.state.profile.enableTrendsBar&&_.state.desktopModelShow&&_.state.userInfo.id>0),Y=()=>{C.value=!1,U.value=!1,v.value=[],x.value=1,M.value=0},e=(s,c)=>{switch(Y(),O.value=s.style,p.query.q&&(p.query.q=null,oe()),s.style){case 1:n("newest");break;case 2:n("hots");break;case 3:p.query.q=null,n("following");break;case 21:P.value=s.username,l();break}B.value[c].show=!1},t=()=>{B.value=B.value.slice(0,3),!(!_.state.profile.useFriendship||!_.state.profile.enableTrendsBar||_.state.userInfo.id===0)&&Le({page:1,page_size:50}).then(s=>{var c=0;const S=s.list||[];let j=[];for(;c0&&(B.value=B.value.concat(j))}).catch(s=>{console.log(s)})},n=s=>{C.value=!0,We({query:p.query.q?decodeURIComponent(p.query.q):null,type:p.query.t,style:s,page:x.value,page_size:K.value}).then(c=>{C.value=!1,c.list.length===0&&(U.value=!0),x.value>1?v.value=v.value.concat(c.list):(v.value=c.list,window.scrollTo(0,0)),M.value=Math.ceil(c.pager.total_rows/K.value)}).catch(c=>{C.value=!1,x.value>1&&x.value--})},l=()=>{C.value=!0,Ke({username:P.value,style:"post",page:x.value,page_size:K.value}).then(s=>{C.value=!1,s.list.length===0&&(U.value=!0),x.value>1?v.value=v.value.concat(s.list):(v.value=s.list||[],window.scrollTo(0,0)),M.value=Math.ceil(s.pager.total_rows/K.value)}).catch(s=>{v.value=[],x.value>1&&x.value--,C.value=!1})},u=s=>{h.push({name:"post",query:{id:s.id}})},m=()=>{switch(O.value){case 1:n("newest");break;case 2:n("hots");break;case 3:n("following");break;case 21:p.query.q?n("search"):l();break}},J=()=>{x.value{Y(),t(),n("newest")}),Se(()=>({path:p.path,query:p.query,refresh:_.state.refresh}),(s,c)=>{if(oe(),s.refresh!==c.refresh){Y(),setTimeout(()=>{t(),m()},0);return}c.path!=="/post"&&s.path==="/"&&(Y(),setTimeout(()=>{t(),m()},0))}),(s,c)=>{const S=kt,j=Mt,F=_t,de=be,ve=gt,me=ht,L=ze,f=Te,Ce=Ge,Ie=wt,De=Re,Be=qe,Ue=Ne,xe=Fe,Ve=ft,Ee=yt;return r(),k("div",null,[a(S,{title:T.value},null,8,["title"]),a(Ve,{class:"main-content-wrap",bordered:""},{default:o(()=>[a(F,null,{default:o(()=>[a(j,{onPostSuccess:u})]),_:1}),pe.value?(r(),A(F,{key:0},{default:o(()=>[a(w(Tt),{modelValue:B.value,"onUpdate:modelValue":c[0]||(c[0]=I=>B.value=I),"wheel-blocks":W.value,"init-blocks":E.value,onClick:e,tag:"div","sub-tag":"div"},{default:o(I=>[D("div",Kt,[a(ve,{value:"1",offset:[-4,48],dot:"",show:I.slotData.show},{default:o(()=>[a(de,{round:"",size:48,src:I.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),D("div",jt,[a(me,{"line-clamp":2},{default:o(()=>[V(fe(I.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):ce.value?(r(),k("div",Qt,[a(f,null,{default:o(()=>[d.value!=="newest"?(r(),A(L,{key:0,size:"small",bordered:!1,onClick:b,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 全部 ")]),_:1})):g("",!0),d.value==="newest"?(r(),A(L,{key:1,size:"small",type:"success",bordered:!1,onClick:b,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 全部 ")]),_:1})):g("",!0),d.value!=="hots"?(r(),A(L,{key:2,size:"small",bordered:!1,onClick:N,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 热门推荐 ")]),_:1})):g("",!0),d.value==="hots"?(r(),A(L,{key:3,size:"small",type:"success",bordered:!1,onClick:N,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 热门推荐 ")]),_:1})):g("",!0),d.value!=="following"?(r(),A(L,{key:4,size:"small",bordered:!1,onClick:R,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 正在关注 ")]),_:1})):g("",!0),d.value==="following"?(r(),A(L,{key:5,size:"small",type:"success",bordered:!1,onClick:R,class:"style-item",secondary:"",round:""},{default:o(()=>[V(" 正在关注 ")]),_:1})):g("",!0)]),_:1})])):g("",!0),C.value&&v.value.length===0?(r(),k("div",Ht,[a(Ce,{num:K.value},null,8,["num"])])):g("",!0),D("div",null,[v.value.length===0?(r(),k("div",Zt,[a(Ie,{size:"large",description:"暂无数据"})])):g("",!0),w(_).state.desktopModelShow?(r(),k("div",Jt,[(r(!0),k(_e,null,ge(v.value,I=>(r(),A(F,{key:I.id},{default:o(()=>[a(De,{post:I,isOwner:w(_).state.userInfo.id==I.user_id,addFollowAction:!0,onSendWhisper:te,onHandleFollowAction:ae,onHandleFriendAction:se},null,8,["post","isOwner"])]),_:2},1024))),128))])):(r(),k("div",Xt,[(r(!0),k(_e,null,ge(v.value,I=>(r(),A(F,{key:I.id},{default:o(()=>[a(Be,{post:I,isOwner:w(_).state.userInfo.id==I.user_id,addFollowAction:!0,onSendWhisper:te,onHandleFollowAction:ae,onHandleFriendAction:se},null,8,["post","isOwner"])]),_:2},1024))),128))]))]),a(Ue,{show:Q.value,user:ee.value,onSuccess:ie},null,8,["show","user"]),a(xe,{show:H.value,user:G,onSuccess:Z},null,8,["show","user"])]),_:1}),M.value>0?(r(),A(f,{key:0,justify:"center"},{default:o(()=>[a(w(zt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[1]||(c[1]=I=>J())},{spinner:o(()=>[D("div",$t,[U.value?g("",!0):(r(),A(Ee,{key:0,size:14})),D("span",es,fe(U.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):g("",!0)])}}}),Os=Ze(ts,[["__scopeId","data-v-cc7d12d2"]]);export{Os as default}; diff --git a/web/dist/assets/Messages-Io0cWkZE.js b/web/dist/assets/Messages-Io0cWkZE.js new file mode 100644 index 000000000..ce2a02616 --- /dev/null +++ b/web/dist/assets/Messages-Io0cWkZE.js @@ -0,0 +1 @@ +import{d as J,c as F,r as me,e as a,f as i,k as n,w as t,bf as o,y as R,t as g,A as p,Z as d,v as z,j as h,l as ge,h as H,x as se,F as ne,H as v,b as fe}from"./@vue-Hd4uXz5f.js";import{u as te}from"./vuex-qScXS-uk.js";import{u as ve,b as ke}from"./vue-router-4Hko0_3l.js";import{K as ye,P as he,Q as we,R as be,u as $e,f as Ce,_ as L,S as Ie,T as Me}from"./index-8lD1klqH.js";import{K as x,k as Se,N as ze,O as qe,Q as ee,U as Oe,r as T,s as Re,t as Ae,X as A,Y as Fe,Z as B,_ as V,R as D}from"./@vicons-V6UxFD2Y.js";import{F as Te,j as m,o as Ne,M as Pe,l as Ue,e as ae,P as oe,T as We,O as je,U as Be,a as Ve,G as De,Q as He,J as Qe,k as Ke,H as Ze}from"./naive-ui-h5SFsZhx.js";import{_ as Ee}from"./whisper-Vl-V0ytb.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{W as Je}from"./v3-infinite-loading-9ocfqcSa.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const Le={class:"sender-wrap"},Xe={key:0,class:"nickname"},Ye={key:0,class:"username"},xe={key:1,class:"nickname"},es={key:0,class:"username"},ss={key:2,class:"nickname"},ns={class:"timestamp"},ts={class:"timestamp-txt"},as={key:0,class:"brief-content"},os={key:1,class:"whisper-content-wrap"},ls={key:2,class:"requesting-friend-wrap"},rs={key:2,class:"status-info"},is={key:3,class:"status-info"},us="https://assets.paopao.info/public/avatar/default/admin.png",cs=J({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(Q,{emit:w}){const N=ve(),c=te(),f=Te(),u=Q,b=e=>()=>H(m,null,{default:()=>H(e)}),$=F(()=>{let e=u.message.type==4&&u.message.sender_user_id==c.state.userInfo.id?u.message.receiver_user:u.message.sender_user,s=[{label:"私信 @"+e.username,key:"whisper",icon:b(T)}];return c.state.userInfo.id!=e.id&&(e.is_following?s.push({label:"取消关注 @"+e.username,key:"unfollow",icon:b(Re)}):s.push({label:"关注 @"+e.username,key:"follow",icon:b(Ae)})),s}),_=w,k=e=>{let s=e.type==4&&e.sender_user_id==c.state.userInfo.id?e.receiver_user:e.sender_user;f.success({title:"提示",content:"确定"+(s.is_following?"取消关注 @":"关注 @")+s.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.is_following?$e({user_id:s.id}).then(y=>{window.$message.success("操作成功"),s.is_following=!1,setTimeout(()=>{_("reload")},50)}).catch(y=>{}):Ce({user_id:s.id}).then(y=>{window.$message.success("关注成功"),s.is_following=!0,setTimeout(()=>{_("reload")},50)}).catch(y=>{})}})},q=e=>{switch(e){case"whisper":const s=u.message;if(s.type!=99){let y=s.type==4&&s.sender_user_id==c.state.userInfo.id?s.receiver_user:s.sender_user;_("send-whisper",y)}break;case"follow":case"unfollow":k(u.message);break}},C=F(()=>u.message.type!==4||u.message.sender_user_id!==c.state.userInfo.id),P=F(()=>u.message.type==4&&u.message.receiver_user_id==c.state.userInfo.id),O=F(()=>u.message.type==4&&u.message.sender_user_id==c.state.userInfo.id),r=e=>{S(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?N.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},K=e=>{S(e),he({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},U=e=>{S(e),we({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},S=e=>{u.message.receiver_user_id==c.state.userInfo.id&&e.is_read===0&&be({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const y=Ne,W=me("router-link"),I=Pe,Z=Ue,l=ae,j=oe,E=We,G=je;return a(),i("div",{class:ge(["message-item",{unread:C.value&&e.message.is_read===0}]),onClick:s[5]||(s[5]=M=>S(e.message))},[n(G,{"content-indented":""},{avatar:t(()=>[n(y,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(c).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:us},null,8,["src"])]),header:t(()=>[h("div",Le,[e.message.type!=4&&e.message.sender_user.id>0||P.value?(a(),i("span",Xe,[n(W,{onClick:s[0]||(s[0]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:t(()=>[p(g(e.message.sender_user.nickname),1)]),_:1},8,["to"]),o(c).state.desktopModelShow?(a(),i("span",Ye," @"+g(e.message.sender_user.username),1)):d("",!0)])):O.value?(a(),i("span",xe,[n(W,{onClick:s[1]||(s[1]=R(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:t(()=>[p(g(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),o(c).state.desktopModelShow?(a(),i("span",es," @"+g(e.message.receiver_user.username),1)):d("",!0)])):(a(),i("span",ss," 系统 ")),O.value?(a(),z(I,{key:3,class:"top-tag",type:"info",size:"small",round:""},{icon:t(()=>[n(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[p(" 私信已发送 ")]),_:1})):d("",!0),e.message.type==4&&e.message.receiver_user_id==o(c).state.userInfo.id?(a(),z(I,{key:4,class:"top-tag",type:"warning",size:"small",round:""},{icon:t(()=>[n(o(m),{component:o(x)},null,8,["component"])]),default:t(()=>[p(" 私信已接收 ")]),_:1})):d("",!0)])]),"header-extra":t(()=>[h("span",ns,[C.value&&e.message.is_read===0?(a(),z(Z,{key:0,dot:"",processing:""})):d("",!0),h("span",ts,g(o(ye)(e.message.created_on)),1),n(j,{placement:"bottom-end",trigger:"click",size:"small",options:$.value,onSelect:q},{default:t(()=>[n(l,{quaternary:"",circle:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Se))]),_:1})]),_:1})]),_:1},8,["options"])])]),description:t(()=>[n(E,{"show-icon":!1,class:"brief-wrap",type:!C.value||e.message.is_read>0?"default":"success"},{default:t(()=>[e.message.type!=4?(a(),i("div",as,[p(g(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(a(),i("span",{key:0,onClick:s[2]||(s[2]=R(M=>r(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ze))]),_:1}),p(" 查看详情 ")])):d("",!0)])):d("",!0),e.message.type===4?(a(),i("div",os,g(e.message.content),1)):d("",!0),e.message.type===5?(a(),i("div",ls,[p(g(e.message.content)+" ",1),e.message.reply_id===1?(a(),i("span",{key:0,onClick:s[3]||(s[3]=R(M=>K(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(qe))]),_:1}),p(" 同意 ")])):d("",!0),e.message.reply_id===1?(a(),i("span",{key:1,onClick:s[4]||(s[4]=R(M=>U(e.message),["stop"])),class:"hash-link view-link"},[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),p(" 拒绝 ")])):d("",!0),e.message.reply_id===2?(a(),i("span",rs,[n(o(m),null,{default:t(()=>[n(o(Oe))]),_:1}),p(" 已同意 ")])):d("",!0),e.message.reply_id===3?(a(),i("span",is,[n(o(m),null,{default:t(()=>[n(o(ee))]),_:1}),p(" 已拒绝 ")])):d("",!0)])):d("",!0)]),_:1},8,["type"])]),_:1})],2)}}}),_s=L(cs,[["__scopeId","data-v-019d5af4"]]),ds={class:"content"},ps=J({__name:"message-skeleton",props:{num:{default:1}},setup(Q){return(w,N)=>{const c=Be;return a(!0),i(ne,null,se(new Array(w.num),f=>(a(),i("div",{class:"skeleton-item",key:f},[h("div",ds,[n(c,{text:"",repeat:2}),n(c,{text:"",style:{width:"60%"}})])]))),128)}}}),ms=L(ps,[["__scopeId","data-v-01d2e871"]]),gs={class:"title title-action"},fs={class:"title title-filter"},vs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},hs={key:1},ws={class:"load-more-wrap"},bs={class:"load-more-spinner"},$s=J({__name:"Messages",setup(Q){const w=te(),N=ke(),c=v(!1),f=v(!1),u=v(+N.query.p||1),b=v(20),$=v(0),_=v([]),k=v("所有消息"),q=v("all"),C=v(!1),P=v({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),O=()=>{f.value=!1,u.value=1,$.value=0,_.value=[]},r=l=>()=>H(m,null,{default:()=>H(l)}),K=F(()=>{let l;switch(k.value){case"所有消息":l=[{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(T)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(A)}];break;case"系统消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"我的私信",key:"whisper",icon:r(T)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(A)}];break;case"我的私信":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"好友申请",key:"requesting",icon:r(D)},{label:"未读消息",key:"unread",icon:r(A)}];break;case"好友申请":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(T)},{label:"未读消息",key:"unread",icon:r(A)}];break;case"未读消息":l=[{label:"所有消息",key:"all",icon:r(B)},{label:"系统消息",key:"system",icon:r(V)},{label:"我的私信",key:"whisper",icon:r(T)},{label:"好友申请",key:"requesting",icon:r(D)}];break;default:l=[];break}return l}),U=l=>{switch(l){case"all":k.value="所有消息";break;case"system":k.value="系统消息";break;case"whisper":k.value="我的私信";break;case"requesting":k.value="好友申请";break;case"unread":k.value="未读消息";break}q.value=l,O(),I()},S=()=>{U("unread")},e=()=>{w.state.unreadMsgCount>0&&_.value.length>0&&Me().then(l=>{if(q.value!="unread")for(let j in _.value)_.value[j].is_read=1;else _.value=[];w.commit("updateUnreadMsgCount",0)}).catch(l=>{console.log(l)})},s=l=>{P.value=l,C.value=!0},y=()=>{C.value=!1},W=()=>{O(),I()},I=()=>{c.value=!0,Ie({style:q.value,page:u.value,page_size:b.value}).then(l=>{c.value=!1,l.list.length===0&&(f.value=!0),u.value>1?_.value=_.value.concat(l.list):(_.value=l.list,window.scrollTo(0,0)),$.value=Math.ceil(l.pager.total_rows/b.value)}).catch(l=>{c.value=!1,u.value>1&&u.value--})},Z=()=>{u.value<$.value||$.value==0?(f.value=!1,u.value++,I()):f.value=!0};return fe(()=>{I()}),(l,j)=>{const E=Ge,G=Ee,M=ae,le=He,re=oe,X=Ve,ie=ms,ue=Qe,ce=_s,_e=Ze,de=De,pe=Ke;return a(),i("div",null,[n(E,{title:"消息"}),n(de,{class:"main-content-wrap messages-wrap",bordered:""},{default:t(()=>[n(G,{show:C.value,user:P.value,onSuccess:y},null,8,["show","user"]),n(X,{justify:"space-between"},{default:t(()=>[h("div",gs,[n(M,{text:"",size:"small",focusable:!1,onClick:S},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(A))]),_:1})]),default:t(()=>[p(" "+g(o(w).state.unreadMsgCount)+" 条未读 ",1)]),_:1}),n(le,{vertical:""}),n(M,{text:"",size:"small",focusable:!1,onClick:e},{default:t(()=>[p("全标已读")]),_:1})]),h("div",fs,[n(re,{placement:"bottom-end",trigger:"click",size:"small",options:K.value,onSelect:U},{default:t(()=>[n(M,{text:""},{icon:t(()=>[n(o(m),null,{default:t(()=>[n(o(Fe))]),_:1})]),default:t(()=>[p(" "+g(k.value),1)]),_:1})]),_:1},8,["options"])])]),_:1}),c.value&&_.value.length===0?(a(),i("div",vs,[n(ie,{num:b.value},null,8,["num"])])):(a(),i("div",ks,[_.value.length===0?(a(),i("div",ys,[n(ue,{size:"large",description:"暂无数据"})])):(a(),i("div",hs,[(a(!0),i(ne,null,se(_.value,Y=>(a(),z(_e,{key:Y.id},{default:t(()=>[n(ce,{message:Y,onSendWhisper:s,onReload:W},null,8,["message"])]),_:2},1024))),128))]))]))]),_:1}),$.value>0?(a(),z(X,{key:0,justify:"center"},{default:t(()=>[n(o(Je),{class:"load-more",slots:{complete:"没有更多消息了",error:"加载出错"},onInfinite:Z},{spinner:t(()=>[h("div",ws,[f.value?d("",!0):(a(),z(pe,{key:0,size:14})),h("span",bs,g(f.value?"没有更多消息了":"加载更多"),1)])]),_:1})]),_:1})):d("",!0)])}}}),Js=L($s,[["__scopeId","data-v-a2e6a3be"]]);export{Js as default}; diff --git a/web/dist/assets/Post-Aii8OJYD.js b/web/dist/assets/Post-Aii8OJYD.js new file mode 100644 index 000000000..39861b3f0 --- /dev/null +++ b/web/dist/assets/Post-Aii8OJYD.js @@ -0,0 +1 @@ +import{d as ae,H as r,r as we,e as o,f as p,j as d,k as t,w as n,t as L,A as S,v as U,Z as i,bf as a,y as Y,c as ce,am as Ge,F as ve,x as he,a0 as Re,a1 as Se,b as Oe,h as Ie,E as Qe}from"./@vue-Hd4uXz5f.js";import{u as re}from"./vuex-qScXS-uk.js";import{i as fe,t as Ze,j as Xe,k as et,_ as pe,l as tt,m as st,n as ot,o as nt,p as at,g as lt,q as it,r as ut,s as ct,v as rt,w as pt,x as _t,y as dt,z as mt,A as vt,B as ht,u as ft,f as gt,C as Te,D as ke}from"./index-8lD1klqH.js";import{Y as se,V as ee}from"./IEnum-u5OuruSk.js";import{T as Le,e as ge,f as Ae,g as ye,h as De,i as yt,j as kt,I as wt,k as bt,l as $t,m as Ct,n as xt,o as It,p as Tt,q as Pt,r as Ut,s as zt,t as ue,u as Rt,v as St,w as Ot,x as Pe,F as Ue,E as de,y as me,z as ze}from"./@vicons-V6UxFD2Y.js";import{j as K,e as _e,K as Me,I as Lt,b as At,L as Dt,o as be,M as Ee,O as Ne,v as Mt,w as Et,x as Nt,y as qt,z as Bt,B as Ht,F as Ft,P as jt,i as Vt,Q as Yt,a as qe,G as Wt,J as Jt,k as Kt,H as Gt,f as Qt,g as Zt}from"./naive-ui-h5SFsZhx.js";import{p as $e,_ as Be,a as Xt,b as es,c as ts}from"./content-fOn-h7ea.js";import{u as He,b as ss}from"./vue-router-4Hko0_3l.js";import{_ as os}from"./post-skeleton-zm5tFcFD.js";import{l as ns}from"./lodash-8cBkGte7.js";import{_ as as}from"./whisper-Vl-V0ytb.js";import{c as ls}from"./copy-to-clipboard-l6UqHK6O.js";import{_ as is}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{W as us}from"./v3-infinite-loading-9ocfqcSa.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";import"./paopao-video-player-iTSRV7j7.js";import"./@babel-5-cIlDoe.js";import"./toggle-selection-fekekO1r.js";const cs={class:"reply-item"},rs={class:"header-wrap"},ps={class:"username"},_s={class:"reply-name"},ds={class:"timestamp"},ms={class:"base-wrap"},vs={class:"content"},hs={class:"reply-switch"},fs={class:"time-item"},gs={class:"actions"},ys={class:"upvote-count"},ks={class:"upvote-count"},ws={key:2,class:"action-item"},bs=ae({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(E,{emit:V}){const u=E,_=re(),g=V,$=r(u.reply.is_thumbs_up==se.YES),O=r(u.reply.is_thumbs_down==se.YES),T=r(u.reply.thumbs_up_count),v=()=>{Ze({tweet_id:u.tweetId,comment_id:u.reply.comment_id,reply_id:u.reply.id}).then(f=>{$.value=!$.value,$.value?(T.value++,O.value=!1):T.value--}).catch(f=>{console.log(f)})},l=()=>{Xe({tweet_id:u.tweetId,comment_id:u.reply.comment_id,reply_id:u.reply.id}).then(f=>{O.value=!O.value,O.value&&$.value&&(T.value--,$.value=!1)}).catch(f=>{console.log(f)})},N=()=>{g("focusReply",u.reply)},D=()=>{et({id:u.reply.id}).then(f=>{window.$message.success("删除成功"),setTimeout(()=>{g("reload")},50)}).catch(f=>{console.log(f)})};return(f,x)=>{const M=we("router-link"),I=K,b=_e,P=Me,y=Lt;return o(),p("div",cs,[d("div",rs,[d("div",ps,[t(M,{class:"user-link",to:{name:"user",query:{s:u.reply.user.username}}},{default:n(()=>[S(L(u.reply.user.username),1)]),_:1},8,["to"]),d("span",_s,L(u.reply.at_user_id>0?"回复":":"),1),u.reply.at_user_id>0?(o(),U(M,{key:0,class:"user-link",to:{name:"user",query:{s:u.reply.at_user.username}}},{default:n(()=>[S(L(u.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),d("div",ds,[S(L(u.reply.ip_loc)+" ",1),a(_).state.userInfo.is_admin||a(_).state.userInfo.id===u.reply.user.id?(o(),U(P,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:D},{trigger:n(()=>[t(b,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(I,null,{default:n(()=>[t(a(Le))]),_:1})]),_:1})]),default:n(()=>[S(" 是否删除这条回复? ")]),_:1})):i("",!0)])]),d("div",ms,[d("div",vs,[t(y,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[S(L(u.reply.content),1)]),_:1})]),d("div",hs,[d("span",fs,L(a(fe)(u.reply.created_on)),1),d("div",gs,[a(_).state.userLogined?i("",!0):(o(),p("div",{key:0,class:"action-item",onClick:x[0]||(x[0]=Y(()=>{},["stop"]))},[t(I,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1}),d("span",ys,L(T.value),1)])),a(_).state.userLogined?(o(),p("div",{key:1,class:"action-item hover",onClick:Y(v,["stop"])},[t(I,{size:"medium"},{default:n(()=>[$.value?i("",!0):(o(),U(a(ge),{key:0})),$.value?(o(),U(a(Ae),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",ks,L(T.value>0?T.value:"赞"),1)])):i("",!0),a(_).state.userLogined?i("",!0):(o(),p("div",ws,[t(I,{size:"medium"},{default:n(()=>[t(a(ye))]),_:1})])),a(_).state.userLogined?(o(),p("div",{key:3,class:"action-item hover",onClick:Y(l,["stop"])},[t(I,{size:"medium"},{default:n(()=>[O.value?i("",!0):(o(),U(a(ye),{key:0})),O.value?(o(),U(a(De),{key:1,class:"show"})):i("",!0)]),_:1})])):i("",!0),a(_).state.userLogined?(o(),p("span",{key:4,class:"show opacity-item reply-btn",onClick:N}," 回复 ")):i("",!0)])])])])}}}),$s=pe(bs,[["__scopeId","data-v-eccdbbd8"]]),Cs={class:"reply-compose-wrap"},xs={class:"reply-switch"},Is={class:"time-item"},Ts={class:"actions"},Ps={key:0,class:"action-item"},Us={class:"upvote-count"},zs={class:"upvote-count"},Rs={key:2,class:"action-item"},Ss={key:0,class:"reply-input-wrap"},Os=ae({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(E,{expose:V,emit:u}){const _=E,g=re(),$=u,O=r(),T=r(!1),v=r(""),l=r(!1),N=300,D=r(_.comment.is_thumbs_up==se.YES),f=r(_.comment.is_thumbs_down==se.YES),x=r(_.comment.thumbs_up_count),M=()=>{tt({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(y=>{D.value=!D.value,D.value?(x.value++,f.value=!1):x.value--}).catch(y=>{console.log(y)})},I=()=>{st({tweet_id:_.comment.post_id,comment_id:_.comment.id}).then(y=>{f.value=!f.value,f.value&&D.value&&(x.value--,D.value=!1)}).catch(y=>{console.log(y)})},b=y=>{T.value=y,y?setTimeout(()=>{var A;(A=O.value)==null||A.focus()},10):(l.value=!1,v.value="",$("reset"))},P=()=>{l.value=!0,ot({comment_id:_.comment.id,at_user_id:_.atUserid,content:v.value}).then(y=>{b(!1),window.$message.success("评论成功"),$("reload")}).catch(y=>{l.value=!1})};return V({switchReply:b}),(y,A)=>{const q=K,s=At,m=_e,B=Dt;return o(),p("div",Cs,[d("div",xs,[d("span",Is,L(a(fe)(y.comment.created_on)),1),d("div",Ts,[a(g).state.userLogined?i("",!0):(o(),p("div",Ps,[t(q,{size:"medium"},{default:n(()=>[t(a(ge))]),_:1}),d("span",Us,L(x.value),1)])),a(g).state.userLogined?(o(),p("div",{key:1,class:"action-item hover",onClick:Y(M,["stop"])},[t(q,{size:"medium"},{default:n(()=>[D.value?i("",!0):(o(),U(a(ge),{key:0})),D.value?(o(),U(a(Ae),{key:1,class:"show"})):i("",!0)]),_:1}),d("span",zs,L(x.value>0?x.value:"赞"),1)])):i("",!0),a(g).state.userLogined?i("",!0):(o(),p("div",Rs,[t(q,{size:"medium"},{default:n(()=>[t(a(ye))]),_:1})])),a(g).state.userLogined?(o(),p("div",{key:3,class:"action-item hover",onClick:Y(I,["stop"])},[t(q,{size:"medium"},{default:n(()=>[f.value?i("",!0):(o(),U(a(ye),{key:0})),f.value?(o(),U(a(De),{key:1,class:"show"})):i("",!0)]),_:1})])):i("",!0),a(g).state.userLogined&&!T.value?(o(),p("span",{key:4,class:"show reply-btn",onClick:A[0]||(A[0]=W=>b(!0))}," 回复 ")):i("",!0),a(g).state.userLogined&&T.value?(o(),p("span",{key:5,class:"hide reply-btn",onClick:A[1]||(A[1]=W=>b(!1))}," 取消 ")):i("",!0)])]),T.value?(o(),p("div",Ss,[t(B,null,{default:n(()=>[t(s,{ref_key:"inputInstRef",ref:O,size:"small",placeholder:_.atUsername?"@"+_.atUsername:"请输入回复内容..",maxlength:a(N),value:v.value,"onUpdate:value":A[2]||(A[2]=W=>v.value=W),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(m,{type:"primary",size:"small",ghost:"",loading:l.value,onClick:P},{default:n(()=>[S(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}}),Ls=pe(Os,[["__scopeId","data-v-f9af7a93"]]),As={class:"comment-item"},Ds={class:"nickname-wrap"},Ms={class:"username-wrap"},Es={class:"opt-wrap"},Ns={class:"timestamp"},qs=["innerHTML"],Bs={class:"reply-wrap"},Hs=ae({__name:"comment-item",props:{comment:{},postUserId:{}},emits:["reload"],setup(E,{emit:V}){const u=re(),_=He(),g=r(0),$=r(""),O=r(),T=V,v=E,l=ce(()=>{let b=Object.assign({texts:[],imgs:[]},v.comment);return b.contents.map(P=>{(+P.type==1||+P.type==2)&&b.texts.push(P),+P.type==3&&b.imgs.push(P)}),b}),N=(b,P)=>{let y=b.target;if(y.dataset.detail){const A=y.dataset.detail.split(":");A.length===2&&(u.commit("refresh"),A[0]==="tag"?window.$message.warning("评论内的无效话题"):_.push({name:"user",query:{s:A[1]}}))}},D=b=>{var P,y;g.value=b.user_id,$.value=((P=b.user)==null?void 0:P.username)||"",(y=O.value)==null||y.switchReply(!0)},f=()=>{T("reload")},x=()=>{g.value=0,$.value=""},M=()=>{nt({id:l.value.id}).then(b=>{window.$message.success("删除成功"),setTimeout(()=>{f()},50)}).catch(b=>{})},I=()=>{at({id:l.value.id}).then(b=>{l.value.is_essence=b.highlight_status,window.$message.success("操作成功"),setTimeout(()=>{f()},50)}).catch(b=>{})};return(b,P)=>{const y=be,A=we("router-link"),q=Ee,s=K,m=_e,B=Me,W=Be,J=Ls,G=$s,z=Ne;return o(),p("div",As,[t(z,{"content-indented":""},Ge({avatar:n(()=>[t(y,{round:"",size:30,src:l.value.user.avatar},null,8,["src"])]),header:n(()=>[d("span",Ds,[t(A,{onClick:P[0]||(P[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:l.value.user.username}}},{default:n(()=>[S(L(l.value.user.nickname),1)]),_:1},8,["to"])]),d("span",Ms," @"+L(l.value.user.username),1),l.value.is_essence==a(se).YES?(o(),U(q,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[S(" 精选 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[d("div",Es,[d("span",Ns,L(l.value.ip_loc),1),a(u).state.userInfo.id===b.postUserId?(o(),U(B,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:I},{trigger:n(()=>[t(m,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[l.value.is_essence==a(se).NO?(o(),U(s,{key:0},{default:n(()=>[t(a(yt))]),_:1})):(o(),U(s,{key:1},{default:n(()=>[t(a(kt))]),_:1}))]),_:1})]),default:n(()=>[S(" "+L(l.value.is_essence==a(se).NO?"是否精选这条评论":"是否取消精选"),1)]),_:1})):i("",!0),a(u).state.userInfo.is_admin||a(u).state.userInfo.id===l.value.user.id?(o(),U(B,{key:1,"negative-text":"取消","positive-text":"确认",onPositiveClick:M},{trigger:n(()=>[t(m,{quaternary:"",circle:"",size:"tiny",class:"action-btn"},{icon:n(()=>[t(s,null,{default:n(()=>[t(a(Le))]),_:1})]),_:1})]),default:n(()=>[S(" 是否删除这条评论? ")]),_:1})):i("",!0)])]),footer:n(()=>[l.value.imgs.length>0?(o(),U(W,{key:0,imgs:l.value.imgs},null,8,["imgs"])):i("",!0),t(J,{ref_key:"replyComposeRef",ref:O,comment:l.value,"at-userid":g.value,"at-username":$.value,onReload:f,onReset:x},null,8,["comment","at-userid","at-username"]),d("div",Bs,[(o(!0),p(ve,null,he(l.value.replies,k=>(o(),U(G,{key:k.id,reply:k,"tweet-id":l.value.post_id,onFocusReply:D,onReload:f},null,8,["reply","tweet-id"]))),128))])]),_:2},[l.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),p(ve,null,he(l.value.texts,k=>(o(),p("span",{key:k.id,class:"comment-text",onClick:P[1]||(P[1]=Y(Q=>N(Q,l.value.id),["stop"])),innerHTML:a($e)(k.content).content},null,8,qs))),128))]),key:"0"}:void 0]),1024)])}}}),Fs=pe(Hs,[["__scopeId","data-v-e1f04c6b"]]),js=E=>(Re("data-v-d9073453"),E=E(),Se(),E),Vs={key:0,class:"compose-wrap"},Ys={class:"compose-line"},Ws={class:"compose-user"},Js={class:"compose-line compose-options"},Ks={class:"attachment"},Gs={class:"submit-wrap"},Qs={class:"attachment-list-wrap"},Zs={key:1,class:"compose-wrap"},Xs=js(()=>d("div",{class:"login-wrap"},[d("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),eo={key:0,class:"login-only-wrap"},to={key:1,class:"login-wrap"},so=ae({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(E,{emit:V}){const u=V,_=E,g=re(),$=r([]),O=r(!1),T=r(!1),v=r(!1),l=r(""),N=r(),D=r("public/image"),f=r([]),x=r([]),M=r("true".toLowerCase()==="true"),I=300,b="/v1/attachment",P=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),y=ns.debounce(h=>{lt({k:h}).then(w=>{let C=[];w.suggest.map(R=>{C.push({label:R,value:R})}),$.value=C,T.value=!1}).catch(w=>{T.value=!1})},200),A=(h,w)=>{T.value||(T.value=!0,w==="@"&&y(h))},q=h=>{h.length>I?l.value=h.substring(0,I):l.value=h},s=h=>{D.value=h},m=h=>{for(let H=0;H30&&(h[H].name=C.substring(0,18)+"..."+C.substring(C.length-9)+"."+R)}f.value=h},B=async h=>{var w,C;return D.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((w=h.file.file)==null?void 0:w.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):D.value==="image"&&((C=h.file.file)==null?void 0:C.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},W=({file:h,event:w})=>{var C;try{let R=JSON.parse((C=w.target)==null?void 0:C.response);R.code===0&&D.value==="public/image"&&x.value.push({id:h.id,content:R.data.content})}catch{window.$message.error("上传失败")}},J=({file:h,event:w})=>{var C;try{let R=JSON.parse((C=w.target)==null?void 0:C.response);if(R.code!==0){let H=R.msg||"上传失败";R.details&&R.details.length>0&&R.details.map(e=>{H+=":"+e}),window.$message.error(H)}}catch{window.$message.error("上传失败")}},G=({file:h})=>{let w=x.value.findIndex(C=>C.id===h.id);w>-1&&x.value.splice(w,1)},z=()=>{O.value=!0},k=()=>{var h;O.value=!1,(h=N.value)==null||h.clear(),f.value=[],l.value="",x.value=[]},Q=()=>{if(l.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:h}=$e(l.value);const w=[];let C=100;w.push({content:l.value,type:2,sort:C}),x.value.map(R=>{C++,w.push({content:R.content,type:3,sort:C})}),v.value=!0,it({contents:w,post_id:_.postId,users:Array.from(new Set(h))}).then(R=>{window.$message.success("发布成功"),v.value=!1,u("post-success"),k()}).catch(R=>{v.value=!1})},Z=h=>{g.commit("triggerAuth",!0),g.commit("triggerAuthKey",h)};return(h,w)=>{const C=be,R=Mt,H=K,e=_e,c=Et,F=Nt,le=qt,X=Bt,oe=Ht;return o(),p("div",null,[a(g).state.userInfo.id>0?(o(),p("div",Vs,[d("div",Ys,[d("div",Ws,[t(C,{round:"",size:30,src:a(g).state.userInfo.avatar},null,8,["src"])]),t(R,{type:"textarea",size:"large",autosize:"",bordered:!1,options:$.value,prefix:["@"],loading:T.value,value:l.value,disabled:_.lock===1,"onUpdate:value":q,onSearch:A,onFocus:z,placeholder:_.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),O.value?(o(),U(oe,{key:0,ref_key:"uploadRef",ref:N,abstract:"","list-type":"image",multiple:!0,max:9,action:b,headers:{Authorization:P.value},data:{type:D.value},"file-list":f.value,onBeforeUpload:B,onFinish:W,onError:J,onRemove:G,"onUpdate:fileList":m},{default:n(()=>[d("div",Js,[d("div",Ks,[t(c,{abstract:""},{default:n(({handleClick:ne})=>[t(e,{disabled:f.value.length>0&&D.value==="public/video"||f.value.length===9,onClick:()=>{s("public/image"),ne()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(H,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(wt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(le,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(F,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:l.value.length/a(I)*100},null,8,["percentage"])]),default:n(()=>[S(" "+L(l.value.length)+" / "+L(a(I)),1)]),_:1})]),d("div",Gs,[t(e,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:k},{default:n(()=>[S(" 取消 ")]),_:1}),t(e,{loading:v.value,onClick:Q,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[S(" 发布 ")]),_:1},8,["loading"])])]),d("div",Qs,[t(X)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(o(),p("div",Zs,[Xs,M.value?i("",!0):(o(),p("div",eo,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=ne=>Z("signin"))},{default:n(()=>[S(" 登录 ")]),_:1})])),M.value?(o(),p("div",to,[t(e,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=ne=>Z("signin"))},{default:n(()=>[S(" 登录 ")]),_:1}),t(e,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=ne=>Z("signup"))},{default:n(()=>[S(" 注册 ")]),_:1})])):i("",!0)]))])}}}),oo=pe(so,[["__scopeId","data-v-d9073453"]]),no={class:"username-wrap"},ao={class:"options"},lo={key:0},io=["innerHTML"],uo={class:"timestamp"},co={key:0},ro={key:1},po={class:"opts-wrap"},_o={class:"opt-item"},mo=ae({__name:"post-detail",props:{post:{}},emits:["reload"],setup(E,{emit:V}){const u="true".toLowerCase()==="true",_=re(),g=He(),$=Ft(),O=r(!1),T=r(!1),v=E,l=r(!1),N=r(!1),D=r(!1),f=r(!1),x=r(!1),M=r(!1),I=r(ee.PUBLIC),b=r(!1),P=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),y=e=>{P.value=e,b.value=!0},A=()=>{b.value=!1},q=V,s=ce({get:()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},v.post);return e.contents.map(c=>{(+c.type==1||+c.type==2)&&e.texts.push(c),+c.type==3&&e.imgs.push(c),+c.type==4&&e.videos.push(c),+c.type==6&&e.links.push(c),+c.type==7&&e.attachments.push(c),+c.type==8&&e.charge_attachments.push(c)}),e},set:e=>{v.post.upvote_count=e.upvote_count,v.post.comment_count=e.comment_count,v.post.collection_count=e.collection_count,v.post.is_essence=e.is_essence}}),m=e=>()=>Ie(K,null,{default:()=>Ie(e)}),B=ce(()=>{var F;let e=[];if(!_.state.userInfo.is_admin&&_.state.userInfo.id!=v.post.user.id)return e.push({label:"私信 @"+v.post.user.username,key:"whisper",icon:m(Ut)}),v.post.user.is_following?e.push({label:"取消关注 @"+v.post.user.username,key:"unfollow",icon:m(zt)}):e.push({label:"关注 @"+v.post.user.username,key:"follow",icon:m(ue)}),e;e.push({label:"删除",key:"delete",icon:m(Rt)}),s.value.is_lock===0?e.push({label:"锁定",key:"lock",icon:m(St)}):e.push({label:"解锁",key:"unlock",icon:m(Ot)}),_.state.userInfo.is_admin&&(s.value.is_top===0?e.push({label:"置顶",key:"stick",icon:m(Pe)}):e.push({label:"取消置顶",key:"unstick",icon:m(Pe)})),s.value.is_essence===0?e.push({label:"设为亮点",key:"highlight",icon:m(Ue)}):e.push({label:"取消亮点",key:"unhighlight",icon:m(Ue)});let c;return s.value.visibility===ee.PUBLIC?c={label:"公开",key:"vpublic",icon:m(de),children:[{label:"私密",key:"vprivate",icon:m(me)},{label:"关注可见",key:"vfollowing",icon:m(ue)}]}:s.value.visibility===ee.PRIVATE?c={label:"私密",key:"vprivate",icon:m(me),children:[{label:"公开",key:"vpublic",icon:m(de)},{label:"关注可见",key:"vfollowing",icon:m(ue)}]}:u&&s.value.visibility===ee.FRIEND?c={label:"好友可见",key:"vfriend",icon:m(ze),children:[{label:"公开",key:"vpublic",icon:m(de)},{label:"私密",key:"vprivate",icon:m(me)},{label:"关注可见",key:"vfollowing",icon:m(ue)}]}:c={label:"关注可见",key:"vfollowing",icon:m(ue),children:[{label:"公开",key:"vpublic",icon:m(de)},{label:"私密",key:"vprivate",icon:m(me)}]},u&&s.value.visibility!==ee.FRIEND&&((F=c.children)==null||F.push({label:"好友可见",key:"vfriend",icon:m(ze)})),e.push(c),e}),W=e=>{$.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+v.post.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?ft({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!1}).catch(c=>{}):gt({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),e.user.is_following=!0}).catch(c=>{})}})},J=e=>{g.push({name:"post",query:{id:e}})},G=(e,c)=>{if(e.target.dataset.detail){const F=e.target.dataset.detail.split(":");if(F.length===2){_.commit("refresh"),F[0]==="tag"?g.push({name:"home",query:{q:F[1],t:"tag"}}):g.push({name:"user",query:{s:F[1]}});return}}J(c)},z=e=>{switch(e){case"whisper":y(v.post.user);break;case"follow":case"unfollow":W(v.post);break;case"delete":l.value=!0;break;case"lock":case"unlock":N.value=!0;break;case"stick":case"unstick":D.value=!0;break;case"highlight":case"unhighlight":f.value=!0;break;case"vpublic":I.value=0,x.value=!0;break;case"vprivate":I.value=1,x.value=!0;break;case"vfriend":I.value=2,x.value=!0;break;case"vfollowing":I.value=3,x.value=!0;break}},k=()=>{rt({id:s.value.id}).then(e=>{window.$message.success("删除成功"),g.replace("/"),setTimeout(()=>{_.commit("refresh")},50)}).catch(e=>{M.value=!1})},Q=()=>{pt({id:s.value.id}).then(e=>{q("reload",s.value.id),e.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(e=>{M.value=!1})},Z=()=>{_t({id:s.value.id}).then(e=>{q("reload",s.value.id),e.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(e=>{M.value=!1})},h=()=>{dt({id:s.value.id}).then(e=>{s.value={...s.value,is_essence:e.highlight_status},e.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(e=>{M.value=!1})},w=()=>{mt({id:s.value.id,visibility:I.value}).then(e=>{q("reload",s.value.id),window.$message.success("修改可见性成功")}).catch(e=>{M.value=!1})},C=()=>{vt({id:s.value.id}).then(e=>{O.value=e.status,e.status?s.value={...s.value,upvote_count:s.value.upvote_count+1}:s.value={...s.value,upvote_count:s.value.upvote_count-1}}).catch(e=>{console.log(e)})},R=()=>{ht({id:s.value.id}).then(e=>{T.value=e.status,e.status?s.value={...s.value,collection_count:s.value.collection_count+1}:s.value={...s.value,collection_count:s.value.collection_count-1}}).catch(e=>{console.log(e)})},H=()=>{ls(`${window.location.origin}/#/post?id=${s.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板")};return Oe(()=>{_.state.userInfo.id>0&&(ut({id:s.value.id}).then(e=>{O.value=e.status}).catch(e=>{console.log(e)}),ct({id:s.value.id}).then(e=>{T.value=e.status}).catch(e=>{console.log(e)}))}),(e,c)=>{const F=be,le=we("router-link"),X=Ee,oe=_e,ne=jt,ie=Vt,Fe=as,Ce=Xt,je=Be,Ve=es,Ye=ts,xe=Yt,We=qe,Je=Ne;return o(),p("div",{class:"detail-item",onClick:c[7]||(c[7]=j=>J(s.value.id))},[t(Je,null,{avatar:n(()=>[t(F,{round:"",size:30,src:s.value.user.avatar},null,8,["src"])]),header:n(()=>[t(le,{onClick:c[0]||(c[0]=Y(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:s.value.user.username}}},{default:n(()=>[S(L(s.value.user.nickname),1)]),_:1},8,["to"]),d("span",no," @"+L(s.value.user.username),1),s.value.is_top?(o(),U(X,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[S(" 置顶 ")]),_:1})):i("",!0),s.value.visibility==a(ee).PRIVATE?(o(),U(X,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[S(" 私密 ")]),_:1})):i("",!0),s.value.visibility==a(ee).FRIEND?(o(),U(X,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[S(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[d("div",ao,[t(ne,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:z},{default:n(()=>[t(oe,{quaternary:"",circle:""},{icon:n(()=>[t(a(K),null,{default:n(()=>[t(a(bt))]),_:1})]),_:1})]),_:1},8,["options"])]),t(ie,{show:l.value,"onUpdate:show":c[1]||(c[1]=j=>l.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:k},null,8,["show"]),t(ie,{show:N.value,"onUpdate:show":c[2]||(c[2]=j=>N.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Q},null,8,["show","content"]),t(ie,{show:D.value,"onUpdate:show":c[3]||(c[3]=j=>D.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(s.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:Z},null,8,["show","content"]),t(ie,{show:f.value,"onUpdate:show":c[4]||(c[4]=j=>f.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(s.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:h},null,8,["show","content"]),t(ie,{show:x.value,"onUpdate:show":c[5]||(c[5]=j=>x.value=j),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(I.value==0?"公开":I.value==1?"私密":I.value==2?"好友可见":"关注可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:w},null,8,["show","content"]),t(Fe,{show:b.value,user:P.value,onSuccess:A},null,8,["show","user"])]),footer:n(()=>[t(Ce,{attachments:s.value.attachments},null,8,["attachments"]),t(Ce,{attachments:s.value.charge_attachments,price:s.value.attachment_price},null,8,["attachments","price"]),t(je,{imgs:s.value.imgs},null,8,["imgs"]),t(Ve,{videos:s.value.videos,full:!0},null,8,["videos"]),t(Ye,{links:s.value.links},null,8,["links"]),d("div",uo,[S(" 发布于 "+L(a(fe)(s.value.created_on))+" ",1),s.value.ip_loc?(o(),p("span",co,[t(xe,{vertical:""}),S(" "+L(s.value.ip_loc),1)])):i("",!0),!a(_).state.collapsedLeft&&s.value.created_on!=s.value.latest_replied_on?(o(),p("span",ro,[t(xe,{vertical:""}),S(" 最后回复 "+L(a(fe)(s.value.latest_replied_on)),1)])):i("",!0)])]),action:n(()=>[d("div",po,[t(We,{justify:"space-between"},{default:n(()=>[d("div",{class:"opt-item hover",onClick:Y(C,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[O.value?i("",!0):(o(),U(a($t),{key:0})),O.value?(o(),U(a(Ct),{key:1,color:"red"})):i("",!0)]),_:1}),S(" "+L(s.value.upvote_count),1)]),d("div",_o,[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(xt))]),_:1}),S(" "+L(s.value.comment_count),1)]),d("div",{class:"opt-item hover",onClick:Y(R,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[T.value?i("",!0):(o(),U(a(It),{key:0})),T.value?(o(),U(a(Tt),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),S(" "+L(s.value.collection_count),1)]),d("div",{class:"opt-item hover",onClick:Y(H,["stop"])},[t(a(K),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(Pt))]),_:1}),S(" "+L(s.value.share_count),1)])]),_:1})])]),default:n(()=>[s.value.texts.length>0?(o(),p("div",lo,[(o(!0),p(ve,null,he(s.value.texts,j=>(o(),p("span",{key:j.id,class:"post-text",onClick:c[6]||(c[6]=Y(Ke=>G(Ke,s.value.id),["stop"])),innerHTML:a($e)(j.content).content},null,8,io))),128))])):i("",!0)]),_:1})])}}}),vo=E=>(Re("data-v-edac44ef"),E=E(),Se(),E),ho={key:0,class:"detail-wrap"},fo={key:1,class:"empty-wrap"},go={key:0,class:"comment-opts-wrap"},yo=vo(()=>d("span",{class:"comment-title-item"},"评论",-1)),ko={key:2},wo={key:0,class:"skeleton-wrap"},bo={key:1},$o={key:0,class:"empty-wrap"},Co={key:0,class:"load-more-spinner"},xo={key:1,class:"load-more-spinner"},Io={key:2,class:"load-more-spinner"},To={key:3,class:"load-more-spinner"},Po={key:4,class:"load-more-spinner"},Uo={key:5,class:"load-more-spinner"},te=20,zo=ae({__name:"Post",setup(E){const V=ss(),u=r({}),_=r(!1),g=r(!1),$=r([]),O=ce(()=>+V.query.id),T=r("default"),v=r(!0);let l={loading(){},loaded(){},complete(){},error(){}};const N=z=>{T.value=z,z==="default"&&(v.value=!0),J(l)},D=z=>{Te({id:z}).then(k=>{u.value=k}).catch(k=>{})},f=()=>{u.value={id:0},_.value=!0,Te({id:O.value}).then(z=>{_.value=!1,u.value=z,J(l)}).catch(z=>{_.value=!1})};let x=1;const M=r(!1),I=r([]),b=z=>{M.value||ke({id:u.value.id,style:"default",page:x,page_size:te}).then(k=>{z!==null&&(l=z),k.list.length0&&(x===1?I.value=k.list:I.value.push(...k.list),$.value=I.value),l.loaded(),g.value=!1}).catch(k=>{g.value=!1,l.error()})};let P=1,y=r(!1);const A=r([]),q=z=>{y.value||ke({id:u.value.id,style:"hots",page:P,page_size:te}).then(k=>{z!==null&&(l=z),k.list.length0&&(P===1?A.value=k.list:A.value.push(...k.list),$.value=A.value),l.loaded(),g.value=!1}).catch(k=>{g.value=!1,l.error()})};let s=1,m=r(!1);const B=r([]),W=z=>{m.value||ke({id:u.value.id,style:"newest",page:s,page_size:te}).then(k=>{z!==null&&(l=z),k.list.length0&&(s===1?B.value=k.list:B.value.push(...k.list),$.value=B.value),l.loaded(),g.value=!1}).catch(k=>{g.value=!1,l.error()})},J=z=>{O.value<1||($.value.length===0&&(g.value=!0),T.value==="default"?($.value=I.value,b(z)):T.value==="hots"?($.value=A.value,q(z)):($.value=B.value,W(z)),g.value=!1)},G=()=>{x=1,M.value=!1,I.value=[],P=1,y.value=!1,A.value=[],s=1,m.value=!1,B.value=[],J(l)};return Oe(()=>{f()}),Qe(O,()=>{O.value>0&&V.name==="post"&&f()}),(z,k)=>{const Q=is,Z=mo,h=Jt,w=Kt,C=Gt,R=Qt,H=Zt,e=oo,c=os,F=Fs,le=qe,X=Wt;return o(),p("div",null,[t(Q,{title:"泡泡详情",back:!0}),t(X,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(C,null,{default:n(()=>[t(w,{show:_.value},{default:n(()=>[u.value.id>1?(o(),p("div",ho,[t(Z,{post:u.value,onReload:D},null,8,["post"])])):(o(),p("div",fo,[t(h,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),u.value.id>0?(o(),p("div",go,[t(H,{type:"bar","justify-content":"end",size:"small","tab-style":"margin-left: -24px;",animated:"","onUpdate:value":N},{prefix:n(()=>[yo]),default:n(()=>[t(R,{name:"default",tab:"推荐"}),t(R,{name:"hots",tab:"热门"}),t(R,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),u.value.id>0?(o(),U(C,{key:1},{default:n(()=>[t(e,{lock:u.value.is_lock,"post-id":u.value.id,onPostSuccess:G},null,8,["lock","post-id"])]),_:1})):i("",!0),u.value.id>0?(o(),p("div",ko,[g.value?(o(),p("div",wo,[t(c,{num:5})])):(o(),p("div",bo,[$.value.length===0?(o(),p("div",$o,[t(h,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(o(!0),p(ve,null,he($.value,oe=>(o(),U(C,{key:oe.id},{default:n(()=>[t(F,{comment:oe,postUserId:u.value.user_id,onReload:G},null,8,["comment","postUserId"])]),_:2},1024))),128))]))])):i("",!0),$.value.length>=te?(o(),U(le,{key:3,justify:"center"},{default:n(()=>[t(a(us),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:J},{spinner:n(()=>[v.value&&M.value?(o(),p("span",Co)):i("",!0),!v.value&&a(y)?(o(),p("span",xo)):i("",!0),!v.value&&a(m)?(o(),p("span",Io)):i("",!0),v.value&&!M.value?(o(),p("span",To,"加载评论")):i("",!0),!v.value&&!a(y)?(o(),p("span",Po,"加载评论")):i("",!0),!v.value&&!a(m)?(o(),p("span",Uo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}}),pn=pe(zo,[["__scopeId","data-v-edac44ef"]]);export{pn as default}; diff --git a/web/dist/assets/Profile-ND6y_r-3.js b/web/dist/assets/Profile-ND6y_r-3.js new file mode 100644 index 000000000..d46e3226a --- /dev/null +++ b/web/dist/assets/Profile-ND6y_r-3.js @@ -0,0 +1 @@ +import{_ as ze}from"./whisper-Vl-V0ytb.js";import{_ as Me,a as $e}from"./post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js";import{_ as qe}from"./post-skeleton-zm5tFcFD.js";import{_ as xe}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{d as Se,H as r,c as Ce,b as Le,E as Ne,r as Ue,f as i,k as u,bf as o,v as h,w as _,Z as f,e as a,j as m,t as O,A as E,y as ue,F as b,x as I,h as ie}from"./@vue-Hd4uXz5f.js";import{u as De}from"./vuex-qScXS-uk.js";import{b as He,u as Be}from"./vue-router-4Hko0_3l.js";import{e as L,L as Ve,u as je,f as Re,_ as We}from"./index-8lD1klqH.js";import{p as G}from"./count-GnrfahME.js";import{W as Ee}from"./v3-infinite-loading-9ocfqcSa.js";import{k as Ge,a as Je}from"./@vicons-V6UxFD2Y.js";import{F as Qe,G as Ze,a as Ke,j as re,o as Xe,M as Ye,e as et,P as tt,f as at,g as st,J as lt,k as ot,H as nt}from"./naive-ui-h5SFsZhx.js";import"./content-fOn-h7ea.js";import"./paopao-video-player-iTSRV7j7.js";import"./copy-to-clipboard-l6UqHK6O.js";import"./@babel-5-cIlDoe.js";import"./toggle-selection-fekekO1r.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const ut={class:"profile-baseinfo"},it={class:"avatar"},rt={class:"base-info"},ct={class:"username"},_t={class:"userinfo"},vt={class:"info-item"},dt={class:"info-item"},mt={class:"userinfo"},ft={class:"info-item"},pt={class:"info-item"},ht={class:"info-item"},gt={class:"user-opts"},wt={key:0,class:"skeleton-wrap"},kt={key:1},yt={key:0,class:"empty-wrap"},bt={key:1},It={key:0},Pt={key:1},Ot={key:2},Tt={key:3},At={key:4},Ft={key:2},zt={key:0},Mt={key:1},$t={key:2},qt={key:3},xt={key:4},St={class:"load-more-wrap"},Ct={class:"load-more-spinner"},Lt=Se({__name:"Profile",setup(Nt){const n=De(),T=He(),ce=Be(),_e=Qe(),d=r(!1),P=r(!1),l=r([]),A=r([]),F=r([]),z=r([]),M=r([]),$=r([]),p=r("post"),J=r(+T.query.p||1),Q=r(1),Z=r(1),K=r(1),X=r(1),s=r(+T.query.p||1),g=r(20),v=r(0),Y=r(0),ee=r(0),te=r(0),ae=r(0),se=r(0),U=r(!1),le=r({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),ve=e=>()=>ie(re,null,{default:()=>ie(e)}),de=Ce(()=>[{label:"设置",key:"setting",icon:ve(Je)}]),me=e=>{switch(e){case"setting":ce.push({name:"setting",query:{t:new Date().getTime()}});break}},w=e=>{le.value=e,U.value=!0},fe=()=>{U.value=!1},k=e=>{_e.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?je({user_id:e.user.id}).then(c=>{window.$message.success("操作成功"),oe(e.user_id,!1)}).catch(c=>{}):Re({user_id:e.user.id}).then(c=>{window.$message.success("关注成功"),oe(e.user_id,!0)}).catch(c=>{})}})};function oe(e,c){q(A.value,e,c),q(F.value,e,c),q(z.value,e,c),q(M.value,e,c),q($.value,e,c)}function q(e,c,W){if(e&&e.length>0)for(let N in e)e[N].user_id==c&&(e[N].user.is_following=W)}const D=()=>{switch(p.value){case"post":H();break;case"comment":B();break;case"highlight":V();break;case"media":j();break;case"star":R();break}},H=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"post",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),A.value=l.value,Y.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},B=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"comment",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),F.value=l.value,ee.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},V=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"highlight",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),z.value=l.value,te.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},j=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"media",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),M.value=l.value,ae.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},R=()=>{d.value=!0,L({username:n.state.userInfo.username,style:"star",page:s.value,page_size:g.value}).then(e=>{d.value=!1,e.list.length===0&&(P.value=!0),s.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),v.value=Math.ceil(e.pager.total_rows/g.value),$.value=l.value,se.value=v.value}).catch(e=>{l.value=[],s.value>1&&s.value--,d.value=!1})},pe=e=>{switch(p.value=e,p.value){case"post":l.value=A.value,s.value=J.value,v.value=Y.value,H();break;case"comment":l.value=F.value,s.value=Q.value,v.value=ee.value,B();break;case"highlight":l.value=z.value,s.value=Z.value,v.value=te.value,V();break;case"media":l.value=M.value,s.value=K.value,v.value=ae.value,j();break;case"star":l.value=$.value,s.value=X.value,v.value=se.value,R();break}},he=()=>{switch(p.value){case"post":J.value=s.value,H();break;case"comment":Q.value=s.value,B();break;case"highlight":Z.value=s.value,V();break;case"media":K.value=s.value,j();break;case"star":X.value=s.value,R();break}},ge=()=>{s.value{D()}),Ne(()=>({path:T.path,query:T.query,refresh:n.state.refresh}),(e,c)=>{if(e.refresh!==c.refresh){s.value=+T.query.p||1,setTimeout(()=>{D()},0);return}c.path!=="/post"&&e.path==="/profile"&&(s.value=+T.query.p||1,setTimeout(()=>{D()},0))}),(e,c)=>{const W=xe,N=Xe,we=Ye,ne=Ue("router-link"),ke=et,ye=tt,x=at,be=st,Ie=qe,Pe=lt,S=Me,y=nt,C=$e,Oe=ze,Te=Ze,Ae=ot,Fe=Ke;return a(),i("div",null,[u(W,{title:"主页"}),o(n).state.userInfo.id>0?(a(),h(Te,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:_(()=>[m("div",ut,[m("div",it,[u(N,{size:72,src:o(n).state.userInfo.avatar},null,8,["src"])]),m("div",rt,[m("div",ct,[m("strong",null,O(o(n).state.userInfo.nickname),1),m("span",null," @"+O(o(n).state.userInfo.username),1),o(n).state.userInfo.is_admin?(a(),h(we,{key:0,class:"top-tag",type:"error",size:"small",round:""},{default:_(()=>[E(" 管理员 ")]),_:1})):f("",!0)]),m("div",_t,[m("span",vt,"UID. "+O(o(n).state.userInfo.id),1),m("span",dt,O(o(Ve)(o(n).state.userInfo.created_on))+" 加入",1)]),m("div",mt,[m("span",ft,[u(ne,{onClick:c[0]||(c[0]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"follows"}}},{default:_(()=>[E(" 关注  "+O(o(G)(o(n).state.userInfo.follows)),1)]),_:1},8,["to"])]),m("span",pt,[u(ne,{onClick:c[1]||(c[1]=ue(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:o(n).state.userInfo.username,n:o(n).state.userInfo.nickname,t:"followings"}}},{default:_(()=>[E(" 粉丝  "+O(o(G)(o(n).state.userInfo.followings)),1)]),_:1},8,["to"])]),m("span",ht," 泡泡  "+O(o(G)(o(n).state.userInfo.tweets_count)),1)])]),m("div",gt,[u(ye,{placement:"bottom-end",trigger:"click",size:"small",options:de.value,onSelect:me},{default:_(()=>[u(ke,{quaternary:"",circle:""},{icon:_(()=>[u(o(re),null,{default:_(()=>[u(o(Ge))]),_:1})]),_:1})]),_:1},8,["options"])])]),u(be,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":pe},{default:_(()=>[u(x,{name:"post",tab:"泡泡"}),u(x,{name:"comment",tab:"评论"}),u(x,{name:"highlight",tab:"亮点"}),u(x,{name:"media",tab:"图文"}),u(x,{name:"star",tab:"喜欢"})]),_:1}),d.value&&l.value.length===0?(a(),i("div",wt,[u(Ie,{num:g.value},null,8,["num"])])):(a(),i("div",kt,[l.value.length===0?(a(),i("div",yt,[u(Pe,{size:"large",description:"暂无数据"})])):f("",!0),o(n).state.desktopModelShow?(a(),i("div",bt,[p.value==="post"?(a(),i("div",It,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Pt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",Ot,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",Tt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",At,[(a(!0),i(b,null,I($.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(S,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)])):(a(),i("div",Ft,[p.value==="post"?(a(),i("div",zt,[(a(!0),i(b,null,I(A.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="comment"?(a(),i("div",Mt,[(a(!0),i(b,null,I(F.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="highlight"?(a(),i("div",$t,[(a(!0),i(b,null,I(z.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="media"?(a(),i("div",qt,[(a(!0),i(b,null,I(M.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0),p.value==="star"?(a(),i("div",xt,[(a(!0),i(b,null,I($.value,t=>(a(),h(y,{key:t.id},{default:_(()=>[u(C,{post:t,isOwner:o(n).state.userInfo.id==t.user_id,addFollowAction:!0,onSendWhisper:w,onHandleFollowAction:k},null,8,["post","isOwner"])]),_:2},1024))),128))])):f("",!0)]))])),u(Oe,{show:U.value,user:le.value,onSuccess:fe},null,8,["show","user"])]),_:1})):f("",!0),v.value>0?(a(),h(Fe,{key:1,justify:"center"},{default:_(()=>[u(o(Ee),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:c[2]||(c[2]=t=>ge())},{spinner:_(()=>[m("div",St,[P.value?f("",!0):(a(),h(Ae,{key:0,size:14})),m("span",Ct,O(P.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):f("",!0)])}}}),ha=We(Lt,[["__scopeId","data-v-106c824e"]]);export{ha as default}; diff --git a/web/dist/assets/Setting-lLn2gCo2.js b/web/dist/assets/Setting-lLn2gCo2.js new file mode 100644 index 000000000..7a48f1464 --- /dev/null +++ b/web/dist/assets/Setting-lLn2gCo2.js @@ -0,0 +1 @@ +import{_ as ge}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{d as we,H as d,S as Q,b as ye,f as h,k as a,w as s,bf as r,v as k,Z as m,e as i,j as _,A as p,t as U,P as be,D as ke,_ as S,y as R,a0 as Ce,a1 as Ie}from"./@vue-Hd4uXz5f.js";import{u as Pe}from"./vuex-qScXS-uk.js";import{a5 as X,a6 as $e,a7 as Be,a8 as Ue,a9 as Se,aa as Re,ab as qe,_ as Ae}from"./index-8lD1klqH.js";import{a2 as Ne}from"./@vicons-V6UxFD2Y.js";import{h as ze,o as De,e as Ke,B as xe,b as Fe,j as Te,T as je,$ as Ve,L as Ee,a0 as Oe,a1 as Le,d as Me}from"./naive-ui-h5SFsZhx.js";import"./vue-router-4Hko0_3l.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const F=q=>(Ce("data-v-7bb19e7f"),q=q(),Ie(),q),We={class:"base-line avatar"},Ge={class:"base-line"},He=F(()=>_("span",{class:"base-label"},"昵称",-1)),Je={key:0},Ze={class:"base-line"},Qe=F(()=>_("span",{class:"base-label"},"用户名",-1)),Xe={key:0},Ye={key:1},ea=F(()=>_("br",null,null,-1)),aa={key:2,class:"phone-bind-wrap"},ta={class:"captcha-img-wrap"},sa={class:"captcha-img"},na=["src"],oa={class:"form-submit-wrap"},la={key:0},ra={key:1},ia=F(()=>_("br",null,null,-1)),ua={key:2,class:"phone-bind-wrap"},da={class:"captcha-img-wrap"},pa={class:"captcha-img"},ca=["src"],ma={class:"form-submit-wrap"},_a={key:1,class:"phone-bind-wrap"},va={class:"form-submit-wrap"},fa=we({__name:"Setting",setup(q){const Y="/v1/attachment",ee="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),A=d("public/avatar"),ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),N=d(!1),z=d(!1),L=d(),M=d(),C=d(!1),D=d(!1),$=d(!1),B=d(!1),I=d(60),y=d(!1),b=d(!1),W=d(),G=d(),H=d(),J=d(),t=Q({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),u=Q({id:"",b64s:"",imgCaptcha:"",activate_code:""}),te=async n=>{var e,v;return A.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):A.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},se=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&A.value==="public/avatar"&&$e({avatar:f.data.content}).then(c=>{var K;window.$message.success("头像更新成功"),(K=L.value)==null||K.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(c=>{console.log(c)})}catch{window.$message.error("上传失败")}},ne=(n,e)=>!!t.password&&t.password.startsWith(e)&&t.password.length>=e.length,oe=(n,e)=>e===t.password,le=()=>{var n;t.reenteredPassword&&((n=J.value)==null||n.validate({trigger:"password-input"}))},re=n=>{var e;n.preventDefault(),(e=H.value)==null||e.validate(v=>{v||(D.value=!0,Be({password:t.password,old_password:t.old_password}).then(f=>{D.value=!1,$.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{D.value=!1}))})},ie=n=>{var e;n.preventDefault(),(e=W.value)==null||e.validate(v=>{v||(N.value=!0,Ue({phone:t.phone,captcha:t.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:t.phone}),t.id="",t.b64s="",t.imgCaptcha="",t.phone="",t.phone_captcha=""}).catch(f=>{N.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(u.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(z.value=!0,Se({activate_code:u.activate_code,captcha_id:u.id,imgCaptcha:u.imgCaptcha}).then(f=>{z.value=!1,b.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:u.activate_code}),u.id="",u.b64s="",u.imgCaptcha="",u.activate_code=""}).catch(f=>{z.value=!1,f.code===20012&&j()}))})},T=()=>{X().then(n=>{t.id=n.id,t.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{X().then(n=>{u.id=n.id,u.b64s=n.b64s}).catch(n=>{console.log(n)})},de=()=>{Re({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&B.value)){if(t.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,qe({phone:t.phone,img_captcha:t.imgCaptcha,img_captcha_id:t.id}).then(n=>{B.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,B.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},ce={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)}]},_e={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:ne,message:"两次密码输入不一致",trigger:"input"},{validator:oe,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},ve=()=>{C.value=!0,setTimeout(()=>{var n;(n=M.value)==null||n.focus()},30)};return ye(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=ge,f=De,c=Ke,K=xe,g=Fe,fe=Te,x=ze,Z=je,w=Ve,he=Ee,V=Oe,E=Le,O=Me;return i(),h("div",null,[a(v,{title:"设置",theme:""}),a(x,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[_("div",We,[a(f,{class:"avatar-img",size:80,src:r(o).state.userInfo.avatar},null,8,["src"]),!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),k(K,{key:0,ref_key:"avatarRef",ref:L,action:Y,headers:{Authorization:ee},data:{type:A.value},onBeforeUpload:te,onFinish:se},{default:s(()=>[a(c,{size:"small"},{default:s(()=>[p("更改头像")]),_:1})]),_:1},8,["headers","data"])):m("",!0)]),_("div",Ge,[He,C.value?m("",!0):(i(),h("div",Je,U(r(o).state.userInfo.nickname),1)),be(a(g,{ref_key:"inputInstRef",ref:M,class:"nickname-input",value:r(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>r(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:de,maxlength:16},null,8,["value"]),[[ke,C.value]]),!C.value&&(!r(o).state.profile.allowPhoneBind||r(o).state.profile.allowPhoneBind&&r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0&&r(o).state.userInfo.status==1)?(i(),k(c,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:ve},{icon:s(()=>[a(fe,null,{default:s(()=>[a(r(Ne))]),_:1})]),_:1})):m("",!0)]),_("div",Ze,[Qe,p(" @"+U(r(o).state.userInfo.username),1)])]),_:1}),r(o).state.profile.allowPhoneBind?(i(),k(x,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.phone&&r(o).state.userInfo.phone.length>0?(i(),h("div",Xe,[p(U(r(o).state.userInfo.phone)+" ",1),!y.value&&r(o).state.userInfo.status==1?(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[p(" 换绑手机 ")]),_:1})):m("",!0)])):(i(),h("div",Ye,[a(Z,{title:"手机绑定提示",type:"warning"},{default:s(()=>[p(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),ea,y.value?m("",!0):(i(),h("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(i(),h("div",aa,[a(O,{ref_key:"phoneFormRef",ref:W,model:t,rules:ce},{default:s(()=>[a(w,{path:"phone",label:"手机号"},{default:s(()=>[a(g,{value:t.phone,"onUpdate:value":e[3]||(e[3]=l=>t.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=S(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[_("div",ta,[a(g,{value:t.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>t.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),_("div",sa,[t.b64s?(i(),h("img",{key:0,src:t.b64s,onClick:T},null,8,na)):m("",!0)])])]),_:1}),a(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[a(he,null,{default:s(()=>[a(g,{value:t.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>t.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),a(c,{type:"primary",ghost:"",disabled:B.value,loading:P.value,onClick:pe},{default:s(()=>[p(U(I.value>0&&B.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[_("div",oa,[a(c,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ie},{default:s(()=>[p(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):m("",!0)]),_:1})):m("",!0),ae?(i(),k(x,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[r(o).state.userInfo.activation&&r(o).state.userInfo.activation.length>0?(i(),h("div",la,[p(U(r(o).state.userInfo.activation)+" ",1),b.value?m("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>b.value=!0)},{default:s(()=>[p(" 重新激活 ")]),_:1}))])):(i(),h("div",ra,[a(Z,{title:"激活码激活提示",type:"warning"},{default:s(()=>[p(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ia,b.value?m("",!0):(i(),h("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>b.value=!0)}," 立即激活 "))]),_:1})])),b.value?(i(),h("div",ua,[a(O,{ref_key:"activateFormRef",ref:G,model:u,rules:me},{default:s(()=>[a(w,{path:"activate_code",label:"激活码"},{default:s(()=>[a(g,{value:u.activate_code,"onUpdate:value":e[10]||(e[10]=l=>u.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=S(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[_("div",da,[a(g,{value:u.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>u.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),_("div",pa,[u.b64s?(i(),h("img",{key:0,src:u.b64s,onClick:j},null,8,ca)):m("",!0)])])]),_:1}),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[_("div",ma,[a(c,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>b.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:z.value,onClick:ue},{default:s(()=>[p(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):m("",!0)]),_:1})):m("",!0),a(x,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[p(" 您已设置密码 "),$.value?m("",!0):(i(),k(c,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>$.value=!0)},{default:s(()=>[p(" 重置密码 ")]),_:1})),$.value?(i(),h("div",_a,[a(O,{ref_key:"formRef",ref:H,model:t,rules:_e},{default:s(()=>[a(w,{path:"old_password",label:"旧密码"},{default:s(()=>[a(g,{value:t.old_password,"onUpdate:value":e[15]||(e[15]=l=>t.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=S(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{path:"password",label:"新密码"},{default:s(()=>[a(g,{value:t.password,"onUpdate:value":e[17]||(e[17]=l=>t.password=l),type:"password",placeholder:"请输入新密码",onInput:le,onKeydown:e[18]||(e[18]=S(R(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),a(w,{ref_key:"rPasswordFormItemRef",ref:J,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[a(g,{value:t.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>t.reenteredPassword=l),disabled:!t.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=S(R(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),a(E,{gutter:[0,24]},{default:s(()=>[a(V,{span:24},{default:s(()=>[_("div",va,[a(c,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>$.value=!1)},{default:s(()=>[p(" 取消 ")]),_:1}),a(c,{secondary:"",round:"",type:"primary",loading:D.value,onClick:re},{default:s(()=>[p(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):m("",!0)]),_:1})])}}}),ja=Ae(fa,[["__scopeId","data-v-7bb19e7f"]]);export{ja as default}; diff --git a/web/dist/assets/Topic-0adcrc3O.css b/web/dist/assets/Topic-0adcrc3O.css new file mode 100644 index 000000000..d3c898188 --- /dev/null +++ b/web/dist/assets/Topic-0adcrc3O.css @@ -0,0 +1 @@ +.tag-item .tag-quote{margin-left:12px;font-size:14px;opacity:.75}.tag-item .tag-follow{margin-right:22px}.tag-item .options{margin-left:-32px;margin-bottom:4px;opacity:.55}.tag-item .n-thing .n-thing-header{margin-bottom:0}.tag-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.tags-wrap[data-v-f89944c3]{padding:20px}.dark .tags-wrap[data-v-f89944c3],.dark .empty-wrap[data-v-f89944c3]{background-color:#101014bf} diff --git a/web/dist/assets/Topic-cLiEWQZV.js b/web/dist/assets/Topic-cLiEWQZV.js new file mode 100644 index 000000000..936d4c4de --- /dev/null +++ b/web/dist/assets/Topic-cLiEWQZV.js @@ -0,0 +1 @@ +import{E as M,F as A,G as q,H as O,I as D,J as G,_ as H}from"./index-8lD1klqH.js";import{D as J}from"./@vicons-V6UxFD2Y.js";import{d as P,H as _,c as $,b as B,r as j,e as c,f as p,k as n,w as a,t as w,A as C,Z as u,v as k,bf as m,E as Z,am as K,F as Q,x as R}from"./@vue-Hd4uXz5f.js";import{o as W,M as L,j as X,e as Y,P as x,O as ee,G as oe,f as te,g as ne,a as se,J as ae,k as ce}from"./naive-ui-h5SFsZhx.js";import{_ as ie}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{u as le}from"./vuex-qScXS-uk.js";import"./vue-router-4Hko0_3l.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const _e={key:0,class:"tag-item"},pe={key:0,class:"tag-quote"},ue={key:1,class:"tag-quote tag-follow"},re={key:0,class:"options"},ge=P({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean},checkPin:{type:Boolean}},setup(F){const l=_(!1),t=F,d=$(()=>t.tag.user?t.tag.user.avatar:M),r=$(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_pin===0?e.push({label:"钉住",key:"pin"}):e.push({label:"取消钉住",key:"unpin"}),t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),i=e=>{switch(e){case"follow":D({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":O({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"pin":q({topic_id:t.tag.id}).then(o=>{t.tag.is_pin=1,window.$message.success("钉住成功")}).catch(o=>{console.log(o)});break;case"unpin":q({topic_id:t.tag.id}).then(o=>{t.tag.is_pin=0,window.$message.success("取消钉住")}).catch(o=>{console.log(o)});break;case"stick":A({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":A({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return B(()=>{l.value=!1}),(e,o)=>{const v=j("router-link"),h=W,y=L,s=X,f=Y,b=x,g=ee;return!e.checkFollowing&&!e.checkPin||e.checkFollowing&&e.tag.is_following===1||e.checkPin&&e.tag.is_following===1&&e.tag.is_pin===1?(c(),p("div",_e,[n(g,null,{header:a(()=>[(c(),k(y,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:a(()=>[n(h,{src:d.value},null,8,["src"])]),default:a(()=>[n(v,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:a(()=>[C(" #"+w(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),p("span",pe,"("+w(e.tag.quote_num)+")",1)),e.showAction?(c(),p("span",ue,"("+w(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":a(()=>[e.showAction?(c(),p("div",re,[n(b,{placement:"bottom-end",trigger:"click",size:"small",options:r.value,onSelect:i},{default:a(()=>[n(f,{type:"success",quaternary:"",circle:"",block:""},{icon:a(()=>[n(s,null,{default:a(()=>[n(m(J))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}}),me={key:0,class:"empty-wrap"},de=P({__name:"Topic",setup(F){const l=le(),t=_([]),d=_("hot"),r=_(!1),i=_(!1),e=_(!1),o=_(!1);Z(i,()=>{i.value||(window.$message.success("保存成功"),l.commit("refreshTopicFollow"))});const v=$({get:()=>{let s="编辑";return i.value&&(s="保存"),s},set:s=>{}}),h=()=>{r.value=!0,G({type:d.value,num:50}).then(s=>{t.value=s.topics,r.value=!1}).catch(s=>{t.value=[],console.log(s),r.value=!1})},y=s=>{d.value=s,e.value=s==="follow",o.value=s==="pin",h()};return B(()=>{h()}),(s,f)=>{const b=ie,g=te,V=L,E=ne,N=ge,S=se,U=ae,z=ce,I=oe;return c(),p("div",null,[n(b,{title:"话题"}),n(I,{class:"main-content-wrap tags-wrap",bordered:""},{default:a(()=>[n(E,{type:"line",animated:"","onUpdate:value":y},K({default:a(()=>[n(g,{name:"hot",tab:"热门"}),n(g,{name:"new",tab:"最新"}),m(l).state.userLogined?(c(),k(g,{key:0,name:"follow",tab:"关注"})):u("",!0),m(l).state.userLogined?(c(),k(g,{key:1,name:"pin",tab:"钉住"})):u("",!0)]),_:2},[m(l).state.userLogined?{name:"suffix",fn:a(()=>[n(V,{checked:i.value,"onUpdate:checked":f[0]||(f[0]=T=>i.value=T),checkable:""},{default:a(()=>[C(w(v.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(z,{show:r.value},{default:a(()=>[n(S,null,{default:a(()=>[(c(!0),p(Q,null,R(t.value,T=>(c(),k(N,{tag:T,showAction:m(l).state.userLogined&&i.value,checkFollowing:e.value,checkPin:o.value},null,8,["tag","showAction","checkFollowing","checkPin"]))),256))]),_:1}),t.value.length===0?(c(),p("div",me,[n(U,{size:"large",description:"暂无数据"})])):u("",!0)]),_:1},8,["show"])]),_:1})])}}}),Me=H(de,[["__scopeId","data-v-f89944c3"]]);export{Me as default}; diff --git a/web/dist/assets/User-PfHpGfJF.js b/web/dist/assets/User-PfHpGfJF.js new file mode 100644 index 000000000..d50b92bd2 --- /dev/null +++ b/web/dist/assets/User-PfHpGfJF.js @@ -0,0 +1 @@ +import{_ as Re,a as Ve}from"./post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js";import{_ as je}from"./post-skeleton-zm5tFcFD.js";import{_ as Ee}from"./whisper-Vl-V0ytb.js";import{_ as Ge}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{d as Je,H as i,S as Qe,c as Ze,b as Ke,E as Xe,r as Ye,f as u,k as o,w as c,v as g,Z as m,e as t,j as w,t as A,bf as r,A as B,y as me,F,x as T,h as fe}from"./@vue-Hd4uXz5f.js";import{u as ea}from"./vuex-qScXS-uk.js";import{b as aa,u as ta}from"./vue-router-4Hko0_3l.js";import{M as sa,L as la,e as H,h as na,u as pe,f as he,N as oa,_ as ua}from"./index-8lD1klqH.js";import{W as ia}from"./whisper-add-friend-PONlu7DH.js";import{p as ce}from"./count-GnrfahME.js";import{W as ra}from"./v3-infinite-loading-9ocfqcSa.js";import{k as ca,a as va,r as _a,G as ge,s as da,t as ma,J as fa,R as pa}from"./@vicons-V6UxFD2Y.js";import{F as ha,G as ga,a as wa,j as we,o as ka,M as ya,e as ba,P as Pa,f as Oa,g as Fa,k as Ta,J as Ia,H as Aa}from"./naive-ui-h5SFsZhx.js";import"./content-fOn-h7ea.js";import"./paopao-video-player-iTSRV7j7.js";import"./copy-to-clipboard-l6UqHK6O.js";import"./@babel-5-cIlDoe.js";import"./toggle-selection-fekekO1r.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const xa={key:0,class:"profile-baseinfo"},$a={class:"avatar"},za={class:"base-info"},Sa={class:"username"},qa={class:"userinfo"},Ma={class:"info-item"},Ua={class:"info-item"},Ca={class:"userinfo"},Wa={class:"info-item"},La={class:"info-item"},Na={class:"info-item"},Da={key:0,class:"user-opts"},Ba={key:0,class:"skeleton-wrap"},Ha={key:1},Ra={key:0,class:"empty-wrap"},Va={key:1},ja={key:0},Ea={key:1},Ga={key:2},Ja={key:3},Qa={key:4},Za={key:2},Ka={key:0},Xa={key:1},Ya={key:2},et={key:3},at={key:4},tt={class:"load-more-wrap"},st={class:"load-more-spinner"},lt=Je({__name:"User",setup(nt){const R=ha(),v=ea(),$=aa(),ke=ta(),f=i(!1),y=i(!1),a=Qe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,tweets_count:0,status:1}),p=i(!1),V=i(!1),G=i(!1),l=i([]),z=i([]),S=i([]),q=i([]),M=i([]),U=i([]),x=i($.query.s||""),n=i(+$.query.p||1),h=i("post"),J=i(+$.query.p||1),Q=i(1),Z=i(1),K=i(1),X=i(1),k=i(20),d=i(0),Y=i(0),ee=i(0),ae=i(0),te=i(0),se=i(0),b=e=>{a.id=e.id,a.username=e.username,a.nickname=e.nickname,a.avatar=e.avatar,V.value=!0},P=e=>{R.success({title:"提示",content:"确定"+(e.user.is_following?"取消关注 @":"关注 @")+e.user.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e.user.is_following?pe({user_id:e.user.id}).then(_=>{window.$message.success("操作成功"),ve(e.user_id,!1)}).catch(_=>{}):he({user_id:e.user.id}).then(_=>{window.$message.success("关注成功"),ve(e.user_id,!0)}).catch(_=>{})}})};function ve(e,_){C(z,e,_),C(S,e,_),C(q,e,_),C(M,e,_),C(U,e,_)}function C(e,_,ie){if(e.value&&e.value.length>0)for(let E in e.value)e.value[E].user_id==_&&(e.value[E].user.is_following=ie)}const ye=()=>{y.value=!1,l.value=[],z.value=[],S.value=[],q.value=[],M.value=[],U.value=[],h.value="post",n.value=1,J.value=1,Q.value=1,Z.value=1,K.value=1,X.value=1,d.value=0,Y.value=0,ee.value=0,ae.value=0,te.value=0,se.value=0},be=()=>{switch(h.value){case"post":j();break;case"comment":le();break;case"highlight":ne();break;case"media":oe();break;case"star":ue();break}},j=()=>{f.value=!0,H({username:x.value,style:"post",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),z.value=l.value,Y.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},le=()=>{f.value=!0,H({username:x.value,style:"comment",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),S.value=l.value,ee.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ne=()=>{f.value=!0,H({username:x.value,style:"highlight",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),q.value=l.value,ae.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},oe=()=>{f.value=!0,H({username:x.value,style:"media",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),M.value=l.value,te.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},ue=()=>{f.value=!0,H({username:x.value,style:"star",page:n.value,page_size:k.value}).then(e=>{f.value=!1,e.list.length===0&&(y.value=!0),n.value>1?l.value=l.value.concat(e.list):(l.value=e.list||[],window.scrollTo(0,0)),d.value=Math.ceil(e.pager.total_rows/k.value),U.value=l.value,se.value=d.value}).catch(e=>{l.value=[],n.value>1&&n.value--,f.value=!1})},Pe=e=>{switch(h.value=e,h.value){case"post":l.value=z.value,n.value=J.value,d.value=Y.value,j();break;case"comment":l.value=S.value,n.value=Q.value,d.value=ee.value,le();break;case"highlight":l.value=q.value,n.value=Z.value,d.value=ae.value,ne();break;case"media":l.value=M.value,n.value=K.value,d.value=te.value,oe();break;case"star":l.value=U.value,n.value=X.value,d.value=se.value,ue();break}},W=()=>{p.value=!0,sa({username:x.value}).then(e=>{p.value=!1,a.id=e.id,a.avatar=e.avatar,a.username=e.username,a.nickname=e.nickname,a.is_admin=e.is_admin,a.is_friend=e.is_friend,a.created_on=e.created_on,a.is_following=e.is_following,a.follows=e.follows,a.followings=e.followings,a.status=e.status,e.tweets_count&&(a.tweets_count=e.tweets_count),be()}).catch(e=>{p.value=!1,console.log(e)})},Oe=()=>{switch(h.value){case"post":J.value=n.value,j();break;case"comment":Q.value=n.value,le();break;case"highlight":Z.value=n.value,ne();break;case"media":K.value=n.value,oe();break;case"star":X.value=n.value,ue();break}},Fe=()=>{V.value=!0},Te=()=>{G.value=!0},Ie=()=>{V.value=!1},Ae=()=>{G.value=!1},I=e=>()=>fe(we,null,{default:()=>fe(e)}),xe=Ze(()=>{if(v.state.userInfo.username==a.username)return[{label:"设置",key:"setting",icon:I(va)}];let e=[{label:"私信",key:"whisper",icon:I(_a)}];return v.state.userInfo.is_admin&&(a.status===1?e.push({label:"禁言",key:"banned",icon:I(ge)}):e.push({label:"解封",key:"deblocking",icon:I(ge)})),a.is_following?e.push({label:"取消关注",key:"unfollow",icon:I(da)}):e.push({label:"关注",key:"follow",icon:I(ma)}),v.state.profile.useFriendship&&(a.is_friend?e.push({label:"删除好友",key:"delete",icon:I(fa)}):e.push({label:"添加朋友",key:"requesting",icon:I(pa)})),e}),$e=e=>{switch(e){case"whisper":Fe();break;case"delete":ze();break;case"requesting":Te();break;case"follow":case"unfollow":Se();break;case"banned":case"deblocking":qe();break;case"setting":ke.push({name:"setting",query:{t:new Date().getTime()}});break}},ze=()=>{R.warning({title:"删除好友",content:"将好友 “"+a.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,na({user_id:a.id}).then(e=>{p.value=!1,a.is_friend=!1,j()}).catch(e=>{p.value=!1,console.log(e)})}})},Se=()=>{R.success({title:"提示",content:"确定"+(a.is_following?"取消关注 @":"关注 @")+a.username+" 吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,a.is_following?pe({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)}):he({user_id:a.id}).then(e=>{p.value=!1,window.$message.success("操作成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},qe=()=>{R.warning({title:"警告",content:"确定对该用户进行"+(a.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{p.value=!0,oa({id:a.id,status:a.status===1?2:1}).then(e=>{p.value=!1,a.status===1?window.$message.success("禁言成功"):window.$message.success("解封成功"),W()}).catch(e=>{p.value=!1,console.log(e)})}})},Me=()=>{n.value{W()}),Xe(()=>({path:$.path,query:$.query}),(e,_)=>{_.path==="/u"&&e.path==="/u"&&(x.value=$.query.s||"",ye(),W())}),(e,_)=>{const ie=Ge,E=ka,re=ya,_e=Ye("router-link"),Ue=ba,Ce=Pa,We=Ee,L=Oa,Le=Fa,de=Ta,Ne=je,De=Ia,N=Re,O=Aa,D=Ve,Be=ga,He=wa;return t(),u("div",null,[o(ie,{title:"用户详情"}),o(Be,{class:"main-content-wrap profile-wrap",bordered:""},{default:c(()=>[o(de,{show:p.value},{default:c(()=>[a.id>0?(t(),u("div",xa,[w("div",$a,[o(E,{size:72,src:a.avatar},null,8,["src"])]),w("div",za,[w("div",Sa,[w("strong",null,A(a.nickname),1),w("span",null," @"+A(a.username),1),r(v).state.profile.useFriendship&&r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_friend?(t(),g(re,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:c(()=>[B(" 好友 ")]),_:1})):m("",!0),r(v).state.userInfo.id>0&&r(v).state.userInfo.username!=a.username&&a.is_following?(t(),g(re,{key:1,class:"top-tag",type:"success",size:"small",round:""},{default:c(()=>[B(" 已关注 ")]),_:1})):m("",!0),a.is_admin?(t(),g(re,{key:2,class:"top-tag",type:"error",size:"small",round:""},{default:c(()=>[B(" 管理员 ")]),_:1})):m("",!0)]),w("div",qa,[w("span",Ma,"UID. "+A(a.id),1),w("span",Ua,A(r(la)(a.created_on))+" 加入",1)]),w("div",Ca,[w("span",Wa,[o(_e,{onClick:_[0]||(_[0]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"follows"}}},{default:c(()=>[B(" 关注  "+A(r(ce)(a.follows)),1)]),_:1},8,["to"])]),w("span",La,[o(_e,{onClick:_[1]||(_[1]=me(()=>{},["stop"])),class:"following-link",to:{name:"following",query:{s:a.username,n:a.nickname,t:"followings"}}},{default:c(()=>[B(" 粉丝  "+A(r(ce)(a.followings)),1)]),_:1},8,["to"])]),w("span",Na," 泡泡  "+A(r(ce)(a.tweets_count||0)),1)])]),r(v).state.userInfo.id>0?(t(),u("div",Da,[o(Ce,{placement:"bottom-end",trigger:"click",size:"small",options:xe.value,onSelect:$e},{default:c(()=>[o(Ue,{quaternary:"",circle:""},{icon:c(()=>[o(r(we),null,{default:c(()=>[o(r(ca))]),_:1})]),_:1})]),_:1},8,["options"])])):m("",!0)])):m("",!0),o(We,{show:V.value,user:a,onSuccess:Ie},null,8,["show","user"]),o(ia,{show:G.value,user:a,onSuccess:Ae},null,8,["show","user"]),p.value?m("",!0):(t(),g(Le,{key:1,class:"profile-tabs-wrap",type:"line",animated:"",value:h.value,"onUpdate:value":Pe},{default:c(()=>[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"]))]),_:1},8,["show"]),f.value&&l.value.length===0?(t(),u("div",Ba,[o(Ne,{num:k.value},null,8,["num"])])):(t(),u("div",Ha,[l.value.length===0?(t(),u("div",Ra,[o(De,{size:"large",description:"暂无数据"})])):m("",!0),r(v).state.desktopModelShow?(t(),u("div",Va,[h.value==="post"?(t(),u("div",ja,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Ea,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Ga,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",Ja,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",Qa,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(N,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)])):(t(),u("div",Za,[h.value==="post"?(t(),u("div",Ka,[(t(!0),u(F,null,T(z.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="comment"?(t(),u("div",Xa,[(t(!0),u(F,null,T(S.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="highlight"?(t(),u("div",Ya,[(t(!0),u(F,null,T(q.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="media"?(t(),u("div",et,[(t(!0),u(F,null,T(M.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0),h.value==="star"?(t(),u("div",at,[(t(!0),u(F,null,T(U.value,s=>(t(),g(O,{key:s.id},{default:c(()=>[o(D,{post:s,isOwner:r(v).state.userInfo.id==s.user_id,addFollowAction:!0,onSendWhisper:b,onHandleFollowAction:P},null,8,["post","isOwner"])]),_:2},1024))),128))])):m("",!0)]))]))]),_:1}),d.value>0?(t(),g(He,{key:0,justify:"center"},{default:c(()=>[o(r(ra),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:_[2]||(_[2]=s=>Me())},{spinner:c(()=>[w("div",tt,[y.value?m("",!0):(t(),g(de,{key:0,size:14})),w("span",st,A(y.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):m("",!0)])}}}),Dt=ua(lt,[["__scopeId","data-v-00ab4b4e"]]);export{Dt as default}; diff --git a/web/dist/assets/Wallet-22Q_5kW8.js b/web/dist/assets/Wallet-22Q_5kW8.js new file mode 100644 index 000000000..680591aec --- /dev/null +++ b/web/dist/assets/Wallet-22Q_5kW8.js @@ -0,0 +1 @@ +import{_ as J}from"./post-skeleton-zm5tFcFD.js";import{_ as Q}from"./main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js";import{d as Y,H as c,b as X,f as r,k as e,w as o,e as n,bf as y,Z as w,j as a,A as k,F as N,x as $,P as ee,D as te,t as _,l as oe,v as q,y as ae,a0 as ne,a1 as se}from"./@vue-Hd4uXz5f.js";import{u as le}from"./vuex-qScXS-uk.js";import{b as ce}from"./vue-router-4Hko0_3l.js";import{b as ie}from"./qrcode-NFgyJgOr.js";import{a1 as re,a2 as _e,a3 as ue,a4 as pe,K as me,_ as de}from"./index-8lD1klqH.js";import{a1 as ge}from"./@vicons-V6UxFD2Y.js";import{G as ve,i as he,Y as fe,Z as ye,e as we,a as ke,R as be,J as xe,j as Ce,l as Se,h as Ie,H as Re}from"./naive-ui-h5SFsZhx.js";import"./vooks-v147mXjr.js";import"./evtd-9ZCiDXyn.js";import"./encode-utf8-YzUDWyGG.js";import"./dijkstrajs-mfgL5WWt.js";import"./axios-kMxbiGYq.js";import"./moment-jIwEdMgI.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./@css-render-oW_PeE7K.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";const P=d=>(ne("data-v-870bd246"),d=d(),se(),d),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},$e={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Pe={key:1},Be={key:0,class:"empty-wrap"},Te={class:"bill-line"},De={key:0,class:"amount-options"},Ee={key:1,style:{"margin-top":"10px"}},Fe={class:"qrcode-wrap"},Le=P(()=>a("canvas",{id:"qrcode-container"},null,-1)),Oe={class:"pay-tips"},Ue={class:"pay-sub-tips"},Ve=P(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),We=Y({__name:"Wallet",setup(d){const i=le(),B=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),x=c(+B.query.p||1),C=c(20),S=c(0),T=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,_e({page:x.value,page_size:C.value}).then(s=>{h.value=!1,b.value=s.list,S.value=Math.ceil(s.pager.total_rows/C.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},D=s=>{x.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?re(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},E=()=>{g.value=!0},F=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(m=>{m.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(m=>{console.log(m)})},2e3)}).catch(l=>{v.value=!1})},L=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return X(()=>{A()}),(s,l)=>{const I=Q,m=fe,O=ye,f=we,z=ke,U=be,V=J,W=xe,M=Re,j=ve,H=Ce,K=Se,Z=Ie,G=he;return n(),r("div",null,[e(I,{title:"钱包"}),e(j,{class:"main-content-wrap",bordered:""},{footer:o(()=>[S.value>1?(n(),r("div",$e,[e(U,{page:x.value,"onUpdate:page":D,"page-slot":y(i).state.collapsedRight?5:8,"page-count":S.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(O,{label:"账户余额 (元)"},{default:o(()=>[e(m,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:E},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:L},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),r("div",qe,[e(V,{num:C.value},null,8,["num"])])):(n(),r("div",Pe,[b.value.length===0?(n(),r("div",Be,[e(W,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),r(N,null,$(b.value,t=>(n(),q(M,{key:t.id},{default:o(()=>[a("div",Te,[a("div",null,"NO."+_(t.id),1),a("div",null,_(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,_(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(G,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(Z,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),r("div",De,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),r(N,null,$(T.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Me=>u.value=t,["stop"])},{default:o(()=>[k(_(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),r("div",Ee,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:F},{icon:o(()=>[e(H,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Fe,[Le,a("div",Oe," 请使用支付宝扫码支付"+_((u.value/100).toFixed(2))+"元 ",1),a("div",Ue,[e(K,{value:100,type:"info",dot:"",processing:""}),Ve])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}}),ft=de(We,[["__scopeId","data-v-870bd246"]]);export{ft as default}; diff --git a/web/dist/assets/content-fOn-h7ea.js b/web/dist/assets/content-fOn-h7ea.js new file mode 100644 index 000000000..273f889cc --- /dev/null +++ b/web/dist/assets/content-fOn-h7ea.js @@ -0,0 +1 @@ +import{d as h,e,f as l,F as u,x as k,k as o,w as s,bf as a,j as C,y,t as I,v as g,Z as m,H as j,A as N,h as b}from"./@vue-Hd4uXz5f.js";import{$ as U,a0 as V}from"./@vicons-V6UxFD2Y.js";import{j as $,V as A,W as B,m as R,X as P,e as T,i as Z}from"./naive-ui-h5SFsZhx.js";import{_ as D,W as L,X as M}from"./index-8lD1klqH.js";import{e as O}from"./paopao-video-player-iTSRV7j7.js";const W={class:"link-wrap"},X={class:"link-txt-wrap"},z=["href"],F={class:"link-txt"},H=h({__name:"post-link",props:{links:{default:()=>[]}},setup(f){const i=f;return(p,r)=>{const x=$;return e(),l("div",W,[(e(!0),l(u,null,k(i.links,n=>(e(),l("div",{class:"link-item",key:n.id},[o(x,{class:"hash-link"},{default:s(()=>[o(a(U))]),_:1}),C("div",X,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:r[0]||(r[0]=y(()=>{},["stop"]))},[C("span",F,I(n.content),1)],8,z)])]))),128))])}}}),st=D(H,[["__scopeId","data-v-36eef76b"]]),q={key:0},rt=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(f){const i=f;return(p,r)=>{const x=A,n=B;return i.videos.length>0?(e(),l("div",q,[o(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:s(()=>[o(x,{span:p.full?1:3},{default:s(()=>[(e(!0),l(u,null,k(i.videos,v=>(e(),g(a(O),{onClick:r[0]||(r[0]=y(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):m("",!0)}}}),G={class:"images-wrap"},ot=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(f){const i="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",p="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png",r=f;return(x,n)=>{const v=R,d=A,c=B,w=P;return e(),l("div",G,[[1].includes(r.imgs.length)?(e(),g(w,{key:0},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:2},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,t=>(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[0]||(n[0]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[2,3].includes(r.imgs.length)?(e(),g(w,{key:1},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,t=>(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[1]||(n[1]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[4].includes(r.imgs.length)?(e(),g(w,{key:2},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,t=>(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[2]||(n[2]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):m("",!0),[5].includes(r.imgs.length)?(e(),g(w,{key:3},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,{key:t.id},[_<3?(e(),g(d,{key:0},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[3]||(n[3]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,{key:t.id},[_>=3?(e(),g(d,{key:0},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[4]||(n[4]=y(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),[6].includes(r.imgs.length)?(e(),g(w,{key:4},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,{key:t.id},[_<3?(e(),g(d,{key:0},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[5]||(n[5]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,{key:t.id},[_>=3?(e(),g(d,{key:0},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[6]||(n[6]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),128))]),_:1})]),_:1})):m("",!0),r.imgs.length===7?(e(),g(w,{key:5},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_<4?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[7]||(n[7]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_>=4?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[8]||(n[8]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),r.imgs.length===8?(e(),g(w,{key:6},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:4},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_<4?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[9]||(n[9]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_>=4?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[10]||(n[10]=y(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0),r.imgs.length===9?(e(),g(w,{key:7},{default:s(()=>[o(c,{"x-gap":4,"y-gap":4,cols:3},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_<3?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[11]||(n[11]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_>=3&&_<6?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[12]||(n[12]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1}),o(c,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:s(()=>[(e(!0),l(u,null,k(r.imgs,(t,_)=>(e(),l(u,null,[_>=6?(e(),g(d,{key:t.id},{default:s(()=>[o(v,{onError:()=>t.content=a(i),onClick:n[13]||(n[13]=y(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+a(p),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):m("",!0)],64))),256))]),_:1})]),_:1})):m("",!0)])}}}),J={class:"attachment-wrap"},K=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(f){const i=f,p=j(!1),r=j(""),x=j(0),n=d=>{p.value=!0,x.value=d.id,r.value="这是一个免费附件,您可以直接下载?",d.type===8&&(r.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(i.price/100).toFixed(2)+"元")]),L({id:x.value}).then(c=>{c.paid&&(r.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(c=>{p.value=!1}))},v=()=>{M({id:x.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,c)=>{const w=$,t=T,_=Z;return e(),l("div",J,[(e(!0),l(u,null,k(d.attachments,E=>(e(),l("div",{class:"attach-item",key:E.id},[o(t,{onClick:y(Q=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:s(()=>[o(w,null,{default:s(()=>[o(a(V))]),_:1})]),default:s(()=>[N(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),o(_,{show:p.value,"onUpdate:show":c[0]||(c[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:r.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}}),lt=D(K,[["__scopeId","data-v-22563084"]]),at=f=>{const i=[],p=[];var r=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(r,n=>(i.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:f,tags:i,users:p}},ct=(f,i,p,r,x=!0)=>{const n=f.length>r;if(x&&n){f=f.substring(0,r);let c=f.charAt(r-1);(c=="#"||c=="#"||c=="@")&&(f=f.substring(0,r-1))}const v=/(#|#)([^#@\s])+?\s+?/g,d=/@([a-zA-Z0-9])+?\s+?/g;return f=f.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(v,c=>''+c.trim()+" ").replace(d,c=>''+c.trim()+" "),n&&(f=f.trimEnd()+(x?"... ":" ")+''+(x?i:p)+" "),f};export{ot as _,lt as a,rt as b,st as c,ct as d,at as p}; diff --git a/web/dist/assets/index-8lD1klqH.js b/web/dist/assets/index-8lD1klqH.js new file mode 100644 index 000000000..f1e7a6f85 --- /dev/null +++ b/web/dist/assets/index-8lD1klqH.js @@ -0,0 +1,7 @@ +import{d as K,H as T,S as X,b as V,e as f,v as z,w as u,bf as d,A as I,k as s,y as N,_ as q,f as R,Z as S,j as w,c as Q,E as j,r as ue,F as ee,t as A,x as te,h as L,a6 as we,q as oe,l as ve,ah as ye}from"./@vue-Hd4uXz5f.js";import{c as be,a as ke,u as ce,b as Le}from"./vue-router-4Hko0_3l.js";import{c as Te,u as W}from"./vuex-qScXS-uk.js";import{a as Pe}from"./axios-kMxbiGYq.js";import{_ as Me,N as Ae,a as pe,b as de,c as Re,d as Ee,e as me,f as Ce,g as Oe,h as he,i as Se,j as F,k as Ie,u as Ue,l as $e,m as De,n as xe,o as Ne,p as qe,q as ze,r as Fe,s as Ke,t as Ve}from"./naive-ui-h5SFsZhx.js";import{h as U}from"./moment-jIwEdMgI.js";import{S as We,M as Be,L as He,C as Ye,B as je,P as Qe,W as Ze,a as Ge,H as re,b as se,c as ne}from"./@vicons-V6UxFD2Y.js";/* empty css */import"./seemly-hKSMrbh9.js";import"./vueuc-xP2DxDTa.js";import"./evtd-9ZCiDXyn.js";import"./@css-render-oW_PeE7K.js";import"./vooks-v147mXjr.js";import"./vdirs-gz97tqc5.js";import"./@juggle--NVrOerG.js";import"./css-render-Adblu2bf.js";import"./@emotion-vV6BesBt.js";import"./lodash-es-KEIJqYRD.js";import"./treemate-hmrDCADh.js";import"./async-validator-BHjhHa7C.js";import"./date-fns-E8ESfRGG.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))_(n);new MutationObserver(n=>{for(const c of n)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&_(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const c={};return n.integrity&&(c.integrity=n.integrity),n.referrerPolicy&&(c.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?c.credentials="include":n.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function _(n){if(n.ep)return;n.ep=!0;const c=r(n);fetch(n.href,c)}})();const Je="modulepreload",Xe=function(e){return"/"+e},ae={},M=function(t,r,_){let n=Promise.resolve();if(r&&r.length>0){const c=document.getElementsByTagName("link");n=Promise.all(r.map(l=>{if(l=Xe(l),l in ae)return;ae[l]=!0;const P=l.endsWith(".css"),k=P?'[rel="stylesheet"]':"";if(!!_)for(let i=c.length-1;i>=0;i--){const v=c[i];if(v.href===l&&(!P||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${k}`))return;const m=document.createElement("link");if(m.rel=P?"stylesheet":Je,P||(m.as="script",m.crossOrigin=""),m.href=l,document.head.appendChild(m),P)return new Promise((i,v)=>{m.addEventListener("load",i),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${l}`)))})}))}return n.then(()=>t()).catch(c=>{const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c})},et=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>M(()=>import("./Home-28LAfziN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]))},{path:"/post",name:"post",meta:{title:"泡泡详情"},component:()=>M(()=>import("./Post-Aii8OJYD.js"),__vite__mapDeps([46,4,25,34,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,21,23,24,26,31,32,33,28,18,19,27,29,35,36,37,38,42,43,47,45]))},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>M(()=>import("./Topic-cLiEWQZV.js"),__vite__mapDeps([48,22,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,35,25,26,36,42,43,49,45]))},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>M(()=>import("./Anouncement-BKCrB4N4.js"),__vite__mapDeps([50,31,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,32,35,25,26,22,36,42,43,51,45]))},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>M(()=>import("./Profile-ND6y_r-3.js"),__vite__mapDeps([52,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,53,37,38,42,43,54,45]))},{path:"/u",name:"user",meta:{title:"用户详情"},component:()=>M(()=>import("./User-PfHpGfJF.js"),__vite__mapDeps([55,20,21,4,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,23,24,25,26,27,28,29,30,31,32,18,19,35,36,1,17,53,37,38,42,43,56,45]))},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>M(()=>import("./Messages-Io0cWkZE.js"),__vite__mapDeps([57,4,25,26,22,2,3,5,6,7,8,9,10,11,12,13,14,15,16,18,19,35,36,37,38,42,43,58,45]))},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>M(()=>import("./Collection-zGgLSBDA.js"),__vite__mapDeps([59,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,35,36,37,38,42,43,60,45]))},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>M(()=>import("./Contacts-70p5eo25.js"),__vite__mapDeps([61,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,22,31,32,35,25,26,36,37,38,42,43,62,45]))},{path:"/following",name:"following",meta:{title:"关注"},component:()=>M(()=>import("./Following-T99T9Q8h.js"),__vite__mapDeps([63,18,4,2,3,5,6,7,8,9,10,11,12,13,14,15,16,19,22,31,32,35,25,26,36,37,38,42,43,64,45]))},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>M(()=>import("./Wallet-22Q_5kW8.js"),__vite__mapDeps([65,31,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,32,35,25,26,22,36,66,67,68,42,43,69,45]))},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>M(()=>import("./Setting-lLn2gCo2.js"),__vite__mapDeps([70,35,25,4,26,8,6,22,2,3,5,7,9,10,11,12,13,14,15,16,36,42,43,71,45]))},{path:"/404",name:"404",meta:{title:"404"},component:()=>M(()=>import("./404-x31eybZD.js"),__vite__mapDeps([72,35,25,4,26,8,6,22,2,3,5,7,9,10,11,12,13,14,15,16,36,42,43,73,45]))},{path:"/:pathMatch(.*)",redirect:"/404"}],_e=be({history:ke(),routes:et});_e.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,r()});const tt=Te({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",unreadMsgCount:0,userLogined:!1,userInfo:{id:0,username:"",nickname:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},profile:{useFriendship:!0,enableTrendsBar:!0,enableWallet:!1,allowTweetAttachment:!0,allowTweetAttachmentPrice:!0,allowTweetVideo:!0,allowUserRegister:!0,allowPhoneBind:!0,defaultTweetMaxLength:2e3,tweetWebEllipsisSize:400,tweetMobileEllipsisSize:300,defaultTweetVisibility:"friend",defaultMsgLoopInterval:5e3,copyrightTop:"2023 paopao.info",copyrightLeft:"Roc's Me",copyrightLeftLink:"",copyrightRight:"泡泡(PaoPao)开源社区",copyrightRightLink:"https://www.paopao.info"}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},updateUnreadMsgCount(e,t){e.unreadMsgCount=t},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)},loadDefaultSiteProfile(e){e.profile.useFriendship="true".toLowerCase()==="true",e.profile.enableTrendsBar="false".toLowerCase()==="true",e.profile.enableWallet="false".toLocaleLowerCase()==="true",e.profile.allowTweetAttachment="true".toLowerCase()==="true",e.profile.allowTweetAttachmentPrice="false".toLowerCase()==="true",e.profile.allowTweetVideo="true".toLowerCase()==="true",e.profile.allowUserRegister="true".toLowerCase()==="true",e.profile.allowPhoneBind="true".toLowerCase()==="true",e.profile.defaultTweetMaxLength=2e3,e.profile.tweetWebEllipsisSize=400,e.profile.tweetMobileEllipsisSize=300,e.profile.defaultTweetVisibility="friend".toLowerCase(),e.profile.defaultMsgLoopInterval=5e3,e.profile.copyrightTop="2023 paopao.info",e.profile.copyrightLeft="Roc's Me",e.profile.copyrightLeftLink="",e.profile.copyrightRight="泡泡(PaoPao)开源社区",e.profile.copyrightRightLink="https://www.paopao.info"},updateSiteProfile(e,t){const r=e.profile;e.profile.useFriendship=t.use_friendship??r.useFriendship,e.profile.enableTrendsBar=t.enable_trends_bar??r.enableTrendsBar,e.profile.enableWallet=t.enable_wallet??r.enableWallet,e.profile.allowTweetAttachment=t.allow_tweet_attachment??r.allowTweetAttachment,e.profile.allowTweetAttachmentPrice=t.allow_tweet_attachment_price??r.allowTweetAttachmentPrice,e.profile.allowTweetVideo=t.allow_tweet_video??r.allowTweetVideo,e.profile.allowUserRegister=t.allow_user_register??r.allowUserRegister,e.profile.allowPhoneBind=t.allow_phone_bind??r.allowPhoneBind,e.profile.defaultTweetMaxLength=t.default_tweet_max_length??r.defaultTweetMaxLength,e.profile.tweetWebEllipsisSize=t.tweet_web_ellipsis_size??r.tweetWebEllipsisSize,e.profile.tweetMobileEllipsisSize=t.tweet_mobile_ellipsis_size??r.tweetMobileEllipsisSize,e.profile.defaultTweetVisibility=t.default_tweet_visibility??r.defaultTweetVisibility,e.profile.defaultMsgLoopInterval=t.default_msg_loop_interval??r.defaultMsgLoopInterval,e.profile.copyrightTop=t.copyright_top??r.copyrightTop,e.profile.copyrightLeft=t.copyright_left??r.copyrightLeft,e.profile.copyrightLeftLink=t.copyright_left_link??r.copyrightLeftLink,e.profile.copyrightRight=t.copyright_right??r.copyrightRight,e.profile.copyrightRightLink=t.copyright_right_link??r.copyrightRightLink},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:"",created_on:0,follows:0,followings:0,tweets_count:0,is_admin:!1},e.userLogined=!1}},actions:{},modules:{}}),Z=Pe.create({baseURL:"",timeout:3e4});Z.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Z.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return Z(e)}const le=e=>o({method:"post",url:"/v1/auth/login",data:e}),ot=e=>o({method:"post",url:"/v1/auth/register",data:e}),Y=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),rt={class:"auth-wrap"},st={key:0},nt=K({__name:"auth",setup(e){const t=W(),r=T(!1),_=T(),n=X({username:"",password:""}),c=T(),l=X({username:"",password:"",repassword:""}),P={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(m,i)=>!!l.password&&l.password.startsWith(i)&&l.password.length>=i.length,message:"两次密码输入不一致",trigger:"input"}]},k=m=>{var i;m.preventDefault(),m.stopPropagation(),(i=_.value)==null||i.validate(v=>{v||(r.value=!0,le({username:n.username,password:n.password}).then(h=>{const b=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(h=>{window.$message.success("登录成功"),r.value=!1,t.commit("updateUserinfo",h),t.commit("triggerAuth",!1),t.commit("refresh"),n.username="",n.password=""}).catch(h=>{r.value=!1}))})},E=m=>{var i;m.preventDefault(),m.stopPropagation(),(i=c.value)==null||i.validate(v=>{v||(r.value=!0,ot({username:l.username,password:l.password}).then(h=>le({username:l.username,password:l.password})).then(h=>{const b=(h==null?void 0:h.token)||"";return localStorage.setItem("PAOPAO_TOKEN",b),Y(b)}).then(h=>{window.$message.success("注册成功"),r.value=!1,t.commit("updateUserinfo",h),t.commit("triggerAuth",!1),l.username="",l.password="",l.repassword=""}).catch(h=>{r.value=!1}))})};return V(()=>{const m=localStorage.getItem("PAOPAO_TOKEN")||"";m?Y(m).then(i=>{t.commit("updateUserinfo",i),t.commit("triggerAuth",!1)}).catch(i=>{t.commit("userLogout")}):t.commit("userLogout")}),(m,i)=>{const v=Me,h=Ae,b=pe,a=de,g=Re,D=Ee,$=me,x=Ce,p=Oe,C=he,B=Se;return f(),z(B,{show:d(t).state.authModalShow,"onUpdate:show":i[7]||(i[7]=y=>d(t).state.authModalShow=y),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:u(()=>[w("div",rt,[s(C,{bordered:!1},{default:u(()=>[d(t).state.profile.allowUserRegister?S("",!0):(f(),R("div",st,[s(b,{justify:"center"},{default:u(()=>[s(h,null,{default:u(()=>[s(v,{type:"success"},{default:u(()=>[I("账号登录")]),_:1})]),_:1})]),_:1}),s(D,{ref_key:"loginRef",ref:_,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(g,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[0]||(i[0]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[1]||(i[1]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:k},{default:u(()=>[I(" 登录 ")]),_:1},8,["loading"])])),d(t).state.profile.allowUserRegister?(f(),z(p,{key:1,"default-value":d(t).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:u(()=>[s(x,{name:"signin",tab:"登录"},{default:u(()=>[s(D,{ref_key:"loginRef",ref:_,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:u(()=>[s(g,{label:"账户",path:"username"},{default:u(()=>[s(a,{value:n.username,"onUpdate:value":i[2]||(i[2]=y=>n.username=y),placeholder:"请输入用户名",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":i[3]||(i[3]=y=>n.password=y),placeholder:"请输入账户密码",onKeyup:q(N(k,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:k},{default:u(()=>[I(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:u(()=>[s(D,{ref_key:"registerRef",ref:c,model:l,rules:P},{default:u(()=>[s(g,{label:"用户名",path:"username"},{default:u(()=>[s(a,{value:l.username,"onUpdate:value":i[4]||(i[4]=y=>l.username=y),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(g,{label:"密码",path:"password"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:l.password,"onUpdate:value":i[5]||(i[5]=y=>l.password=y),onKeyup:q(N(E,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(g,{label:"重复密码",path:"repassword"},{default:u(()=>[s(a,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:l.repassword,"onUpdate:value":i[6]||(i[6]=y=>l.repassword=y),onKeyup:q(N(E,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s($,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:E},{default:u(()=>[I(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):S("",!0)]),_:1})])]),_:1},8,["show"])}}}),fe=(e,t)=>{const r=e.__vccOpts||e;for(const[_,n]of t)r[_]=n;return r},at=fe(nt,[["__scopeId","data-v-6f778fc4"]]),no=e=>o({method:"get",url:"/v1/posts",params:e}),lt=e=>o({method:"get",url:"/v1/tags",params:e}),ao=e=>o({method:"get",url:"/v1/post",params:e}),lo=e=>o({method:"get",url:"/v1/post/star",params:e}),io=e=>o({method:"post",url:"/v1/post/star",data:e}),uo=e=>o({method:"get",url:"/v1/post/collection",params:e}),co=e=>o({method:"post",url:"/v1/post/collection",data:e}),po=e=>o({method:"get",url:"/v1/post/comments",params:e}),mo=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ho=e=>o({method:"get",url:"/v1/trends/index",params:e}),_o=e=>o({method:"post",url:"/v1/post",data:e}),fo=e=>o({method:"delete",url:"/v1/post",data:e}),go=e=>o({method:"post",url:"/v1/post/lock",data:e}),wo=e=>o({method:"post",url:"/v1/post/stick",data:e}),vo=e=>o({method:"post",url:"/v1/post/highlight",data:e}),yo=e=>o({method:"post",url:"/v1/post/visibility",data:e}),bo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),ko=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),Lo=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),To=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),Po=e=>o({method:"post",url:"/v1/post/comment",data:e}),Mo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),Ao=e=>o({method:"post",url:"/v1/post/comment/highlight",data:e}),Ro=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),Eo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),Co=e=>o({method:"post",url:"/v1/topic/stick",data:e}),Oo=e=>o({method:"post",url:"/v1/topic/pin",data:e}),So=e=>o({method:"post",url:"/v1/topic/follow",data:e}),Io=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),Uo=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),$o=e=>o({method:"post",url:"/v1/captcha",data:e}),Do=e=>o({method:"post",url:"/v1/user/whisper",data:e}),xo=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),No=e=>o({method:"post",url:"/v1/friend/add",data:e}),qo=e=>o({method:"post",url:"/v1/user/follow",data:e}),zo=e=>o({method:"post",url:"/v1/user/unfollow",data:e}),Fo=e=>o({method:"get",url:"/v1/user/follows",params:e}),Ko=e=>o({method:"get",url:"/v1/user/followings",params:e}),Vo=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Wo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Bo=e=>o({method:"post",url:"/v1/user/phone",data:e}),Ho=e=>o({method:"post",url:"/v1/user/activate",data:e}),Yo=e=>o({method:"post",url:"/v1/user/password",data:e}),jo=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Qo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),ie=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Zo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Go=e=>o({method:"post",url:"/v1/user/message/read",data:e}),Jo=()=>o({method:"post",url:"/v1/user/message/readall"}),Xo=e=>o({method:"get",url:"/v1/user/collections",params:e}),er=e=>o({method:"get",url:"/v1/user/profile",params:e}),tr=e=>o({method:"get",url:"/v1/user/posts",params:e}),or=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),rr=e=>o({method:"post",url:"/v1/user/recharge",data:e}),sr=e=>o({method:"get",url:"/v1/user/recharge",params:e}),nr=e=>o({method:"get",url:"/v1/suggest/users",params:e}),ar=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),lr=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),ir=e=>o({method:"get",url:"/v1/attachment",params:e}),ur=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),it=()=>o({method:"get",url:"/v1/admin/site/status"});U.locale("zh-cn");const ut=e=>U.unix(e).fromNow(),cr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},pr=e=>{let t=U.unix(e),r=U();return t.year()!=r.year()?t.utc(!0).format("YYYY-MM-DD"):U().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()},dr=e=>U.unix(e).utc(!0).format("YYYY年MM月"),ct={key:0,class:"rightbar-wrap"},pt={class:"search-wrap"},dt={class:"post-num"},mt={class:"post-num"},ht={class:"copyright"},_t=["href"],ft=["href"],gt={class:"site-info-item"},wt=K({__name:"rightbar",setup(e){const t=T([]),r=T([]),_=T(!1),n=T(""),c=W(),l=ce(),P=T(0),k=T(0),E=T(0),m=T(0),i=T(null),v=6,h=12,b=()=>{it().then(p=>{P.value=p.register_user_count,k.value=p.online_user_count,E.value=p.history_max_online,m.value=p.server_up_time}).catch(p=>{}),x.disconnect()},a=()=>{_.value=!0,lt({type:"hot_extral",num:h,extral_num:v}).then(p=>{t.value=p.topics,r.value=p.extral_topics??[],$.value=!0,_.value=!1}).catch(p=>{_.value=!1})},g=p=>p>=1e3?(p/1e3).toFixed(1)+"k":p,D=()=>{l.push({name:"home",query:{q:n.value}})},$=Q({get:()=>c.state.userLogined&&r.value.length!==0,set:p=>{}});j(()=>({refreshTopicFollow:c.state.refreshTopicFollow,userLogined:c.state.userLogined}),(p,C)=>{(p.refreshTopicFollow!==C.refreshTopicFollow||p.userLogined)&&a(),c.state.userInfo.is_admin&&b()});const x=new IntersectionObserver(p=>{p.forEach(C=>{C.isIntersecting&&b()})},{root:null,rootMargin:"0px",threshold:1});return V(()=>{i.value&&x.observe(i.value),a()}),(p,C)=>{const B=F,y=de,G=ue("router-link"),J=Ie,H=he,ge=pe;return d(c).state.collapsedRight?S("",!0):(f(),R("div",ct,[w("div",pt,[s(y,{round:"",clearable:"",placeholder:"搜一搜...",value:n.value,"onUpdate:value":C[0]||(C[0]=O=>n.value=O),onKeyup:q(N(D,["prevent"]),["enter"])},{prefix:u(()=>[s(B,{component:d(We)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),$.value?(f(),z(H,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:_.value},{default:u(()=>[(f(!0),R(ee,null,te(r.value,O=>(f(),R("div",{class:"hot-tag-item",key:O.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:O.tag,t:"tag"}}},{default:u(()=>[I(" #"+A(O.tag),1)]),_:2},1032,["to"]),w("div",dt,A(g(O.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):S("",!0),s(H,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:u(()=>[s(J,{show:_.value},{default:u(()=>[(f(!0),R(ee,null,te(t.value,O=>(f(),R("div",{class:"hot-tag-item",key:O.id},[s(G,{class:"hash-link",to:{name:"home",query:{q:O.tag,t:"tag"}}},{default:u(()=>[I(" #"+A(O.tag),1)]),_:2},1032,["to"]),w("div",mt,A(g(O.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(H,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:u(()=>[w("div",ht,"© "+A(d(c).state.profile.copyrightTop),1),w("div",null,[s(ge,null,{default:u(()=>[w("a",{href:d(c).state.profile.copyrightLeftLink,target:"_blank",class:"hash-link"},A(d(c).state.profile.copyrightLeft),9,_t),w("a",{href:d(c).state.profile.copyrightRightLink,target:"_blank",class:"hash-link"},A(d(c).state.profile.copyrightRight),9,ft)]),_:1})])]),_:1}),d(c).state.userInfo.is_admin?(f(),R("div",{key:1,class:"site-info",ref_key:"userInfoElement",ref:i},[w("span",gt,A(P.value)+" 注册用户,"+A(k.value)+" 人在线,最高在线 "+A(E.value)+" 人,站点上线于 "+A(d(ut)(m.value)),1)],512)):S("",!0)]))}}}),vt=fe(wt,[["__scopeId","data-v-181f8063"]]),yt="/assets/logo-ME_znyse.png",bt={class:"sidebar-wrap"},kt={class:"logo-wrap"},Lt={key:0,class:"user-wrap"},Tt={class:"user-info"},Pt={class:"nickname"},Mt={class:"nickname-txt"},At={class:"username"},Rt={class:"user-mini-wrap"},Et={key:1,class:"user-wrap"},Ct={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},St=K({__name:"sidebar",setup(e){const t=W(),r=Le(),_=ce(),n=T(!1),c=T(r.name||""),l=T(),P="false".toLowerCase()==="true";j(r,()=>{c.value=r.name}),j(t.state,()=>{n.value=t.state.unreadMsgCount>0,t.state.userInfo.id>0?l.value||(ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)}),l.value=setInterval(()=>{ie().then(a=>{n.value=a.count>0,t.commit("updateUnreadMsgCount",a.count)}).catch(a=>{console.log(a)})},t.state.profile.defaultMsgLoopInterval)):l.value&&clearInterval(l.value)}),V(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const k=Q(()=>{const a=[{label:"广场",key:"home",icon:()=>L(re),href:"/"},{label:"话题",key:"topic",icon:()=>L(se),href:"/topic"}];return P&&a.push({label:"公告",key:"anouncement",icon:()=>L(Be),href:"/anouncement"}),a.push({label:"主页",key:"profile",icon:()=>L(He),href:"/profile"}),a.push({label:"消息",key:"messages",icon:()=>L(Ye),href:"/messages"}),a.push({label:"收藏",key:"collection",icon:()=>L(je),href:"/collection"}),t.state.profile.useFriendship&&a.push({label:"好友",key:"contacts",icon:()=>L(Qe),href:"/contacts"}),t.state.profile.enableWallet&&a.push({label:"钱包",key:"wallet",icon:()=>L(Ze),href:"/wallet"}),a.push({label:"设置",key:"setting",icon:()=>L(Ge),href:"/setting"}),t.state.userInfo.id>0?a:[{label:"广场",key:"home",icon:()=>L(re),href:"/"},{label:"话题",key:"topic",icon:()=>L(se),href:"/topic"}]}),E=a=>"href"in a?L("div",{},a.label):a.label,m=a=>a.key==="messages"?L($e,{dot:!0,show:n.value,processing:!0},{default:()=>L(F,{color:a.key===c.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:a.icon})}):L(F,null,{default:a.icon}),i=(a,g={})=>{c.value=a,_.push({name:a,query:{t:new Date().getTime()}})},v=()=>{r.path==="/"&&t.commit("refresh"),i("home")},h=a=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",a)},b=()=>{t.commit("userLogout"),t.commit("refresh"),v()};return window.$store=t,window.$message=Ue(),(a,g)=>{const D=De,$=xe,x=Ne,p=me;return f(),R("div",bt,[w("div",kt,[s(D,{class:"logo-img",width:"36",src:d(yt),"preview-disabled":!0,onClick:v},null,8,["src"])]),s($,{accordion:!0,"icon-size":24,options:k.value,"render-label":E,"render-icon":m,value:c.value,"onUpdate:value":i},null,8,["options","value"]),d(t).state.userInfo.id>0?(f(),R("div",Lt,[s(x,{class:"user-avatar",round:"",size:34,src:d(t).state.userInfo.avatar},null,8,["src"]),w("div",Tt,[w("div",Pt,[w("span",Mt,A(d(t).state.userInfo.nickname),1),s(p,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:b},{icon:u(()=>[s(d(F),null,{default:u(()=>[s(d(ne))]),_:1})]),_:1})]),w("div",At,"@"+A(d(t).state.userInfo.username),1)]),w("div",Rt,[s(p,{class:"logout",quaternary:"",circle:"",onClick:b},{icon:u(()=>[s(d(F),{size:24},{default:u(()=>[s(d(ne))]),_:1})]),_:1})])])):(f(),R("div",Et,[d(t).state.profile.allowUserRegister?S("",!0):(f(),R("div",Ct,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=C=>h("signin"))},{default:u(()=>[I(" 登录 ")]),_:1})])),d(t).state.profile.allowUserRegister?(f(),R("div",Ot,[s(p,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=C=>h("signin"))},{default:u(()=>[I(" 登录 ")]),_:1}),s(p,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=C=>h("signup"))},{default:u(()=>[I(" 注册 ")]),_:1})])):S("",!0)]))])}}}),It=()=>o({method:"get",url:"/v1/site/profile"}),Ut={"has-sider":"",class:"main-wrap",position:"static"},$t={key:0},Dt={class:"content-wrap"},xt=K({__name:"App",setup(e){const t=W(),r=Q(()=>t.state.theme==="dark"?ze:null);function _(){t.commit("loadDefaultSiteProfile"),"true".toLowerCase()==="true"&&It().then(n=>{t.commit("updateSiteProfile",n)}).catch(n=>{console.log(n)})}return V(()=>{_()}),(n,c)=>{const l=St,P=ue("router-view"),k=vt,E=at,m=Fe,i=Ke,v=Ve,h=qe;return f(),z(h,{theme:r.value},{default:u(()=>[s(i,null,{default:u(()=>[s(m,null,{default:u(()=>{var b;return[w("div",{class:ve(["app-container",{dark:((b=r.value)==null?void 0:b.name)==="dark",mobile:!d(t).state.desktopModelShow}])},[w("div",Ut,[d(t).state.desktopModelShow?(f(),R("div",$t,[s(l)])):S("",!0),w("div",Dt,[s(P,{class:"app-wrap"},{default:u(({Component:a})=>[(f(),z(we,null,[n.$route.meta.keepAlive?(f(),z(oe(a),{key:0})):S("",!0)],1024)),n.$route.meta.keepAlive?S("",!0):(f(),z(oe(a),{key:0}))]),_:1})]),s(k)]),s(E)],2)]}),_:1})]),_:1}),s(v)]),_:1},8,["theme"])}}});ye(xt).use(_e).use(tt).mount("#app");export{Ko as $,io as A,co as B,ao as C,po as D,yt as E,Co as F,Oo as G,Io as H,So as I,lt as J,ut as K,dr as L,er as M,ur as N,xo as O,No as P,Vo as Q,Go as R,Zo as S,Jo as T,Xo as U,pr as V,lr as W,ir as X,mo as Y,Fo as Z,fe as _,ar as a,Do as a0,Y as a1,or as a2,rr as a3,sr as a4,Uo as a5,Qo as a6,Yo as a7,Bo as a8,Ho as a9,jo as aa,$o as ab,St as ac,ho as b,_o as c,no as d,tr as e,qo as f,nr as g,Wo as h,cr as i,To as j,Eo as k,bo as l,ko as m,Ro as n,Mo as o,Ao as p,Po as q,lo as r,uo as s,Lo as t,zo as u,fo as v,go as w,wo as x,vo as y,yo as z}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/Home-28LAfziN.js","assets/whisper-add-friend-PONlu7DH.js","assets/naive-ui-h5SFsZhx.js","assets/seemly-hKSMrbh9.js","assets/@vue-Hd4uXz5f.js","assets/vueuc-xP2DxDTa.js","assets/evtd-9ZCiDXyn.js","assets/@css-render-oW_PeE7K.js","assets/vooks-v147mXjr.js","assets/vdirs-gz97tqc5.js","assets/@juggle--NVrOerG.js","assets/css-render-Adblu2bf.js","assets/@emotion-vV6BesBt.js","assets/lodash-es-KEIJqYRD.js","assets/treemate-hmrDCADh.js","assets/async-validator-BHjhHa7C.js","assets/date-fns-E8ESfRGG.js","assets/whisper-add-friend-R3W2ljoW.css","assets/whisper-Vl-V0ytb.js","assets/whisper-UU5QVlv3.css","assets/post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js","assets/content-fOn-h7ea.js","assets/@vicons-V6UxFD2Y.js","assets/paopao-video-player-iTSRV7j7.js","assets/content--HAHeWeT.css","assets/vuex-qScXS-uk.js","assets/vue-router-4Hko0_3l.js","assets/copy-to-clipboard-l6UqHK6O.js","assets/@babel-5-cIlDoe.js","assets/toggle-selection-fekekO1r.js","assets/post-item-wU5RYMZl.css","assets/post-skeleton-zm5tFcFD.js","assets/post-skeleton-tYynKIkA.css","assets/lodash-8cBkGte7.js","assets/IEnum-u5OuruSk.js","assets/main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js","assets/main-nav-Cd31t9PJ.css","assets/v3-infinite-loading-9ocfqcSa.js","assets/v3-infinite-loading-Z45psRbt.css","assets/@opentiny-dth6RzMU.js","assets/vue-VsGwIgVC.js","assets/@opentiny-urK5SdM0.css","assets/axios-kMxbiGYq.js","assets/moment-jIwEdMgI.js","assets/Home-FNP8rm38.css","assets/vfonts-1-VPxUEo.css","assets/Post-Aii8OJYD.js","assets/Post-1TDHbf8L.css","assets/Topic-cLiEWQZV.js","assets/Topic-0adcrc3O.css","assets/Anouncement-BKCrB4N4.js","assets/Anouncement-_fp7ZHOJ.css","assets/Profile-ND6y_r-3.js","assets/count-GnrfahME.js","assets/Profile-6IJN_JzI.css","assets/User-PfHpGfJF.js","assets/User-sRiaqMlA.css","assets/Messages-Io0cWkZE.js","assets/Messages-hpLWVpg-.css","assets/Collection-zGgLSBDA.js","assets/Collection-Asz6ngr2.css","assets/Contacts-70p5eo25.js","assets/Contacts-5sEVRvVP.css","assets/Following-T99T9Q8h.js","assets/Following-M_pYXXXd.css","assets/Wallet-22Q_5kW8.js","assets/qrcode-NFgyJgOr.js","assets/encode-utf8-YzUDWyGG.js","assets/dijkstrajs-mfgL5WWt.js","assets/Wallet-gRH3TBUo.css","assets/Setting-lLn2gCo2.js","assets/Setting-99jPXkCK.css","assets/404-x31eybZD.js","assets/404-QyiMvdft.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js new file mode 100644 index 000000000..f4041f672 --- /dev/null +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-9UCTRVDk.js @@ -0,0 +1 @@ +import{ac as A}from"./index-8lD1klqH.js";import{u as B}from"./vuex-qScXS-uk.js";import{u as E}from"./vue-router-4Hko0_3l.js";import{j as z}from"./vooks-v147mXjr.js";import{a3 as C,a4 as P,a5 as D,a6 as N}from"./@vicons-V6UxFD2Y.js";import{u as R,a3 as H,a4 as I,j as V,e as $,a5 as j,h as q}from"./naive-ui-h5SFsZhx.js";import{d as x,H as h,b as F,e as n,f,bf as a,k as e,w as t,Z as c,j as L,v as i,A as U,t as Z,F as G}from"./@vue-Hd4uXz5f.js";const J={key:0},K={class:"navbar"},ae=x({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(w){const o=B(),m=E(),l=h(!1),g=h("left"),u=w,_=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),o.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),o.commit("triggerTheme","light"))},k=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return F(()=>{localStorage.getItem("PAOPAO_THEME")||_(z()==="dark"),o.state.desktopModelShow||(window.$store=o,window.$message=R())}),(s,d)=>{const b=A,y=H,M=I,r=V,p=$,O=j,S=q;return n(),f(G,null,[a(o).state.drawerModelShow?(n(),f("div",J,[e(M,{show:l.value,"onUpdate:show":d[0]||(d[0]=T=>l.value=T),width:212,placement:g.value,resizable:""},{default:t(()=>[e(y,null,{default:t(()=>[e(b)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(S,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[L("div",K,[a(o).state.drawerModelShow&&!s.back?(n(),i(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(C))]),_:1})]),_:1})):c("",!0),s.back?(n(),i(p,{key:1,class:"back-btn",onClick:k,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(a(P))]),_:1})]),_:1})):c("",!0),U(" "+Z(u.title)+" ",1),u.theme?(n(),i(O,{key:2,value:a(o).state.theme==="dark","onUpdate:value":_,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:a(D)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:a(N)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{ae as _}; diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js new file mode 100644 index 000000000..8cb7c90ab --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-hfTPUkT_.js @@ -0,0 +1 @@ +import{d as V,a as W,_ as J,b as Z,c as G}from"./content-fOn-h7ea.js";import{d as K,H as Q,c as z,r as U,e as l,f as $,k as a,am as X,w as n,F as Y,y as h,bf as i,x as ee,j as u,t as _,A as m,v as c,Z as r,h as q}from"./@vue-Hd4uXz5f.js";import{u as te}from"./vuex-qScXS-uk.js";import{u as se}from"./vue-router-4Hko0_3l.js";import{V as oe,A as ne,B as ae}from"./index-8lD1klqH.js";import{c as le}from"./copy-to-clipboard-l6UqHK6O.js";import{k as ie,l as ue,n as ce,o as re,r as pe,s as _e,t as me,J as de,R as ve,q as he}from"./@vicons-V6UxFD2Y.js";import{j as f,o as fe,M as ke,e as ge,P as ye,a as we,O as be}from"./naive-ui-h5SFsZhx.js";const xe={class:"post-item"},$e={class:"nickname-wrap"},Ce={class:"username-wrap"},Oe={class:"timestamp-mobile"},ze={class:"item-header-extra"},qe=["innerHTML"],Re=K({__name:"mobile-post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(T,{emit:S}){const g=se(),C=te(),y=Q(!0),o=T,w=S,d=t=>()=>q(f,null,{default:()=>q(t)}),B=z(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:d(pe)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:d(_e)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:d(me)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:d(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:d(ve)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(he)}),t}),F=async t=>{switch(t){case"copyTweetLink":le(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":w("send-whisper",o.post.user);break;case"delete":case"requesting":w("handle-friend-action",o.post);break;case"follow":case"unfollow":w("handle-follow-action",o.post);break}},e=z({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.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=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),A=()=>{ne({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{ae({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)})},b=t=>{g.push({name:"post",query:{id:t}})},L=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&(C.commit("refresh"),v[0]==="tag"?g.push({name:"home",query:{q:v[1],t:"tag"}}):g.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?y.value=!y.value:b(s)};return(t,s)=>{const p=fe,v=U("router-link"),x=ke,M=ge,H=ye,O=W,j=J,D=Z,N=G,I=we,R=be;return l(),$("div",xe,[a(R,{"content-indented":""},X({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",$e,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[m(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Ce," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(x,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[m(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(x,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[m(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(x,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[m(" 好友可见 ")]),_:1})):r("",!0),u("div",null,[u("span",Oe,_(i(oe)(e.value.created_on))+" "+_(e.value.ip_loc),1)])]),"header-extra":n(()=>[u("div",ze,[a(H,{placement:"bottom-end",trigger:"click",size:"small",options:B.value,onSelect:F},{default:n(()=>[a(M,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(D,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(N,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item",onClick:h(A,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),m(" "+_(e.value.upvote_count),1)]),u("div",{class:"opt-item",onClick:s[3]||(s[3]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),m(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(re))]),_:1}),m(" "+_(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[u("div",{onClick:s[2]||(s[2]=k=>b(e.value.id))},[(l(!0),$(Y,null,ee(e.value.texts,k=>(l(),$("span",{key:k.id,class:"post-text",onClick:s[1]||(s[1]=h(E=>L(E,e.value.id),["stop"])),innerHTML:i(V)(k.content,"展开","收起",i(C).state.profile.tweetMobileEllipsisSize,y.value)},null,8,qe))),128))])]),key:"0"}:void 0]),1024)])}}}),Te={class:"nickname-wrap"},Se={class:"username-wrap"},Be={class:"item-header-extra"},Fe={class:"timestamp"},Ae=["innerHTML"],Ee=K({__name:"post-item",props:{post:{},isOwner:{type:Boolean},addFriendAction:{type:Boolean},addFollowAction:{type:Boolean}},emits:["send-whisper","handle-follow-action","handle-friend-action"],setup(T,{emit:S}){const g=se(),C=te(),y=Q(!0),o=T,w=S,d=t=>()=>q(f,null,{default:()=>q(t)}),B=z(()=>{let t=[];return o.isOwner||t.push({label:"私信 @"+o.post.user.username,key:"whisper",icon:d(pe)}),!o.isOwner&&o.addFollowAction&&(o.post.user.is_following?t.push({label:"取消关注 @"+o.post.user.username,key:"unfollow",icon:d(_e)}):t.push({label:"关注 @"+o.post.user.username,key:"follow",icon:d(me)})),!o.isOwner&&o.addFriendAction&&(o.post.user.is_friend?t.push({label:"删除好友 @"+o.post.user.username,key:"delete",icon:d(de)}):t.push({label:"添加朋友 @"+o.post.user.username,key:"requesting",icon:d(ve)})),t.push({label:"复制链接",key:"copyTweetLink",icon:d(he)}),t}),F=async t=>{switch(t){case"copyTweetLink":le(`${window.location.origin}/#/post?id=${e.value.id}&share=copy_link&t=${new Date().getTime()}`),window.$message.success("链接已复制到剪贴板");break;case"whisper":w("send-whisper",o.post.user);break;case"delete":case"requesting":w("handle-friend-action",o.post);break;case"follow":case"unfollow":w("handle-follow-action",o.post);break}},e=z({get:()=>{let t=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},o.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=>{o.post.upvote_count=t.upvote_count,o.post.collection_count=t.collection_count}}),A=()=>{ne({id:e.value.id}).then(t=>{t.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count>0?e.value.upvote_count-1:0}}).catch(t=>{console.log(t)})},P=()=>{ae({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)})},b=t=>{g.push({name:"post",query:{id:t}})},L=(t,s)=>{const p=t.target.dataset.detail;if(p&&p!=="post"){const v=p.split(":");v.length===2&&(C.commit("refresh"),v[0]==="tag"?g.push({name:"home",query:{q:v[1],t:"tag"}}):g.push({name:"user",query:{s:v[1]}}))}else p&&p==="post"?y.value=!y.value:b(s)};return(t,s)=>{const p=fe,v=U("router-link"),x=ke,M=ge,H=ye,O=W,j=J,D=Z,N=G,I=we,R=be;return l(),$("div",{class:"post-item",onClick:s[3]||(s[3]=k=>b(e.value.id))},[a(R,{"content-indented":""},X({avatar:n(()=>[a(p,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[u("span",Te,[a(v,{onClick:s[0]||(s[0]=h(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.value.user.username}}},{default:n(()=>[m(_(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",Se," @"+_(e.value.user.username),1),e.value.is_top?(l(),c(x,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[m(" 置顶 ")]),_:1})):r("",!0),e.value.visibility==1?(l(),c(x,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[m(" 私密 ")]),_:1})):r("",!0),e.value.visibility==2?(l(),c(x,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[m(" 好友可见 ")]),_:1})):r("",!0)]),"header-extra":n(()=>[u("div",Be,[u("span",Fe,_(e.value.ip_loc?e.value.ip_loc+" · ":e.value.ip_loc)+" "+_(i(oe)(e.value.created_on)),1),a(H,{placement:"bottom-end",trigger:"hover",size:"small",options:B.value,onSelect:F},{default:n(()=>[a(M,{quaternary:"",circle:""},{icon:n(()=>[a(i(f),null,{default:n(()=>[a(i(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:n(()=>[e.value.attachments.length>0?(l(),c(O,{key:0,attachments:e.value.attachments},null,8,["attachments"])):r("",!0),e.value.charge_attachments.length>0?(l(),c(O,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):r("",!0),e.value.imgs.length>0?(l(),c(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):r("",!0),e.value.videos.length>0?(l(),c(D,{key:3,videos:e.value.videos},null,8,["videos"])):r("",!0),e.value.links.length>0?(l(),c(N,{key:4,links:e.value.links},null,8,["links"])):r("",!0)]),action:n(()=>[a(I,{justify:"space-between"},{default:n(()=>[u("div",{class:"opt-item hover",onClick:h(A,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ue))]),_:1}),m(" "+_(e.value.upvote_count),1)]),u("div",{class:"opt-item hover",onClick:s[2]||(s[2]=h(k=>b(e.value.id),["stop"]))},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(ce))]),_:1}),m(" "+_(e.value.comment_count),1)]),u("div",{class:"opt-item hover",onClick:h(P,["stop"])},[a(i(f),{size:"18",class:"opt-item-icon"},{default:n(()=>[a(i(re))]),_:1}),m(" "+_(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:n(()=>[(l(!0),$(Y,null,ee(e.value.texts,k=>(l(),$("span",{key:k.id,class:"post-text hover",onClick:s[1]||(s[1]=h(E=>L(E,e.value.id),["stop"])),innerHTML:i(V)(k.content,"展开","收起",i(C).state.profile.tweetWebEllipsisSize,y.value)},null,8,Ae))),128))]),key:"0"}:void 0]),1024)])}}});export{Ee as _,Re as a}; diff --git a/web/dist/assets/post-skeleton-zm5tFcFD.js b/web/dist/assets/post-skeleton-zm5tFcFD.js new file mode 100644 index 000000000..0f181e09c --- /dev/null +++ b/web/dist/assets/post-skeleton-zm5tFcFD.js @@ -0,0 +1 @@ +import{U as _}from"./naive-ui-h5SFsZhx.js";import{d as c,e as s,f as n,x as p,j as o,k as t,F as l}from"./@vue-Hd4uXz5f.js";import{_ as m}from"./index-8lD1klqH.js";const i={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(a,k)=>{const e=_;return s(!0),n(l,null,p(new Array(a.num),r=>(s(),n("div",{class:"skeleton-item",key:r},[o("div",i,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}}),g=m(u,[["__scopeId","data-v-ab0015b4"]]);export{g as _}; diff --git a/web/dist/assets/whisper-Vl-V0ytb.js b/web/dist/assets/whisper-Vl-V0ytb.js new file mode 100644 index 000000000..ddcd5fd85 --- /dev/null +++ b/web/dist/assets/whisper-Vl-V0ytb.js @@ -0,0 +1 @@ +import{a0 as b,_ as B}from"./index-8lD1klqH.js";import{d as C,H as p,e as N,v as U,w as s,A as a,t as i,k as n,j as _}from"./@vue-Hd4uXz5f.js";import{S as V,I as z,T as I,b as R,e as S,i as T}from"./naive-ui-h5SFsZhx.js";const W={class:"whisper-wrap"},$={class:"whisper-line"},j={class:"whisper-line send-wrap"},A=C({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(r,{emit:u}){const d=r,o=p(""),t=p(!1),m=u,c=()=>{m("success")},h=()=>{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 w=V,f=z,v=I,g=R,y=S,x=T;return N(),U(x,{show:e.show,"onUpdate:show":c,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[_("div",W,[n(v,{"show-icon":!1},{default:s(()=>[a(" 即将发送私信给: "),n(f,{style:{"max-width":"100%"}},{default:s(()=>[n(w,{type:"success"},{default:s(()=>[a(i(e.user.nickname)+"@"+i(e.user.username),1)]),_:1})]),_:1})]),_:1}),_("div",$,[n(g,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":l[0]||(l[0]=k=>o.value=k),maxlength:"200","show-count":""},null,8,["value"])]),_("div",j,[n(y,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:h},{default:s(()=>[a(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}}),q=B(A,[["__scopeId","data-v-0cbfe47c"]]);export{q as _}; diff --git a/web/dist/assets/whisper-add-friend-PONlu7DH.js b/web/dist/assets/whisper-add-friend-PONlu7DH.js new file mode 100644 index 000000000..09123ec64 --- /dev/null +++ b/web/dist/assets/whisper-add-friend-PONlu7DH.js @@ -0,0 +1 @@ +import{O as b,_ as B}from"./index-8lD1klqH.js";import{S as C,I as N,T as V,b as W,e as z,i as A}from"./naive-ui-h5SFsZhx.js";import{d as F,H as i,e as I,v as R,w as s,j as a,k as n,A as l,t as r}from"./@vue-Hd4uXz5f.js";const S={class:"whisper-wrap"},T={class:"whisper-line"},U={class:"whisper-line send-wrap"},j=F({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(p,{emit:u}){const d=p,o=i(""),t=i(!1),m=u,_=()=>{m("success")},h=()=>{t.value=!0,b({user_id:d.user.id,greetings:o.value}).then(e=>{window.$message.success("发送成功"),t.value=!1,o.value="",_()}).catch(e=>{t.value=!1})};return(e,c)=>{const w=C,f=N,g=V,v=W,y=z,x=A;return I(),R(x,{show:e.show,"onUpdate:show":_,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:s(()=>[a("div",S,[n(g,{"show-icon":!1},{default:s(()=>[l(" 发送添加朋友申请给: "),n(f,{style:{"max-width":"100%"}},{default:s(()=>[n(w,{type:"success"},{default:s(()=>[l(r(e.user.nickname)+"@"+r(e.user.username),1)]),_:1})]),_:1})]),_:1}),a("div",T,[n(v,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:o.value,"onUpdate:value":c[0]||(c[0]=k=>o.value=k),maxlength:"120","show-count":""},null,8,["value"])]),a("div",U,[n(y,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:h},{default:s(()=>[l(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}}),M=B(j,[["__scopeId","data-v-60be56a2"]]);export{M as W};