You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/Home-5d6ae80a.js

2 lines
21 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{_ as Te}from"./whisper-e51c17fc.js";import{_ as Ue,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-eaa0dff0.js";import{_ as Ve}from"./post-skeleton-2311fe04.js";import{d as _e,H as n,c as ce,b as ge,e as c,f as w,bf as I,j as A,k as a,w as l,q,Y as y,y as ve,A as F,x as $,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Ye}from"./index-fae12ace.js";import{p as Fe}from"./content-1a1bcb51.js";import{V as R,P as Q}from"./IEnum-5453a777.js";import{I as Le,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-96e8e840.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const gt=H=>{const P=new FileReader,k=i=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(i),D=()=>{const i=new Uint8Array(P.result).subarray(0,4);let B="";for(let _=0;_<i.length;_++)B+=i[_].toString(16);switch(B){case"504b0304":case"504b0506":case"504b0708":return k("application/zip");case"504b030414":return k("application/x-zip-compressed");case"504b0508":return k("application/x-zip");case"504b5370":return k("application/octet-stream");default:return!1}};return new Promise((i,B)=>{P.onloadend=()=>{const _=H.type;i(_===""||_==="application/octet-stream"?D():k(_))},P.readAsArrayBuffer(H.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},At={class:"attachment"},kt={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Tt=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ut={key:0,class:"login-only-wrap"},Et={key:1,class:"login-wrap"},Vt=_e({__name:"compose",emits:["post-success"],setup(H,{emit:P}){const k=fe(),D=n([]),i=n(!1),B=n(!1),_=n(!1),G=n(!1),g=n(""),E=n([]),T=n(),U=n(0),f=n("public/image"),b=n([]),v=n([]),h=n([]),C=n([]),z=n(R.PUBLIC),V=n(R.PUBLIC),M="true".toLowerCase()==="true",Y=+"400",Z=n("true".toLowerCase()==="true"),J=n("true".toLowerCase()==="true"),ee=n("true".toLowerCase()==="true"),L=n("false".toLowerCase()==="true"),te=n("true".toLowerCase()==="true"),K="/v1/attachment",N=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),X=ce(()=>{let e=[{value:R.PUBLIC,label:"公开"},{value:R.PRIVATE,label:"私密"},{value:R.Following,label:"关注可见"}];return M&&e.push({value:R.FRIEND,label:"好友可见"}),e}),ae=()=>{_.value=!_.value,_.value&&G.value&&(G.value=!1)},W=()=>{G.value=!G.value,G.value&&_.value&&(_.value=!1)},se=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),p=me.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),D.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),d=(e,t)=>{i.value||(i.value=!0,t==="@"?se(e):p(e))},S=e=>{e.length>Y?g.value=e.substring(0,Y):g.value=e},O=e=>{f.value=e},x=e=>{for(let u=0;u<e.length;u++){var t=e[u].name,o=t.split(".").slice(0,-1).join("."),s=t.split(".").pop();o.length>30&&(e[u].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}b.value=e},oe=async e=>{var t,o,s,u,r;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((r=e.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ne=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(f.value==="public/image"&&v.value.push({id:e.id,content:s.data.content}),f.value==="public/video"&&h.value.push({id:e.id,content:s.data.content}),f.value==="attachment"&&C.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let u=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(r=>{u+=":"+r}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ie=({file:e})=>{let t=v.value.findIndex(o=>o.id===e.id);t>-1&&v.value.splice(t,1),t=h.value.findIndex(o=>o.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(o=>o.id===e.id),t>-1&&C.value.splice(t,1)},re=()=>{if(g.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Fe(g.value);const o=[];let s=100;o.push({content:g.value,type:Q.TEXT,sort:s}),v.value.map(u=>{s++,o.push({content:u.content,type:Q.IMAGEURL,sort:s})}),h.value.map(u=>{s++,o.push({content:u.content,type:Q.VIDEOURL,sort:s})}),C.value.map(u=>{s++,o.push({content:u.content,type:Q.ATTACHMENT,sort:s})}),E.value.length>0&&E.value.map(u=>{s++,o.push({content:u,type:Q.LINKURL,sort:s})}),B.value=!0,qe({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+U.value*100,visibility:z.value}).then(u=>{var r;window.$message.success("发布成功"),B.value=!1,P("post-success",u),_.value=!1,G.value=!1,(r=T.value)==null||r.clear(),b.value=[],g.value="",E.value=[],v.value=[],h.value=[],C.value=[],z.value=V.value}).catch(u=>{B.value=!1})},j=e=>{k.commit("triggerAuth",!0),k.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();M&&e==="friend"?V.value=R.FRIEND:e==="following"?V.value=R.Following:e==="public"?V.value=R.PUBLIC:V.value=R.PRIVATE,z.value=V.value}),(e,t)=>{const o=he,s=je,u=Qe,r=He,ue=Ze,ye=Je,Ae=Xe,ke=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return c(),w("div",null,[I(k).state.userInfo.id>0?(c(),w("div",ft,[A("div",ht,[A("div",wt,[a(o,{round:"",size:30,src:I(k).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:i.value,value:g.value,prefix:["@","#"],options:D.value,onSearch:d,"onUpdate:value":S,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:T,abstract:"","list-type":"image",multiple:!0,max:9,action:K,headers:{Authorization:N.value},data:{type:f.value},"file-list":b.value,onBeforeUpload:oe,onFinish:ne,onError:le,onRemove:ie,"onUpdate:fileList":x},{default:l(()=>[A("div",yt,[A("div",At,[a(ue,{abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),J.value?(c(),q(ue,{key:0,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value!=="public/video"||b.value.length===9,onClick:()=>{O("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),ee.value?(c(),q(ue,{key:1,abstract:""},{default:l(({handleClick:m})=>[a(r,{disabled:b.value.length>0&&f.value==="public/video"||b.value.length===9,onClick:()=>{O("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):y("",!0),a(r,{quaternary:"",circle:"",type:"primary",onClick:ve(ae,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(Ke))]),_:1})]),_:1},8,["onClick"]),te.value?(c(),q(r,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(W,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(I(We))]),_:1})]),_:1},8,["onClick"])):y("",!0)]),A("div",kt,[a(Ae,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/I(Y)*100},null,8,["percentage"])]),default:l(()=>[F(" "+$(g.value.length)+" / "+$(I(Y)),1)]),_:1}),a(r,{loading:B.value,onClick:re,type:"primary",secondary:"",round:""},{default:l(()=>[F(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(ke),C.value.length>0?(c(),w("div",Ct,[L.value?(c(),q(be,{key:0,value:U.value,"onUpdate:value":t[0]||(t[0]=m=>U.value=m),min:0,max:1e5,placeholder:"请输入附件价格0为免费附件"},{prefix:l(()=>[zt]),_:1},8,["value"])):y("",!0)])):y("",!0)])]),_:1},8,["headers","data","file-list"]),G.value?(c(),w("div",It,[a(De,{value:z.value,"onUpdate:value":t[1]||(t[1]=m=>z.value=m),name:"radiogroup"},{default:l(()=>[a(Ie,null,{default:l(()=>[(c(!0),w(pe,null,de(X.value,m=>(c(),q(ze,{key:m.value,value:m.value,label:m.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):y("",!0),_.value?(c(),w("div",Dt,[a(Be,{value:E.value,"onUpdate:value":t[2]||(t[2]=m=>E.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":l(()=>[F(" 创建链接 ")]),_:1},8,["value"])])):y("",!0)])):(c(),w("div",Bt,[Tt,Z.value?y("",!0):(c(),w("div",Ut,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1})])),Z.value?(c(),w("div",Et,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=m=>j("signin"))},{default:l(()=>[F(" 登录 ")]),_:1}),a(r,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=m=>j("signup"))},{default:l(()=>[F(" 注册 ")]),_:1})])):y("",!0)]))])}}});const Nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeGmFIGilrVJUwBcw0jKgnc6Ijsr0D8eO1qrt+Kio9fEHRR1n7ExH8IEzdmgZWluxPnhYijJCkZQAtoSQmARaHk2A3WSzu/ec/n6XJpLdu5u9u/eVx2dmJ/u4m909v3N+v/P7nhcDn7JunVSm3xiv0kLabCnERGBQLoGNlQDnM5D0dzQDUOlavJ/C+0cA2BF8rR6fasMn2xnnhzri8U++Ua61MMZS4EMY+AQppXo4lpqjKHyOkHIWfrVrwE4k+wCYrFU433zsJGy7cgzrAB/gqQHq6mSwdCIsk1LchLV4cXeNdgUJbwHjG2NReK9mFIuCR3higINnuqaqqvpTKWGZq4VuguG+JLymBPiacUG2E1zGNQOsWCH5nY/ot+IHPoS+/ErwIRg/doGivFAdYuvBJVwxQEMstYgz9iLWtgnQD2AM6oDzFW4YwlEDNES7LuNcWe3XGt838lPGlMerS9gWcAhHDHDwpCxTNLEKa9I9MADAQloZjfKnnAjWthvgUDQ5D7t6b6C7qYQBBLklBvyBqhK2CWyEg01QkG2I6Y9zzj8eaIVPYI+tRkjxcWOn/hj9VrAJW1rA4TZZDiH9ffx334FBAGbVn8k4WzC+grVDkRRtSezTT5EhsWewFD6BWftVEBTbG7vkpVAkRbWAxjPJOVLhG/GuBoOTOAd+Q1WY/Q0KpOAW0ByXC4TCP4TBW/iEpoPY8lV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SNJ5MlYKn7A8LkcnRHDOvwdD9EKRfGkhh/kUNDBKZ6VINMJQSzBIMskXjouwd6EAisoXmzrkdwUI2tp+0B5jRS7Z6rkx51LU1ABqchR0KPLDIANbfxP99mIKn7DvKMMgHXEySE7Tw35+e0KZf7kfjjIk6EzF6rAyazBkzJThvom/1Y7CJ2zXDJs65TxdiJdQRR1Qp26gy2lBbefOvo4ksYrt08NI/+iI8atIhoUBAg4nrtY726faXfiEo6o5KqlzpNR/iR/j6VkEhYJDs7sCUrk72+kXduDKsEVjh1wipFjRX9wSDsceYpw9UKWxP4PDuDJDtTrM1k+IKNMYcDqbwLdjzfTdUE74wRsl7GI3Cp/wZOCOtsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",xt="/assets/discover-tweets-ab101944.jpeg",Rt="/assets/following-tweets-e36b4410.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Yt={key:1},Ft={key:2},Lt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(H){const P="true".toLowerCase()==="true",k="true".toLowerCase()==="true",D=fe(),i=dt(),B=vt(),_=n(9),G=n(8),g=n([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,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}]),E=n("泡泡广场"),T=n(!1),U=n(!1),f=n(1),b=n(""),v=n([]),h=n(1),C=n(20),z=n(0),V=n(!1),M=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),Y=p=>{M.value=p,V.value=!0},Z=()=>{V.value=!1},J=()=>{E.value="泡泡广场",i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?E.value="#"+decodeURIComponent(i.query.q):E.value="搜索: "+decodeURIComponent(i.query.q))},ee=ce(()=>P&&k&&D.state.desktopModelShow&&D.state.userInfo.id>0),L=()=>{T.value=!1,U.value=!1,v.value=[],h.value=1,z.value=0},te=(p,d)=>{switch(L(),f.value=p.style,i.query.q&&(i.query.q=null,J()),p.style){case 1:N("newest");break;case 2:N("hots");break;case 3:i.query.q=null,N("following");break;case 21:b.value=p.username,X();break}g.value[d].show=!1},K=()=>{g.value=g.value.slice(0,3),!(!P||!k||D.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(p=>{var d=0;const S=p.list||[];let O=[];for(;d<S.length;d++){let x=S[d];O.push({title:x.nickname,style:21,username:x.username,avatar:x.avatar,show:!1})}O.length>0&&(g.value=g.value.concat(O))}).catch(p=>{console.log(p)})},N=p=>{T.value=!0,Oe({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,style:p,page:h.value,page_size:C.value}).then(d=>{T.value=!1,d.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(d.list):(v.value=d.list,window.scrollTo(0,0)),z.value=Math.ceil(d.pager.total_rows/C.value)}).catch(d=>{T.value=!1,h.value>1&&h.value--})},X=()=>{T.value=!0,Pe({username:b.value,style:"post",page:h.value,page_size:C.value}).then(p=>{T.value=!1,p.list.length===0&&(U.value=!0),h.value>1?v.value=v.value.concat(p.list):(v.value=p.list||[],window.scrollTo(0,0)),z.value=Math.ceil(p.pager.total_rows/C.value)}).catch(p=>{v.value=[],h.value>1&&h.value--,T.value=!1})},ae=p=>{B.push({name:"post",query:{id:p.id}})},W=()=>{switch(f.value){case 1:N("newest");break;case 2:N("hots");break;case 3:N("following");break;case 21:i.query.q?N("search"):X();break}},se=()=>{h.value<z.value||z.value==0?(U.value=!1,h.value++,W()):U.value=!0};return ge(()=>{L(),K(),N("newest")}),Ne(()=>({path:i.path,query:i.query,refresh:D.state.refresh}),(p,d)=>{if(J(),p.refresh!==d.refresh){L(),setTimeout(()=>{K(),W()},0);return}d.path!=="/post"&&p.path==="/"&&(L(),setTimeout(()=>{K(),W()},0))}),(p,d)=>{const S=pt,O=Vt,x=lt,oe=he,ne=it,le=rt,ie=Ve,re=ut,j=Ue,e=Ee,t=Te,o=nt,s=ct,u=we;return c(),w("div",null,[a(S,{title:E.value},null,8,["title"]),a(o,{class:"main-content-wrap",bordered:""},{default:l(()=>[a(x,null,{default:l(()=>[a(O,{onPostSuccess:ae})]),_:1}),ee.value?(c(),q(x,{key:0},{default:l(()=>[a(I(_t),{modelValue:g.value,"onUpdate:modelValue":d[0]||(d[0]=r=>g.value=r),"wheel-blocks":G.value,"init-blocks":_.value,onClick:te,tag:"div","sub-tag":"div"},{default:l(r=>[A("div",qt,[a(ne,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:l(()=>[a(oe,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(le,{"line-clamp":2},{default:l(()=>[F($(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):y("",!0),T.value&&v.value.length===0?(c(),w("div",Ot,[a(ie,{num:C.value},null,8,["num"])])):y("",!0),A("div",null,[v.value.length===0?(c(),w("div",Pt,[a(re,{size:"large",description:"暂无数据"})])):y("",!0),I(D).state.desktopModelShow?(c(),w("div",Yt,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(j,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))])):(c(),w("div",Ft,[(c(!0),w(pe,null,de(v.value,r=>(c(),q(x,{key:r.id},{default:l(()=>[a(e,{post:r,onSendWhisper:Y},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:V.value,user:M.value,onSuccess:Z},null,8,["show","user"])]),_:1}),z.value>0?(c(),q(u,{key:0,justify:"center"},{default:l(()=>[a(I(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:d[1]||(d[1]=r=>se())},{spinner:l(()=>[A("div",Lt,[U.value?y("",!0):(c(),q(s,{key:0,size:14})),A("span",St,$(U.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):y("",!0)])}}});const Ta=Ye(Mt,[["__scopeId","data-v-b0cbbdc2"]]);export{Ta as default};