2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
|
import{d as a,r as e,u as l,a as t,c as o,o as r,b as s,s as i,e as p,g as d,f as u,h as g,i as n,w as m,j as f,k as v,v as c,l as b,m as h,n as _,p as x,q as j,t as y,x as S}from"./index-849cf30e.js";import{_ as w}from"./u-loading-page.195e23a4.js";import{_ as k,a as M}from"./index.69a24174.js";import{u as C}from"./useShare.5c07111a.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-loading-icon.d012ecbf.js";import"./u-transition.75065529.js";import"./u-icon.e3aa4770.js";import"./u-image.5cc88b24.js";import"./app-link.vue_vue_type_script_setup_true_lang.d62f9cf3.js";import"./u-avatar.2111318d.js";import"./u-tabbar.9997804a.js";import"./u-safe-bottom.2f6af56c.js";import"./wechat.b5eac334.js";const R=D(a({__name:"diy",setup(a){const{setShare:D,onShareAppMessage:R,onShareTimeline:B}=C();R(),B();const U=e(!0),I=l(),J=e(0),N=t({pageMode:"diy",title:"",global:{},value:[]}),O=o((()=>"decorate"==I.mode?I:N)),T=e(0),q=e("");return r((a=>{I.mode=a.mode||"","decorate"==I.mode&&(U.value=!1),T.value=a.id||"",q.value=a.name||""})),s((()=>{J.value++,i()})),p((()=>{"decorate"==I.mode?I.init():d({id:T.value,name:q.value}).then((a=>{if(a.data.value){let e=a.data;N.pageMode=e.mode,N.title=e.title;let l=JSON.parse(e.value);N.global=l.global,N.value=l.value,N.value.forEach(((a,e)=>{a.pageStyle="",a.pageBgColor&&(a.pageStyle+="background-color:"+a.pageBgColor+";"),a.margin&&(a.pageStyle+="padding-top:"+2*a.margin.top+"rpx;",a.pageStyle+="padding-bottom:"+2*a.margin.bottom+"rpx;",a.pageStyle+="padding-right:"+2*a.margin.both+"rpx;",a.pageStyle+="padding-left:"+2*a.margin.both+"rpx;")})),u({title:N.title})}let e=a.data.share?JSON.parse(a.data.share):null;D(e),U.value=!1}))})),(a,e)=>{const l=x(j("u-loading-page"),w),t=x(j("diy-group"),k),o=y,r=x(j("fixed-group"),M);return g(),n(o,null,{default:m((()=>[f(l,{loading:U.value,loadingText:"","bg-color":"#f7f7f7"},null,8,["loading"]),v(f(o,null,{default:m((()=>[b(" 自定义模板渲染 "),"fixed"!=h(O).pageMode?(g(),n(o,{key:0,class:"diy-template-wrap bg-index",style:_({backgroundColor:h(O).global.pageBgColor,minHeight:"calc(100vh - 50px)",backgroundImage:h(O).global.bgUrl?"url("+h(S)(h(O).global.bgUrl)+")":""})},{default:m((()=>[f(t,{data:h(O),pullDownRefresh:J.value},null,8,["data","pullDownRefresh"])])),_:1},8,["style"])):b("v-if",!0),b(" 固定模板渲染 "),"fixed"==h(O).pageMode?(g(),n(o,{key:1,class:"fixed-template-wrap"},{default:m((()=>[f(r,{data:h(O),pullDownRefresh:J.value},null,8,["data","pullDownRefresh"])])),_:1})):b("v-if",!0)])),_:1},512),[[c,!U.value]])])),_:1})}}}),[["__scopeId","data-v-2c9362cd"]]);export{R as default};
|