fix(build): build
build Signed-off-by: liubaixun <liubaixun@yinxiang.com>mini-program
commit
987fda70f3
43
App.vue
43
App.vue
|
@ -1,13 +1,50 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
console.log('App Launch')
|
// console.log('App Launch')
|
||||||
|
const updateManager = uni.getUpdateManager();
|
||||||
|
//检测版本更新
|
||||||
|
updateManager.onCheckForUpdate(function(res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
if (res.hasUpdate) {
|
||||||
|
//监听小程序有版本更新事件
|
||||||
|
updateManager.onUpdateReady(function() {
|
||||||
|
uni.showModal({
|
||||||
|
title: '更新提示',
|
||||||
|
content: '新版本已经准备好,是否重启应用?',
|
||||||
|
showCancel: false,
|
||||||
|
success(res) {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
// if (res.cancel) {
|
||||||
|
// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '取消更新将会无法体验新功能',
|
||||||
|
// content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开。',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
updateManager.onUpdateFailed(function() {
|
||||||
|
// 新版本下载失败
|
||||||
|
uni.showModal({
|
||||||
|
title: '已经有新版本啦!',
|
||||||
|
content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开。',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
console.log('App Show')
|
// console.log('App Show')
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
console.log('App Hide')
|
// console.log('App Hide')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -103,7 +103,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
/* WEBPACK VAR INJECTION */(function(uni) {
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", {
|
Object.defineProperty(exports, "__esModule", {
|
||||||
value: true
|
value: true
|
||||||
|
@ -111,16 +111,54 @@ Object.defineProperty(exports, "__esModule", {
|
||||||
exports.default = void 0;
|
exports.default = void 0;
|
||||||
var _default = {
|
var _default = {
|
||||||
onLaunch: function onLaunch() {
|
onLaunch: function onLaunch() {
|
||||||
console.log('App Launch');
|
// console.log('App Launch')
|
||||||
|
var updateManager = uni.getUpdateManager();
|
||||||
|
//检测版本更新
|
||||||
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
if (res.hasUpdate) {
|
||||||
|
//监听小程序有版本更新事件
|
||||||
|
updateManager.onUpdateReady(function () {
|
||||||
|
uni.showModal({
|
||||||
|
title: '更新提示',
|
||||||
|
content: '新版本已经准备好,是否重启应用?',
|
||||||
|
showCancel: false,
|
||||||
|
success: function success(res) {
|
||||||
|
// console.log(res)
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
// if (res.cancel) {
|
||||||
|
// // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '取消更新将会无法体验新功能',
|
||||||
|
// content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开。',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
updateManager.onUpdateFailed(function () {
|
||||||
|
// 新版本下载失败
|
||||||
|
uni.showModal({
|
||||||
|
title: '已经有新版本啦!',
|
||||||
|
content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开。'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onShow: function onShow() {
|
onShow: function onShow() {
|
||||||
console.log('App Show');
|
// console.log('App Show')
|
||||||
},
|
},
|
||||||
onHide: function onHide() {
|
onHide: function onHide() {
|
||||||
console.log('App Hide');
|
// console.log('App Hide')
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.default = _default;
|
exports.default = _default;
|
||||||
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"es6": false,
|
"es6": false,
|
||||||
"postcss": false,
|
"postcss": false,
|
||||||
"minified": true,
|
"minified": false,
|
||||||
"newFeature": true,
|
"newFeature": true,
|
||||||
"bigPackageSizeSupport": true,
|
"bigPackageSizeSupport": true,
|
||||||
"babelSetting": {
|
"babelSetting": {
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "3.1.2",
|
"libVersion": "3.1.2",
|
||||||
"appid": "wx0518521f67048cc8",
|
"appid": "wx05b45a2699f02a2b",
|
||||||
"projectname": "greenhouse-wisdom-applet",
|
"projectname": "greenhouse-wisdom-applet",
|
||||||
"condition": {},
|
"condition": {},
|
||||||
"editorSetting": {
|
"editorSetting": {
|
||||||
|
|
Loading…
Reference in New Issue