Commit cae9ab3abe8080f49d63ecd05a74993fdd5d7b3d

Authored by wangfan
1 parent c9ce94f2

fix nav bug

... ... @@ -27,27 +27,7 @@ Component({
},
attached(){
let disBack = false;
let disHome = false;
let pages = getCurrentPages();
console.log('pages.length',pages[0]);
if (pages.length > 1) {
disBack = true;
} else {
//if (getApp().shareTicket && this.data.hasHome) {
if (this.data.hasHome && pages[0].route!="pages/customer/list") {
disHome = true;
}
}
let wxBarHeight=68;
let statusBarHeight=getApp().system.statusBarHeight*getApp().system.pixelRatio;
this.setData({
statusBarHeight: statusBarHeight,
disHome: disHome,
disBack: disBack,
statusBarHeightFull:wxBarHeight + statusBarHeight,
})
console.log('this.setData',this.data);
this.init();
},
/**
* 组件的方法列表
... ... @@ -61,6 +41,33 @@ Component({
wx.reLaunch({
url:'/pages/customer/index'
})
}
},
init(){
let wxBarHeight=68;
let disBack = false;
let disHome = false;
let pages = getCurrentPages();
console.log('pages.length',pages[0]);
if (pages.length > 1) {
disBack = true;
} else {
//if (getApp().shareTicket && this.data.hasHome) {
if (this.data.hasHome && pages[0].route!="pages/customer/list") {
disHome = true;
}
}
let statusBarHeight=40;
if(getApp().system.system){
statusBarHeight=getApp().system.statusBarHeight
*(getApp().system.system.toLowerCase().indexOf('ios')>-1?2:getApp().system.pixelRatio);
}
this.setData({
statusBarHeight: statusBarHeight,
disHome: disHome,
disBack: disBack,
statusBarHeightFull:wxBarHeight + statusBarHeight,
})
console.log('this.setData',this.data);
},
}
})
... ...
... ... @@ -59,13 +59,14 @@ Page({
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
},1000);
})
},1000);
var that=this;
this.setData({
isloading:false,
})
this.getbooklist();
this.selectComponent('#nav').init();
},
async getbooklist(){
var formdata={};
... ...
<nav>订座</nav>
<nav id="nav">订座</nav>
<view class="page">
<block wx:if="{{isloading==true}}">
<view class="book-page bg_white">
<view class="book-search flex-ll">
... ... @@ -52,6 +53,7 @@
</view>
</block>
</block>
</view>
<tabBar></tabBar>
<view class="calendar-mask" bindtap="calendarClose"
... ...
page{
background:#efeef3;
}
.page{
width: 100%;
margin: 0;
}
.book-page{
width:100%;
padding-top:20rpx;
... ...