1 Star 0 Fork 98

于大伟 / O2OA_Mini_Program

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.js 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
fancylou 提交于 2020-09-24 10:23 . 添加一些试用账号
//app.js
App({
onLaunch: function () {
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
this.getNaviInfo()
},
// 获取菜单按钮(右上角胶囊按钮)的布局位置信息
getNaviInfo: function() {
let menuRect = wx.getMenuButtonBoundingClientRect();
wx.getSystemInfo({
success: (res) => {
let naviInfo = this.globalData.naviInfo;
naviInfo.naviHeight = res.statusBarHeight + menuRect.height + (menuRect.top - res.statusBarHeight) * 2;
naviInfo.naviWidth = res.windowWidth;
naviInfo.menuTop = menuRect.top;
naviInfo.menuHeight = menuRect.height;
naviInfo.menuWidth = menuRect.width;
naviInfo.menuRight = res.width - menuRect.width - menuRect.left;
naviInfo.statusBarHeight = res.statusBarHeight;
},
})
},
globalData: {
userInfo: null,
o2oa: {
centerHost: "sample.o2oa.net",
centerContext: "/x_program_center",
centerPort: 40030,
httpProtocol: "https"
},
naviInfo: {
naviHeight: 0,
naviWidth: 0,
menuTop: 0,
menuHeight: 0,
menuWidth: 0,
menuRight: 0,
statusBarHeight: 0,
}
}
})
1
https://gitee.com/dw0225/O2OA_mini_program.git
git@gitee.com:dw0225/O2OA_mini_program.git
dw0225
O2OA_mini_program
O2OA_Mini_Program
master

搜索帮助