Files

2 lines
3.4 KiB
JavaScript

import{t as e,a as t,x as a,as as s,O as r,o,j as l,w as n,h as i,y as h,i as u,a0 as d,z as c,u as g,aY as p,B as f,G as y,H as m}from"./index-90c12cc1.js";import{_ as w}from"./uv-icon.c815b875.js";import{b as B}from"./utils.80a0ac72.js";import{_ as x}from"./_plugin-vue_export-helper.1b428a4d.js";const b=x({__name:"index",props:{scrollTop:{type:Number,default:()=>0},systemBarAreaBg:{type:String,default:()=>"#FFFFFF00"},headerAreaBg:{type:String,default:()=>"#FFFFFF00"},headerAreaTextColor:{type:String,default:()=>"#000000"},showReturn:{type:Boolean,default:()=>!0},returnColor:{type:String,default:()=>"#000"},returnSize:{type:Number,default:()=>22},textShadow:{type:[Boolean,String],default:()=>!1},bgChangeByScroll:{type:Boolean,default:()=>!0},bgChangeColor:{type:String,default:()=>"#fff"},propUp:{type:Boolean,default:()=>!0},showRight:{type:Boolean,default:()=>!0},leftWidth:{type:Number,default:()=>0}},emits:["getSystemInfo","animation"],setup(x,{expose:b,emit:v}){const S=x,{goBack:_}=g(),{systemBarAreaBg:C,headerAreaBg:F,headerAreaTextColor:H,showReturn:k,returnColor:A,returnSize:I,textShadow:W,bgChangeByScroll:$,bgChangeColor:j,propUp:z,showRight:T,leftWidth:R,scrollTop:N}=e(S),Y=t({safeAreaInsets:{bottom:0,top:0,left:0,right:0},statusBarHeight:0,screenWidth:0,screenHeight:0});const U=t({bottom:0,height:0,left:0,right:0,top:0,width:0}),X=a((()=>({"--header-height":"60px"}))),G=a((()=>({width:"100%",height:2*u(Y).statusBarHeight+"rpx",background:u(C)}))),O=a((()=>{const e=u(U).height>0?`-${(60-u(U).height)/2}px`:0;return{width:"100%",background:u(F),color:u(H),marginTop:e}})),q=a((()=>({textShadow:u(W)?u(W):"none"}))),D=a((()=>({width:u(R)<=0?"":`calc( 100vw - var(--side-distance) - var(--side-distance) - ${R.value}rpx )`,left:u(R)<=0?"50%":`calc( var(--side-distance) + ${R.value}rpx )`,textShadow:u(W)?u(W):"none",transform:u(R)<=0?"translateX(-50%) translateY(-50%)":"translateX(0) translateY(-50%)"}))),E=a((()=>({background:u(j),opacity:u(L)}))),J=a((()=>{const e=u(U).height>0?""+(60-u(U).height)/2:0;return u(Y).statusBarHeight+60-e}));let K;const L=t(0);function M(){const e=Y.value.safeAreaInsets.bottom+60+100;K=B(0,e,0,1)}return s(N,(()=>{$.value&&(K||M(),L.value=K(u(N)),v("animation",L.value))})),b({containerHeight:J,heightInfo:Y}),r((()=>{!function(){const e=p(),t=u(Y);t.safeAreaInsets=e.safeAreaInsets,t.statusBarHeight=e.statusBarHeight,t.screenWidth=e.screenWidth||e.windowWidth,t.screenHeight=e.screenHeight||e.windowHeight}(),M()})),(e,t)=>{const a=f,s=y(m("uv-icon"),w);return o(),l(a,{class:"container",style:h(u(X))},{default:n((()=>[i(a,{class:"header-container"},{default:n((()=>[i(a,{class:"system-bar-area",style:h(u(G))},null,8,["style"]),i(a,{class:"header-row",style:h(u(O))},{default:n((()=>[u(k)?(o(),l(a,{key:0,class:"left",style:h(u(q))},{default:n((()=>[d(e.$slots,"left",{},(()=>[i(s,{name:"arrow-left",color:u(A),size:u(I),onClick:u(_)},null,8,["color","size","onClick"])]),!0)])),_:3},8,["style"])):c("",!0),i(a,{class:"title",style:h(u(D))},{default:n((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3},8,["style"]),u(T)?(o(),l(a,{key:1,class:"right"},{default:n((()=>[d(e.$slots,"right",{},void 0,!0)])),_:3})):c("",!0)])),_:3},8,["style"]),i(a,{class:"bg-mask",style:h(u(E))},null,8,["style"])])),_:3}),u(z)?(o(),l(a,{key:0,class:"prop-up",style:h({height:`${u(J)}px`})},null,8,["style"])):c("",!0)])),_:3},8,["style"])}}},[["__scopeId","data-v-e87ecf32"]]);export{b as H};