import{d as a,u as e,a as t,Q as s,e as r,a9 as i,x as o,r as n,aa as l,f as u,g as p,o as d,h as m,w as h,i as _,N as c,B as f,_ as b,K as g,z as w}from"./index-WeUkftbp.js";import{_ as j}from"./uni-search-bar.BHGf4P5g.js";import{n as y}from"./index.Vw7NoxQA.js";import{f as v}from"./forumList.Cf2rusgi.js";import{e as x,a as D}from"./forum.BGXd3LTG.js";import{u as L}from"./useVerifyCode.Bm9sm4v1.js";import{_ as C}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  */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-list.D2b1m_I0.js";import"./uni-badge.CLrZv6EZ.js";import"./index.D8Jasx-l.js";/* empty css                                                              */import"./share-bg.DLa-IrMH.js";const F=C(a({__name:"search",setup(a){e((a=>({e71d91a6:t(C)})));const{height:C,getBarHeight:F}=L(),V=f();s((()=>{F(".cr-position-header",V),I()}));const B=r({barList:[],listData:[],where:{label_id:"",limit:10,name:"",page:1,sort:"recom"},newIsShowMax:3,hotData:[],typeData:["recom","new","hot"]});i((a=>{a.type&&(B.where.sort=a.type)}));const z=()=>{B.where.name="",B.listData=[]},A=()=>{b()},H=()=>{B.where.name?N(!0):z()},I=()=>{x().then((a=>{B.barList=a.data.list||[],B.barList.length>0&&B.barList.unshift({id:"",title:"全部"})})).catch((a=>{o.error(a.message)}))},M=n(!1),N=(a=!1)=>{D(B.where).then((e=>{B.hotData=e.data.hot,a&&(B.listData=[]),B.listData.push(...e.data.list);const t=Math.ceil(e.data.count/B.where.limit);B.listData.length<=0||B.where.page>=t?M.value=!1:M.value=!0,g()})).catch((a=>{o.error(a.message)}))};l((()=>{M.value&&(B.where.page++,N())}));const Q=a=>{a?(B.where.label_id=a.id,B.where.page=1,B.where.name&&N(!0)):I()};return(a,e)=>{const s=w,r=u(p("uni-search-bar"),j);return d(),m(s,null,{default:h((()=>[_(s,{class:"cr-position-header"},{default:h((()=>[_(s,{class:"status_bar"}),_(s,{class:"default-search"},{default:h((()=>[_(r,{onConfirm:H,onFocus:H,focus:!0,bgColor:"#F0F1F5",modelValue:t(B).where.name,"onUpdate:modelValue":e[0]||(e[0]=a=>t(B).where.name=a),onClear:z,onCancel:A},null,8,["modelValue"])])),_:1}),t(B).typeData.includes(t(B).where.sort)?(d(),m(s,{key:0,class:"forum-line-style"},{default:h((()=>[_(t(y),{ref:"navigationBarRef","props-data":{name:"title"},isActiveLine:!1,isSidebar:!0,"bar-data":t(B).barList,onHandleData:Q},null,8,["bar-data"])])),_:1})):c("",!0)])),_:1}),_(s,{class:"content"},{default:h((()=>[_(t(v),{"list-data":t(B).listData,"hot-data":t(B).hotData,"empty-title":"暂无搜索结果~"},null,8,["list-data","hot-data"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-0bc7109d"]]);export{F as default};
