import{d as a,z as e,W as s,o as t,c as l,w as r,h as u,b as c,l as i,t as d,k as o,n as m,y as n,r as f,a as p}from"./index.2197fbbc.js";import{_ as x}from"./u-parse.1667d736.js";import{_}from"./u-icon.da63fc7c.js";import{_ as v}from"./icon_visit.9ad00ab7.js";import{b as w,c as h,d as b}from"./news.b689fff2.js";import{_ as y}from"./plugin-vue_export-helper.21dcd24c.js";var j=y(a({__name:"news_detail",setup(a){const y=e({});let j="";const k=async a=>{y.value=await w({id:a})};return s((a=>{j=a.id,k(j)})),(a,e)=>{const s=o,w=m,g=n,I=f(p("u-parse"),x),z=f(p("u-icon"),_);return t(),l(s,{class:"news-detail bg-white"},{default:r((()=>[u(" 标题信心 "),c(s,{class:"news-detail-header py-[20rpx] px-[30rpx]"},{default:r((()=>[c(s,{class:"text-3xl font-medium"},{default:r((()=>[i(d(y.value.title),1)])),_:1}),c(s,{class:"flex mt-[20rpx] text-xs"},{default:r((()=>[y.value.author?(t(),l(s,{key:0,class:"mr-[40rpx]"},{default:r((()=>[i("作者: "+d(y.value.author),1)])),_:1})):u("v-if",!0),c(s,{class:"text-muted mr-[40rpx] flex-1"},{default:r((()=>[i(d(y.value.createTime),1)])),_:1}),c(s,{class:"flex items-center text-muted flex-none"},{default:r((()=>[c(w,{src:v,class:"w-[30rpx] h-[30rpx]"}),c(s,{class:"ml-[10rpx]"},{default:r((()=>[i(d(y.value.visit),1)])),_:1})])),_:1})])),_:1})])),_:1}),u(" 咨询内容 "),c(s,{class:"news-detail-section bg-white p-[24rpx]"},{default:r((()=>[u(" 摘要 "),y.value.summary?(t(),l(s,{key:0,class:"summary p-[20rpx] text-base"},{default:r((()=>[c(g,{class:"font-medium"},{default:r((()=>[i("摘要: ")])),_:1}),i(" "+d(y.value.summary),1)])),_:1})):u("v-if",!0),u(" 内容 "),c(s,{class:"mt-[20rpx]"},{default:r((()=>[c(I,{html:y.value.content},null,8,["html"])])),_:1})])),_:1}),c(s,{class:"panel-btn flex items-center px-[34rpx]",onClick:e[0]||(e[0]=a=>(async a=>{try{y.value.collect?(await h({articleId:a}),uni.$u.toast("已取消收藏")):(await b({articleId:a}),uni.$u.toast("收藏成功")),k(j)}catch(e){}})(y.value.id))},{default:r((()=>[c(z,{name:y.value.collect?"star-fill":"star",size:"40",color:y.value.collect?"#F7BA47":"#333"},null,8,["name","color"]),c(g,{class:"ml-[10rpx]"},{default:r((()=>[i("收藏")])),_:1})])),_:1})])),_:1})}}}),[["__scopeId","data-v-3a16a61e"]]);export{j as default};
