import{d as p,U as d,q as u,x as f,y as m,a as s,S,F as h,a4 as y,a0 as g,a1 as C,D as k}from"./index-5a763f46.js";import{M as w}from"./index-d6ed1881.js";import{M as T}from"./index-cb91d786.js";import{s as i}from"./index.module-caa3742e.js";import{L as v}from"./index-0bc239b6.js";import{C as M}from"./index-18ed1ff2.js";import"./index-89035dfd.js";import"./index-689e945e.js";import"./use-tab-status-d36fb07d.js";function b(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!C(l)}const q=p({name:"help-center",setup(){const l=d(),r=u(),t=f({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 k.post("/edu-app/open/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()},c=a=>{a.linkType==="OUT"?window.location.href=a.linkUrl:r.push({path:"/information-detail",query:{id:a.id}})};return m(()=>{o()}),()=>{let a;return s("div",{class:[i.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(T,{position:"top"},{default:()=>[s(S,{border:!1,isBack:l.query.platformType!="ANALYSIS"},null),s(w,{onSearch:n},null)]}),t.listState.dataShow?s(v,{finished:t.listState.finished,finishedText:" ",class:[i.container,i.containerInformation],onLoad:o,immediateCheck:!1},b(a=t.list.map(e=>s(M,{class:i.cell,onClick:()=>c(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(h,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?y(e.createTime).format("YYYY年MM月DD日"):""])])})))?a:{default:()=>[a]}):s(g,{description:"暂无数据"},null)])}}});export{q as default};
