Files
Blizzard 609f7d06cf init: 毛孩子计划 小程序 + Go 后端 + 内嵌后台
- pets-fe: 微信原生小程序(首页/计划/记录/报告/社区/引导),
  服务端驱动、无假数据;弹层改用 scroll-view,打开时隐藏自定义 tabBar
- pets-be: Gin + GORM(MySQL, sundynix_ 前缀) + MinIO,统一响应/分页,
  微信 code2session 登录,provider-neutral AI(DeepSeek),go:embed React 后台
- 修复:分段选择类型不匹配(字符串 vs 数字)导致选不中

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 15:36:55 +08:00

29 lines
1.0 KiB
JavaScript

const store = require('./utils/store.js');
App({
globalData: {
statusBarHeight: 20,
navBarHeight: 44,
menuRight: 10
},
onLaunch() {
// 启动即登录并加载宠物(失败不阻塞 UI,页面会各自重试)
store.ready().catch((e) => console.warn('[app] 启动登录失败:', e && e.message));
// 计算自定义导航栏所需的状态栏 / 胶囊尺寸
try {
const win = wx.getWindowInfo ? wx.getWindowInfo() : wx.getSystemInfoSync();
const menu = wx.getMenuButtonBoundingClientRect();
const statusBarHeight = win.statusBarHeight || 20;
// 导航栏高度 = 胶囊高度 + 上下等距间隙
const navBarHeight = (menu.top - statusBarHeight) * 2 + menu.height;
this.globalData.statusBarHeight = statusBarHeight;
this.globalData.navBarHeight = navBarHeight;
this.globalData.menuRight = win.windowWidth - menu.right;
this.globalData.menuHeight = menu.height;
this.globalData.menuTop = menu.top;
} catch (e) {
// 兜底
}
}
});