import{d as t,b as e,r as a,a9 as s,e as o,x as l,f as n,g as i,o as u,h as c,w as d,i as r,a as f,N as p,j as _,t as m,A as g,y as h,z as y}from"./index-Cg3FU-dV.js";import{_ as b,a as j}from"./uni-row.DfI4R5V8.js";import{_ as v}from"./uni-dateformat.D7mTxFoD.js";import{l as x}from"./loginPop.CPL0ODAr.js";import{g as k}from"./index.vG6WzeDr.js";import{b as L,c as C,d as w}from"./forum.BiZN6Umy.js";import{_ as T}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-easyinput.Cm5bRP31.js";import"./uni-icons.D_sy4NxH.js";/* empty css                                                                  *//* empty css                                                                      */import"./uni-forms.DHQIQZAE.js";import"./uni-forms.vue_vue_type_style_index_0_scoped_a2a9907e_lang.DijPs27m.js";import"./uni-popup.B818XS1j.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.D0ze9A39.js";import"./useVerifyCode.CrYQp_Od.js";const q=T(t({__name:"default",setup(t){const T=e(),q=a(null);s((t=>{t.id&&M(t.id)}));const D=o({default:{},newIsShowMax:3,hotData:[],content:"",isLoading:!1}),M=t=>{L(t).then((t=>{D.default=t.data||{},t.data.content&&(D.content=t.data.content.replace(/<img/gi,'<img style="max-width:100%;height:auto" ')),D.hotData=t.data.hot,D.isLoading=!0})).catch((t=>{l.error(t.message)}))};return(t,e)=>{const a=h,s=y,o=n(i("uni-col"),b),L=n(i("uni-dateformat"),v),z=n(i("uni-row"),j);return u(),c(s,null,{default:d((()=>[r(s,{class:"default plr10"},{default:d((()=>[r(s,{class:"title"},{default:d((()=>[f(D).isLoading&&f(D).hotData.includes(f(D).default.id)?(u(),c(a,{key:0,class:"iconfont icon-rebang default-error"})):p("",!0),_(m(f(D).default.title),1)])),_:1}),r(z,{class:"caption display-align"},{default:d((()=>[r(o,{span:15,class:"caption-left"},{default:d((()=>[r(s,{class:"bottom display-align"},{default:d((()=>[r(s,{class:"bottom-left line1"},{default:d((()=>[_(m(f(D).default.author),1)])),_:1}),r(s,{class:"bottom-right line1"},{default:d((()=>[_(m(0===f(D).default.types?"原创 ":"转载 ")+" "+m(f(D).default.visit)+"浏览 ",1)])),_:1})])),_:1})])),_:1}),r(o,{span:9,class:"text-right"},{default:d((()=>[r(L,{format:"yyyy/MM/dd hh:mm",date:f(D).default.created_at},null,8,["date"])])),_:1})])),_:1}),r(s,{class:"content"},{default:d((()=>[r(s,{innerHTML:f(D).content},null,8,["innerHTML"])])),_:1}),f(D).isLoading?(u(),c(s,{key:0,class:"forum-button plr10"},{default:d((()=>[r(s,{class:"forum-button-con"},{default:d((()=>[r(s,{class:"forum-button-item"},{default:d((()=>[r(s,{class:g(1===f(D).default.is_support?"default-error":""),onClick:e[0]||(e[0]=t=>(t=>{if(T.state.app.forumToken){const e={id:t.id,status:0===t.is_support?1:0};w(e).then((()=>{0===t.is_support?l.success("点赞成功"):l.success("取消点赞"),M(t.id)})).catch((t=>{l.error(t.message)}))}else q.value.inputDialogToggle()})(f(D).default))},{default:d((()=>[r(a,{class:g(["iconfont",1===f(D).default.is_support?"icon-shequ-dianzan-yidian":"icon-shequ-dianzan"])},null,8,["class"]),r(a,null,{default:d((()=>[_(m(f(D).default.support),1)])),_:1})])),_:1},8,["class"])])),_:1}),r(s,{class:"forum-button-item"},{default:d((()=>[r(s,{class:g(1===f(D).default.is_collect?"default-warning":""),onClick:e[1]||(e[1]=t=>(t=>{if(T.state.app.forumToken){const e={id:t.id,status:0===t.is_collect?1:0};C(e).then((()=>{0===t.is_collect?l.success("收藏成功"):l.success("取消收藏"),M(t.id)})).catch((t=>{l.error(t.message)}))}else q.value.inputDialogToggle()})(f(D).default))},{default:d((()=>[r(a,{class:g(["iconfont",1===f(D).default.is_collect?"icon-shequ-shoucang-yishoucang":"icon-shequ-shoucang1"])},null,8,["class"]),r(a,null,{default:d((()=>[_(m(f(D).default.collect),1)])),_:1})])),_:1},8,["class"])])),_:1}),r(s,{class:"forum-button-item",onClick:e[2]||(e[2]=t=>(t=>{l.error("分享制作中");const e=document.createElement("input");let a="";a=`https://tuoluojiang.com/mobile/detail/${t.id}`,e.value=a,document.body.appendChild(e),e.select(),document.execCommand("Copy"),e.style.display="none",document.body.removeChild(e),l.success("复制分享链接成功，请前去粘贴使用")})(f(D).default))},{default:d((()=>[r(s,null,{default:d((()=>[r(a,{class:"iconfont icon-shequ-fenxiang1"})])),_:1})])),_:1})])),_:1})])),_:1})):p("",!0)])),_:1}),r(k),r(f(x),{ref_key:"loginRef",ref:q,onLoginOk:t.loginOk},null,8,["onLoginOk"])])),_:1})}}}),[["__scopeId","data-v-401589fb"]]);export{q as default};
