Files
anmo/server/public/coach/assets/page-meta.142863c8.js
2025-08-21 16:38:20 +08:00

2 lines
1.8 KiB
JavaScript

import{$ as t,be as e,_ as o,bf as s,E as r,b5 as a,o as l,c as i,w as n,R as u,i as p}from"./index-8146d74e.js";import{_ as c}from"./_plugin-vue_export-helper.1b428a4d.js";const d=c({name:"PageMeta",setup(o,{emit:s}){t(()=>{e(t=>{s("resize",t)})})},props:{backgroundTextStyle:{type:String,default:"dark",validator:t=>-1!==["dark","light"].indexOf(t)},backgroundColor:{type:String,default:"#ffffff"},backgroundColorTop:{type:String,default:"#ffffff"},backgroundColorBottom:{type:String,default:"#ffffff"},scrollTop:{type:String,default:""},scrollDuration:{type:Number,default:300},pageStyle:{type:String,default:""},enablePullDownRefresh:{type:[Boolean,String],default:!1},rootFontSize:{type:String,default:""}},created(){const t=o()[0];this.$pageVm=t.$vm||t,this.$watch("backgroundTextStyle",()=>{this.setBackgroundTextStyle()}),this.$watch(()=>[this.rootFontSize,this.pageStyle],()=>{this.setPageMeta()}),this.$watch(()=>[this.backgroundColor,this.backgroundColorTop,this.backgroundColorBottom],()=>{this.setBackgroundColor()}),this.$watch(()=>[this.scrollTop,this.scrollDuration],()=>{this.pageScrollTo()})},beforeMount(){this.setBackgroundColor(),(this.rootFontSize||this.pageStyle)&&this.setPageMeta(),this.backgroundTextStyle&&this.setBackgroundTextStyle()},mounted(){this.scrollTop&&this.pageScrollTo()},methods:{setPullDownRefresh(t,e){t.setStyle({pullToRefresh:{support:e,style:"Android"===plus.os.name?"circle":"default"}})},setPageMeta(){s({pageStyle:this.pageStyle,rootFontSize:this.rootFontSize})},setBackgroundTextStyle(){},setBackgroundColor(){},pageScrollTo(){let t=String(this.scrollTop);-1!==t.indexOf("rpx")&&(t=r(t.replace("rpx",""))),t=parseFloat(t),isNaN(t)||a({scrollTop:t,duration:this.scrollDuration,success:()=>{}})}}},[["render",function(t,e,o,s,r,a){const c=p;return l(),i(c,{style:{display:"none"}},{default:n(()=>[u(t.$slots,"default")]),_:3})}]]);export{d as _};