index.4d9ba3a0.js 1.8 KB

1
  1. import{d as c,aV as u,ag as f,r as d,$ as m,c as s,ai as h,ak as S,m as C,f as r}from"./index.ffe80dbe.js";import{O as g}from"./index.c7af3af2.js";import{O as y}from"./index.4ddd16f0.js";import{s as o}from"./index.module.76d9b610.js";import{L as k}from"./index.cafcb8b5.js";import{C as w}from"./index.ea031708.js";import"./index.92ec0bf4.js";import"./use-tab-status.5a3cd090.js";function O(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!S(i)}var V=c({name:"help-center",setup(){const i=u(),n=f(),t=d({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(r.platformApi+"/helpCenterContent/page",{data:{...t.params,catalogType:r.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:[o.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(y,{position:"top"},{default:()=>[s(g,{onSearch:p},null)]}),t.listState.dataShow?s(k,{finished:t.listState.finished,finishedText:" ",class:o.container,onLoad:l,immediateCheck:!1},O(a=t.list.map(e=>s(w,{titleClass:[o.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(h,{btnStatus:!1,tips:"\u6682\u65E0\u6570\u636E"},null)])}}});export{V as default};