import{d as t,b as e,r as a,e as s,c as i,C as o,Q as n,x as r,K as p,aa as l,J as d,o as u,h as _,w as m,i as c,a as h,m as y,z as f}from"./index-WeUkftbp.js";import{g}from"./index.NTbA_2SX.js";import{n as b}from"./index.Vw7NoxQA.js";import{d as j}from"./index.BcUDVLb2.js";import{f as v}from"./forumList.Cf2rusgi.js";import{d as w}from"./dropDown.BqJIy245.js";import{g as x,a as D}from"./forum.BGXd3LTG.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-row.DLutFlIQ.js";import"./uni-tag.BU4fxSTe.js";import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";import"./uni-nav-bar.cBITQXNK.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-list.D2b1m_I0.js";import"./uni-badge.CLrZv6EZ.js";import"./index.D8Jasx-l.js";/* empty css                                                              */import"./share-bg.DLa-IrMH.js";const I=L(t({__name:"index",setup(t){const L=e();a(null);const I=s([{name:"推荐",type:"recom",types:"tab"},{name:"最新",type:"new",types:"tab"},{name:"热榜",type:"hot",types:"tab"}]);let B=s({phone:"",verificationCode:""});const C=i((()=>L.state.app.userInfo)),$=s([{type:1,icon:"icon-sousuo",types:"icon"},{type:2,icon:"icon-gengduo1",types:"icon"}]);o((()=>{B.phone=C.value.phone}));const k=a(!1);n((()=>{A(),H()}));const q=s([{name:"阅读记录",id:"history",icon:"icon-shequ-yuedujilu"},{name:"我的收藏",id:"collect",icon:"icon-shequ-shoucang"}]),z=s({barList:[],listData:[],where:{label_id:"",limit:15,name:"",page:1,sort:"recom"},newIsShowMax:3,hotData:[],moreButton:!1}),A=()=>{x({types:1}).then((t=>{z.barList=t.data.list||[],z.barList.length>0&&z.barList.unshift({id:"",title:"全部"})})).catch((t=>{r.error(t.message)}))};a(null),a(!0);const F=a(!1),H=(t=!1)=>{D(z.where).then((e=>{z.hotData=e.data.hot,t&&(z.listData=[]),z.listData.push(...e.data.list);const a=Math.ceil(e.data.count/z.where.limit);z.listData.length<=0||z.where.page>=a?F.value=!1:F.value=!0,p()}))};l((()=>{F.value&&(z.where.page++,H())})),d((()=>{z.where.page=1,F.value=!1,z.listData=[],H()}));const J=t=>{t?(z.where.label_id=t.id,z.where.page=1,H(!0)):A()},M=a(null),N=t=>{"tab"===t.types?(z.where.sort=t.type,z.where.page=1,H(!0)):1===t.type?y(`/pages/forum/search?type=${z.where.sort}`):M.value.openDropdown()},Q=t=>{y(`/pages/forum/history?type=${t.id}`)};return(t,e)=>{const a=f;return u(),_(a,null,{default:m((()=>[c(a,{class:"cr-position-header"},{default:m((()=>[c(a,{class:"status_bar"}),c(h(j),{"is-left":!1,"default-type":1,"tab-data":h(I),"is-right":!0,"right-data":h($),onHandleNarItem:N},null,8,["tab-data","right-data"]),c(a,{class:"forum-line-style"},{default:m((()=>[c(h(b),{ref:"navigationBarRef",isActiveLine:!1,isFirstlogin:h(k),"props-data":{name:"title"},isSidebar:!0,"bar-data":h(z).barList,onHandleData:J},null,8,["isFirstlogin","bar-data"])])),_:1})])),_:1}),c(a,{class:"content"},{default:m((()=>[c(h(v),{"list-data":h(z).listData,"hot-data":h(z).hotData,"empty-title":"暂无文章~"},null,8,["list-data","hot-data"])])),_:1}),c(h(w),{ref_key:"dropDownRef",ref:M,"list-data":h(q),onBtnClick:Q},null,8,["list-data"]),c(g)])),_:1})}}}),[["__scopeId","data-v-72e74d0e"]]);export{I as default};
