编辑 | blame | 历史 | 原始文档

Repository Guidelines

Project Structure & Module Organization

pages/ hosts the multi-tab MES screens—treat each subdirectory as an isolated feature. Shared UI and device helpers live in components/, common/, and utils/; extend these before adding new modules so tablet flows stay consistent. Global state and server toggles sit in store/index.js; adjust serverURL, serverAPI, pdaMac, and machineNo here before packaging. Keep generated build assets in unpackage/ untouched, and store documentation under docs/.

Build, Test, and Development Commands

Primary workflow uses HBuilderX: Run > Run to Mobile Device for live debugging, Build > Native App-Cloud Packaging targeting App-Plus. CLI fallback commands: npx @dcloudio/uni-cli-service dev -p app-plus for local preview and npx @dcloudio/uni-cli-service build -p app-plus for production bundles. Run these from the repo root with UTF-8 terminals to avoid encoding drift.

Coding Style & Naming Conventions

Components follow Vue 2 SFC format with tab (width 4) indentation in <template>/<script> and two spaces in SCSS. Name components in PascalCase, data/methods in camelCase, and reserve UPPER_SNAKE_CASE for constants. All files must be UTF-8 encoded; inline comments should stay concise and in Chinese to match existing context. Prefer reusing mixins/utilities from common/ and utils/ instead of reimplementing device logic.

Testing Guidelines

No automated suite exists; document manual verification covering work-order flow, barcode printing, Bluetooth pairing, and tablet layouts (1280×800, 1920×1080). Capture logs via HBuilderX > Debug > View Log when issues appear, and note the API environment configured in store/index.js.

Commit & Pull Request Guidelines

Write descriptive imperative commit subjects (e.g., feat: improve WorkOrder polling) instead of legacy numeric messages. Each PR should state the device/environment used, list manual test steps, and attach screenshots for UI tweaks. Reference affected modules (components/WorkOrder.vue) and link tracker items when possible; keep unrelated changes out of scope.

Security & Configuration Tips

Never hard-code credentials; fetch tokens via uni.getStorageSync. Reset device bindings and API targets before distributing shared builds, and clean unpackage/ artifacts prior to committing to keep the repo lean.