forked from guren-cloud/weapp-one
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
44 lines (35 loc) · 865 Bytes
/
Copy pathapp.js
File metadata and controls
44 lines (35 loc) · 865 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
34
35
36
37
38
39
40
41
42
43
44
/**
* 一ONE小程序
* 项目:https://github.com/safe-dog/one
* vPush:https://vpush.cloud
* 作者微信:hack_fish
*/
//app.js
var API = require('./utils/api.js');
var vPush = require('./libs/vpush-sdk/vPush.js');
var FAV = require('./utils/fav.js');
App({
API,
vPush: new vPush('vPush创建的应用ID'),
FAV: new FAV(),
/**
* 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
*/
onLaunch: function () {
},
/**
* 当小程序启动,或从后台进入前台显示,会触发 onShow
*/
onShow: function (options) {
},
/**
* 当小程序从前台进入后台,会触发 onHide
*/
onHide: function () {
},
/**
* 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
*/
onError: function (msg) {
}
})