/*!
 *  build: Vue  Admin Plus
 *  copyright: vue-admin-beautiful.com
 *  time: 2024-03-07 17:07:58
 */
"use strict";(self["webpackChunkadmin_plus"]=self["webpackChunkadmin_plus"]||[]).push([[4997,9726,3754],{15904:function(t,e,a){a.d(e,{l:function(){return s},x:function(){return i}});var o=a(20235),n=a(96486),r=a.n(n);function i(t){const e=r().pick(t,["tid","fid","pid","authorid","avatar","author","subject","message","dateline"]);return e.author_route=(0,o.gx)(e.authorid),e}function s(t,e){return t.map((t=>{const a=r().pick(t,["tid","fid","pid","favid","authorid","authoravatar","avatar","author","subject","coverpath","attachmentPic","replies"]);a.link=(0,o.OO)(t.tid),a.image_id=t.attachmentPic.length>0?t.attachmentPic[0].aid:0,a.images=t.attachmentPic.map((t=>t.img)),a.author_route=(0,o.gx)(t.authorid);const n=parseInt(t.authorid)!==e;return a.like={can:n&&0==t.threadHasRecommend,number:parseInt(t.recommend_add),liked:!!t.threadHasRecommend},a}))}},79726:function(t,e,a){a.r(e),a.d(e,{default:function(){return f}});var o=a(4350),n=(a(3241),a(91103),a(31452)),r=(a(68445),a(66252)),i=a(3577),s=a(2262);const u={class:"wrap aligin-center"},c={key:0,class:"loading"},d={key:2};var l={__name:"index",props:{status:{type:String,default:"loadmore"}},emits:["loadmore"],setup(t,{emit:e}){const a=t,l=(0,r.Fl)((()=>{let t="";switch(a.status){case"loadmore":t="更多";break;case"loading":t="加载中";break;case"nomore":t="没有数据了";break}return t}));function p(){e("loadmore")}return(e,a)=>{const m=n.E2,g=o.t;return(0,r.wg)(),(0,r.iD)("div",u,["loading"==t.status?(0,r.wy)(((0,r.wg)(),(0,r.iD)("div",c,null,512)),[[g,!0]]):(0,r.kq)("",!0),"loadmore"==t.status?((0,r.wg)(),(0,r.j4)(m,{key:1,type:"primary",onClick:p},{default:(0,r.w5)((()=>[(0,r.Uk)((0,i.zw)((0,s.SU)(l)),1)])),_:1})):((0,r.wg)(),(0,r.iD)("span",d,(0,i.zw)((0,s.SU)(l)),1))])}}};function p(t){t.__source="src/components/LoadMore/index.vue"}var m=a(83744);"function"===typeof p&&p(l);const g=(0,m.Z)(l,[["__scopeId","data-v-300dc6ea"]]);var f=g},56947:function(t,e,a){a.r(e),a.d(e,{default:function(){return w}});var o=a(65450),n=(a(3241),a(69998),a(66252)),r=a(2262),i=(a(96486),a(53580)),s=a(72181),u=a(79726),c=a(15790),d=a(15904),l=a(26010);function p(){const t=(0,r.iH)("loadmore"),e=(0,n.Fl)((()=>"loading"===t.value||"nomore"===t.value)),a=(0,n.Fl)((()=>"nomore"===t.value));function o(){t.value="loading"}function i(){t.value="loadmore"}function s(e,a,o){const n=(0,l.Gc)(e,a,o);t.value=n?"nomore":"loadmore"}return{loadMoreStatus:t,disabledLoadMore:e,noMoreData:a,setLoadingStatus:o,resetLoadMoreStatus:i,setLoadMoreStatus:s}}var m=a(22201);const g=["infinite-scroll-disabled"];var f={__name:"posts",setup(t){const e=(0,c.L)(),a=(0,m.yj)(),{loadMoreStatus:l,disabledLoadMore:f,noMoreData:v,setLoadingStatus:h,resetLoadMoreStatus:y,setLoadMoreStatus:w}=p(),_=(0,r.qj)({topics:[],queryForm:{page:1},pagination:{pageSize:1,total:1}}),{topics:k,queryForm:S,pagination:b}=(0,r.BK)(_);function M(t){if(t.tag){const e={name:t.tag,page:S.value.page};return(0,i.Wx)(e)}{const e=(0,i.iw)(t.filter);return e.page=S.value.page,(0,i.BB)(e)}}function L(){if(v.value)return!1;S.value.page++,U(a.query)}async function U(t){try{h();const{body:{list:a,page_perpage:o,page_allcount:n}}=await M(t),r=(0,d.l)(a,e.getUserId).filter((t=>t.coverpath));1==S.value.page?_.topics=r:_.topics=[..._.topics,...r];const i=parseInt(o),s=parseInt(n);_.pagination.pageSize=i,_.pagination.total=s,w(_.queryForm.page,i,s)}catch(a){y()}}return(0,n.wF)((()=>{U(a.query)})),(0,m.ao)((t=>{S.value.page=1,U(t.query)})),(t,e)=>{const a=(0,n.up)("masonry-wall"),i=o.n;return(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",{"infinite-scroll-disabled":(0,r.SU)(f),class:"home-topics"},[(0,n.Wm)(a,{items:(0,r.SU)(k),col:"7",gap:16,"column-width":230,"key-mapper":t=>t.tid},{default:(0,n.w5)((({item:t,index:e})=>[(0,n.Wm)((0,r.SU)(s["default"]),{item:t,"show-user-bar":!1},null,8,["item"])])),_:1},8,["items","key-mapper"]),(0,n.Wm)((0,r.SU)(u["default"]),{status:(0,r.SU)(l),class:"load-more-bar"},null,8,["status"])],8,g)),[[i,L]])}}};function v(t){t.__source="src/views/index/components/posts.vue"}var h=a(83744);"function"===typeof v&&v(f);const y=(0,h.Z)(f,[["__scopeId","data-v-2902e87e"]]);var w=y}}]);