This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a WeChat Mini Program (微信小程序) for music digital education activation, allowing users to purchase music course subscriptions and instruments.
# WeChat Developer Tools: Tools > Build npm
# Or via CLI equivalent in project.config.json packNpmManually settings
Edit miniprogram/config.ts to change environment:
const environmentVariable = "online"; // "dev" | "test" | "online"
miniprogram/ is the source rootminiprogram/
├── api/ # API request functions (login.ts, new.ts)
├── components/ # Reusable components (navigation-bar, service, apply-refound)
├── pages/ # Page modules (index, login, orders, protocol, download, buyerInformation)
├── plugins/ # Request plugin for HTTP calls
├── utils/ # Utilities (EventBus, util, qrcode)
├── app.ts # App entry with global state
├── app.json # Page routes and global config
├── config.ts # Environment-based API URLs
Request Layer: plugins/request.ts handles all API calls with:
wx.getStorageSync("token")/open/, /code/) skip token requirementGlobal State: app.ts manages:
globalData.baseUrl - API base URL from config.tsglobalData.appId - WeChat Mini Program AppIDglobalData.isLogin - Login statusglobalData.userInfo - User profilePages: Each page follows WeChat Mini Program structure:
.ts - Page logic with Page({...}).wxml - Template markup.less - Styles.json - Page config (usingComponents, etc.)Components: Custom components using Component({...}):
navigation-bar - Custom header with safe area handlingservice - Customer service floating buttonapply-refound - Refund application modalEventBus: utils/EventBus.ts provides simple pub/sub for cross-component communication.
All APIs under /edu-app/ prefix:
/userlogin, /user/getUserInfo/open/shop/product, /open/shop/instruments/userPaymentOrder/* (executeOrder, detail, refund, etc.)/userReceiveAddress/*/userBeneficiary/*Uses Vant Weapp (@vant/weapp) component library. Components registered in page .json files.
Strict mode enabled with:
noImplicitAny, strictNullChecks, stricttypings/