-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (34 loc) · 855 Bytes
/
app.js
File metadata and controls
40 lines (34 loc) · 855 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
//app.js
const utils = require('utils/util.js')
const updateManager = wx.getUpdateManager()
App({
onLaunch: function () {
wx.getStorageInfo({
success(res) {
console.log('载入程序', res.keys)
}
})
// 第一次进入游戏数据初始化
var firstTimePlayGame = wx.getStorageSync('firstTimePlayGame') || 'true'
if (firstTimePlayGame == 'true') {
utils.initAllData()
wx.redirectTo({
url: '/pages/event/event?event=kaishi',
})
}
// 版本检测
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
},
globalData: {
}
})