新增了多个静态图片资源文件,包括01.png、02.png等,并添加了相关的配置文件和组件,如vue.config.js、package.json等。同时引入了Tuniao UI库,并配置了相关的依赖和设置,以支持项目的开发和构建。
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
/**
|
|
* 更新自定义顶部导航栏的高度
|
|
*/
|
|
function updateCustomBarInfo () {
|
|
return new Promise((resolve, reject) => {
|
|
uni.getSystemInfo({
|
|
success: (e) => {
|
|
let statusBarHeight = 0
|
|
let customBarHeight = 0
|
|
// #ifndef MP
|
|
statusBarHeight = e.statusBarHeight
|
|
if (e.platform == 'android') {
|
|
customBarHeight = e.statusBarHeight + 50
|
|
} else {
|
|
customBarHeight = e.statusBarHeight + 45
|
|
};
|
|
// #endif
|
|
|
|
// #ifdef MP-WEIXIN
|
|
statusBarHeight = e.statusBarHeight
|
|
let custom = wx.getMenuButtonBoundingClientRect()
|
|
customBarHeight = custom.bottom + ((custom.top - e.statusBarHeight) <= 4 ? (custom.top - e
|
|
.statusBarHeight) + 4 : (custom.top - e.statusBarHeight))
|
|
// #endif
|
|
|
|
// #ifdef MP-ALIPAY
|
|
statusBarHeight = e.statusBarHeight
|
|
customBarHeight = e.statusBarHeight + e.titleBarHeight
|
|
// #endif
|
|
resolve({
|
|
statusBarHeight,
|
|
customBarHeight
|
|
})
|
|
},
|
|
fail: (err) => {
|
|
console.log("获取设备信息失败", err);
|
|
reject()
|
|
}
|
|
})
|
|
|
|
})
|
|
}
|
|
|
|
export default updateCustomBarInfo
|