import{d as c,q as d,x as p,y as f,a as s,S as u,F as m,a5 as S,a0 as h,a1 as g,D as y}from"./index-29f55498.js";import{M as C}from"./index-dbef2af4.js";import{M as k}from"./index-f6e6ee6a.js";import{s as i}from"./index.module-caa3742e.js";import{L as w}from"./index-55320892.js";import{C as v}from"./index-8abd9667.js";import"./index-c5366225.js";import"./use-tab-status-e31191a4.js";function T(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!g(l)}const N=c({name:"help-center",setup(){const l=d(),t=p({isClick:!1,list:[],listState:{dataShow:!0,loading:!1,finished:!1},params:{keyword:null,status:!0,type:"HOT_CONSULTATION",page:1,rows:20}}),o=async()=>{try{if(t.isClick)return;t.isClick=!0;const a=await y.post("/edu-app/helpCenterContent/page",{data:{...t.params,catalogType:"STUDENT"}});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(a){t.listState.dataShow=!1,t.listState.finished=!0,t.isClick=!1}},n=a=>{t.params.keyword=a,t.params.page=1,t.list=[],t.listState.dataShow=!0,t.listState.loading=!1,t.listState.finished=!1,o()},r=a=>{a.linkType==="OUT"?window.location.href=a.linkUrl:l.push({path:"/information-detail",query:{id:a.id}})};return f(()=>{o()}),()=>{let a;return s("div",{class:[i.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(k,{position:"top"},{default:()=>[s(u,{border:!1},null),s(C,{onSearch:n},null)]}),t.listState.dataShow?s(w,{finished:t.listState.finished,finishedText:" ",class:[i.container,i.containerInformation],onLoad:o,immediateCheck:!1},T(a=t.list.map(e=>s(v,{class:i.cell,onClick:()=>r(e),titleStyle:{display:"flex",flexDirection:"column",justifyContent:"space-between"}},{icon:()=>s("div",{class:[i.img,i.bgImg],style:e.coverImage?{backgroundImage:`url(${e.coverImage})`,backgroundSize:"cover"}:""},null),title:()=>s(m,null,[s("div",{class:[i.title,"van-ellipsis"]},[e.title]),s("div",{class:[i.content,"van-multi-ellipsis--l2"]},[e.summary]),s("div",{class:i.time},[e.createTime?S(e.createTime).format("YYYY年MM月DD日"):""])])})))?a:{default:()=>[a]}):s(h,{description:"暂无数据"},null)])}}});export{N as default};
