index-97823541.js 2.3 KB

1
  1. import{d as u,P as p,q as d,x as f,y as m,a as s,V as S,F as h,a7 as y,a2 as g,a3 as C,D as k}from"./index-869d77fb.js";import{M as w}from"./index-d315d9dc.js";import{M as T}from"./index-3eb77ad0.js";import{s as i}from"./index.module-caa3742e.js";import{L as v}from"./index-f12c44b8.js";import{C as M}from"./index-1c6c2ec0.js";import"./index-0153d173.js";import"./index-155c29c2.js";import"./use-tab-status-0ed30c24.js";function b(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!C(l)}const E=u({name:"help-center",setup(){const l=p(),r=d(),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{E as default};