import{d as c,ah as u,ag as d,r as f,$ as m,c as s,aj as h,ak as S,al as g,m as C,g as o}from"./index.28bb778f.js";import{O as y}from"./index.8323fc08.js";import{O as k}from"./index.82695db9.js";import{s as r}from"./index.module.2e3d103e.js";import{L as w}from"./index.4ac17938.js";import{C as O}from"./index.49de14a4.js";import"./index.5332ff88.js";import"./use-tab-status.c9f6a196.js";function b(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!g(i)}var V=c({name:"help-center",setup(){const i=u(),n=d(),t=f({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,status:!0,page:1,rows:20}}),l=async()=>{try{if(t.isClick)return;t.isClick=!0;const a=await C.post(o.platformApi+"/helpCenterContent/page",{data:{...t.params,catalogType:o.platformType}});t.listState.loading=!1;const e=a.data||{};if(t.list.length>0&&e.current===1)return;t.list=t.list.concat(e.rows||[]),t.listState.finished=e.current>=e.pages,t.params.page=e.current+1,t.listState.dataShow=t.list.length>0,t.isClick=!1}catch{t.listState.dataShow=!1,t.listState.finished=!0,t.isClick=!1}},p=a=>{t.params.keyword=a,t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,l()};return m(()=>{l()}),()=>{let a;return s("div",{class:[r.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(k,{position:"top"},{default:()=>[s(h,{border:!1},null),s(y,{onSearch:p},null)]}),t.listState.dataShow?s(w,{finished:t.listState.finished,finishedText:" ",class:r.container,onLoad:l,immediateCheck:!1},b(a=t.list.map(e=>s(O,{titleClass:[r.title,"van-ellipsis"],title:e.title,isLink:!0,onClick:()=>{n.push({path:"help-detail",query:{id:e.id,source:i.query.source}})}},null)))?a:{default:()=>[a]}):s(S,{btnStatus:!1,tips:"\u6682\u65E0\u6570\u636E"},null)])}}});export{V as default};
