index-legacy.04a1259e.js 5.1 KB

1
  1. !function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,a=[],o=!0,l=!1;try{for(n=n.call(t);!(o=(i=n.next()).done)&&(a.push(i.value),!e||a.length!==e);o=!0);}catch(c){l=!0,r=c}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var i=document.createElement("style");i.innerHTML="._colHeader_a7v8p_1{--van-font-weight-bold: 600}._colHeader_a7v8p_1 .van-nav-bar__title,._colHeader_a7v8p_1 .van-icon{color:inherit}._colHeader_a7v8p_1 .van-nav-bar__right>div{line-height:0}._colHeader_a7v8p_1._transparent_a7v8p_11{background-color:transparent}._headerSection_a7v8p_14{position:relative}\n",document.head.appendChild(i),System.register(["./index-legacy.59567947.js"],(function(n){"use strict";var i,r,a,o,l,c,s,u,h,f,d,g,v,p,b;return{setters:[function(t){i=t.m,r=t.w,a=t.t,o=t.d,l=t.S,c=t.aH,s=t.am,u=t.k,h=t.aI,f=t.aJ,d=t.a1,g=t.y,v=t.p,p=t.e,b=t.F}],execute:function(){var k=e(i("nav-bar"),2),y=k[0],m=k[1],_={title:String,fixed:Boolean,zIndex:r,border:a,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:a},H=o({name:y,props:_,emits:["clickLeft","clickRight"],setup:function(e,n){var i=n.emit,r=n.slots,a=l(),o=c(a,m),g=function(t){return i("clickLeft",t)},v=function(t){return i("clickRight",t)},p=function(){var n,i=e.title,o=e.fixed,l=e.border,c=e.zIndex,p=s(c),b=e.leftArrow||e.leftText||r.left,k=e.rightText||r.right;return u("div",{ref:a,style:p,class:[m({fixed:o}),(n={},t(n,f,l),t(n,"van-safe-area-top",e.safeAreaInsetTop),n)]},[u("div",{class:m("content")},[b&&u("div",{class:[m("left"),e.clickable?h:""],onClick:g},[r.left?r.left():[e.leftArrow&&u(d,{class:m("arrow"),name:"arrow-left"},null),e.leftText&&u("span",{class:m("text")},[e.leftText])]]),u("div",{class:[m("title"),"van-ellipsis"]},[r.title?r.title():i]),k&&u("div",{class:[m("right"),e.clickable?h:""],onClick:v},[r.right?r.right():u("span",{class:m("text")},[e.rightText])])])])};return function(){return e.fixed&&e.placeholder?o(p):p()}}}),x=g(H),S="_colHeader_a7v8p_1",B="_headerSection_a7v8p_14";n("O",o({name:"o-header",props:{title:String,isBack:{type:Boolean,default:!1},backIconColor:{type:String,default:"black"},isFixed:{type:Boolean,default:!0},styleName:{type:Object,default:function(){return{}}},titleClass:String,background:{type:String,default:"white"},color:{type:String,default:"#323233"},rightText:String,onClickRight:{type:Function,default:function(){}},border:{type:Boolean,default:!0},onHeaderBack:{type:Function,default:function(){}}},watch:{backIconColor:function(){v({api:"backIconChange",content:{iconStyle:this.backIconColor}})}},data:function(){return{headerTitle:null,navBarHeight:0,titleHeight:44}},mounted:function(){var t=this;this.headerTitle=this.title||this.$route.meta.title,this.navBarInit((function(){t.onHeaderBack&&t.onHeaderBack()}))},unmounted:function(){v({api:"setBarStatus",content:{status:1}}),v({api:"backIconChange",content:{iconStyle:"black"}})},methods:{navBarInit:function(t){var e=this;v({api:"setBarStatus",content:{status:0}}),v({api:"backIconChange",content:{iconStyle:this.backIconColor||"black"}});var n=sessionStorage.getItem("navHeight"),i=sessionStorage.getItem("titleHeight");n&&i?(this.navBarHeight=Number(n),t&&t()):v({api:"getNavHeight"},(function(n){var i=n.content,r=i.dpi||2;if(i.navHeight){var a=i.navHeight/r;sessionStorage.setItem("navHeight",String(a)),e.navBarHeight=a}if(i.titleHeight){var o=i.titleHeight/r;sessionStorage.setItem("titleHeight",String(o)),e.titleHeight=o}t&&t()})),!p().isApp&&t&&t()},onClickLeft:function(){this.$router.back()},clickRight:function(){this.onClickRight&&this.onClickRight()}},render:function(){var t=this;return u("div",null,[this.$slots.content?u("div",{style:{paddingTop:"".concat(this.navBarHeight,"px"),background:this.background},class:B},[this.$slots.content(this.navBarHeight)]):u(b,null,[u("div",{style:{minHeight:"calc(var(--van-nav-bar-height) + ".concat(this.navBarHeight,"px)")},class:B},[u(x,{title:this.headerTitle,class:[S],style:{background:this.background,color:this.color,paddingTop:"".concat(this.navBarHeight,"px"),zIndex:99},"left-arrow":this.isBack,rightText:this.rightText,fixed:this.isFixed,border:this.border,"onClick-right":this.clickRight,"onClick-left":this.onClickLeft},{right:function(){return t.$slots.right&&t.$slots.right()||t.rightText}})]),this.$slots.default?this.$slots.default():null])])}}))}}}))}();