WeChat Mini Program (微信小程序) — school campus app. Source root is `src/` (set via `miniprogramRoot` in `project.config.json`).
## Commands
- **Lint:** `pnpm run lint:fix` (eslint only; no separate typecheck or test commands exist)
- **npm build:** Must use WeChat DevTools → "Build npm" menu. Output goes to `src/miniprogram_npm/` (gitignored). Do not edit `miniprogram_npm/` manually.
- **JSX compile:** `pnpm run beforeCompile` — Babel-transforms `.jsx` files under `src/pages/` using `@babel/plugin-transform-react-jsx` (automatic runtime). WeChat DevTools runs this automatically via `project.config.json` scripts before compile/preview/upload. No `.jsx` files currently exist, but the pipeline is wired.
## Architecture
- **Custom Page wrapper** (`src/utils/page.ts`): The global `Page` constructor is replaced in `app.ts``onLaunch`. Every page automatically gets navbar setup, image params, scroll-based nav background, and a default `onShareAppMessage`. When adding page lifecycle hooks, be aware these wrappers run before your own handlers.
- **`wx.ajax`**: Custom property added to `wx` in `app.ts``onLaunch`. It is a curried version of `src/api/request.ts` with the base URL baked in. Use `wx.ajax(...)` for network requests — do not call `request` directly from pages.
- **Login flow**: Managed in `App` via `globalData.loginState` / `globalData.initLoginInfo`. Pages call `getApp().waitLogin()` before making authenticated requests.
- **API request pattern**: All page-level API requests should be placed inside `app.waitLogin()` callback in `onLoad` to ensure login state is ready before making authenticated requests. Example: `app.waitLogin({ type: 1 }).then(() => { this.fetchData() })`.
- **Interface usage**: Minimize interface definitions. Only add interfaces when absolutely necessary (e.g., complex API response structures, reusable data models). Prefer inline type annotations or `any` for simple cases. Avoid over-engineering type safety.