export function checkUpdate() { const { scene } = uni.getEnterOptionsSync(); // 从朋友圈单页模式打开页面 if (scene === 1154) { return; } const updateManager = uni.getUpdateManager(); updateManager.onCheckForUpdate(res => {}); updateManager.onUpdateReady(() => { uni.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', success(res) { if (res.confirm) { updateManager.applyUpdate(); } } }); }); updateManager.onUpdateFailed((error) => { uni.showModal({ title: '更新失败', content: '请删除小程序后重新打开' }); }); }