import{_ as M,ac as T,c as r,w as t,f as D,C as v,E as h,o as l,k as s,j as N,i as y,p as u,t as _,q as E,L,M as I,N as w,l as S}from"./index-CZJgrp0v.js";import{_ as F}from"./uv-tags.Iqd2Do9l.js";import{_ as B}from"./uv-button.DwAMxj01.js";const H={name:"eventStyleDetail",components:{},props:{info:{type:Object,default:()=>{}},showLive:{type:Boolean,default:!1}},watch:{info:{handler(n,e){n&&(this.detailInfo=n)},deep:!0}},data(){return{detailInfo:{}}},onLoad(){window.addEventListener("message",this.onMessageFromParent),window.parent.postMessage({type:"H5_READY"},"*")},mounted(){},methods:{onMessageFromParent(n){let e=n.data||"{}";try{typeof e!="string"&&(e=JSON.stringify(e));let{data:a,moduleType:d,subModuleType:o}=JSON.parse(e||"{}");console.log({data:a,moduleType:d,subModuleType:o}),d=="CHARM_LIST"&&o=="formData"&&(console.log("666"),a.tagsList=a.tags,a.imagesList=JSON.parse(a.images||"[]"),this.detailInfo=a)}catch(a){console.error("onMessageFromParent",a)}},previewImage(n){T({urls:this.detailInfo.imagesList.map(e=>e.url),current:this.detailInfo.imagesList[n].url})},handleSortData(n){n.forEach(e=>{e.tagList=e.tagList.split(",")})},goToLive(){console.log("跳转到直播页面"),window.open(this.detailInfo.liveUrl)}}};function O(n,e,a,d,o,f){const i=N,p=E,x=v(h("uv-tags"),F),k=S,b=v(h("uv-button"),B),C=D("layout-default-uni");return l(),r(C,null,{default:t(()=>[s(i,{class:"page-main-container"},{default:t(()=>[s(i,{class:"detail-content"},{default:t(()=>{var g;return[s(i,{class:"detail-title"},{default:t(()=>[u(_(o.detailInfo.title),1)]),_:1}),s(i,{class:"info-bar"},{default:t(()=>[s(p,{class:"organization"},{default:t(()=>[u(_(o.detailInfo.eventName),1)]),_:1}),s(p,{class:"publish-time"},{default:t(()=>[u(_(o.detailInfo.createTime),1)]),_:1})]),_:1}),(g=o.detailInfo.tagsList)!=null&&g.length?(l(),r(i,{key:0,class:"tags-container"},{default:t(()=>[(l(!0),L(I,null,w(o.detailInfo.tagsList,(m,c)=>(l(),r(x,{key:c,text:m,plain:"",style:{"margin-right":"16rpx","margin-bottom":"16rpx",height:"40rpx"}},null,8,["text"]))),128))]),_:1})):y("",!0),s(i,{class:"rich-content",innerHTML:o.detailInfo.description},null,8,["innerHTML"]),s(i,{class:"image-container"},{default:t(()=>[(l(!0),L(I,null,w(o.detailInfo.imagesList,(m,c)=>(l(),r(k,{key:c+"IMAGE",src:m.url,class:"detail-image",mode:"widthFix",onClick:P=>f.previewImage(c)},null,8,["src","onClick"]))),128))]),_:1})]}),_:1}),a.showLive?(l(),r(i,{key:0,class:"bottom-button-container"},{default:t(()=>[s(b,{type:"primary",onClick:f.goToLive,class:"live-button"},{default:t(()=>[u("看直播")]),_:1},8,["onClick"])]),_:1})):y("",!0)]),_:1})]),_:1})}const j=M(H,[["render",O],["__scopeId","data-v-33acee94"]]);export{j as default};
