-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (32 loc) · 852 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// app.js
App({
globalData: {
// userInfo: null
screenWidth: 375,
screenHeight: 667,
statusBarHeight: 20,
contentHeight: 500,
},
onLaunch() {
// 获取设备的信息
wx.getSystemInfo({
success: (res) => {
this.globalData.screenWidth = res.screenWidth;
this.globalData.screenHeight = res.screenHeight;
this.globalData.statusBarHeight = res.statusBarHeight;
this.globalData.contentHeight =
res.screenHeight - res.statusBarHeight - 44;
},
});
// 展示本地存储能力
// const logs = wx.getStorageSync('logs') || []
// logs.unshift(Date.now())
// wx.setStorageSync('logs', logs)
// 登录
// wx.login({
// success: res => {
// // 发送 res.code 到后台换取 openId, sessionKey, unionId
// }
// })
},
});