index.1c4d98bd.js 2.2 KB

1
  1. import{d as f,ag as p,r as d,$ as m,c as s,F as u,ah as S,ai as h,ak as y,m as g,f as r}from"./index.ffe80dbe.js";import{O as w}from"./index.c7af3af2.js";import{O as C}from"./index.4ddd16f0.js";import{s as i}from"./index.module.76d9b610.js";import{L as k}from"./index.cafcb8b5.js";import{C as O}from"./index.ea031708.js";import{I as v}from"./index.7e972106.js";import"./index.92ec0bf4.js";import"./use-tab-status.5a3cd090.js";function T(l){return typeof l=="function"||Object.prototype.toString.call(l)==="[object Object]"&&!y(l)}var A=f({name:"help-center",setup(){const l=p(),t=d({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 g.post(r.platformApi+"/sysNewsInformation/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}},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:l.push({path:"/information-detail",query:{id:a.id}})};return m(()=>{o()}),()=>{let a;return s("div",{class:[i.helpCenter,!t.listState.dataShow&&"emptyRootContainer"]},[s(C,{position:"top"},{default:()=>[s(w,{onSearch:n},null)]}),t.listState.dataShow?s(k,{finished:t.listState.finished,finishedText:" ",class:[i.container,i.containerInformation],onLoad:o,immediateCheck:!1},T(a=t.list.map(e=>s(O,{class:i.cell,onClick:()=>c(e),titleStyle:{display:"flex",flexDirection:"column",justifyContent:"space-between"}},{icon:()=>s(v,{src:e.coverImage,class:i.img,fit:"cover"},null),title:()=>s(u,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\u5E74MM\u6708DD\u65E5"):""])])})))?a:{default:()=>[a]}):s(h,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u6570\u636E"},null)])}}});export{A as default};