forked from Heliner/ChatGptWxMiniProgram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
33 lines (32 loc) · 774 Bytes
/
app.js
File metadata and controls
33 lines (32 loc) · 774 Bytes
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
const config = require('config');
const Cloud = require('common/util/cloud-call');
App({
onLaunch: function () {
this.InitCloud(); //初始化云服务 / ESC
this.InitCustom(); //初始化custom所需配置信息
},
InitCloud() {
var that = this;
wx.cloud.init({
env: config.CloudID,
traceUser: true
})
},
InitCustom() {
wx.getSystemInfo({
success: e => {
//console.log(e)
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
// console.log(custom)
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
}
})
},
globalData:{
},
config,
Cloud,
})