Переглянути джерело

chore: 本地开发 HTTP 配置、启动脚本与 review-and-commit skill

- hdApp、mallApp 开发环境 API/图片地址由 https 改为 http,同步 ext.json 与 iconfont 字体 CDN

- 新增 hdApp、ghsApp 小程序 dev/build 批处理启动脚本

- 新增 .cursor/skills/review-and-commit 项目 skill

- hdApp manifest.json 修正 uniStatistics 缩进

- API: none

- Config: hdApp/mallApp config.js、ext.json、iconfont.css;hdApp manifest.json 格式

- Breaking Changes: none

Co-authored-by: Cursor <cursoragent@cursor.com>
ouyang 3 тижнів тому
батько
коміт
947e3516dc

+ 137 - 0
.cursor/skills/review-and-commit/SKILL.md

@@ -0,0 +1,137 @@
+---
+name: review-and-commit
+description: Analyze local Git changes in this front-end monorepo, review Vue2/uni-app implementation quality and risk, run proportionate validation, and create a Conventional Commit with a detailed intent-focused body. Use when the user asks to analyze/review code changes and commit them, create a commit from the current working tree, inspect changes before committing, or says "分析改动及提交 Commit".
+---
+
+# Review and Commit
+
+Review the exact change set before creating one intentional, traceable commit. Treat invocation with an explicit commit request as authorization to stage and commit only the relevant local changes, never to push.
+
+## Repository Context
+
+This is a **multi-product front-end monorepo** (uni-app mobile/tablet + desktop Vue). Before reviewing, read `AGENTS.md` and applicable `.cursor/rules/` files.
+
+**Products** (use as commit scope when clear): `hdApp`, `ghsApp`, `mallApp`, `hdPad`, `ghsPad`, `hd`, `ghs`.
+
+Each product is independent — do not mix unrelated product changes in one commit unless the user intended a cross-product change.
+
+## Workflow
+
+1. Read `AGENTS.md` and follow project-specific validation and architecture rules.
+2. Inspect `git status --short`, staged and unstaged diffs, diff statistics, and recent commit style.
+3. Account for untracked files explicitly because `git diff` omits their contents. List and read every relevant untracked file.
+4. Determine the intended change set. Preserve unrelated user changes and existing staged state. If unrelated changes cannot be separated safely, stop and ask for scope clarification.
+5. Identify the **target product(s)** from changed paths. Flag accidental cross-product edits.
+6. Review for correctness, security, compatibility, layering, error handling, and accidental generated or secret files. Identify API wrapper, configuration, dependency, and breaking changes.
+7. Do not commit known blocking defects. Report the concrete defect and ask whether to fix it unless the user already authorized implementation. Do not silently rewrite the user's changes merely to make the commit pass.
+8. Run proportionate checks for the affected stack (see Validation below).
+9. Stage exact paths belonging to the change; avoid `git add -A` when the worktree contains unrelated files.
+10. Before committing, inspect the complete staged diff with `git diff --cached`. If output is truncated, inspect it per file or in chunks until every staged line is reviewed. Re-run `git diff --cached --check`.
+11. Create the commit and verify it with `git show` plus `git status --short`. Never push, amend, reset, or discard changes unless explicitly requested.
+
+## Front-End Review Checklist
+
+Apply checks relevant to the changed files:
+
+### uni-app / Vue 2
+
+- Use `<view>`, `<text>`, `<image>` — not HTML tags (`<div>`, `<span>`, etc.).
+- Use uni-app APIs (`uni.request`, `uni.navigateTo`) — not Web-only APIs (`window`, `document`, `localStorage`).
+- Options API only (Vue 2); no Composition API / `<script setup>` unless the target project already uses it.
+- Lifecycle: page (`onLoad`, `onShow`, …) vs app (`onLaunch`, …) used correctly.
+- Styles use `upx`; avoid `gap` in flex layouts — use `margin` instead (see `.cursor/rules/style-compatibility.mdc`).
+- Conditional compilation (`#ifdef MP-WEIXIN`, `#ifdef APP-PLUS`, `#ifdef H5`) where platform behavior differs.
+
+### Configuration & Routing
+
+- `config.js`, `ext.json`, `ext-production.json`, `manifest.json`, `pages.json` — confirm no secrets, no accidental dev-only values destined for production.
+- `pages.json` route/subPackage entries consistent with new or moved pages.
+- Environment switches (`change.bat`, `ext.json` vs `ext-production.json`) not committed in a broken intermediate state.
+
+### API & Data
+
+- Front-end wrappers under `src/api/**` (uni-app) or `src/service/**` (desktop Vue) match expected request/response shape.
+- For API-related commits, note if backend contract alignment was verified; do not claim backend parity unless checked.
+- Auth tokens, shop/user isolation, and error handling preserved.
+
+### Code Quality
+
+- New or materially changed files/functions include **Simplified Chinese comments** per `.cursor/rules/chinese-code-comments.mdc`.
+- No unrelated refactors bundled into the same commit.
+- No debug `console.log` left in production paths unless intentional.
+
+## Validation
+
+Run checks proportional to the change — do not run unrelated broad fixes.
+
+| Change type | Suggested checks |
+|-------------|------------------|
+| `.vue` / `.js` / `.ts` edits | `read_lints` on changed files; `git diff --check` |
+| `pages.json` / routing | Verify paths exist; spot-check referenced page files |
+| Config files | Manual review for secrets and environment correctness |
+| Dependency / build config | Targeted install or syntax check only if changed |
+
+**Do not** automatically run `npm run build:mp-weixin` — the user normally keeps dev/build running. Run build only when explicitly requested or when a specific validation need is identified.
+
+Distinguish static/local validation from end-to-end verification. Do not claim tests or builds passed unless they were run successfully.
+
+## Commit Message
+
+Use Conventional Commits:
+
+```text
+<type>(<scope>): <concise purpose>
+
+- <key intent or behavior change>
+- <key intent or behavior change>
+- API: <front-end request/response contract changes or none>
+- Config: <config.js, ext.json, manifest.json, pages.json changes or none>
+- Breaking Changes: <details or none>
+```
+
+Choose a precise type: `feat`, `fix`, `refactor`, `perf`, `style`, `test`, `docs`, `build`, `ci`, or `chore`.
+
+- **scope**: product name when clear (`hdApp`, `ghsApp`, …) or functional area (`order`, `auth`).
+- Subject: one clear sentence describing purpose and behavior — never vague subjects like `update`, `fix`, or `changes` alone.
+- Include API, Config, and Breaking Changes lines when relevant; state `none` / `无` when an explicit audit trail is useful.
+
+### Examples
+
+```text
+feat(hdApp): 订单列表支持按配送日期筛选
+
+- 新增日期选择器与列表查询参数 deliveryDate
+- 空态与加载态与现有列表页保持一致
+- API: order/list 增加 deliveryDate 可选参数
+- Config: none
+- Breaking Changes: none
+```
+
+```text
+fix(ghsApp): 修复 APP 端 flex 间距不生效
+
+- 将 gap 替换为 margin-top 并处理首项归零
+- API: none
+- Config: none
+- Breaking Changes: none
+```
+
+## Scope and Safety
+
+- Do not include unrelated modified, staged, or untracked files.
+- Do not expose secrets from diffs in the final response; stop if credentials or sensitive data are detected.
+- Do not claim tests passed unless they were run successfully.
+- Respect repository rules: this skill authorizes commit only when the user explicitly requests it.
+- Never push unless explicitly requested.
+
+## Handoff
+
+Report:
+
+1. Commit hash and subject
+2. Behavioral summary (which product(s), what changed for users/developers)
+3. Validations run and their results
+4. API / Config / Breaking Changes status
+5. Remaining risks or uncommitted work
+6. Whether the worktree is clean
+7. Confirm no push was performed

+ 12 - 0
ghsApp/bin/build.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 运行小程序dev
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run dev:mp-weixin
+
+pause

+ 12 - 0
ghsApp/bin/dev.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo ÔËÐÐÅú·¢¶Ë-»¨µêС³ÌÐò
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run dev:mp-weixin
+
+pause

+ 12 - 0
hdApp/bin/build.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo [信息] 运行小程序dev
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run dev:mp-weixin
+
+pause

+ 12 - 0
hdApp/bin/dev.bat

@@ -0,0 +1,12 @@
+@echo off
+echo.
+echo ÔËÐÐÁãÊÛ-»¨µêС³ÌÐò
+echo.
+
+%~d0
+cd %~dp0
+
+cd ..
+npm run dev:mp-weixin
+
+pause

+ 3 - 3
hdApp/src/config.js

@@ -1,7 +1,7 @@
 export const ProjectName = 'hd'
-export const APIHOST = 'https://api.shop.huaml.com'
-export const FORMALHOST = 'https://shop.huaml.com'
-export const IMGHOST = 'https://img.huaml.com'
+export const APIHOST = 'http://api.shop.huaml.com'
+export const FORMALHOST = 'http://shop.huaml.com'
+export const IMGHOST = 'http://img.huaml.com'
 export const CURRENT_ENV = 'dev'
 export const WSSHOST = 'wss://chat.shop.huaml.com'
 export const APP_VERSION = '2.3.7'

+ 2 - 2
hdApp/src/ext.json

@@ -4,9 +4,9 @@
   "directCommit": false,
   "ext": {
     "account": 12362,
-    "apiHost": "https://api.shop.huaml.com",
+    "apiHost": "http://api.shop.huaml.com",
     "socketApiHost": "api.shop.huaml.com",
-    "imgHost": "https://img.huaml.com",
+    "imgHost": "http://img.huaml.com",
     "name":"花美玲"
   }
 }

+ 1 - 1
hdApp/src/manifest.json

@@ -224,7 +224,7 @@
             "subPackages" : true
         },
         "lazyCodeLoading":"requiredComponents",
-       "uniStatistics" : {
+        "uniStatistics" : {
             "enable" : false
         },
         "unipush" : {

+ 6 - 6
hdApp/src/static/iconfont/iconfont.css

@@ -1,11 +1,11 @@
 @font-face {
   font-family: 'iconfont';  /* project id 1525256 */
-  src: url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.eot');
-  src: url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.eot?#iefix') format('embedded-opentype'),
-  url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
-  url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.woff') format('woff'),
-  url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.ttf') format('truetype'),
-  url('https://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.svg#iconfont') format('svg');
+  src: url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.eot');
+  src: url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.eot?#iefix') format('embedded-opentype'),
+  url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
+  url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.woff') format('woff'),
+  url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.ttf') format('truetype'),
+  url('http://api.shop.huaml.com/iconfont/font_1525256_6bxwphhntqh.svg#iconfont') format('svg');
 }
 
 .iconfont {

+ 1 - 1
mallApp/src/config.js

@@ -1,4 +1,4 @@
 export const ProjectName = 'mall'
 export const CURRENT_ENV = 'dev'
-export const APIHOST = 'https://api.shop.theflorist.cn'
+export const APIHOST = 'http://api.shop.theflorist.cn'
 export const WSSHOST = 'wss://chat.shop.huaml.com'

+ 2 - 2
mallApp/src/ext.json

@@ -4,9 +4,9 @@
   "directCommit": false,
   "ext": {
     "account": 0,
-    "apiHost": "https://api.shop.theflorist.cn",
+    "apiHost": "http://api.shop.theflorist.cn",
     "socketApiHost": "api.shop.theflorist.cn",
-    "imgHost": "https://img.theflorist.cn",
+    "imgHost": "http://img.theflorist.cn",
     "name":"中花卉"
   }
 }

+ 6 - 6
mallApp/src/static/iconfont/iconfont.css

@@ -1,11 +1,11 @@
 @font-face {
   font-family: 'iconfont';  /* project id 1525256 */
-  src: url('https://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot');
-  src: url('https://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot?#iefix') format('embedded-opentype'),
-  url('https://api.shop.theflorist.cn/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
-  url('https://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff') format('woff'),
-  url('https://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.ttf') format('truetype'),
-  url('https://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.svg#iconfont') format('svg');
+  src: url('http://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot');
+  src: url('http://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.eot?#iefix') format('embedded-opentype'),
+  url('http://api.shop.theflorist.cn/iconfont/font_1525256_6bxwphhntqh.woff2') format('woff2'),
+  url('http://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.woff') format('woff'),
+  url('http://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.ttf') format('truetype'),
+  url('http://api.shop.theflorist.cn/iconfont/font_1525256_6243f1wxe9f.svg#iconfont') format('svg');
 }
 
 .iconfont {