patient-mini/app.js
2025-07-03 18:16:42 +08:00

42 lines
850 B
JavaScript

// app.js
// import Mock from './mock/index';
import createBus from './utils/eventBus';
// import { connectSocket, fetchUnreadNum } from './mock/chat';
// if (config.isMock) {
// Mock();
// }
App({
onLaunch() {
const updateManager = wx.getUpdateManager();
updateManager.onCheckForUpdate((res) => {
// console.log(res.hasUpdate)
});
updateManager.onUpdateReady(() => {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
updateManager.applyUpdate();
}
},
});
});
},
globalData: {
// userInfo: null,
// unreadNum: 0, // 未读消息数量
// socket: null, // SocketTask 对象
},
/** 全局事件总线 */
eventBus: createBus(),
});