You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3 KiB

// pages/components/statusBar/statusBar.js
Component({
/**
* 组件的属性列表
*/
properties: {
showBackTop: Boolean,
title: String
},
/**
* 组件的初始数据
*/
data: {
showBack: true
},
/**
* 组件的方法列表
*/
methods: {
/**
*
*返回上一级
*
* @param {*} e
*/
_backPage(e) {
wx.navigateBack()
},
},
lifetimes: {
attached: function () {
wx.getSystemInfo({
success: (res) => {
const isiOS = res.system.indexOf('iOS') > -1;
this.setData({
navHeight: isiOS ? 44 : 48,
statusBarHeight: res.statusBarHeight,
windowHeight: res.windowHeight,
windowWidth: res.windowWidth,
})
}
})
// wx.getSystemInfo({
// success: (res) => {
// const isiOS = res.system.indexOf('iOS') > -1;
// this.setData({
// navHeight: isiOS ? 44 : 48,
// statusBarHeight: res.statusBarHeight,
// windowHeight: res.windowHeight,
// windowWidth: res.windowWidth,
// })
// }
// })
},
},
pageLifetimes: {
show: function () {
if (getCurrentPages().length <= 1) {
this.setData({
showBack: false
})
}
},
}
})