// 全局版本检查帮助函数 const versionManager = require('./simple-version-manager.js'); /** * 在页面中添加版本检查 * 使用方法:在页面的 onShow 中调用 checkVersionOnShow() */ function checkVersionOnShow() { try { const hasVersionUpdate = versionManager.checkVersionUpdate(); if (hasVersionUpdate) { return true; // 返回 true 表示有版本更新 } return false; // 返回 false 表示无版本更新 } catch (error) { console.error('页面版本检查失败:', error); return false; } } module.exports = { checkVersionOnShow };