custom-nav-bar.js 1.8 KB

1
  1. "use strict";const t=require("../../common/vendor.js"),s=require("../../common/assets.js"),r={data(){return{logoImage:s._imports_0,opacity:0,scrollTop:0,statusBarHeight:0,myback:{show:!0},topStyle:{}}},props:{title:String,titleColor:{type:String,default:"#000000"},back:{type:Object,default:function(){return{show:!0,logoShow:!1}}},backgroundImageShow:{type:Boolean,default:!1},backgroundColor:{type:String,default:"linear-gradient(to top right, #CDDC39, #8BC34A, #FFEB3B)"},backgroundImage:String,hideHeight:{type:Boolean,default:!0},topHeight:{type:Number,default:80}},mounted(){this.init()},methods:{goBack(){const e=getCurrentPages();if(e.length>1)t.index.navigateBack();else{const n=e[0].route.split("/");t.index.switchTab({url:`/${n[0]}/${n[1]}/index`})}},init(){this.statusBarHeight=this.getSysInfo().statusBarHeight;for(let e in this.back)this.myback[e]=this.back[e]},getSysInfo(){return t.index.getSystemInfoSync()},scrollScroll(e){this.scrollTop=e,e<200?this.opacity=e/100/2:this.opacity=1}}};Array||t.resolveComponent("u-icon")();const g=()=>"../../uni_modules/uview-plus/components/u-icon/u-icon.js";Math||g();function u(e,n,i,l,o,c){return t.e({a:t.s("height: "+o.statusBarHeight+"px"),b:t.s("height: "+i.topHeight+"rpx"),c:i.backgroundImageShow?"url("+i.backgroundImage+") no-repeat;":i.backgroundColor,d:o.opacity,e:t.s("height: "+o.statusBarHeight+"px"),f:o.myback.show},o.myback.show?{g:t.p({size:"20",name:"arrow-left"}),h:t.o((...a)=>c.goBack&&c.goBack(...a))}:{},{i:o.myback.logoShow},o.myback.logoShow?{j:o.logoImage,k:t.o((...a)=>c.goBack&&c.goBack(...a))}:{},{l:t.t(i.title),m:i.titleColor,n:t.s("height:"+i.topHeight+"rpx"),o:t.s("height: calc("+o.statusBarHeight+"px + "+i.topHeight+"rpx)")})}const h=t._export_sfc(r,[["render",u],["__scopeId","data-v-10729898"]]);wx.createComponent(h);