You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
1.9 KiB
JavaScript

import{r as s,o as a,c as t,w as e,s as p,P as l,$ as r,i as _,a as o,u as c,b as u,g as n,h as d,j as i,F as f,d as w,k,t as m,n as y}from"./index-adccf756.js";import{_ as b,o as g}from"./uni-app.es.ee0b6c0a.js";const h=b({__name:"posts",props:{type:{type:String,default:"1"},hospital:{type:String,default:"0"}},setup(b){const h=b,v=s([]);return g((()=>{(()=>{let s="新闻列表";switch(h.type){case 1:s="健康宣传";break;case 2:s="常见问题"}p({title:s})})(),(async()=>{const s=await l({...h});r(s,(()=>{v.value=s.data.list}))})()})),(s,p)=>{const l=w,r=_;return a(),t(r,null,{default:e((()=>[v.value.length?n("",!0):(a(),t(r,{key:0,class:"no_post_wrapper"},{default:e((()=>[o(l,{src:c(k)("/storage/assets/h5/posts/暂无文章.png")},null,8,["src"]),o(r,null,{default:e((()=>[u("暂无文章")])),_:1})])),_:1})),o(r,{class:"top_line_wrapper"}),o(r,{class:"posts_wrapper"},{default:e((()=>[(a(!0),d(f,null,i(v.value,((s,p)=>(a(),t(r,{onClick:a=>{y({url:`/pages/main/post/post?id=${s.id}`})},class:"post_item_wrapper"},{default:e((()=>[o(r,{class:"post_title_wrapper"},{default:e((()=>[u(m(s.title),1)])),_:2},1024),1===Number(h.type)?(a(),t(r,{key:0,class:"post_content_wrapper"},{default:e((()=>[o(r,{class:"post_cover_wrapper"},{default:e((()=>[o(l,{src:c(k)(s.cover)},null,8,["src"])])),_:2},1024),o(r,{class:"post_text_wrapper"},{default:e((()=>[o(r,{class:"post_text_line_wrapper"},{default:e((()=>[o(r,{class:"post_author_wrapper"},{default:e((()=>[u(m(s.author),1)])),_:2},1024),o(r,{class:"post_break_wrapper"}),o(r,{class:"post_date_wrapper"},{default:e((()=>[u(m(s.date),1)])),_:2},1024)])),_:2},1024),o(r,{class:"post_text_content_wrapper"},{default:e((()=>[u(m(s.desc),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)):n("",!0),o(r,{class:"post_break_line_wrapper"})])),_:2},1032,["onClick"])))),256))])),_:1}),o(r,{class:"blank_wrapper"})])),_:1})}}},[["__scopeId","data-v-618fe0db"]]);export{h as default};