|
@@ -150,6 +150,34 @@ class App extends Component {
|
150
|
150
|
}
|
151
|
151
|
|
152
|
152
|
componentDidShow() {
|
|
153
|
+ const updateManager = wx.getUpdateManager()
|
|
154
|
+ updateManager.onCheckForUpdate(function (res) {
|
|
155
|
+ // 请求完新版本信息的回调
|
|
156
|
+ console.info('新版本是否更新:', res.hasUpdate)
|
|
157
|
+ })
|
|
158
|
+
|
|
159
|
+ updateManager.onUpdateReady(function () {
|
|
160
|
+ wx.showModal({
|
|
161
|
+ title: '更新提示',
|
|
162
|
+ content: '新版本已经准备好,是否重启应用?',
|
|
163
|
+ success(res) {
|
|
164
|
+ if (res.confirm) {
|
|
165
|
+ // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
166
|
+ updateManager.applyUpdate()
|
|
167
|
+ }
|
|
168
|
+ }
|
|
169
|
+ })
|
|
170
|
+ })
|
|
171
|
+ }
|
|
172
|
+ componentDidMount() {
|
|
173
|
+ console.info('app componentDidMount')
|
|
174
|
+ }
|
|
175
|
+ componentWillMount(params) {
|
|
176
|
+ // console.info('app componentWillMount', params)
|
|
177
|
+ this.initData()
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ initData () {
|
153
|
181
|
console.info('app componentDidShow')
|
154
|
182
|
console.info('router1', this.$router.params)
|
155
|
183
|
console.info('ready status1', ready)
|
|
@@ -190,31 +218,6 @@ class App extends Component {
|
190
|
218
|
})
|
191
|
219
|
})
|
192
|
220
|
})
|
193
|
|
-
|
194
|
|
- const updateManager = wx.getUpdateManager()
|
195
|
|
- updateManager.onCheckForUpdate(function (res) {
|
196
|
|
- // 请求完新版本信息的回调
|
197
|
|
- console.info('新版本是否更新:', res.hasUpdate)
|
198
|
|
- })
|
199
|
|
-
|
200
|
|
- updateManager.onUpdateReady(function () {
|
201
|
|
- wx.showModal({
|
202
|
|
- title: '更新提示',
|
203
|
|
- content: '新版本已经准备好,是否重启应用?',
|
204
|
|
- success(res) {
|
205
|
|
- if (res.confirm) {
|
206
|
|
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
207
|
|
- updateManager.applyUpdate()
|
208
|
|
- }
|
209
|
|
- }
|
210
|
|
- })
|
211
|
|
- })
|
212
|
|
- }
|
213
|
|
- componentDidMount() {
|
214
|
|
- console.info('app componentDidMount')
|
215
|
|
- }
|
216
|
|
- componentWillMount(params) {
|
217
|
|
- console.info('app componentWillMount', params)
|
218
|
221
|
}
|
219
|
222
|
|
220
|
223
|
getRouterParams() {
|