- 新增用户消息中心组件 UserMessageView - 新增师傅消息中心组件 MasterMessageView - 新增用户订单列表组件 UserOrdersView - 重构订单列表页,复用独立组件 - 新增系统工具 getWindowInfoSafe 兼容多端系统信息获取 - 重构 TabBar 组件,支持单母页模式和事件回调 - 优化消息跳转逻辑,支持角色自适应 Tab 切换
31 行
676 B
JavaScript
31 行
676 B
JavaScript
/**
|
||
* 系统与窗口信息工具
|
||
* 兼容微信小程序新版规范(废弃 wx.getSystemInfoSync,推荐 getWindowInfo)
|
||
*/
|
||
export function getWindowInfoSafe() {
|
||
try {
|
||
if (typeof uni.getWindowInfo === 'function') {
|
||
const win = uni.getWindowInfo();
|
||
if (win && (win.statusBarHeight !== undefined || win.windowWidth !== undefined)) {
|
||
return win;
|
||
}
|
||
}
|
||
if (typeof uni.getSystemInfoSync === 'function') {
|
||
return uni.getSystemInfoSync();
|
||
}
|
||
} catch (e) {
|
||
// 忽略异常,降级兜底
|
||
}
|
||
return {
|
||
statusBarHeight: 20,
|
||
windowWidth: 375,
|
||
windowHeight: 667,
|
||
screenWidth: 375,
|
||
screenHeight: 667
|
||
};
|
||
}
|
||
|
||
export default {
|
||
getWindowInfoSafe
|
||
};
|