Commit 0027a4a4 authored by Morson's avatar Morson
parents ca8f2f7e b664afdf
...@@ -8,8 +8,8 @@ export default { ...@@ -8,8 +8,8 @@ export default {
uniEnv: process.uniEnv, uniEnv: process.uniEnv,
// 登录凭证 // 登录凭证
token: "", token: "",
// 微信小程序平台编号,空--家维广场,1--自营平台 // 微信小程序平台编号,空--家维广场,1--自营平台
wxAppNo: 1, wxAppNo: 1,
//授权提示 图标 //授权提示 图标
icon_auth_notice: "https://qn-static.banshouhui.com/auth_notice.png", icon_auth_notice: "https://qn-static.banshouhui.com/auth_notice.png",
...@@ -53,10 +53,13 @@ export default { ...@@ -53,10 +53,13 @@ export default {
onLaunch: function () { onLaunch: function () {
// 应用初始化(全局只触发一次) // 应用初始化(全局只触发一次)
AnalysysAgent.registerSuperProperty("platform", "self-support"); AnalysysAgent.registerSuperProperty("platform", "self-support");
// 版本更新
this.updateApp();
}, },
onShow: function () { onShow: function () {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
this.autoLogin() this.autoLogin();
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
...@@ -133,6 +136,34 @@ export default { ...@@ -133,6 +136,34 @@ export default {
} }
}, },
/* 版本更新 */
updateApp() {
// 版本更新
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log(res.hasUpdate);
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: "更新提示",
content: "新版本已经准备好,是否重启应用?",
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function (res) {
// 新的版本下载失败
});
},
/* ------------------------- 数据埋点begin ------------------------------ */ /* ------------------------- 数据埋点begin ------------------------------ */
track(event, properties) { track(event, properties) {
if (AnalysysAgent) { if (AnalysysAgent) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment