Commit 3fbedd0f by 前端

Merge branch 'SAAS+V5.8.5' into 'master'

上线合并

See merge request !32
2 parents 22532bca 7de134e7
Showing 540 changed files with 4748 additions and 20 deletions
---
name: requirement-impact-analysis
description: >-
Use when handling WeChat mini-program requirements, 做需求, 快改, 只分析,
impact scope, 改哪里, shared components, cross-package behavior, or suspected
missing related pages.
---
# 需求影响分析
## Overview
实现或评估需求前,用项目知识图谱取得带证据的候选关系,再由业务文档和源码检索校准。核心原则:**图谱邻接不等于必改**,单文件命中也不代表影响仅限单文件。
## 工作流
1. 先读 [DOMAIN-INDEX](../../../docs/DOMAIN-INDEX.md),确定 `application`、`workspace`、`study`、`matters`、`workOrder` 或 `shared` 业务边界及已有专章。
2. 提取 1–5 个精确关键词,优先页面、组件、API 方法、字段和全局状态,例如 `createOrder`、`wx.$orderListRefresh`、`packageWorkspace`、`gl-cust-form`。
3. 运行 `npm run knowledge:check`。有修改权限且产物漂移时执行 `npm run knowledge:build`;只读会话则标记图谱可能陈旧。
4. 逐个执行 `npm run impact -- --keyword <值> --depth 2 --direction both --format json`,依次审阅直接命中、上下游、跨域风险、测试、文档和 `unresolved`。
5. 用 `rg` 复核动态路由、计算字段、提交/回显和共享消费者。命中 `unresolved` 时保留不确定性,不猜测目标。
6. 结合需求条件分类:`必改`只放直接承担行为或契约的文件;`可能波及`放共享消费者和跨域证据;`明确不改`记录已核实但不满足触发条件的邻接项。
7. 默认按 [简表](references/reference.md) 输出;用户要求详细分析时使用 [完整模板](references/reference-full.md)。图谱输出只能作为证据,不能直接改名为改动清单。
8. 获得写权限后实施并验证。先执行 `npm run test:affected -- --list --format json` 检查测试计划,再运行所选测试;修改 `usingComponents` 后运行 `npm run gen:component-index`。
## 完成门槛(REQUIRED)
给出结论前,复制并填满下面的内部记录,保留全部七个原始标题;任一值为空就继续分析:
```markdown
- 业务域(DOMAIN-INDEX):命中的域与专章
- 漂移状态(knowledge:check):通过 | 已重建 | 只读降级说明
- 图谱查询(impact):每个精确关键词及命中摘要
- 未解析项(unresolved):相关项、源码复核或剩余风险
- 语义检索(rg):动态关系和条件分支证据
- 影响分类:必改 / 可能波及 / 明确不改及依据
- 测试计划(test:affected):选择结果、实际测试和手动回归
```
## 快速判定
| 信号 | 处理 |
|---|---|
| 页面内纯展示、无共享依赖 | 可轻量分析 |
| `components/`、`api/`、`store/`、`utils/` | 全库复核消费者,测试选择可升级全量 |
| 全局状态或跨分包证据 | 同时检查写入、读取、清理和回显 |
| 动态关系进入 `unresolved` | 用源码检索和运行时路径确认,不静态猜测 |
## 常见错误
- 直接 `rg` 后凭经验下结论,未检查图谱是否漂移。
- 将宽泛关键词的所有邻接项都列为改动目标。
- 只查提交页,遗漏列表、详情、返回刷新和接口契约。
- 共享层变更未经消费者检索就按单页测试收尾。
- 把登录手机号、验证码、Token 或会话内容写进仓库;Live 凭据只能来自环境变量。
# 需求影响分析完整模板
用户要求“详细分析”时使用;结论仍需由图谱证据、业务文档和源码语义共同支持。
```markdown
## 需求影响面分析
### 需求摘要
一句话说明行为、触发条件与预期结果。
### 涉及业务域
- 域名 — DOMAIN-INDEX 入口与原因
### 必改文件
| 路径 | 证据 | 原因 |
|---|---|---|
| `path/to/file.js` | 方法/API/状态关系 | 直接承担需求行为 |
### 可能波及
| 类型 | 路径/范围 | 复核点 |
|---|---|---|
| 共享组件/API/状态 | `components/...` | 其他消费者是否满足触发条件 |
### 明确不改
| 路径/范围 | 排除依据 |
|---|---|
| `packageWorkspace/...` | 仅名称相近,无共同依赖或状态关系 |
### 未解析风险与文档
- `unresolved` 项及对应 `rg` 复核结果
- `docs/order-creation/README.md` 等相关专章
### 测试 / 回归
- `npm run test:affected -- --list --format json`
- 选中的离线测试与手动页面路径
### 结论
- 改动边界、剩余假设和未执行的 Live 验证
```
检索示例:
```powershell
npm run impact -- --keyword createOrder --depth 2 --direction both --format json
npm run impact -- --keyword 'wx.$orderListRefresh' --depth 3 --direction both --format json
rg -n "createOrder|wx\.\$orderListRefresh" --glob "!node_modules/**" --glob "!miniprogram_npm/**"
```
# 需求影响简表
默认先给出以下结构;“只分析”到此结束,“做需求/快改”再按当前权限继续。
```markdown
## 影响面(简版)
- **模式**:做需求 | 快改 | 只分析
- **域**:application | workspace | study | matters | workOrder | shared
- **必改**:`path/to/file.js` — 直接承担行为或契约
- **可能波及**:无 | `components/...` / `api/...` — 共享或跨域证据
- **明确不改**:`path/to/file.js` — 已核实但不满足需求条件
- **回归**:自动化命令 + 一条手动路径
```
判定时优先读取图谱返回的 `documents`。工单相关专章位于:
- `docs/order-creation/README.md`
- `docs/order-lifecycle/README.md`
- `docs/tabWorkOrder/createOrder.md`
- `docs/tabWorkOrder/精品工单页面接口清单.md`
常用精确关键词:`createOrder`、`wx.$orderListRefresh`、`packageWorkspace`、`gl-cust-form`。共享组件还需核对 `docs/COMPONENT-PAGE-INDEX.md`。
# 迁移门禁
跨项目迁移或较大重构开始前,必须创建迁移 manifest 并通过 `npm run check:migration -- --manifest <manifest> --phase pre`。完成后使用 `--phase post` 复核测试状态和未阻塞验证命令。
小型修复不强制使用该门禁。文档和测试的准备工作可以直接进行,不受门禁阻挡;门禁用于阻止尚未具备迁移证据的业务变更进入迁移阶段。
# regional-assistant
区域助手微信小程序。开发环境使用 Node.js 24,安装依赖后在微信开发者工具中执行“构建 npm”。
```powershell
npm install
```
## 领域知识图谱与增量测试
```powershell
npm run knowledge:build
npm run knowledge:check
npm run impact -- --keyword createOrder --depth 2 --direction both --format json
npm run test:affected -- --list --format json
```
完整的领域入口、生成物说明、维护方式和 Live 安全边界见 [项目文档](./docs/README.md#领域知识图谱搭建与使用)。运行时账号、验证码和会话信息只能通过环境变量传入,不得写入仓库。
...@@ -69,6 +69,13 @@ module.exports = { ...@@ -69,6 +69,13 @@ module.exports = {
getYQList() { getYQList() {
return api.post('dj.api.smartcarlife.serviceMerchant.curYqList') return api.post('dj.api.smartcarlife.serviceMerchant.curYqList')
}, },
/** 获取当前登录账号关联的4S店及园区店列表 */
getShopWithYqList(data) {
return api.post(
'dj.api.smartcarlife.serviceMerchant.shopWithYqList',
data || {}
)
},
/** 根据商户号获取员工列表信息(转化人员) */ /** 根据商户号获取员工列表信息(转化人员) */
getConversionEmployeeList(data) { getConversionEmployeeList(data) {
// 0->2.0 1->1.1 2->1.2 3->1.3 场景对应 // 0->2.0 1->1.1 2->1.2 3->1.3 场景对应
...@@ -158,7 +165,7 @@ module.exports = { ...@@ -158,7 +165,7 @@ module.exports = {
/** 获取商户订单设置 */ /** 获取商户订单设置 */
getMerchantRecordingSettings(data) { getMerchantRecordingSettings(data) {
return api.post( return api.post(
'dj.api.smartcarlife.recordingSettings.getMerchantRecordingSettings', 'dj.api.smartcarlife.order.field.lightChange.setting.list',
data data
) )
}, },
...@@ -172,6 +179,7 @@ module.exports = { ...@@ -172,6 +179,7 @@ module.exports = {
}, },
/**补录订单 */ /**补录订单 */
waitinputorder(data) { waitinputorder(data) {
data = data || {}
data.inputStatus = 0 data.inputStatus = 0
// data.payType = 1 // data.payType = 1
return api.post('dj.api.smartcarlife.weapp.waitinputorder.page', data) return api.post('dj.api.smartcarlife.weapp.waitinputorder.page', data)
...@@ -516,7 +524,10 @@ module.exports = { ...@@ -516,7 +524,10 @@ module.exports = {
}, },
// 获取异常订单待审核数量 // 获取异常订单待审核数量
getOrderWaitForAudit(data) { getOrderWaitForAudit(data) {
return api.post('dj.api.smartcarlife.goodsOrderApplyRecord.waitForAudit.count', data) return api.post(
'dj.api.smartcarlife.goodsOrderApplyRecord.waitForAudit.count',
data
)
}, },
/** 带教申请列表 */ /** 带教申请列表 */
getMentorShipList(data) { getMentorShipList(data) {
...@@ -531,4 +542,89 @@ module.exports = { ...@@ -531,4 +542,89 @@ module.exports = {
getPotentialCustomersPage(data) { getPotentialCustomersPage(data) {
return api.post('dj.api.staff.miniprogram.recruitment.demand.potentialCustomers.page', data) return api.post('dj.api.staff.miniprogram.recruitment.demand.potentialCustomers.page', data)
}, },
// 精品工单:查询员工可用场景
getUserScene(data) {
return api.post('dj.api.smartcarlife.scene.config.getUserScene', data)
},
// 精品工单:异常订单锁单状态
abnormalOrderLock() {
return api.post(
'dj.api.smartcarlife.goodsOrder.abnormalOrder.lock.select',
{}
)
},
// 精品工单:异常流水门店锁单状态
checkAbnormalFlowShopLock(data) {
return api.post(
'dj.api.smartcarlife.abnormalFlowDeclaration.checkShopLock',
data
)
},
// 精品工单:学习任务开单限制
checkStudyTaskAPI(data) {
return api.post(
'dj.api.pad.learning.center.study.permission',
data,
[],
'/rop-dj-pad/router'
)
},
// 精品工单:VIN 校验
checkVinValidate(data) {
return api.post('dj.pad.api.vin.validate', data, [], '/rop-dj-pad/router')
},
// 精品工单学习任务弹窗:获取北森单点登录令牌
findBeiSenSSOToken(data) {
return api.post(
'dj.pad.api.beisen.findBeiSenSSOToken',
data,
[],
'/rop-dj-pad/router'
)
},
// 招聘管理门店列表
getDemandStoreListAPI(data) {
return api.post(
'dj.api.staff.miniprogram.recruitment.demand.store.list',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
// 招聘管理字典查询
getStaffDictListAPI(data) {
return api.post(
'dj.api.staff.miniprogram.dict.list',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
/** 添加招聘需求 */
addStaffDictListAPI(data) {
return api.post(
'dj.api.staff.miniprogram.recruitment.demand.add',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
/** 招聘需求分页列表 */
getRecruitmentPageAPI(data) {
return api.post(
'dj.api.staff.miniprogram.recruitment.page',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
/** 获取所有驻店人员数据 */
getAllStaffListAPI(data) {
return api.post(
'dj.api.staff.miniprogram.recruitment.staff.page',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
},
} }
import api from "~/utils/request/request.js";
module.exports = {
// 获取人员带教表单字典数据
getMentorDictList(data) {
return api.post('dj.api.staff.miniprogram.dict.list', data, [], '/rop-dj-staff-miniprogram/router')
},
// 获取带教参与人员列表数据
getParticipantOptions(data) {
return api.post('dj.api.supervisor.mini.team.staff.baseInfo.page', data, [], '/rop-dj-supervisor-mini/router')
},
// 查询督导管理门店数据
getSupervisorMerchantList(data) {
return api.post('dj.api.supervisor.mini.list.flightSupervisionMerchant', data, [], '/rop-dj-supervisor-mini/router')
},
/**
* 获取任务中心督导带教任务详情
*/
getTaskCenterDetail(data) {
return api.post('dj.staff.api.taskcenter.supervisor.coach.detail',data, [], '/rop-dj-staff-miniprogram/router')
},
/**
* 执行任务中心督导带教任务
*/
executeTaskCenter(data) {
return api.post('dj.staff.api.taskcenter.supervisor.coach.submit',data, [], '/rop-dj-staff-miniprogram/router')
},
// 获取全部课程列表数据
getRecommendedCourseList(data) {
return api.post('dj.supervisor.mini.api.all.course.page', data, [], '/rop-dj-supervisor-mini/router')
},
}
//app.js //app.js
// 初始化sentry
import sentryInit from '~/utils/sentryConfig/sentryInit'
const sentry = sentryInit()
wx.$sendSentry = function (e) {
sentry.captureException(e)
}
// 解决showLoading 和 showToast显示异常的问题 // 解决showLoading 和 showToast显示异常的问题
import fixWxShowToast from './utils/lib/fixWxShowToast' import fixWxShowToast from './utils/lib/fixWxShowToast'
fixWxShowToast() fixWxShowToast()
...@@ -27,9 +21,13 @@ import { checkYqdSuper, checkScene } from '~/store/index' ...@@ -27,9 +21,13 @@ import { checkYqdSuper, checkScene } from '~/store/index'
import eventbus from './utils/eventbus' import eventbus from './utils/eventbus'
import api from './api/api' import api from './api/api'
import { Version } from 'glsx-common-sdk' import { Version } from 'glsx-common-sdk'
import { areaList } from '@vant/area-data' //预加载省市区
import globalDataFunction from './mixins/globalDataFunction' import globalDataFunction from './mixins/globalDataFunction'
import {
hasPermission,
createPermissionHelpers,
LOGIN_ROLE
} from './utils/rolePermission'
/**全埋点 */ /**全埋点 */
import Track from '~/utils/track' import Track from '~/utils/track'
...@@ -81,7 +79,6 @@ App({ ...@@ -81,7 +79,6 @@ App({
wx.$util = util wx.$util = util
wx.$api = wxApi wx.$api = wxApi
wx.$eventbus = eventbus wx.$eventbus = eventbus
wx.$areaList = areaList
wx.$track = $Track wx.$track = $Track
let userInfo = util.getStorageSync('dj_boutique_user_info') let userInfo = util.getStorageSync('dj_boutique_user_info')
// ,this.globalData, userInfo // ,this.globalData, userInfo
...@@ -93,6 +90,9 @@ App({ ...@@ -93,6 +90,9 @@ App({
} }
}) })
wx.$globalDataFunction = globalDataFunction wx.$globalDataFunction = globalDataFunction
wx.$hasPermission = hasPermission
wx.$permission = createPermissionHelpers()
wx.$LOGIN_ROLE = LOGIN_ROLE
}, },
async getVersionInfo(request) { async getVersionInfo(request) {
if (request) this.globalData.versionData = null if (request) this.globalData.versionData = null
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"pages/webView/webView", "pages/webView/webView",
"pages/tab/index/index", "pages/tab/index/index",
"pages/tab/workspace/workspace", "pages/tab/workspace/workspace",
"pages/tabWorkOrder/pages/index/index",
"pages/tab/matters/matters", "pages/tab/matters/matters",
"pages/tab/study/study", "pages/tab/study/study",
"pages/tab/mine/mine", "pages/tab/mine/mine",
...@@ -19,7 +20,8 @@ ...@@ -19,7 +20,8 @@
"pages/mattersSubmitResult/mattersSubmitResult", "pages/mattersSubmitResult/mattersSubmitResult",
"pages/teachApply/teachApply", "pages/teachApply/teachApply",
"pages/teachApplyDetail/teachApplyDetail", "pages/teachApplyDetail/teachApplyDetail",
"pages/teachApplyCreate/teachApplyCreate" "pages/teachApplyCreate/teachApplyCreate",
"pages/specialMentoring/specialMentoring"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
...@@ -123,12 +125,30 @@ ...@@ -123,12 +125,30 @@
"pages/aiCheck/detail/detail", "pages/aiCheck/detail/detail",
"pages/aiCheck/defense/defense" "pages/aiCheck/defense/defense"
] ]
},
{
"root": "tabWorkOrder",
"name": "tabWorkOrder",
"pages": [
"pages/index/index",
"pages/createOrder/createOrder",
"pages/confirmOrder/confirmOrder",
"pages/orderDetail/orderDetail",
"pages/ocr/ocr"
]
} }
], ],
"preloadRule": {
"pages/tab/workspace/workspace": {
"network": "all",
"packages": [
"tabWorkOrder"
]
}
},
"usingComponents": { "usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell", "gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar", "calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar", "navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup", "popup": "/components/Popup/Popup",
...@@ -157,4 +177,4 @@ ...@@ -157,4 +177,4 @@
}, },
"lazyCodeLoading": "requiredComponents", "lazyCodeLoading": "requiredComponents",
"resizable": true "resizable": true
}
\ No newline at end of file \ No newline at end of file
}
...@@ -16,6 +16,14 @@ Component({ ...@@ -16,6 +16,14 @@ Component({
} }
}, },
title: String, title: String,
cancelText: {
type: String,
value: '取消'
},
confirmText: {
type: String,
value: '确认'
},
height: { height: {
type: String, type: String,
value: '85%' value: '85%'
...@@ -49,4 +57,4 @@ Component({ ...@@ -49,4 +57,4 @@ Component({
showPopup: !!this.properties.show, showPopup: !!this.properties.show,
}) })
} }
})
\ No newline at end of file \ No newline at end of file
})
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<slot></slot> <slot></slot>
</view> </view>
<view class="popup-footer {{ isFullSucreen?'isFullSucreen':'' }}"> <view class="popup-footer {{ isFullSucreen?'isFullSucreen':'' }}">
<view class="cancel btn text-center" bind:tap="hidePopup">取消</view> <view class="cancel btn text-center" bind:tap="hidePopup">{{ cancelText }}</view>
<view class="confirm btn text-center" bind:tap="confirm">确认</view> <view class="confirm btn text-center" bind:tap="confirm">{{ confirmText }}</view>
</view> </view>
</view> </view>
</view>
\ No newline at end of file \ No newline at end of file
</view>
export const LOW_PRICE_FLAG = 1
const CHILD_LIST_KEYS = [
'shopMerchantList',
'shopList',
'shopWithYqList',
'merchantList',
'storeList',
'shopMerchantInfoList',
'children'
]
function firstDefined(...values) {
return values.find(value => value !== undefined && value !== null && value !== '')
}
function unwrapList(value) {
if (Array.isArray(value)) return value
if (!value || typeof value !== 'object') return []
if (value.data !== undefined) return unwrapList(value.data)
for (const key of ['list', 'records', 'rows', 'result']) {
if (Array.isArray(value[key])) return value[key]
}
return []
}
function childListOf(item) {
for (const key of CHILD_LIST_KEYS) {
if (Array.isArray(item?.[key])) return item[key]
}
return []
}
function toOption(item, parent) {
const hasExplicitShop = item?.shopMerchantId !== undefined
const merchantId = firstDefined(
item?.shopMerchantId,
item?.merchantId,
item?.shopId,
item?.id
)
const merchantName = firstDefined(
item?.shopMerchantName,
item?.merchantName,
item?.shopName,
item?.name,
''
)
const yqMerchantId = firstDefined(
item?.yqMerchantId,
item?.sellerMerchantId,
item?.parkMerchantId,
parent?.yqMerchantId,
parent?.sellerMerchantId,
parent?.parkMerchantId,
parent?.merchantId,
hasExplicitShop ? item?.merchantId : undefined,
merchantId
)
const yqMerchantName = firstDefined(
item?.yqMerchantName,
item?.sellerMerchantName,
item?.parkMerchantName,
parent?.yqMerchantName,
parent?.sellerMerchantName,
parent?.parkMerchantName,
parent?.merchantName,
hasExplicitShop ? item?.merchantName : undefined,
merchantName
)
if (merchantId === undefined || merchantId === null || merchantId === '') {
return null
}
return {
merchantId,
merchantName,
yqMerchantId,
yqMerchantName,
key: `${yqMerchantId}:${merchantId}`
}
}
/**
* 将 shopWithYqList 的园区/4S 店混合返回结构统一为可选 4S 店。
*/
export function normalizeOrderMerchantOptions(payload) {
const result = []
const seen = new Set()
unwrapList(payload).forEach(parent => {
const children = childListOf(parent)
const rows = children.length ? children : [parent]
rows.forEach(row => {
const option = toOption(row, children.length ? parent : null)
if (!option || seen.has(option.key)) return
seen.add(option.key)
result.push(option)
})
})
return result
}
export function filterOrderMerchantOptions(options, keyword) {
const normalizedKeyword = String(keyword || '').trim().toLowerCase()
if (!normalizedKeyword) return [...(options || [])]
return (options || []).filter(item =>
`${item.merchantName || ''} ${item.yqMerchantName || ''}`
.toLowerCase()
.includes(normalizedKeyword)
)
}
export function buildLowPriceMerchantContext(option = {}) {
const yqMerchantId = firstDefined(
option.yqMerchantId,
option.sellerMerchantId
)
const yqMerchantName = firstDefined(
option.yqMerchantName,
option.sellerMerchantName,
''
)
return {
lowPriceFlag: LOW_PRICE_FLAG,
merchantId: option.merchantId,
merchantName: option.merchantName || '',
yqMerchantId,
yqMerchantName,
sellerMerchantId: yqMerchantId,
sellerMerchantName: yqMerchantName
}
}
import api from '~/api/api'
import {
buildLowPriceMerchantContext,
filterOrderMerchantOptions,
normalizeOrderMerchantOptions
} from './orderMerchantContext.helpers'
const FULL_PAY_TYPE_LIST = [
{ label: '收款方为门店收款', value: '3' },
{ label: '收款方为嘀加且属于对公转账收款', value: '4' },
{
label: '收款方为嘀加二维码收款',
value: '5',
tips: '适用于已有交易收款流水需补录订单时'
},
{
label: '特殊收款',
value: '6',
tips: '仅用于无法关联流水或混合支付场景,请谨慎选择。'
}
]
const DJ_QR_ONLY_PAY_TYPE_LIST = FULL_PAY_TYPE_LIST.filter(
item => item.value === '5'
)
Component({
properties: {
show: {
type: Boolean,
observer(show) {
if (show) this.openPresentation()
}
},
lowPriceMode: {
type: Boolean,
value: false,
observer() {
if (this.data.show) this.openPresentation()
}
},
/** 异常流水锁单态:仅允许嘀加二维码收款 */
djQrOnlyMode: {
type: Boolean,
value: false,
observer(value) {
if (this.data.show && !this.properties.lowPriceMode) {
this.applyDjQrOnlyPresentation(value)
}
}
},
popupSlotStyle: {
type: String,
value:
'height: calc(100% - var(--fontSize120) - env(safe-area-inset-bottom)); overflow: hidden;'
},
height: {
type: String,
value: 'var(--fontSize500)'
},
merchantHeight: {
type: String,
value: '80%'
},
includesChildHeight: {
type: String,
value: 'var(--fontSize1020)'
},
sceneObj: {
type: Object,
value: {},
observer(value) {
if (this.properties.djQrOnlyMode || this.properties.lowPriceMode) return
if (Object.keys(value || {}).length) {
const payTypeList = this.data.payTypeList.filter(item => item.value != 5)
this.setData({
payTypeList,
includesChildHeight: 'var(--fontSize870)'
})
}
}
}
},
data: {
currentStep: 1,
infoData: {},
payTypeList: FULL_PAY_TYPE_LIST.map(item => ({ ...item })),
merchantList: [],
filteredMerchantList: [],
merchantKeyword: '',
selectedMerchantKey: '',
selectedMerchant: null,
merchantLoading: false,
merchantError: ''
},
methods: {
openPresentation() {
if (this.properties.lowPriceMode) {
this.setData({
currentStep: 1,
infoData: {},
payTypeList: FULL_PAY_TYPE_LIST.map(item => ({ ...item })),
merchantList: [],
filteredMerchantList: [],
merchantKeyword: '',
selectedMerchantKey: '',
selectedMerchant: null,
merchantError: ''
})
this.loadOrderMerchantList()
return
}
this.applyDjQrOnlyPresentation(this.properties.djQrOnlyMode)
},
applyDjQrOnlyPresentation(djQrOnlyMode) {
if (djQrOnlyMode) {
this.setData({
payTypeList: DJ_QR_ONLY_PAY_TYPE_LIST.map(item => ({ ...item })),
includesChildHeight: 'var(--fontSize870)',
infoData: { payFlag: '2', payType: '5' }
})
return
}
this.setData({
payTypeList: FULL_PAY_TYPE_LIST.map(item => ({ ...item })),
includesChildHeight: 'var(--fontSize1020)',
infoData: {}
})
},
async loadOrderMerchantList() {
this.setData({ merchantLoading: true, merchantError: '' })
try {
const response = await api.getShopWithYqList({ sceneType: 1 })
if (response?.code != 0) {
throw new Error(response?.message || '下单门店加载失败')
}
const merchantList = normalizeOrderMerchantOptions(response?.data)
this.setData({
merchantList,
filteredMerchantList: merchantList,
merchantLoading: false,
merchantError: merchantList.length ? '' : '暂无可选择的下单门店'
})
} catch (error) {
const merchantError = error?.message || '下单门店加载失败,请稍后重试'
this.setData({
merchantList: [],
filteredMerchantList: [],
merchantLoading: false,
merchantError
})
wx.$util.showToast(merchantError)
}
},
onMerchantKeywordInput(e) {
const merchantKeyword = e.detail.value || ''
this.setData({
merchantKeyword,
filteredMerchantList: filterOrderMerchantOptions(
this.data.merchantList,
merchantKeyword
)
})
},
clearMerchantKeyword() {
this.setData({
merchantKeyword: '',
filteredMerchantList: [...this.data.merchantList]
})
},
chooseMerchant(e) {
const selectedMerchant = e.currentTarget.dataset.item
this.setData({
selectedMerchant,
selectedMerchantKey: selectedMerchant.key
})
},
chooseParent(e) {
if (this.properties.djQrOnlyMode) {
return wx.$util.showToast(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
this.setData({ 'infoData.payFlag': e.currentTarget.dataset.type })
},
chooseChild(e) {
const type = e.currentTarget.dataset.type
if (this.properties.djQrOnlyMode && String(type) !== '5') {
return wx.$util.showToast(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
this.setData({ 'infoData.payType': type })
},
cancel() {
this.triggerEvent('cancel')
},
confirm() {
if (this.properties.lowPriceMode && this.data.currentStep === 1) {
if (!this.data.selectedMerchant) {
return wx.$util.showToast('请选择下单门店')
}
this.setData({ currentStep: 2 })
return
}
const { infoData } = this.data
if (
this.properties.djQrOnlyMode &&
String(infoData.payType) !== '5'
) {
return wx.$util.showToast(
'存在异常流水未处理,请选择嘀加二维码收款'
)
}
if (!infoData.payFlag || (infoData.payFlag == 2 && !infoData.payType)) {
return wx.$util.showToast('请选择订单收款方式')
}
const detail = this.properties.lowPriceMode
? {
...infoData,
...buildLowPriceMerchantContext(this.data.selectedMerchant)
}
: infoData
this.cancel()
this.triggerEvent('confirm', detail)
}
}
})
{ {
"component": true, "component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* components/orderPromptPop/orderPromptPop.wxss */
.prompt-layout {
height: 100%;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.sub-title {
height: var(--fontSize100);
font-size: var(--fontSize32);
color: #222222;
font-weight: 600;
position: sticky;
left: 0;
top: 0;
background-color: #fff;
z-index: 2;
border-bottom: var(--fontSize1) solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.stepper {
position: relative;
display: flex;
justify-content: center;
padding: var(--fontSize28) var(--fontSize72) var(--fontSize20);
flex-shrink: 0;
}
.stepper-line {
position: absolute;
width: 35%;
height: var(--fontSize2);
top: var(--fontSize36);
left: 32.5%;
background: #D9E3FF;
}
.stepper-item {
position: relative;
z-index: 1;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
color: #292D33;
}
.stepper-item.active {
color: #2C66F7;
}
.stepper-item.active .stepper-dot {
background: #2C66F7;
border-color: #2C66F7;
}
.stepper-dot {
width: var(--fontSize12);
height: var(--fontSize12);
border-radius: 50%;
border: var(--fontSize2) solid #9DB7FF;
background: #FFFFFF;
box-sizing: border-box;
}
.stepper-text {
margin-top: var(--fontSize16);
font-size: var(--fontSize24);
}
.merchant_content {
height: 0;
min-height: 0;
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
padding-bottom: var(--fontSize12);
box-sizing: border-box;
}
.merchant-search {
height: var(--fontSize64);
border-radius: var(--fontSize32);
background: #F5F6F8;
display: flex;
align-items: center;
padding: 0 var(--fontSize20);
box-sizing: border-box;
flex-shrink: 0;
}
.merchant-search input {
flex: 1;
height: 100%;
font-size: var(--fontSize26);
color: #292D33;
}
.merchant-search-icon,
.merchant-clear-icon {
width: var(--fontSize28);
height: var(--fontSize28);
flex-shrink: 0;
}
.merchant-search-icon {
margin-right: var(--fontSize12);
}
.merchant-clear-icon {
margin-left: var(--fontSize12);
}
.merchant-list {
height: 0;
min-height: 0;
flex: 1;
margin-top: var(--fontSize12);
}
.payment-scroll {
height: 0;
min-height: 0;
flex: 1;
}
.merchant-item {
min-height: var(--fontSize76);
border-bottom: var(--fontSize1) solid #EBEDF0;
display: flex;
align-items: center;
justify-content: space-between;
font-size: var(--fontSize26);
color: #292D33;
padding: 0 var(--fontSize4);
box-sizing: border-box;
}
.merchant-item.selected {
color: #2C66F7;
}
.merchant-name {
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.merchant-check {
color: #2C66F7;
font-size: var(--fontSize32);
font-weight: 600;
margin-left: var(--fontSize16);
}
.merchant-state {
color: #9B9B9E;
font-size: var(--fontSize26);
text-align: center;
padding: var(--fontSize64) 0;
}
.prompt_content {
padding: var(--fontSize24) 0;
font-size: var(--fontSize28);
color: #222222;
}
.prompt_content .select_item {
padding: var(--fontSize24) 0;
border-bottom: var(--fontSize2) solid #EBEDF0;
display: flex;
}
.prompt_content .child_select_content {
margin-left: var(--fontSize56);
background: #F7F7F7;
border-radius: var(--fontSize16);
}
.prompt_content .child_select_content .child_select_item {
display: flex;
align-items: center;
border-bottom: var(--fontSize1) solid rgba(195, 195, 195, 0.3);
padding: var(--fontSize32) var(--fontSize24);
}
.prompt_content .child_select_content .child_select_item:last-child {
border-bottom: 0;
}
.prompt_content .radio_label {
font-size: var(--fontSize28);
color: #292D33;
margin-left: var(--fontSize24);
margin-top: calc(-1 * var(--fontSize6));
}
.prompt_content .arc {
width: var(--fontSize28);
height: var(--fontSize28);
border-radius: 50%;
border: var(--fontSize2) solid #E3E3E6;
}
.prompt_content .radio-icon {
width: var(--fontSize32);
height: var(--fontSize32);
}
.prompt_content .radio_tips {
font-size: var(--fontSize24);
color: #9B9B9E;
margin-top: var(--fontSize8);
margin-left: var(--fontSize24);
}
<popup show="{{ show }}"
bindconfirm="confirm"
bindcancel="cancel"
height="{{ lowPriceMode ? merchantHeight : (infoData.payFlag == 2 ? includesChildHeight : height) }}"
slotStyle="{{ popupSlotStyle }}"
confirmText="{{ lowPriceMode && currentStep == 1 ? '下一步' : '确认' }}">
<view class="prompt-layout">
<view class="sub-title">
<view>
{{ lowPriceMode ? '新建低价单' : '确认订单收款方式' }}
</view>
</view>
<view class="stepper" wx:if="{{ lowPriceMode }}">
<view class="stepper-line"></view>
<view class="stepper-item active">
<view class="stepper-dot"></view>
<view class="stepper-text">
选择下单门店
</view>
</view>
<view class="stepper-item {{ currentStep == 2 ? 'active' : '' }}">
<view class="stepper-dot"></view>
<view class="stepper-text">
订单收款方式
</view>
</view>
</view>
<view class="merchant_content" wx:if="{{ lowPriceMode && currentStep == 1 }}">
<view class="merchant-search">
<image class="merchant-search-icon" src="/images/search.png" />
<input value="{{ merchantKeyword }}"
placeholder="搜索"
bindinput="onMerchantKeywordInput" />
<image wx:if="{{ merchantKeyword }}"
class="merchant-clear-icon"
src="/images/clear.png"
bindtap="clearMerchantKeyword" />
</view>
<scroll-view class="merchant-list" scroll-y>
<view class="merchant-item {{ selectedMerchantKey == item.key ? 'selected' : '' }}"
wx:for="{{ filteredMerchantList }}"
wx:key="key"
data-item="{{ item }}"
bindtap="chooseMerchant">
<view class="merchant-name">
{{ item.merchantName }}
</view>
<view class="merchant-check" wx:if="{{ selectedMerchantKey == item.key }}">
✓
</view>
</view>
<view class="merchant-state" wx:if="{{ merchantLoading }}">
门店加载中...
</view>
<view class="merchant-state"
wx:elif="{{ merchantError || !filteredMerchantList.length }}">
{{ merchantError || '未搜索到匹配门店' }}
</view>
</scroll-view>
</view>
<scroll-view class="payment-scroll"
wx:else
scroll-y
enhanced="{{ true }}"
show-scrollbar="{{ false }}">
<view class="prompt_content">
<view class="select_item" wx:if="{{ !djQrOnlyMode }}">
<image wx:if="{{ infoData.payFlag == 1 }}"
class="radio-icon"
src="/components/images/radio.png" />
<view wx:else
class="arc"
bindtap="chooseParent"
data-type="1" />
<view bindtap="chooseParent" data-type="1">
<view class="radio_label">
未支付
</view>
<view class="radio_tips">
去创建线上付款码订单
</view>
</view>
</view>
<view class="select_item" style="border-bottom: 0rpx;">
<image wx:if="{{ infoData.payFlag == 2 }}"
class="radio-icon"
src="/components/images/radio.png" />
<view wx:else
class="arc"
bindtap="chooseParent"
data-type="2" />
<view bindtap="chooseParent" data-type="2">
<view class="radio_label">
已支付
</view>
<view class="radio_tips">
款项已付需补录订单
</view>
</view>
</view>
<view class="child_select_content" wx:if="{{ infoData.payFlag == 2 }}">
<view wx:for="{{ payTypeList }}"
class="child_select_item"
wx:key="value">
<image wx:if="{{ infoData.payType == item.value }}"
class="radio-icon"
src="/components/images/radio.png" />
<view wx:else
class="arc"
bindtap="chooseChild"
data-type="{{ item.value }}" />
<view bindtap="chooseChild" data-type="{{ item.value }}">
<view class="radio_label">
{{ item.label }}
</view>
<view class="radio_tips" wx:if="{{ item.tips }}">
{{ item.tips }}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</popup>
// packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.js
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'
Component({
options: {
addGlobalClass: true
},
properties: {
show: {
type: Boolean,
value: false
},
title: {
type: String,
value: ''
},
// 原始选项列表,支持任意字段名,通过 labelKey/valueKey 映射
options: {
type: Array,
value: []
},
// 是否多选
multiple: {
type: Boolean,
value: false
},
// 单选初始值
value: {
type: null,
value: null
},
// 多选初始值
values: {
type: Array,
value: []
},
// 字段映射
labelKey: {
type: String,
value: 'name'
},
valueKey: {
type: String,
value: 'value'
},
// 多选最大数量(不限制则设为 0 或不传)
max: {
type: Number,
value: 0
},
// 单选时点击即确认
confirmOnSelect: {
type: Boolean,
value: false
},
height: {
type: String
},
allowSearch: {
type: Boolean
}
},
data: {
IMG_URL,
displayOptions: [], // 带 checked 的渲染选项
selectedValues: [] // 选中的值列表(单选也统一用数组)
},
observers: {
'options, multiple, value, values': function(options, multiple, value, values) {
this.initDisplay(options || [], multiple, value, values)
},
show(n) {
// 进出场时保持数据一致
if (n) {
this.setData({
searchValue: ''
})
this.initDisplay(this.properties.options || [], this.properties.multiple, this.properties.value, this.properties.values)
}
}
},
methods: {
initDisplay(options = [], multiple = false, value = null, values = []) {
const vKey = this.properties.valueKey
// 初始选中值统一转为数组
const initSelected = multiple ? (Array.isArray(values) ? values.slice() : []) : (value !== null && value !== undefined ? value : [])
const display = (options || []).map(item => {
const val = item[vKey]
const checked = initSelected?.some(v => v == val)
return { ...item, checked }
})
this.setData({
displayOptions: display,
copyDisplayOptions: wx.$util.deepClone(display),
selectedValues: initSelected
})
},
toggle(e) {
const { index, item } = e.currentTarget.dataset
const { multiple, max, valueKey } = this.properties
let { displayOptions, copyDisplayOptions } = this.data
if (!item || item.disabled) return
if (multiple) {
let nextChecked = !item.checked
// 限制最大数量
if (nextChecked && max > 0) {
const selectedCount = this.data.selectedValues.length
if (selectedCount >= max) {
// 可根据项目规范提示用户,这里不做 UI 弹窗,保持组件纯净
this.triggerEvent('maxtips')
return
}
}
const selectIndex = displayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`displayOptions[${selectIndex}].checked`]: nextChecked })
const copySelectIndex = copyDisplayOptions?.findIndex(v => v[valueKey] == item[valueKey])
this.setData({ [`copyDisplayOptions[${copySelectIndex}].checked`]: nextChecked })
const val = item[valueKey]
let selected = this.data.selectedValues.slice()
const pos = selected.findIndex(v => v == val)
if (nextChecked && pos == -1) selected.push(val)
if (!nextChecked && pos > -1) selected.splice(pos, 1)
this.setData({ selectedValues: selected })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
} else {
// 单选:取消其他,选中当前
const currentVal = item[valueKey]
const display = this.data.displayOptions.map((it, idx) => ({ ...it, checked: idx == index ? !it.checked : false }))
const selected = display[index].checked ? [currentVal] : []
this.setData({ displayOptions: display, selectedValues: selected })
const copyDisplay = this.data.copyDisplayOptions.map((it, idx) => ({ ...it, checked: idx == index ? !it.checked : false }))
this.setData({ copyDisplayOptions: copyDisplay })
this.triggerEvent('change', { values: selected, items: this.getSelectedItems() })
if (this.properties.confirmOnSelect) {
this.onConfirm()
}
}
},
search(e) {
let { labelKey, copyDisplayOptions, displayOptions, selectedValues, valueKey } = this.data
let { value } = e.detail
if (!value) {
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
return i
})
this.setData({
displayOptions: copyDisplayOptions
})
} else {
let arr = []
copyDisplayOptions.map(i => {
i.checked = false
if (selectedValues.includes(i[valueKey])) i.checked = true
if (i[labelKey].indexOf(value) != -1) {
arr.push(i)
}
})
this.setData({
displayOptions: arr
})
}
},
onCancel() {
this.triggerEvent('cancel')
},
onConfirm() {
const values = this.data.selectedValues
const items = this.getSelectedItems()
this.triggerEvent('confirm', { values, items })
},
getSelectedItems() {
return (this.data.copyDisplayOptions || []).filter(it => it.checked)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
/* packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.wxss */
.sp-list {
box-sizing: border-box;
height: 100%;
&.hassearch {
height: calc(100% - 104rpx);
}
.sp-item {
display: flex;
align-items: center;
justify-content: space-between;
height: 96rpx;
border-bottom: 2rpx solid #F0F2F5;
color: #333;
font-size: 28rpx;
&:last-child {
border-bottom: none;
}
.label {
max-width: 580rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.check {
width: 32rpx;
height: 32rpx;
}
}
.active {
.label {
color: #3D74FF;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageWorkspace/pages/performanceRating/components/selectPopup/selectPopup.wxml-->
<popup show="{{show}}" title="{{title}}" height="{{height || '50%'}}" bind:confirm="onConfirm" bind:cancel="onCancel" customPopupSlotStyle="overflow:auto;">
<view wx:if="{{allowSearch}}">
<search-input bindsearch="search" placeholder="搜索" value="{{ searchValue }}" />
</view>
<scroll-view scroll-y show-scrollbar="{{false}}" enhanced class="sp-list {{allowSearch ? 'hassearch' : ''}}">
<block wx:if="{{displayOptions.length}}">
<block wx:for="{{displayOptions}}" wx:key="index">
<view class="sp-item {{item.checked ? 'active' : ''}} {{item.disabled ? 'disabled' : ''}}" catchtap="toggle" data-index="{{index}}" data-item="{{item}}">
<text class="label">{{item[labelKey] || item.label || item.text}}</text>
<image class="check" src="{{IMG_URL}}checked.png" wx:if="{{item.checked}}" />
</view>
</block>
</block>
<block wx:else>
<empty-data />
</block>
</scroll-view>
</popup>
\ No newline at end of file \ No newline at end of file
...@@ -87,8 +87,6 @@ export const ALIYUN = ALIYUN_LIST[1]; ...@@ -87,8 +87,6 @@ export const ALIYUN = ALIYUN_LIST[1];
// 报价单图片地址 // 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]]; export const quotedImgUrl = createQuotedUrl[target[envIndex]];
export const scoket_url = scoketURL[target[envIndex]]; export const scoket_url = scoketURL[target[envIndex]];
// sentry Dsn 地址
export const dsnUrl = "https://6b10bd312d154ff3a4664772bb4e50f5@sentry.glsx.com.cn/49";
// 图片基地址 // 图片基地址
export const ImgUrl = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat"; export const ImgUrl = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat";
......
# 领域索引
| 域 | 业务范围 | 主要入口 | 人工文档 |
|---|---|---|---|
| `application` | 主包、登录、账号与场景切换 | `pages/loading`、`pages/sceneIndex`、`pages/wxLogin` | [文档总入口](./README.md) |
| `workspace` | 工作台、区域督导、业务工作区 | `pages/tab/workspace`、`packageWorkspace` | [开单入口](./order-creation/README.md) |
| `study` | 学习、课程、教学申请、专项辅导 | `pages/tab/study`、`packageStudy` | [文档总入口](./README.md) |
| `matters` | 事项、待办、处理与提交 | `pages/tab/matters` | [文档总入口](./README.md) |
| `workOrder` | 精品工单、低价单、开单与详情 | `pages/tabWorkOrder`、`tabWorkOrder` | [迁移与回归](./order-creation/README.md)、[生命周期](./order-lifecycle/README.md)、[页面说明](./tabWorkOrder/createOrder.md)、[接口清单](./tabWorkOrder/精品工单页面接口清单.md) |
| `shared` | 组件、API、Store、工具、行为与 WXS | `components`、`api`、`store`、`utils` | [组件反向索引](./COMPONENT-PAGE-INDEX.md) |
## 生成索引
- [项目总览](./generated/PROJECT-SUMMARY.md)
- [页面与路由](./generated/ROUTE-PAGE-INDEX.md)
- [API 调用方](./generated/API-CALLER-INDEX.md)
- [全局状态](./generated/GLOBAL-STATE-INDEX.md)
- [组件与页面](./COMPONENT-PAGE-INDEX.md)
## 精品工单既有入口
- [迁移与回归入口](./order-creation/README.md)
- [精品工单页面接口清单](./tabWorkOrder/精品工单页面接口清单.md)
- [自动化验收表](./order-lifecycle/test-acceptance.md)
# regional-assistant 文档
## 业务入口
- [六域索引](./DOMAIN-INDEX.md)
- [精品工单迁移与回归入口](./order-creation/README.md)
- [精品工单页面接口清单](./tabWorkOrder/精品工单页面接口清单.md)
- [精品工单生命周期维护手册](./order-lifecycle/README.md)
- [迁移设计](./superpowers/specs/2026-07-30-work-order-migration-design.md)
- [实施计划](./superpowers/plans/2026-07-30-work-order-migration.md)
## 领域知识图谱搭建与使用
图谱从 `app.json`、页面/组件配置、JavaScript、WXML、测试和人工域目录生成。机器关系只提供证据候选;动态路由、动态导入和运行时接口会保留为 `unresolved`,不得据此猜测最终目标。
```powershell
npm run knowledge:build
npm run knowledge:check
npm run impact -- --keyword createOrder --depth 2 --direction both --format json
npm run test:affected -- --list --format json
npm test
```
`docs/generated` 包含项目总览、页面路由、API 调用、全局状态、六域视图和机器图谱;`docs/COMPONENT-PAGE-INDEX.md` 是组件反向索引。`docs`、`scripts`、`tests` 和 `.agents` 均由 `project.config.json` 明确做了上传排除,不会进入小程序包。
需求分析顺序:先读 `DOMAIN-INDEX`,再执行 `knowledge:check` 和精确 `impact` 查询,随后用 `rg` 校准动态关系,最后将证据分成必改、可能波及和明确不改。实现后用 `test:affected` 复核测试计划,共享层或不确定改动会保守升级为全量离线测试。
## 日常维护
- 页面、组件、API、状态或域目录变化后运行 `npm run knowledge:build`。
- 提交前运行 `npm run knowledge:check`;若报告漂移,重新生成并审阅差异。
- 修改 `usingComponents` 后运行 `npm run gen:component-index`。
- 图谱无法解析的关系保留在 `unresolved`,首次涉及时补充业务文档或测试,不在生成器内硬编码猜测。
## Live 自动化
Live 用例默认跳过。登录手机号、验证码、Token 和会话信息只能通过对应 profile 声明的环境变量注入,仓库只保存环境变量名称。开发环境仅允许登录冒烟,禁止写业务数据;测试环境写操作还必须显式设置写入开关。任何输出和清理报告都不得包含凭据或会话值。
# 项目知识图谱概览
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
## 规模
- 节点:4255
- 关系:8122
- 未解析:91
## 节点类型
| 类型 | 数量 |
| --- | --- |
| apiOperation | 332 |
| component | 109 |
| document | 87 |
| domain | 6 |
| endpoint | 234 |
| globalState | 32 |
| method | 2937 |
| module | 365 |
| page | 72 |
| test | 81 |
## 关系类型
| 类型 | 数量 |
| --- | --- |
| bindsEvent | 939 |
| calls | 885 |
| callsApi | 221 |
| callsEndpoint | 332 |
| contains | 712 |
| coveredBy | 63 |
| declares | 2938 |
| definesApi | 332 |
| documentedBy | 60 |
| imports | 438 |
| navigatesTo | 71 |
| readsState | 766 |
| usesComponent | 314 |
| writesState | 51 |
## 使用入口
- 更新事实:`npm run knowledge:build`
- 检查漂移:`npm run knowledge:check`
- 查询影响:`npm run impact -- --keyword <关键词> --depth 2 --direction both --format json`
# 路由索引
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
| 来源 | 目标页面 | 证据 |
| --- | --- | --- |
| `app.js` | `pages/wxLogin/wxLogin` | `app.js:201` |
| `app.js` | `pages/wxLogin/wxLogin` | `app.js:221` |
| `packageStudy/pages/aiCheck/detail/components/fluent/fluent.js` | `packageStudy/pages/aiCheck/redundance/redundance` | `packageStudy/pages/aiCheck/detail/components/fluent/fluent.js:77` |
| `packageStudy/pages/aiCheck/detail/detail.js` | `packageStudy/pages/aiCheck/scene/scene` | `packageStudy/pages/aiCheck/detail/detail.js:36` |
| `packageStudy/pages/aiCheck/detail/detail.js` | `packageStudy/pages/aiCheck/scene/scene` | `packageStudy/pages/aiCheck/detail/detail.js:40` |
| `packageStudy/pages/aiCheck/detail/detail.js` | `packageStudy/pages/aiCheck/start/start` | `packageStudy/pages/aiCheck/detail/detail.js:57` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/defense/defense` | `packageStudy/pages/aiCheck/result/result.js:119` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/defense/defense` | `packageStudy/pages/aiCheck/result/result.js:119` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/scene/scene` | `packageStudy/pages/aiCheck/result/result.js:119` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/scene/scene` | `packageStudy/pages/aiCheck/result/result.js:122` |
| `packageStudy/pages/aiCheck/result/result.js` | `pages/tab/workspace/workspace` | `packageStudy/pages/aiCheck/result/result.js:96` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/start/start` | `packageStudy/pages/aiCheck/result/result.js:135` |
| `packageStudy/pages/aiCheck/result/result.js` | `pages/tab/workspace/workspace` | `packageStudy/pages/aiCheck/result/result.js:268` |
| `packageStudy/pages/aiCheck/result/result.js` | `packageStudy/pages/aiCheck/detail/detail` | `packageStudy/pages/aiCheck/result/result.js:556` |
| `packageStudy/pages/sceneMarket/carBrands/carBrands.js` | `packageStudy/pages/sceneMarket/carSeries/carSeries` | `packageStudy/pages/sceneMarket/carBrands/carBrands.js:155` |
| `packageStudy/pages/sceneMarket/components/formItem/formItem.js` | `packageStudy/pages/sceneMarket/carBrands/carBrands` | `packageStudy/pages/sceneMarket/components/formItem/formItem.js:28` |
| `packageStudy/pages/sceneMarket/index/methods.js` | `packageStudy/pages/sceneMarket/clue/clue` | `packageStudy/pages/sceneMarket/index/methods.js:25` |
| `packageWorkspace/pages/carBrands/carBrands.js` | `packageWorkspace/pages/carSeries/carSeries` | `packageWorkspace/pages/carBrands/carBrands.js:155` |
| `packageWorkspace/pages/cashFlowReview/pages/cashFlowDetail/cashFlowDetail.js` | `packageWorkspace/pages/cashFlowReview/pages/cashFlowList/cashFlowList` | `packageWorkspace/pages/cashFlowReview/pages/cashFlowDetail/cashFlowDetail.js:232` |
| `packageWorkspace/pages/newReceptionRecords/newReceptionRecords.js` | `pages/loading/loading` | `packageWorkspace/pages/newReceptionRecords/newReceptionRecords.js:126` |
| `packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.js` | `packageWorkspace/pages/orderApprovalManage/orderApprovalList/orderApprovalList` | `packageWorkspace/pages/orderApprovalManage/orderApprovalDetail/orderApprovalDetail.js:214` |
| `packageWorkspace/pages/receptionDetail/receptionDetail.js` | `pages/loading/loading` | `packageWorkspace/pages/receptionDetail/receptionDetail.js:88` |
| `packageWorkspace/pages/receptionRecords/receptionRecords.js` | `packageWorkspace/pages/receptionDetail/receptionDetail` | `packageWorkspace/pages/receptionRecords/receptionRecords.js:330` |
| `packageWorkspace/pages/recruitManage/recruitInsert/recruitInsert.js` | `packageWorkspace/pages/recruitManage/recruitResult/recruitResult` | `packageWorkspace/pages/recruitManage/recruitInsert/recruitInsert.js:761` |
| `packageWorkspace/pages/recruitManage/recruitManage/recruitManage.js` | `packageWorkspace/pages/recruitManage/recruitDetail/recruitDetail` | `packageWorkspace/pages/recruitManage/recruitManage/recruitManage.js:160` |
| `packageWorkspace/pages/recruitManage/recruitManage/recruitManage.js` | `packageWorkspace/pages/recruitManage/recruitInsert/recruitInsert` | `packageWorkspace/pages/recruitManage/recruitManage/recruitManage.js:179` |
| `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js` | `pages/tab/workspace/workspace` | `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js:38` |
| `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js` | `packageWorkspace/pages/recruitManage/recruitManage/recruitManage` | `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js:33` |
| `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js` | `packageWorkspace/pages/recruitManage/recruitInsert/recruitInsert` | `packageWorkspace/pages/recruitManage/recruitResult/recruitResult.js:28` |
| `packageWorkspace/pages/refundApply/refundApply.js` | `packageWorkspace/pages/refundOperationList/refundOperationList` | `packageWorkspace/pages/refundApply/refundApply.js:584` |
| `packageWorkspace/pages/refundApply/refundApply.js` | `packageWorkspace/pages/refundOperationList/refundOperationList` | `packageWorkspace/pages/refundApply/refundApply.js:526` |
| `packageWorkspace/pages/refundApply/refundApply.js` | `pages/loading/loading` | `packageWorkspace/pages/refundApply/refundApply.js:735` |
| `pages/accountItems/accountItems.js` | `pages/merchantList/merchantList` | `pages/accountItems/accountItems.js:295` |
| `pages/accountItems/accountItems.js` | `pages/sceneIndex/sceneIndex` | `pages/accountItems/accountItems.js:283` |
| `pages/accountItems/accountItems.js` | `pages/sceneIndex/sceneIndex` | `pages/accountItems/accountItems.js:291` |
| `pages/changeScene/changeScene.js` | `pages/tab/workspace/workspace` | `pages/changeScene/changeScene.js:52` |
| `pages/h5AuthPhone/h5AuthPhone.js` | `pages/nothing/nothing` | `pages/h5AuthPhone/h5AuthPhone.js:116` |
| `pages/loading/loading.js` | `pages/accountItems/accountItems` | `pages/loading/loading.js:46` |
| `pages/loading/loading.js` | `pages/sceneIndex/sceneIndex` | `pages/loading/loading.js:48` |
| `pages/loading/loading.js` | `pages/tab/workspace/workspace` | `pages/loading/loading.js:71` |
| `pages/mattersHandle/mattersHandle.js` | `pages/tab/matters/matters` | `pages/mattersHandle/mattersHandle.js:248` |
| `pages/mattersHandle/mattersHandle.js` | `pages/tab/matters/matters` | `pages/mattersHandle/mattersHandle.js:772` |
| `pages/mattersSubmitResult/mattersSubmitResult.js` | `packageWorkspace/pages/recruitManage/recruitInsert/recruitInsert` | `pages/mattersSubmitResult/mattersSubmitResult.js:16` |
| `pages/mattersSubmitResult/mattersSubmitResult.js` | `pages/tab/matters/matters` | `pages/mattersSubmitResult/mattersSubmitResult.js:21` |
| `pages/merchantList/merchantList.js` | `pages/sceneIndex/sceneIndex` | `pages/merchantList/merchantList.js:125` |
| `pages/sceneIndex/sceneIndex.js` | `pages/loading/loading` | `pages/sceneIndex/sceneIndex.js:126` |
| `pages/sceneIndex/sceneIndex.js` | `pages/tab/workspace/workspace` | `pages/sceneIndex/sceneIndex.js:58` |
| `pages/specialMentoring/specialMentoring.js` | `pages/tab/matters/matters` | `pages/specialMentoring/specialMentoring.js:110` |
| `pages/tab/matters/matters.js` | `pages/teachApply/teachApply` | `pages/tab/matters/matters.js:349` |
| `pages/tab/mine/mine.js` | `pages/changeScene/changeScene` | `pages/tab/mine/mine.js:142` |
| `pages/tab/mine/mine.js` | `pages/log/log` | `pages/tab/mine/mine.js:137` |
| `pages/tab/workspace/workspace.js` | `packageWorkspace/pages/receptionRecords/receptionRecords` | `pages/tab/workspace/workspace.js:410` |
| `pages/tab/workspace/workspace.js` | `tabWorkOrder/pages/createOrder/createOrder` | `pages/tab/workspace/workspace.js:229` |
| `pages/teachApply/teachApply.js` | `pages/teachApplyCreate/teachApplyCreate` | `pages/teachApply/teachApply.js:176` |
| `pages/wxLogin/wxLogin.js` | `pages/sceneIndex/sceneIndex` | `pages/wxLogin/wxLogin.js:567` |
| `pages/wxLogin/wxLogin.js` | `pages/sceneIndex/sceneIndex` | `pages/wxLogin/wxLogin.js:606` |
| `pages/wxLogin/wxLogin.js` | `pages/accountItems/accountItems` | `pages/wxLogin/wxLogin.js:640` |
| `pages/wxLogin/wxLogin.js` | `pages/nothing/nothing` | `pages/wxLogin/wxLogin.js:471` |
| `pages/wxLogin/wxLogin.js` | `pages/nothing/nothing` | `pages/wxLogin/wxLogin.js:413` |
| `pages/wxLogin/wxLogin.js` | `pages/nothing/nothing` | `pages/wxLogin/wxLogin.js:208` |
| `pages/wxLogin/wxLogin.js` | `pages/nothing/nothing` | `pages/wxLogin/wxLogin.js:257` |
| `tabWorkOrder/pages/confirmOrder/confirmOrder.js` | `tabWorkOrder/pages/orderDetail/orderDetail` | `tabWorkOrder/pages/confirmOrder/confirmOrder.js:178` |
| `tabWorkOrder/pages/confirmOrder/confirmOrder.js` | `tabWorkOrder/pages/orderDetail/orderDetail` | `tabWorkOrder/pages/confirmOrder/confirmOrder.js:264` |
| `tabWorkOrder/pages/confirmOrder/confirmOrder.js` | `tabWorkOrder/pages/orderDetail/orderDetail` | `tabWorkOrder/pages/confirmOrder/confirmOrder.js:200` |
| `tabWorkOrder/pages/createOrder/createOrder.js` | `pages/tab/workspace/workspace` | `tabWorkOrder/pages/createOrder/createOrder.js:2170` |
| `tabWorkOrder/pages/createOrder/createOrder.js` | `tabWorkOrder/pages/ocr/ocr` | `tabWorkOrder/pages/createOrder/createOrder.js:682` |
| `tabWorkOrder/pages/createOrder/submitStrategy.js` | `tabWorkOrder/pages/confirmOrder/confirmOrder` | `tabWorkOrder/pages/createOrder/submitStrategy.js:352` |
| `tabWorkOrder/pages/createOrder/submitStrategy.js` | `tabWorkOrder/pages/index/index` | `tabWorkOrder/pages/createOrder/submitStrategy.js:338` |
| `tabWorkOrder/pages/index/index.js` | `tabWorkOrder/pages/createOrder/createOrder` | `tabWorkOrder/pages/index/index.js:733` |
| `tabWorkOrder/pages/index/index.js` | `tabWorkOrder/pages/createOrder/createOrder` | `tabWorkOrder/pages/index/index.js:171` |
| `tabWorkOrder/pages/orderDetail/orderDetail.js` | `tabWorkOrder/pages/createOrder/createOrder` | `tabWorkOrder/pages/orderDetail/orderDetail.js:802` |
# application 领域索引
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
## 人工语义
- 别名:主包、场景切换、登录、账号选择
- 根目录:`app`、`pages`
- 核心入口:`pages/loading/loading`、`pages/sceneIndex/sceneIndex`、`pages/wxLogin/wxLogin`
- 风险关键词:`App`、`globalData`、`login`、`scene`
## 已知文档缺口
| 缺口 | 补齐时机 |
| --- | --- |
| 部分主框架跳转目标由运行时参数计算,静态图谱保留 unresolved。 | 涉及跳转需求时用 rg 复核 navigateTo、redirectTo、reLaunch、switchTab 和 wx.$router.go 的目标构造。 |
## 机器事实统计
| 类型 | 数量 |
| --- | --- |
| page | 11 |
| component | 5 |
| apiOperation | 9 |
| globalState | 20 |
| test | 0 |
| document | 1 |
## 可定位实体
| 类型 | 路径/符号 |
| --- | --- |
| apiOperation | `pages/tab/mine/api.js#GETGRASSLIST` |
| apiOperation | `pages/tab/mine/api.js#GETGRASSTOTAL` |
| apiOperation | `pages/tab/mine/api.js#getScoreDetailApi` |
| apiOperation | `pages/tab/mine/api.js#getStaffBankList` |
| apiOperation | `pages/tab/mine/api.js#getStaffDetailApi` |
| apiOperation | `pages/tab/mine/api.js#getWorkSetting` |
| apiOperation | `pages/tab/mine/api.js#logout` |
| apiOperation | `pages/tab/mine/api.js#queryPartnersByYqShop` |
| apiOperation | `pages/tab/mine/api.js#setWorkSetting` |
| component | `pages/components/authNoLogin/authNoLogin` |
| component | `pages/components/authSetting/authSetting` |
| component | `pages/components/recruitPopup/recruitPopup` |
| component | `pages/wxLogin/components/InputIcon/InputIcon` |
| component | `pages/wxLogin/components/TypeList/TypeList` |
| document | `docs/README.md` |
| globalState | `globalData.YQList` |
| globalState | `globalData.YQorderSetting` |
| globalState | `globalData.businessSchoolScene` |
| globalState | `globalData.isYqdSuper` |
| globalState | `globalData.serviceFilmRollSetting` |
| globalState | `globalData.storeListRange` |
| globalState | `globalData.yqdInfo` |
| globalState | `wx.$LOGIN_ROLE` |
| globalState | `wx.$api` |
| globalState | `wx.$eventbus` |
| globalState | `wx.$globalDataFunction` |
| globalState | `wx.$hasPermission` |
| globalState | `wx.$modal` |
| globalState | `wx.$permission` |
| globalState | `wx.$relogin` |
| globalState | `wx.$router` |
| globalState | `wx.$storage` |
| globalState | `wx.$track` |
| globalState | `wx.$util` |
| globalState | `wx.$versionConfig` |
| page | `pages/accountItems/accountItems` |
| page | `pages/changeScene/changeScene` |
| page | `pages/h5AuthPhone/h5AuthPhone` |
| page | `pages/loading/loading` |
| page | `pages/log/log` |
| page | `pages/merchantList/merchantList` |
| page | `pages/nothing/nothing` |
| page | `pages/sceneIndex/sceneIndex` |
| page | `pages/tab/mine/mine` |
| page | `pages/webView/webView` |
| page | `pages/wxLogin/wxLogin` |
# matters 领域索引
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
## 人工语义
- 别名:事项、审批、待办
- 根目录:`pages/mattersHandle`、`pages/mattersSubmitResult`、`pages/tab/matters`
- 核心入口:`pages/tab/matters/matters`
- 风险关键词:`handle`、`matters`、`submit`
## 已知文档缺口
| 缺口 | 补齐时机 |
| --- | --- |
| 暂无 | |
## 机器事实统计
| 类型 | 数量 |
| --- | --- |
| page | 3 |
| component | 0 |
| apiOperation | 0 |
| globalState | 0 |
| test | 0 |
| document | 1 |
## 可定位实体
| 类型 | 路径/符号 |
| --- | --- |
| document | `docs/README.md` |
| page | `pages/mattersHandle/mattersHandle` |
| page | `pages/mattersSubmitResult/mattersSubmitResult` |
| page | `pages/tab/matters/matters` |
# shared 领域索引
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
## 人工语义
- 别名:全局状态、公共接口、公共组件、共享层
- 根目录:`api`、`behaviors`、`components`、`store`、`utils`、`wxs`
- 核心入口:未维护
- 风险关键词:`GLCustForm`、`Popup`、`area-data`、`globalData`、`wx.$`
## 已知文档缺口
| 缺口 | 补齐时机 |
| --- | --- |
| 部分 ROP 方法或服务路径由请求封装在运行时组合,静态图谱不猜测最终接口。 | 涉及接口需求时用 rg 复核 API 方法、请求封装参数和调用页面。 |
## 机器事实统计
| 类型 | 数量 |
| --- | --- |
| page | 0 |
| component | 14 |
| apiOperation | 110 |
| globalState | 8 |
| test | 1 |
| document | 1 |
## 可定位实体
| 类型 | 路径/符号 |
| --- | --- |
| apiOperation | `api/api.js#abnormalOrderLock` |
| apiOperation | `api/api.js#accountAndPwd` |
| apiOperation | `api/api.js#addStaffDictListAPI` |
| apiOperation | `api/api.js#approvedPointsAPI` |
| apiOperation | `api/api.js#areaSupervisionExistsAPI` |
| apiOperation | `api/api.js#authPhone` |
| apiOperation | `api/api.js#burialPointRecord` |
| apiOperation | `api/api.js#cancelInvoiceQrcode` |
| apiOperation | `api/api.js#checkAbnormalFlowShopLock` |
| apiOperation | `api/api.js#checkStudyTaskAPI` |
| apiOperation | `api/api.js#checkVinValidate` |
| apiOperation | `api/api.js#clockInConfigPhone` |
| apiOperation | `api/api.js#createOrderCode` |
| apiOperation | `api/api.js#createQrcodeImage` |
| apiOperation | `api/api.js#findBeiSenSSOToken` |
| apiOperation | `api/api.js#getAllStaffListAPI` |
| apiOperation | `api/api.js#getBrandList` |
| apiOperation | `api/api.js#getConfigList` |
| apiOperation | `api/api.js#getConversionEmployeeList` |
| apiOperation | `api/api.js#getCouponList` |
| apiOperation | `api/api.js#getCurShopList` |
| apiOperation | `api/api.js#getCustomerClueRemind` |
| apiOperation | `api/api.js#getCustomerCouponList` |
| apiOperation | `api/api.js#getCustomerFileList` |
| apiOperation | `api/api.js#getDemandStoreListAPI` |
| apiOperation | `api/api.js#getEmployeeList` |
| apiOperation | `api/api.js#getGoodsTypeList` |
| apiOperation | `api/api.js#getInviteDateList` |
| apiOperation | `api/api.js#getLastUserOrderInfo` |
| apiOperation | `api/api.js#getListSelectAccount` |
| apiOperation | `api/api.js#getMentorShipList` |
| apiOperation | `api/api.js#getMerchantListPage` |
| apiOperation | `api/api.js#getMerchantRecordingSettings` |
| apiOperation | `api/api.js#getMoreBtnAPI` |
| apiOperation | `api/api.js#getOrderCode` |
| apiOperation | `api/api.js#getOrderRefundStep` |
| apiOperation | `api/api.js#getOrderWaitForAudit` |
| apiOperation | `api/api.js#getPointsReviewListAPI` |
| apiOperation | `api/api.js#getPositionList` |
| apiOperation | `api/api.js#getPotentialCustomersPage` |
| apiOperation | `api/api.js#getQYTechnicianList` |
| apiOperation | `api/api.js#getRecruitmentPageAPI` |
| apiOperation | `api/api.js#getRefundDetailListAPI` |
| apiOperation | `api/api.js#getSMS` |
| apiOperation | `api/api.js#getSceneById` |
| apiOperation | `api/api.js#getSceneMerchantRefStoreList` |
| apiOperation | `api/api.js#getServiceFilmRollSetting` |
| apiOperation | `api/api.js#getServiceMerchantList` |
| apiOperation | `api/api.js#getShopMerchantPointConfig` |
| apiOperation | `api/api.js#getShopWithYqList` |
| apiOperation | `api/api.js#getStaffDictListAPI` |
| apiOperation | `api/api.js#getStaffListByMerchantAPI` |
| apiOperation | `api/api.js#getStaffMentorFlag` |
| apiOperation | `api/api.js#getStaffRemindList` |
| apiOperation | `api/api.js#getStaffTargetTaskApi` |
| apiOperation | `api/api.js#getStaffTemplate` |
| apiOperation | `api/api.js#getStrategyShopMerchantList` |
| apiOperation | `api/api.js#getStrategyShopMerchantStaffList` |
| apiOperation | `api/api.js#getStrategyShopMerchantSupervisor` |
| apiOperation | `api/api.js#getSubShopMerchantList` |
| apiOperation | `api/api.js#getTaskCenterCountStat` |
| apiOperation | `api/api.js#getTaskCenterDetail` |
| apiOperation | `api/api.js#getTaskCenterPage` |
| apiOperation | `api/api.js#getTeachingApplicationDetail` |
| apiOperation | `api/api.js#getTeachingApplicationPage` |
| apiOperation | `api/api.js#getUserScene` |
| apiOperation | `api/api.js#getWaitAuditCountAPI` |
| apiOperation | `api/api.js#getWorkList` |
| apiOperation | `api/api.js#getWorkPackageGoodsList` |
| apiOperation | `api/api.js#getWsUrl` |
| apiOperation | `api/api.js#getYQList` |
| apiOperation | `api/api.js#getYqMerchantListPage` |
| apiOperation | `api/api.js#getYqMerchantSceneConfigAPI` |
| apiOperation | `api/api.js#getYqStoreConfig` |
| apiOperation | `api/api.js#isBusinessSchoolEnableCurrentUser` |
| apiOperation | `api/api.js#loginLogAdd` |
| apiOperation | `api/api.js#loginRecordSave` |
| apiOperation | `api/api.js#logout` |
| apiOperation | `api/api.js#merchantSettleAccountRule` |
| apiOperation | `api/api.js#merchantSettleAccountRuleGetByEffectDate` |
| apiOperation | `api/api.js#noLogin` |
| apiOperation | `api/api.js#ocr` |
| apiOperation | `api/api.js#reNoSignIn` |
| apiOperation | `api/api.js#searchOrderCustomer` |
| apiOperation | `api/api.js#selectAccountLogin` |
| apiOperation | `api/api.js#selectMerchantScene` |
| apiOperation | `api/api.js#serviceMerchantCurshopList` |
| apiOperation | `api/api.js#setMerchantRecordingSettings` |
| apiOperation | `api/api.js#setTaskDialog` |
| apiOperation | `api/api.js#shutDownTaskApi` |
| apiOperation | `api/api.js#smsLogin` |
| apiOperation | `api/api.js#ssoLogin` |
| apiOperation | `api/api.js#staffDailyReportMerchantValid` |
| apiOperation | `api/api.js#staffPermissions` |
| apiOperation | `api/api.js#submitTaskCenter` |
| apiOperation | `api/api.js#submitTeachingApplication` |
| apiOperation | `api/api.js#uploadImg` |
| apiOperation | `api/api.js#uploadPdfAPI` |
| apiOperation | `api/api.js#waitinputorder` |
| apiOperation | `api/api.js#waitstaffstateAPI` |
| apiOperation | `api/api.js#wxLogin` |
| apiOperation | `api/serviceCenter/index.js#getCompanyNoticeDetail` |
| apiOperation | `api/serviceCenter/index.js#getCompanyNoticeList` |
| apiOperation | `api/serviceCenter/index.js#getUnreadCountByType` |
| apiOperation | `api/specialMentoring/index.js#executeTaskCenter` |
| apiOperation | `api/specialMentoring/index.js#getMentorDictList` |
| apiOperation | `api/specialMentoring/index.js#getParticipantOptions` |
| apiOperation | `api/specialMentoring/index.js#getRecommendedCourseList` |
| apiOperation | `api/specialMentoring/index.js#getSupervisorMerchantList` |
| apiOperation | `api/specialMentoring/index.js#getTaskCenterDetail` |
| component | `components/Calendar/Calendar` |
| component | `components/EmptyData/EmptyData` |
| component | `components/GlCell/GlCell` |
| component | `components/GlImage/index` |
| component | `components/GlTextarea/GlTextarea` |
| component | `components/Popup/Popup` |
| component | `components/SearchInput/SearchInput` |
| component | `components/TabBar/TabBar` |
| component | `components/cover-tab-bar/cover-tab-bar` |
| component | `components/modal/modal` |
| component | `components/navigationBar/navigationBar` |
| component | `components/orderPromptPop/orderPromptPop` |
| component | `components/report-template-popup/report-template-popup` |
| component | `components/selectPopup/selectPopup` |
| document | `docs/README.md` |
| globalState | `globalData.YQorderSettingMerchantId` |
| globalState | `globalData.YQorderSettingYqMerchantId` |
| globalState | `globalData.configInfo` |
| globalState | `globalData.isStaff` |
| globalState | `globalData.isSuper` |
| globalState | `globalData.positionTypeList` |
| globalState | `globalData.staffListRange` |
| globalState | `wx.$dateListRefresh` |
| test | `tests/work-order-migration/low-price-api-contract.test.mjs` |
# study 领域索引
> 此文件由 `npm run knowledge:build` 生成。代码事实请勿手工修改;业务语义维护在 `docs/knowledge/`。
## 人工语义
- 别名:专项辅导、学习、教学申请、课程
- 根目录:`packageStudy`、`pages/specialMentoring`、`pages/tab/study`、`pages/teachApply`、`pages/teachApplyCreate`、`pages/teachApplyDetail`
- 核心入口:`pages/tab/study/study`
- 风险关键词:`course`、`specialMentoring`、`study`、`teachApply`
## 已知文档缺口
| 缺口 | 补齐时机 |
| --- | --- |
| 暂无 | |
## 机器事实统计
| 类型 | 数量 |
| --- | --- |
| page | 18 |
| component | 23 |
| apiOperation | 0 |
| globalState | 0 |
| test | 0 |
| document | 1 |
## 可定位实体
| 类型 | 路径/符号 |
| --- | --- |
| component | `packageStudy/pages/aiCheck/components/AudioTts/AudioTts` |
| component | `packageStudy/pages/aiCheck/components/Popup/Popup` |
| component | `packageStudy/pages/aiCheck/components/SpeechPopup/SpeechPopup` |
| component | `packageStudy/pages/aiCheck/components/scenePopup/scenePopup` |
| component | `packageStudy/pages/aiCheck/detail/components/attitude/attitude` |
| component | `packageStudy/pages/aiCheck/detail/components/deliver/deliver` |
| component | `packageStudy/pages/aiCheck/detail/components/emoji/emoji` |
| component | `packageStudy/pages/aiCheck/detail/components/fluent/fluent` |
| component | `packageStudy/pages/aiCheck/detail/components/lineChat/lineChat` |
| component | `packageStudy/pages/aiCheck/detail/components/pieChat/pieChat` |
| component | `packageStudy/pages/aiCheck/detail/components/quality/index` |
| component | `packageStudy/pages/aiCheck/detail/components/sale/sale` |
| component | `packageStudy/pages/aiCheck/detail/components/skilled/skilled` |
| component | `packageStudy/pages/aiCheck/start/components/RecordList/RecordList` |
| component | `packageStudy/pages/aiCheck/start/components/introduction/introduction` |
| component | `packageStudy/pages/aiCheck/start/components/tipsPop/tipsPop` |
| component | `packageStudy/pages/sceneMarket/components/PageLoading/PageLoading` |
| component | `packageStudy/pages/sceneMarket/components/TabView/TabView` |
| component | `packageStudy/pages/sceneMarket/components/audioComponent/audioComponent` |
| component | `packageStudy/pages/sceneMarket/components/filtrateBox/filtrateBox` |
| component | `packageStudy/pages/sceneMarket/components/formItem/formItem` |
| component | `packageStudy/pages/sceneMarket/components/material/material` |
| component | `packageStudy/pages/sceneMarket/components/materialTab/materialTab` |
| document | `docs/README.md` |
| page | `packageStudy/pages/aiCheck/chat/chat` |
| page | `packageStudy/pages/aiCheck/defense/defense` |
| page | `packageStudy/pages/aiCheck/detail/detail` |
| page | `packageStudy/pages/aiCheck/redundance/redundance` |
| page | `packageStudy/pages/aiCheck/result/result` |
| page | `packageStudy/pages/aiCheck/scene/scene` |
| page | `packageStudy/pages/aiCheck/start/start` |
| page | `packageStudy/pages/sceneMarket/carBrands/carBrands` |
| page | `packageStudy/pages/sceneMarket/carSeries/carSeries` |
| page | `packageStudy/pages/sceneMarket/clue/clue` |
| page | `packageStudy/pages/sceneMarket/clueForm/clueForm` |
| page | `packageStudy/pages/sceneMarket/index/index` |
| page | `packageStudy/pages/sceneMarket/materialPage/materialPage` |
| page | `pages/specialMentoring/specialMentoring` |
| page | `pages/tab/study/study` |
| page | `pages/teachApply/teachApply` |
| page | `pages/teachApplyCreate/teachApplyCreate` |
| page | `pages/teachApplyDetail/teachApplyDetail` |
This diff could not be displayed because it is too large.
{
"schemaVersion": 1,
"domains": [
{
"name": "application",
"aliases": ["主包", "登录", "账号选择", "场景切换"],
"roots": ["app", "pages"],
"entrypoints": ["pages/loading/loading", "pages/sceneIndex/sceneIndex", "pages/wxLogin/wxLogin"],
"riskKeywords": ["App", "globalData", "login", "scene"],
"documents": ["docs/README.md"]
},
{
"name": "workspace",
"aliases": ["工作台", "区域督导", "业务工作区"],
"roots": ["packageWorkspace", "pages/tab/index", "pages/tab/workspace"],
"entrypoints": ["pages/tab/workspace/workspace"],
"riskKeywords": ["workspace", "supervisor", "workOrder", "pending"],
"documents": ["docs/README.md", "docs/order-creation/README.md"]
},
{
"name": "study",
"aliases": ["学习", "课程", "教学申请", "专项辅导"],
"roots": ["packageStudy", "pages/tab/study", "pages/teachApply", "pages/teachApplyDetail", "pages/teachApplyCreate", "pages/specialMentoring"],
"entrypoints": ["pages/tab/study/study"],
"riskKeywords": ["study", "course", "teachApply", "specialMentoring"],
"documents": ["docs/README.md"]
},
{
"name": "matters",
"aliases": ["事项", "待办", "审批"],
"roots": ["pages/tab/matters", "pages/mattersHandle", "pages/mattersSubmitResult"],
"entrypoints": ["pages/tab/matters/matters"],
"riskKeywords": ["matters", "handle", "submit"],
"documents": ["docs/README.md"]
},
{
"name": "workOrder",
"aliases": ["精品工单", "低价单", "开单", "订单详情"],
"roots": ["tabWorkOrder", "pages/tabWorkOrder"],
"entrypoints": ["tabWorkOrder/pages/index/index", "tabWorkOrder/pages/createOrder/createOrder", "tabWorkOrder/pages/orderDetail/orderDetail"],
"riskKeywords": ["createOrder", "lowPriceFlag", "wx.$orderListRefresh", "OCR"],
"documents": ["docs/order-creation/README.md", "docs/order-lifecycle/README.md", "docs/tabWorkOrder/createOrder.md", "docs/tabWorkOrder/精品工单页面接口清单.md"]
},
{
"name": "shared",
"aliases": ["共享层", "公共组件", "公共接口", "全局状态"],
"roots": ["components", "api", "store", "utils", "behaviors", "wxs"],
"entrypoints": [],
"riskKeywords": ["GLCustForm", "Popup", "wx.$", "globalData", "area-data"],
"documents": ["docs/README.md"]
}
]
}
{
"schemaVersion": 1,
"gaps": [
{
"domain": "application",
"kind": "route",
"reason": "部分主框架跳转目标由运行时参数计算,静态图谱保留 unresolved。",
"nextStep": "涉及跳转需求时用 rg 复核 navigateTo、redirectTo、reLaunch、switchTab 和 wx.$router.go 的目标构造。"
},
{
"domain": "shared",
"kind": "endpoint",
"reason": "部分 ROP 方法或服务路径由请求封装在运行时组合,静态图谱不猜测最终接口。",
"nextStep": "涉及接口需求时用 rg 复核 API 方法、请求封装参数和调用页面。"
}
]
}
# 低价单接口清单
| 接口 | 调用位置 | 参数或返回改造 |
| --- | --- | --- |
| `order.search.containPackageGoods.byArea` | 低价单列表 | `sceneType=1`、`lowPriceFlag=1`、审批状态筛选 |
| `order.statByApplyStatus` | 低价单页签统计 | `sceneType=1`、`lowPriceFlag=1` |
| `weapp.waitinputorder.page` | 待补录弹层 | `lowPriceFlag`、`merchantId`、`yqMerchantId` |
| `weapp.waitinputorder.count` | 创建页待补录统计 | `lowPriceFlag`、`yqMerchantId` |
| `order.supplementOrder` | 补录提交 | `lowPriceFlag`、`sellerMerchantId` |
| `order.createWithPay` | 普通提交 | `lowPriceFlag`、`sellerMerchantId` |
| `serviceMerchant.curYqList` | 创建页非销售类人员选择 | 返回当前账号可见园区店;不用于新建低价单第一步 |
| `serviceMerchant.shopWithYqList` | 新建低价单第一步、低价单筛选 | 必传 `sceneType=1`;返回当前账号关联 4S 店及园区店并归一化 |
| `order.detail` | 详情与编辑回显 | 保留返回的 `lowPriceFlag` |
`merchantId` 始终表示所选 4S 店,`yqMerchantId` 与 `sellerMerchantId` 始终表示该 4S 店所属园区店。固定用户模拟只负责用户身份,不提供或覆盖 session,也不参与下单门店选择。
低价商品资格为前端提交前规则,不新增 ROP 接口:选品接口返回的每个实际商品需
`validMinSellPrice='Y'` 且存在 `minSellPrice`,录入基础单价必须严格小于该值;失败时在进入
`order.createWithPay` 或 `order.supplementOrder` 前终止。
{
"id": "low-price-order-store-selection",
"title": "低价单下单门店选择与接口改造",
"sourceProject": "dj-car-boutique-work-wechat",
"affectedPaths": [
"api",
"components/orderPromptPop",
"pages/tab/workspace",
"pages/tabWorkOrder",
"tabIndex/components/recordingOrderPopup",
"tabWorkOrder/pages/createOrder",
"docs/migrations/low-price-order-store-selection"
],
"interfaces": [
"dj.api.smartcarlife.order.search.containPackageGoods.byArea",
"dj.api.smartcarlife.order.statByApplyStatus",
"dj.api.smartcarlife.weapp.waitinputorder.page",
"dj.api.smartcarlife.weapp.waitinputorder.count",
"dj.api.smartcarlife.order.supplementOrder",
"dj.api.smartcarlife.order.createWithPay",
"dj.api.smartcarlife.serviceMerchant.curYqList",
"dj.api.smartcarlife.serviceMerchant.shopWithYqList",
"dj.api.smartcarlife.order.detail"
],
"tests": [
{
"id": "low-price-order-flow",
"file": "tests/work-order-migration/low-price-order-flow.test.mjs",
"level": "unit-integration",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "low-price-api-contract",
"file": "tests/work-order-migration/low-price-api-contract.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "low-price-goods-validation",
"file": "tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.helpers.test.mjs",
"level": "unit",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "low-price-goods-integration",
"file": "tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.integration.test.mjs",
"level": "unit-integration",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short HEAD",
"result": "0a3fa2a"
},
"apiInventory": "docs/migrations/low-price-order-store-selection/api-inventory.md",
"acceptance": "docs/migrations/low-price-order-store-selection/test-acceptance.md",
"verification": {
"commands": [
{
"command": "npm run test:workOrder",
"status": "pass"
}
]
}
}
# 低价单下单门店选择验收矩阵
## 页面行为
1. 工作台点击新增工单后,先显示“选择下单门店”,以 `sceneType=1` 调用 `serviceMerchant.shopWithYqList`,加载并可搜索当前账号关联的 4S 店。
2. 未选择门店不能进入收款方式步骤;选择后可进入“订单收款方式”。
3. 未支付、已支付及四种已支付收款方式保持现有业务含义。
4. 选择嘀加二维码时,待补录列表只查询当前选中 4S 店与园区店的低价单流水。
5. 普通下单和补录下单均使用同一次门店选择结果。
6. 订单收款方式步骤使用响应式高度,标题和按钮固定,超出可用高度的选项可以纵向滚动。
7. 新建工单页底部只显示“直接下单”,不显示“建档”按钮。
8. 低价单商品行回显最低价;未开启最低价时明确显示“未开启”。
9. 商品确认和改价时只回显最低价,不执行最低价资格校验;提交时如整单没有商品严格低于最低价,提示“价格未触发最低价,其他正常单请到生意助手侧录单”。
## 数据行为
1. 低价单标记统一为数值 `1`。
2. 4S 店写入 `merchantId`,所属园区店写入 `yqMerchantId` 和 `sellerMerchantId`。
3. 列表页签为全部、待审批、已通过、已驳回,分别对应无筛选、`[1,2]`、`[3]`、`[4]`。
4. 订单详情返回的 `lowPriceFlag` 在页面数据与后续编辑流程中不丢失。
5. 固定用户保持现状,sessionId 沿用系统原登录态且不会被固定用户模拟覆盖。
6. 工作台不查询订单待审核或异常数量;退款审核和招聘待处理统计保持原逻辑。
7. 下单页销售顾问直接将已选 4S 店作为唯一合作门店,不依赖第二次关联门店查询;非低价单仍使用原查询与用户上下文。
8. 普通商品、多规格 SKU 和套餐子商品均参与整单复核;任一商品满足 `validMinSellPrice='Y'` 且基础单价严格小于 `minSellPrice` 即可进入审批确认,全部不满足时不调用下单接口。
9. 上述反向最低价规则仅适用于 `lowPriceFlag=1`,普通工单原有最低价校验保持不变。
## 自动验证
Node.js 使用项目约束的 24.x 运行。单元测试覆盖门店归一化、搜索、审批状态映射、路由上下文、提交字段以及三类商品的最低价严格边界;契约测试覆盖 9 个接口及页面接线;迁移闭包检查覆盖依赖、路由、资源和公共 API。
# 主包体积优化接口清单
本迁移不改变后端 API、请求参数或响应契约,只改变静态资源物理归属:
| 接口/边界 | 迁移前 | 迁移后 |
|---|---|---|
| 学习图表 | `utils/wxcharts.js` | `packageStudy/utils/wxcharts.js` |
| 工单二维码 | `utils/lib/wxqrcode.js` | `tabWorkOrder/utils/wxqrcode.js` |
| 督导表单 | 根全局组件 | `packageWorkspace` 本地组件 |
| 地区数据 | 根 npm 依赖并挂载 `wx.$areaList` | `packageWorkspace/utils/area-data.js` 本地数据;旧 npm 产物显式排除上传 |
| workspace 筛选 | 根组件 | `packageWorkspace/components` |
| 工单独占组件 | 根组件 | `tabWorkOrder/components` |
| 主包预算 | 无 | `npm run size:main`,最大 2,000,000 字节 |
| 跨包边界 | 仅检查文件存在 | `npm run check:packageBoundaries`,拒绝主包到分包及跨分包依赖 |
{
"id": "main-package-size-optimization",
"title": "微信小程序主包体积优化",
"sourceProject": "regional-assistant@87171bc",
"affectedPaths": [
"app.js",
"app.json",
"package.json",
"package-lock.json",
"yarn.lock",
"project.config.json",
"miniprogram_npm",
"utils",
"components",
"packageStudy",
"packageWorkspace",
"tabWorkOrder",
"scripts",
"tests",
"docs"
],
"interfaces": [
"npm run size:main",
"npm run check:packageBoundaries",
"npm run knowledge:build",
"npm test",
"node scripts/wx-upload-guard.js"
],
"tests": [
{
"id": "migration-readiness-contract",
"file": "tests/migration-readiness/checkMigrationReadiness.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "main-package-budget-contract",
"file": "tests/package-size/mainPackageBudget.test.mjs",
"level": "integration",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short 87171bc",
"result": "87171bc"
},
"apiInventory": "docs/migrations/main-package-size-optimization/api-inventory.md",
"acceptance": "docs/migrations/main-package-size-optimization/test-acceptance.md",
"verification": {
"commands": [
{
"command": "npm run size:main",
"status": "pass"
},
{
"command": "node scripts/run-node-tests.mjs tests/package-size/mainPackageBudget.test.mjs",
"status": "pass"
},
{
"command": "npm run check:packageBoundaries",
"status": "pass"
},
{
"command": "npm run test:workOrder",
"status": "pass"
},
{
"command": "npm run knowledge:check",
"status": "pass"
},
{
"command": "npm test",
"status": "pass"
}
]
}
}
# 主包体积优化验收
| ID | 验收项 | Pre | Post |
|---|---|---|---|
| SIZE-001 | 物理主包不超过 2,000,000 字节 | fail: 2,360,562 bytes | pass: 1,981,498 bytes |
| SIZE-002 | wxcharts 仅位于 packageStudy | fail | pass |
| SIZE-003 | wxqrcode 仅位于 tabWorkOrder | fail | pass |
| SIZE-004 | 地区数据与 GLCustForm 仅位于 packageWorkspace | fail | pass |
| SIZE-005 | 工单独占根组件全部迁入 tabWorkOrder | fail | pass |
| SIZE-006 | workspace 独占筛选组件迁入分包 | fail | pass |
| SIZE-007 | 上传依赖、路由和 API 闭包 | pass | pass |
| SIZE-008 | 全仓离线测试 | pass | pass |
## 最终证据(2026-08-21)
- 保守物理主包从 2,360,562 字节降到 1,981,498 字节,减少 379,064 字节;低于内部 2,000,000 字节预算 18,502 字节,低于微信 2 MiB 上限 115,654 字节。
- 主包预算与分包边界合同 7 项通过,覆盖地区数据结构、许可文件、旧路径清理、消费者新路径和非法跨包边。
- 精品工单迁移、创建页、生命周期和闭包命令全部通过;生命周期回归为 82 项通过,4 个 Live 用例默认跳过。
- 知识图谱回归 29 项通过;12 个生成产物保持最新,最终图谱包含 4,240 个节点、8,117 条边、71 个页面和 88 个已知未解析项。
- `npm test` 退出码为 0;Node 24.19 上传 guard 扫描 235 个工单文件,依赖、路由和 API 闭包均无缺口。
- 上传 guard 依次执行主包预算、跨包依赖和工单闭包;跨包审计检查 670 条运行时导入/组件边(含 `app.json` 全局注册),未发现主包到分包或跨分包非法依赖。
- `@vant/area-data` 已从依赖清单移除;workspace 内保留 1.5.2 的地区数据与 MIT 许可,并通过 `project.config.json` 排除可能残留的旧 npm 构建产物。
- 登录及写入型 Live 用例继续依赖运行时环境变量与显式开关,本次验证未运行 Live 写入,也未在仓库写入测试账号。
# miniprogram_npm 体积优化接口清单
## 业务接口
本次迁移不新增、删除或修改任何业务 API、请求参数、响应结构或页面路由。
## 构建接口
- `project.config.json.setting.packNpmManually = true`
- `project.config.json.setting.packNpmRelationList[0] = { "packageJsonPath": "./package.json", "miniprogramNpmDistDir": "./" }`
- `pruneGeneratedNpmArtifacts(projectRoot)` 返回 `{ removedNestedNpm: boolean, removedSourceMaps: number }`。
- `scripts/wx-upload-guard.js` 在静态依赖闭包检查前调用裁剪函数。
## 运行时依赖
- 保留:`glsk-applet-component/GlsxPrivacy/index`。
- 删除:仓库业务源码无引用的 `glsx-applet-component`。
{
"id": "miniprogram-npm-size-reduction",
"title": "miniprogram_npm 插件与上传产物体积优化",
"sourceProject": "dj-car-boutique-work-wechat",
"affectedPaths": [
"package.json",
"package-lock.json",
"yarn.lock",
"project.config.json",
"project.private.config.json",
"scripts/wx-upload-guard.js",
"scripts/prune-miniprogram-npm.js",
"tests/work-order-migration/upload-config.test.mjs",
"tests/work-order-migration/npm-upload-prune.test.mjs",
"tests/work-order-migration/npm-dependency-prune.test.mjs",
"docs/migrations/miniprogram-npm-size-reduction"
],
"interfaces": [
"WeChat DevTools manual npm packaging configuration",
"pruneGeneratedNpmArtifacts(projectRoot)"
],
"tests": [
{
"id": "npm-dependency-prune",
"file": "tests/work-order-migration/npm-dependency-prune.test.mjs",
"level": "unit",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "npm-artifact-prune",
"file": "tests/work-order-migration/npm-upload-prune.test.mjs",
"level": "unit",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "upload-config-boundary",
"file": "tests/work-order-migration/upload-config.test.mjs",
"level": "integration",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short 70c239a",
"result": "70c239a"
},
"apiInventory": "docs/migrations/miniprogram-npm-size-reduction/api-inventory.md",
"acceptance": "docs/migrations/miniprogram-npm-size-reduction/test-acceptance.md",
"verification": {
"commands": [
{
"command": "npm run test:workOrderMigration",
"status": "pass"
},
{
"command": "npm run check:workOrderClosure",
"status": "pass"
}
]
}
}
# miniprogram_npm 体积优化验收
## 基线与清理后结果
| 指标 | 清理前 | 清理后 | 变化 |
| --- | ---: | ---: | ---: |
| `miniprogram_npm` 文件数 | 712 | 567 | -145 |
| `miniprogram_npm` 字节数 | 1,648,929 | 863,329 | -785,600(-47.64%) |
| `miniprogram_npm` MiB | 1.572541 | 0.823335 | -0.749206 |
| source map 数量 | 49 | 0 | -49 |
| source map 字节数 | 540,083 | 0 | -540,083 |
| `glsx-applet-component` 文件数 | 118 | 0 | -118 |
| `glsx-applet-component` 字节数 | 423,591 | 0 | -423,591 |
清理前的 source map 中有 22 个位于 `glsx-applet-component` 内,因此插件体积与 source map 体积有重叠,不能从总字节数中重复扣减。实测清理后为 863,329 字节,而不是按两项简单相加估算出的约 0.65 MiB。
## 生成产物验收
- `glsx-applet-component`:不存在。
- `glsk-applet-component`:存在,保留隐私组件运行依赖。
- source map:0 个。
- 嵌套 `miniprogram_npm/miniprogram_npm`:不存在。
- 清理前其余顶层包为 `@vant`、`dayjs`、`glsk-applet-component`、`glsx-common-sdk`、`number-precision`、`rfdc`;清理后六项均仍存在。
- 已提交的清理函数输出:`{ removedNestedNpm: false, removedSourceMaps: 27 }`。定向删除的插件目录已同时移除其中 22 个 source map,总计移除 49 个。
生成目录被 Git 忽略,可通过微信开发者工具“工具 → 构建 npm”重新生成。
## 验证结果
验证进程将 `C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin` 置于 `PATH` 首位,实际运行时为 Node `v24.14.0`、npm `10.8.2`,满足项目的 `>=24 <25` 约束。post gate 及其启动的两条 verification 命令继承同一 Node 24 进程环境。
| 命令 | 结果 |
| --- | --- |
| `npm run test:workOrderMigration`(Node v24.14.0) | 通过:61 tests,17 suites,61 pass,0 fail,0 cancelled,0 skipped |
| `npm run check:workOrderClosure`(Node v24.14.0) | 通过:扫描 234 个文件;0 缺失依赖、0 死路由、0 缺失 API 方法 |
| `npm run check:migration -- --manifest docs/migrations/miniprogram-npm-size-reduction/manifest.json --phase post`(Node v24.14.0) | 通过:输出 `Migration readiness post check passed`,并在同一 Node 24 环境中重跑两条 verification 命令 |
准备阶段曾在 Node v20.19.0 下运行验证;该结果不作为最终迁移证据。首次运行测试时,本地 `node_modules` 缺少已由 `package.json` 和 `package-lock.json` 声明的 `@babel/parser` 与 `@babel/generator`,因此 45 tests 中 41 pass、4 个测试文件加载失败。执行 `npm ci` 从已提交锁文件恢复依赖后,最终完整证据全部在上述 Node v24.14.0 环境下重新取得;该操作不使用 `yarn.lock`。
# 项目知识图谱迁移接口清单
## 来源
- 项目:dj-car-boutique-work-wechat
- 提交:e4fc97927e631208fb33af77ac47ea38892026fc
## 命令接口
| 接口 | 输入 | 输出/行为 |
|---|---|---|
| `npm run knowledge:build` | 当前仓库 | 重建稳定图谱和 Markdown 索引 |
| `npm run knowledge:check` | 当前仓库 | 只读比较生成物,漂移时非零退出 |
| `npm run impact -- --keyword <value>` | 1–5 个关键词 | 返回上下游、测试、文档、风险和证据 |
| `npm run test:affected -- --list --format json` | Git 变更集 | 返回 none/docs-only/targeted/full 计划 |
| `npm test` | 无 | 运行全部离线测试,Live 默认跳过 |
## 图谱契约
顶层字段固定为 `schemaVersion`、`nodes`、`edges`、`unresolved`、`stats`。每条边必须包含 `from`、`to`、`type`、`confidence` 和文件行列证据。
{
"id": "project-knowledge-graph",
"title": "项目知识图谱与增量测试迁移",
"sourceProject": "dj-car-boutique-work-wechat@e4fc97927e631208fb33af77ac47ea38892026fc",
"affectedPaths": [
"components/orderPromptPop/orderMerchantContext.helpers.js",
"package.json",
"project.config.json",
"README.md",
"docs",
"scripts",
"tests"
],
"interfaces": [
"npm run knowledge:build",
"npm run knowledge:check",
"npm run impact",
"npm run test:affected",
"npm test"
],
"tests": [
{
"id": "migration-readiness-contract",
"file": "tests/migration-readiness/checkMigrationReadiness.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "upload-exclusions-contract",
"file": "tests/migration-readiness/uploadExclusions.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short 5d7d57032ad31517c56fb4f53a00b01e1905728b",
"result": "5d7d570"
},
"apiInventory": "docs/migrations/project-knowledge-graph/api-inventory.md",
"acceptance": "docs/migrations/project-knowledge-graph/test-acceptance.md",
"verification": {
"commands": [
{
"command": "node scripts/run-node-tests.mjs tests/knowledge-graph tests/project-governance tests/order-lifecycle/liveProfiles.test.mjs tests/order-lifecycle/ui/loginSmokeConfig.test.mjs tests/order-lifecycle/e2e/liveCleanup.test.mjs tests/order-lifecycle/environmentGuard.test.mjs tests/order-lifecycle/e2e/orderLifecycle.live.test.mjs tests/order-lifecycle/ui/loginSmoke.live.test.mjs",
"status": "pass"
},
{
"command": "npm run knowledge:check",
"status": "pass"
},
{
"command": "npm test",
"status": "pass"
}
]
}
}
# 项目知识图谱迁移验收
| ID | 验收项 | Pre | Post |
|---|---|---|---|
| KG-001 | migration readiness contract | pass | pass |
| KG-002 | existing merchant search contract | fail: park name is not searched | pass |
| KG-003 | knowledge graph fixture contracts | absent | pass |
| KG-004 | all 71 app pages are indexed | probe only | pass |
| KG-005 | generated artifacts are byte-stable | absent | pass |
| KG-006 | affected selection escalates shared/cross-domain/unresolved changes | absent | pass |
| KG-007 | Live profiles contain no credential literals and default to skipped | absent | pass |
| KG-008 | full offline suite | blocked by KG-002 | pass |
| KG-009 | knowledge artifacts remain outside upload package | docs/scripts/tests pass; .agents absent | pass |
## 最终证据(2026-08-21)
- 知识图谱与治理合同:34 项通过,0 失败。
- 生成稳定性:`docs/generated` 与组件索引共 12 个文件,连续两次构建的 SHA-256 完全一致;最终图谱包含 4,218 个节点、8,097 条边、71 个页面和 88 个未解析项。
- 全仓离线套件:`npm test` 退出码为 0;订单生命周期单独回归为 82 项通过、4 个 Live 用例默认跳过。
- Live 安全合同:开发 profile 仅允许登录冒烟,测试 profile 写入要求 `LIVE_ALLOW_WRITES=1`;登录冒烟停在账号列表,不选择园区、门店或场景。
- 公共查询:`createOrder` 返回 337 个直接命中和 1,360 条证据;`packageWorkspace` 返回 1,158 个直接命中和 2,910 条证据。
- 上传边界:`docs`、`scripts`、`tests`、`.agents` 均被排除;Node 24.19 下上传 guard 扫描 236 个文件,依赖、路由和 API 闭包均无缺口。
- 凭据边界:从设计基线起的全部迁移差异通过通用 11 位手机号模式扫描,未发现凭据字面量。
- 当前项目没有参考项目的 `constructionFlow.mjs`;本次未引入该独有施工 Live 业务,只为现有撤销单与改单流程增加逆序、脱敏的尽力清理。
# API 清单
| 接口 | 调用方 | 来源证据 | 迁移处理 |
| --- | --- | --- | --- |
| `POST /api/order/create` | 订单创建页 | 源项目订单创建流程 | 在目标项目完成鉴权、请求参数与响应映射核对后接入 |
清单中的每一项都应在实际迁移清单中替换为对应接口和可追溯证据。
{
"id": "order-api-migration-example",
"title": "订单接口迁移示例",
"sourceProject": "dj-car-boutique-work-wechat",
"affectedPaths": [
"app.js"
],
"interfaces": [
"POST /api/order/create"
],
"tests": [
{
"id": "migration-readiness-contract",
"file": "tests/migration-readiness/checkMigrationReadiness.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short HEAD",
"result": "d340278"
},
"apiInventory": "docs/migrations/template/api-inventory.md",
"acceptance": "docs/migrations/template/test-acceptance.md",
"verification": {
"commands": [
{
"command": "node --test tests/migration-readiness/checkMigrationReadiness.test.mjs tests/migration-readiness/uploadExclusions.test.mjs",
"status": "pass"
}
]
}
}
# 测试验收
1. 在迁移开始前运行 `npm run check:migration -- --manifest <manifest> --phase pre`。
2. 记录基线命令及其结果,并确认受影响路径、接口清单和测试证据齐全。
3. 迁移完成后将每个测试标为 `pass` 或带有明确原因的 `blocked`。
4. 运行 `npm run check:migration -- --manifest <manifest> --phase post`,由门禁执行未阻塞的验证命令。
5. 将门禁结果与实际测试输出一起保留在迁移记录中。
# 工单列表分包迁移接口清单
本迁移不改变后端接口、请求参数和响应契约,只改变列表实现、局部 API 封装和组件的物理路径。
| 边界 | 迁移前 | 迁移后 | 契约 |
| --- | --- | --- | --- |
| 工单列表实现 | `/pages/tabWorkOrder/pages/index/index` | `/tabWorkOrder/pages/index/index` | 页面行为与查询参数不变 |
| 历史列表入口 | 完整业务页 | `redirectTo` 兼容页 | 转发全部 URI 编码查询参数 |
| 区域低价单查询 | `pages/tabWorkOrder/api.js#getWorkPackageGoodsList` | `tabWorkOrder/pages/index/api.js#getWorkPackageGoodsList` | `sceneType=1`、`lowPriceFlag=1`、`pageSize=10` |
| 审批状态统计 | `pages/tabWorkOrder/api.js#statByStatus` | `tabWorkOrder/pages/index/api.js#statByStatus` | `sceneType=1`、`lowPriceFlag=1` |
| 撤销工单 | `pages/tabWorkOrder/api.js#revokeOrder` | `tabWorkOrder/pages/index/api.js#revokeOrder` | 方法名和请求数据不变 |
| 服务商配置 | `pages/tabWorkOrder/api.js#getServiceBaseInfo` | `tabWorkOrder/pages/index/api.js#getServiceBaseInfo` | `merchantId` 入参不变 |
| 详情跳转 | `tabWorkOrder.orderDetail` | `tabWorkOrder.orderDetail` | 命名路由和页面栈行为不变 |
| 列表刷新 | `wx.$orderListRefresh` | `wx.$orderListRefresh` | 写入、消费和清除时机不变 |
组件迁移边界:`CalendarMonth` 与 `studyPermissionModal` 归入 `tabWorkOrder/components`;`OrderScreen` 与 `StoreSelectPopup` 归入 `tabWorkOrder/pages/index/components`。主包工作台仍使用的 `orderPromptPop` 保持主包路径。
{
"id": "work-order-list-subpackage",
"title": "工单列表与非全局组件分包迁移",
"sourceProject": "regional-assistant@701241a",
"affectedPaths": [
"app.json",
"package.json",
"pages/tabWorkOrder",
"pages/tab/workspace",
"components",
"tabWorkOrder",
"scripts/check-work-order-migration.mjs",
"tests",
"docs"
],
"interfaces": [
"/pages/tabWorkOrder/pages/index/index compatibility route",
"/tabWorkOrder/pages/index/index implementation route",
"tabWorkOrder.orderDetail",
"wx.$orderListRefresh",
"npm run check:packageBoundaries",
"node scripts/wx-upload-guard.js"
],
"tests": [
{
"id": "work-order-list-subpackage-route",
"file": "tests/work-order-migration/work-order-list-subpackage.test.mjs",
"level": "integration",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "work-order-list-page-behavior",
"file": "tests/work-order-migration/work-order-list-page.test.mjs",
"level": "integration",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "workspace-direct-entry",
"file": "tests/work-order-migration/workspace-source-contract.test.mjs",
"level": "contract",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short 701241a",
"result": "701241a; npm test pass; main package 1643287 bytes"
},
"apiInventory": "docs/migrations/work-order-list-subpackage/api-inventory.md",
"acceptance": "docs/migrations/work-order-list-subpackage/test-acceptance.md",
"verification": {
"commands": [
{
"command": "node scripts/run-node-tests.mjs tests/work-order-migration/work-order-list-subpackage.test.mjs tests/work-order-migration/work-order-list-page.test.mjs tests/work-order-migration/workspace-source-contract.test.mjs",
"status": "pass"
},
{
"command": "npm run test:workOrder",
"status": "pass"
},
{
"command": "npm run check:packageBoundaries",
"status": "pass"
},
{
"command": "npm run knowledge:check",
"status": "pass"
},
{
"command": "npm test",
"status": "pass"
},
{
"command": "npm run size:main",
"status": "pass"
}
]
}
}
# 工单列表与非全局组件分包迁移验收
| ID | 验收项 | Pre | Post |
| --- | --- | --- | --- |
| ROUTE-001 | 新列表注册在 `tabWorkOrder` 分包 | fail: 未注册 | pass: 已注册 `/tabWorkOrder/pages/index/index` |
| ROUTE-002 | 旧地址使用 `redirectTo` 并完整转发查询参数 | fail: 旧地址仍是业务页 | pass: 兼容页使用 `redirectTo`,查询参数编码转发 |
| ROUTE-003 | 工作台与预录单直接进入新列表 | fail: 仍使用旧地址 | pass: 两个入口均直接使用新分包地址 |
| RETURN-001 | 列表进入详情后原生返回到新列表且刷新标记继续消费 | fail: 新列表不存在 | pass: 命名详情路由、页面栈与 `wx.$orderListRefresh` 契约通过测试 |
| COMP-001 | CalendarMonth 与 studyPermissionModal 仅位于 `tabWorkOrder` | fail: 位于根 components | pass: 已迁入 `tabWorkOrder/components` |
| COMP-002 | OrderScreen 与 StoreSelectPopup 位于列表页面目录 | fail: 位于主包 | pass: 已迁入 `tabWorkOrder/pages/index/components` |
| SIZE-001 | 保守物理主包不超过 1,500,000 字节 | fail: 1,643,287 bytes | pass: 1,457,338 bytes |
| TEST-001 | 工单、分包边界、知识图谱和全仓测试 | pass: 干净基线 | pass: Node 24 全仓 420 项,416 pass、4 skipped、0 fail |
## 基线证据(2026-08-21)
- `node -v`:`v20.19.0`。
- `npm test`:退出码 0。
- `npm run size:main`:主包 1,643,287 字节,共 835 个文件,距离 2,000,000 字节预算 356,713 字节。
- 代码与文档不保存开发或测试环境手机号;功能验证继续使用运行时登录输入。
## 迁移后证据(2026-08-21)
- `node -v`:`v24.19.0`,符合微信上传门禁要求。
- `npm test`:420 项测试,416 pass、4 skipped、0 fail。
- `npm run test:workOrder`:迁移测试 78 pass;创建工单测试 207 pass;生命周期测试 82 pass、4 skipped。
- `npm run check:packageBoundaries`:检查 666 条依赖边,非法跨包依赖 0 条。
- `npm run check:workOrderClosure`:闭包 238 个文件,缺失依赖 0、失效路由 0、缺失 API 0。
- `node scripts/wx-upload-guard.js`:上传前门禁通过。
- `npm run size:main`:主包 1,457,338 字节,共 798 个文件;较基线减少 185,949 字节,距离 2,000,000 字节预算 542,662 字节。
- `tests/package-size/mainPackageBudget.test.mjs`:同时守卫微信 2,000,000 字节上限和本次迁移的 1,500,000 字节余量目标。
- `tabWorkOrder` 分包物理大小 1,067,617 字节,共 210 个文件,未超过单分包 2 MiB 限制。
# 精品工单用户上下文接口清单
## 上下文字段与消费者
| 上下文字段 | 原始用户字段 | 精品工单消费者 | 关联接口或提交字段 |
| --- | --- | --- | --- |
| `sceneType` | 顶层 `sceneType` | 最近场景、场景列表、订单类型配置 | `scene.recent.getUserScene`、`scene.config.getUserScene` |
| `phone` | 顶层 `phone`,子用户回退 | 最近场景、场景列表 | 上述两个场景接口的 `phone` |
| `parkMerchantId` | 顶层 `merchantId`,子用户回退 | 合作门店、Router 初始化后的订单 | `query4SRefByYqShopByLogin.merchantId`、`sellerMerchantId` |
| `shopMerchantId` | 顶层/子用户 `shopMerchantId`,默认 4S 门店回退 | 场景列表、门店配置、客户档案、门店筛选 | `getUserScene.merchantId`、`shopMerchantPointConfig.get.merchantId`、客户列表 `merchantId` |
| `operatorId` | `subLoginUser.uuid`,顶层 `uuid` 回退 | 上一单销售顾问、订单初始化 | `order.getLastUser.sellerUserId`、`sellerUserId` |
| `operatorName` | `subLoginUser.name`,顶层 `name` 回退 | 订单初始化 | `sellerName` |
| `parkMerchantName` | 顶层 `merchantName`,子用户回退 | 订单初始化 | `sellerMerchantName` |
## 提交接口
规范化字段先写入 `orderObj`,再由现有提交策略选择接口:
- `dj.api.smartcarlife.order.createWithPay`
- `dj.api.smartcarlife.order.supplementOrder`
- `dj.api.smartcarlife.order.preliminaryOrder`
sessionId 不属于用户上下文,由现有统一请求层附加。
{
"id": "work-order-user-context",
"title": "精品工单用户上下文适配器",
"sourceProject": "dj-car-boutique-work-wechat",
"affectedPaths": [
"tabWorkOrder/pages/createOrder",
"components/CustomerInfo/CustomerInfo.js",
"docs/migrations/work-order-user-context"
],
"interfaces": [
"dj.api.smartcarlife.scene.recent.getUserScene",
"dj.api.smartcarlife.scene.config.getUserScene",
"dj.api.smartcarlife.order.getLastUser",
"dj.api.scenemerchantref.query4SRefByYqShopByLogin",
"dj.api.smartcarlife.shopMerchantPointConfig.get",
"dj.api.smartcarlife.order.search.containPackageGoods",
"dj.api.smartcarlife.order.createWithPay",
"dj.api.smartcarlife.order.supplementOrder",
"dj.api.smartcarlife.order.preliminaryOrder"
],
"tests": [
{
"id": "work-order-user-context-unit",
"file": "tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs",
"level": "unit",
"expectedBefore": "pass",
"status": "pass"
},
{
"id": "work-order-user-context-page-integration",
"file": "tabWorkOrder/pages/createOrder/tests/createOrderUserContextIntegration.test.mjs",
"level": "integration",
"expectedBefore": "pass",
"status": "pass"
}
],
"baseline": {
"command": "git rev-parse --short HEAD",
"result": "c5acef0"
},
"apiInventory": "docs/migrations/work-order-user-context/api-inventory.md",
"acceptance": "docs/migrations/work-order-user-context/test-acceptance.md",
"verification": {
"commands": [
{
"command": "npm run test:workOrderMigration",
"status": "pass"
},
{
"command": "npm run test:createOrder",
"status": "pass"
},
{
"command": "npm run test:orderLifecycle",
"status": "pass"
},
{
"command": "npm run check:workOrderClosure",
"status": "pass"
}
]
}
}
# 精品工单用户上下文验收映射
## 固定用户期望
| 语义字段 | 期望值 |
| --- | --- |
| `sceneType` | `1` |
| `phone` | `18372203315` |
| `parkMerchantId` | `44211025` |
| `shopMerchantId` | `44210895` |
| `operatorId` | `6825aaebf4f04f6a8a4c3d5a9b26c914` |
| `operatorName` | `0523ymt` |
| `parkMerchantName` | `流程测试园区门店` |
## 行为验收
1. 顶层 `sceneType=1` 生效,不读取 `subLoginUser.sceneType=7` 作为精品工单场景。
2. 合作门店接口使用园区 ID `44211025`。
3. 场景、门店配置和客户档案默认使用门店 ID `44210895`。
4. 操作人优先使用 `subLoginUser.uuid/name`,字段缺失时回退顶层用户。
5. 原始用户为空时返回字段齐全的空上下文,不抛异常。
6. 共享 Router、统一请求 session、其他工作台功能和 OCR 行为不变。
## 验证结果
验证运行时:Node.js `v24.14.0`。
| 验证项 | 结果 |
| --- | --- |
| 精品工单迁移测试 | 33/33 通过 |
| 新增工单测试 | 112/112 通过 |
| 订单生命周期测试 | 69 通过、3 个显式 live 跳过、0 失败 |
| 静态依赖闭包 | 扫描 238 个文件,无缺失依赖、死路由或缺失 API |
# ROP Swagger 安全导入与小程序改造门禁实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans. Follow TDD for every behavior change.
**Goal:** 加固 `dj-car-life-system` 的 ROP Swagger 契约工具,并把安全导入、离线快照、迁移门禁和项目级聊天导入能力同步到 `regional-assistant` 与 `dj-car-boutique-work-wechat`。
**Architecture:** 先修复后台项目的 Swagger 2.0 契约核心,再把相同行为以内置工具形式分别适配到两个小程序。小程序使用测试环境 boutique Swagger 完整快照;业务 API 只允许通过默认 dry-run、唯一 AST 定位和显式 `--apply` 改写。
**Tech Stack:** Node.js、Jest、Node test runner、Swagger 2.0、Babel parser/generator、微信小程序。
## Global Constraints
- 直接在三个当前分支开发,不创建 worktree 或新分支。
- `regional-assistant` 以 `456a612` 为基线。
- 小程序默认 Swagger 为 `http://dj.test.glsx.com.cn/rop-dj-car-boutique/swagger-rop/api-docs`。
- 本轮只用 `dj.api.smartcarlife.auth.phone` 做 dry-run,不正式迁移业务接口。
- 生产请求 method、payload 引用、完整响应 envelope 和 Promise reject 行为不得改变。
- 完整 Swagger 快照提交仓库,但 `docs/`、`tests/`、`scripts/rop/` 不得进入小程序上传包。
- 默认验证不得访问真实业务环境;真实 API/UI 只允许显式安全开关开启。
---
### Task 1: 小程序迁移前置门禁
在两个小程序中以测试先行增加 migration manifest 模板、API 清单、测试验收模板、`check:migration -- --manifest <path> --phase pre|post` 和对应 `AGENTS.md` 规则。验证缺失材料、占位符、缺失测试文件和 post 阶段未通过/未阻塞用例会失败;验证工具、文档、测试和 Swagger 快照被上传配置排除。
### Task 2: 加固后台 ROP 契约核心
先扩展 `tests/unit/libs/rop`,覆盖深层分页 DTO、`allOf`、循环引用、required、HTTP 非 2xx/重定向/超时/非法 JSON、嵌套契约漂移、线上差异方向、AST 唯一/歧义定位、默认 dry-run、幂等和人工契约。再最小修改 `swaggerInspect`、`contractDiff`、`ropImport` 和 CLI,使测试通过;`rop:verify` 保持离线,真实冒烟拆到 `rop:verify:live`。
### Task 3: 适配 regional-assistant
在 `scripts/rop/` 内置通过 Task 2 验证的契约行为,提交 boutique 测试环境完整快照,增加 `rop:swagger:fetch`、`rop:swagger`、`rop:import`、`rop:contract:check`、`rop:verify`、`rop:verify:live`。契约输出到 `docs/rop/contracts`,adapter 输出到 `api/adapters`;支持 CommonJS 对象方法和 ESM 导出函数,默认透明传递。用 `auth.phone` dry-run 验证唯一定位且工作区无业务改动。
### Task 4: 适配 dj-car-boutique-work-wechat
复用 Task 3 的工具接口、黄金 fixture 和快照策略,按精品小程序代码风格适配并验证。同样只执行 `auth.phone` dry-run,不落盘业务接口。
### Task 5: 项目级聊天导入与最终验收
先基线测试再更新后台项目已有 `rop-api-import` skill;随后逐个初始化、编写并验证两个小程序的项目级 skill。固定“解析 method → JSON dry-run → 用户确认 → `--apply` → 契约检查”的流程。执行三个仓库专项回归、上传排除检查、工作区审计和最终代码审查。
# 精品工单依赖闭包迁移实施计划
> 实施目标:在当前分支完成精品工单四个核心页面、OCR、工作台新入口、测试和文档的闭包迁移。
## 1. 先锁定行为
- 添加直接收款方式解析测试。
- 添加显式业务守卫跳过策略测试。
- 添加 `app.json`、页面、OCR 与静态资源完整性测试。
- 运行测试并确认因目标能力尚不存在而失败。
## 2. 建立入口与纯策略
- 新增工作台“新增工单”菜单和收款方式/补录选择弹窗。
- 实现无业务前置判断的直接路由参数构造。
- 实现只识别显式 `skipOrderGuards` 的业务守卫策略。
- 保持手机号配置、表单校验和提交错误处理。
## 3. 迁移页面依赖闭包
- 迁移列表、新建、确认、详情和 OCR 页面。
- 迁移这些页面实际使用的组件、服务、WXS、图片和工具。
- 复用目标项目已有公共组件,避免覆盖同名全局实现。
- 移除或改造严格四页范围外的路由入口。
## 4. 合并公共能力
- 更新主包、分包和预下载配置。
- 方法级合并 App 权限初始化、公共 API、Store 校验和必要工具。
- 适配目标项目品牌文案及退款页面路径。
## 5. 迁移测试与运行时
- 将 Node 版本固定为 Node 24 LTS。
- 迁移并改造新建工单测试、订单生命周期测试和预检脚本。
- 增加可重复运行的静态依赖/路由/资源闭包检查。
- 更新小程序上传忽略项。
## 6. 迁移文档
- 迁移接口清单、新建工单说明、订单生命周期说明和验收映射。
- 将项目名、路径、命令、范围和不迁移页面改为目标项目实际情况。
- 重新生成 DOCX。
## 7. 验证
- 运行新建工单测试。
- 运行订单生命周期测试。
- 运行静态依赖、路由和资源完整性检查。
- 运行文档维护性校验。
- 渲染 DOCX 并逐页检查。
- 检查 Git diff,确认没有修改来源仓库或混入无关文件。
# 新建工单客户档案唯一导入实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 让新建工单页面的客户信息只能经“客户档案”导入,页面内不再允许手动填写或修改。
**Architecture:** 仅调整 `createOrder.wxml` 的客户信息展示层;既有的 `showCustomPop`、`chooseCustomerInfo`、`onRoute` 与客户档案补全逻辑不变。新增 Node 模板回归测试直接读取 WXML,锁定客户档案入口和禁止手动编辑的交互边界。
**Tech Stack:** 微信小程序 WXML、Node.js 内置 `node:test`、Node.js 内置 `assert`、`npm run test:createOrder`。
## Global Constraints
- 客户信息区覆盖车主姓名、客户来源、性别、手机号、车型、VIN、车牌号、是否体验。
- “客户档案”仍是唯一数据选择入口,继续调用现有 `showCustomPop`。
- 不改动客户档案组件、接口、`chooseCustomerInfo`、`onRoute`、提交校验或提交载荷。
- 空值展示文案固定为“请通过客户档案选择”。
- 小型页面交互修复,不属于跨项目迁移或较大重构,无需迁移 manifest 门禁。
---
## File Structure
- Create: `tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs` — 读取客户信息 WXML 区段,回归验证唯一导入入口和只读约束。
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml:112-256` — 将客户信息区从可编辑控件替换成只读文本展示,保留客户档案按钮。
### Task 1: 锁定客户档案唯一导入交互
**Files:**
- Create: `tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml:112-256`
- Test: `tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
**Interfaces:**
- Consumes: `showCustomPop()` 是 `createOrder.js` 已有的客户档案弹窗打开方法;客户信息展示数据来自 `orderObj.customer`。
- Produces: WXML 中仅保留 `bindtitleClick="showCustomPop"` 的客户档案入口;客户信息区不包含 `input`、来源选择、性别/体验切换、车型选择或 OCR 扫描绑定。
- [ ] **Step 1: 写入失败的模板回归测试**
创建 `tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`:
```js
import { readFileSync } from 'node:fs'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
const template = readFileSync(
new URL('../createOrder.wxml', import.meta.url),
'utf8'
)
const start = template.indexOf('<view class="customerName">')
const end = template.indexOf(
'\\n\\t\\t<view class="box" wx:if="{{ orderObj.userId && orderObj.baseSceneCode }}">',
start
)
const customerSection = template.slice(start, end)
describe('createOrder customer information template', () => {
it('keeps customer archive as the only manual customer-data entry', () => {
assert.ok(start >= 0)
assert.ok(end > start)
assert.match(customerSection, /bindtitleClick="showCustomPop"/)
assert.match(customerSection, /请通过客户档案选择/)
assert.doesNotMatch(customerSection, /<input/)
assert.doesNotMatch(customerSection, /bind:click="toSelectCustomerSource"/)
assert.doesNotMatch(customerSection, /bindtap="changeGender"/)
assert.doesNotMatch(customerSection, /data-show-name="carBrandBox"/)
assert.doesNotMatch(customerSection, /bindtitleClick="navOcr"/)
assert.doesNotMatch(customerSection, /bindtap="changeExperience"/)
})
})
```
- [ ] **Step 2: 运行测试,确认其因现有手工交互失败**
Run: `node --test tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
Expected: FAIL。失败断言应指出客户信息区仍存在 `<input` 或手动修改事件绑定;不得因文件路径或测试语法错误失败。
- [ ] **Step 3: 以最小 WXML 改动切换为只读展示**
在 `tabWorkOrder/pages/createOrder/createOrder.wxml` 的客户信息区执行以下变更:
```wxml
<gl-cell
border
valueAlign="right"
label="车主姓名"
titleBtn="客户档案"
bindtitleClick="showCustomPop"
value="{{ orderObj.customer.customerName || '请通过客户档案选择' }}"
/>
<gl-cell
border
label="客户来源"
value="{{ filter.getSalesTypeName(Sourcecolumns, orderObj.customer.salesType) || '请通过客户档案选择' }}"
valueAlign="right"
/>
```
对性别、手机号、车型、VIN、车牌号、是否体验使用同样的只读 `gl-cell` 或文本插槽:有值时显示 `orderObj.customer` 中的现有值,无值时显示“请通过客户档案选择”。删除这些字段的 `<input>`、`bindinput`、`bindblur`、`toSelectCustomerSource`、`changeGender`、`showPopup`(车型)、`navOcr`、`changeExperience` 与相关交互图标属性;不删除姓名行的 `titleBtn` 和 `bindtitleClick="showCustomPop"`。
- [ ] **Step 4: 重新运行单测,确认模板约束通过**
Run: `node --test tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
Expected: PASS,且仅该一个测试文件被执行。
- [ ] **Step 5: 运行 createOrder 回归测试**
Run: `npm run test:createOrder`
Expected: PASS,所有 `tabWorkOrder/pages/createOrder/tests` 测试通过,退出码为 0。
- [ ] **Step 6: 复查变更并提交**
Run: `git diff --check && git diff -- tabWorkOrder/pages/createOrder/createOrder.wxml tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
Expected: 没有空白错误;差异仅包含客户信息只读化和回归测试。
```bash
git add tabWorkOrder/pages/createOrder/createOrder.wxml tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs
git commit -m "feat: require customer archive for create order"
```
# Customer Work Order Menu Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 在工作台“门店运营管理”中,把“客户工单”菜单放在“新增工单”之后并直达已迁移客户工单列表。
**Architecture:** 复用工作台现有 `storeManagementMenus` 和 `jumpTo()` 的本地 `path` 分支,不增加路由别名或事件方法。从来源项目复制原 `tab-order.png`,菜单通过 `iconUrl` 使用本地资源。
**Tech Stack:** 微信小程序 JavaScript/WXML、Node.js 24 LTS、`node:test`
## Global Constraints
- 当前分支开发,不创建 worktree 或新分支。
- 客户工单必须紧跟“新增工单”,路径固定为 `/pages/tabWorkOrder/pages/index/index`。
- 图标必须从来源项目 `images/tab-order.png` 原样复制到目标项目同路径。
- 不修改客户工单页面、开单弹窗、公共路由器或订单业务判断。
- 这是已迁移页面的小型入口补充,不执行迁移 manifest 门禁。
- 未经用户要求,不提交或推送运行时代码。
---
### Task 1: 客户工单菜单、图标和入口契约
**Files:**
- Modify: `tests/work-order-migration/workspace-source-contract.test.mjs`
- Modify: `pages/tab/workspace/workspace.js`
- Create: `images/tab-order.png`
**Interfaces:**
- Consumes: `jumpTo()` 已有 `path` 分支
- Produces: `storeManagementMenus` 中的客户工单配置
- [ ] **Step 1: Write the failing test**
Add imports for `@babel/parser`, `@babel/generator`, and `node:vm`. Load the
actual `Page` configuration by parsing `workspace.js`, removing only import
declarations, and evaluating the remaining module with controlled `wx` and
`Page` globals:
```js
async function loadWorkspacePage() {
const pageSource = await readFile(
path.join(projectRoot, 'pages/tab/workspace/workspace.js'),
'utf8'
)
const ast = parse(pageSource, { sourceType: 'module' })
ast.program.body = ast.program.body.filter(
node => node.type !== 'ImportDeclaration'
)
let pageConfig
const navigations = []
const tracks = []
runInNewContext(generate(ast).code, {
Page(config) { pageConfig = config },
wx: {
$util: { getUserInfo: () => ({ sceneType: 1 }) },
$track: { setTrackData: (...args) => tracks.push(args) },
$router: { go: () => assert.fail('本地 path 不应调用公共路由器') },
navigateTo: options => navigations.push(options)
}
})
return { pageConfig, navigations, tracks }
}
```
Add a second test to `workspace-source-contract.test.mjs`:
```js
it('客户工单紧跟新增工单并直达已迁移列表页', async () => {
const { pageConfig, navigations, tracks } = await loadWorkspacePage()
const menus = pageConfig.data.storeManagementMenus
const createOrderIndex = menus.findIndex(item => item.name === '新增工单')
const customerOrderIndex = menus.findIndex(item => item.name === '客户工单')
assert.equal(customerOrderIndex, createOrderIndex + 1)
assert.deepEqual(
JSON.parse(JSON.stringify(menus[customerOrderIndex])),
{
name: '客户工单',
path: '/pages/tabWorkOrder/pages/index/index',
iconUrl: '/images/tab-order.png',
trackingCode: 'regional-assistant-customer-work-order'
}
)
pageConfig.jumpTo({
currentTarget: { dataset: { target: menus[customerOrderIndex] } }
})
assert.deepEqual(
JSON.parse(JSON.stringify(navigations)),
[{ url: '/pages/tabWorkOrder/pages/index/index' }]
)
assert.equal(tracks[0][1], 'regional-assistant-customer-work-order')
const icon = await readFile(
path.join(projectRoot, 'images/tab-order.png')
)
assert.ok(icon.length > 0)
})
```
- [ ] **Step 2: Verify RED**
Run:
```powershell
node scripts/run-node-tests.mjs tests/work-order-migration/workspace-source-contract.test.mjs
```
Expected: FAIL because `客户工单` is absent from `storeManagementMenus`.
- [ ] **Step 3: Copy the source icon**
Run:
```powershell
Copy-Item -LiteralPath 'C:\Users\admin\Desktop\工作\dj-car-boutique-work-wechat\images\tab-order.png' -Destination 'C:\Users\admin\Desktop\工作\regional-assistant\images\tab-order.png'
```
The source file is 1,087 bytes and the target path is currently absent.
- [ ] **Step 4: Add the menu item**
Insert immediately after “新增工单”:
```js
{
name: "客户工单",
path: "/pages/tabWorkOrder/pages/index/index",
iconUrl: "/images/tab-order.png",
trackingCode: "regional-assistant-customer-work-order",
},
```
- [ ] **Step 5: Verify GREEN**
Run:
```powershell
node scripts/run-node-tests.mjs tests/work-order-migration/workspace-source-contract.test.mjs
npm run test:workOrderMigration
npm run check:workOrderClosure
```
Expected: the workspace tests, migration suite, route check, and asset closure all pass.
### Task 2: Entry documentation and complete regression
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
**Interfaces:**
- Consumes: the new customer-work-order menu contract
- Produces: maintainer and acceptance guidance
- [ ] **Step 1: Update documentation**
Document that:
- “客户工单” follows “新增工单” under “门店运营管理”;
- it directly opens `/pages/tabWorkOrder/pages/index/index`;
- it does not trigger the create-order payment prompt;
- the original `tab-order.png` is now part of the migration closure.
Update acceptance test counts and scanned-file statistics from the final command output.
- [ ] **Step 2: Run complete verification**
Run:
```powershell
npm run test:workOrder
node --check pages/tab/workspace/workspace.js
git diff --check
```
Expected: all automated tests and static closure checks pass, the workspace script parses, and the diff has no whitespace errors.
# System Session Restore Implementation Plan
**Goal:** 撤销固定 sessionId 模拟,保留固定用户信息,并让所有请求继续使用系统原有登录态。
**Architecture:** `utils/fixedUserInfoMock.js` 只负责固定用户;`utils/util.js` 的
`getSessionId()` 直接读取 `dj_boutique_sessionId`;`App.onLaunch()` 不再传入或执行任何
session writer。
**Tech Stack:** 微信小程序 JavaScript、Node.js 24 LTS、`node:test`
## 变更清单
- [x] 先增加失败测试,验证固定用户模块不再导出 session resolver。
- [x] 验证 `getSessionId()` 恢复系统原有缓存读取。
- [x] 删除固定 session 常量和创建函数。
- [x] 删除启动阶段的旧、新 session 缓存写入。
- [x] 删除工作台订单待审核/异常数量查询及其 API wrapper。
- [x] 执行完整精品工单回归、迁移后置门禁和差异格式检查。
## 完成标准
- 仓库不包含原指定 sessionId。
- 固定用户模块不再生成、解析或写入 sessionId。
- 工作台刷新不调用订单待审核/异常数量接口。
- 固定用户、工作台入口和精品工单完整回归全部通过。
# Fixed User Info Mock Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 在登录功能尚未迁入期间,让 `wx.$util.getUserInfo()` 与两套现有缓存读取路径稳定取得需求指定的固定用户信息。
**Architecture:** 新增一个不依赖微信运行时的固定用户模块,集中保存临时用户、返回深拷贝,并负责把独立副本写入旧缓存和新缓存。`utils/util.js` 通过该模块解析用户,`app.js` 在其他用户初始化逻辑之前预热两套缓存。
**Tech Stack:** 微信小程序 JavaScript、Node.js 24 LTS、`node:test`
## Global Constraints
- 当前分支开发,不创建 worktree 或新分支。
- 固定用户模拟默认开启,登录功能迁入后可通过单一开关关闭。
- 不在控制台、测试输出或文档中打印完整用户对象。
- 这是小型兼容修复,不执行迁移 manifest 门禁。
---
### Task 1: 固定用户行为与双缓存初始化
**Files:**
- Create: `utils/fixedUserInfoMock.js`
- Create: `tests/work-order-migration/fixed-user-info-mock.test.mjs`
- Modify: `utils/util.js`
- Modify: `app.js`
**Interfaces:**
- Produces: `createFixedUserInfo(): object`
- Produces: `resolveRuntimeUserInfo(readStoredUserInfo: Function): object | null`
- Produces: `installFixedUserInfoMock({ setLegacyUserInfo, setCurrentUserInfo }): object | null`
- Produces: `FIXED_USER_INFO_MOCK_ENABLED: boolean`
- [ ] **Step 1: Write the failing tests**
```js
it('模拟开启时忽略旧缓存并返回固定用户的独立副本', () => {
const first = resolveRuntimeUserInfo(() => ({ accountName: 'old' }))
const second = resolveRuntimeUserInfo(() => ({ accountName: 'old' }))
assert.equal(first.accountName, '18372203315')
first.subLoginUser.sceneType = 0
assert.equal(second.subLoginUser.sceneType, 7)
})
it('启动安装器把独立用户副本写入旧缓存和新缓存', () => {
let legacyUser
let currentUser
const installed = installFixedUserInfoMock({
setLegacyUserInfo: value => { legacyUser = value },
setCurrentUserInfo: value => { currentUser = value }
})
assert.deepEqual(legacyUser, installed)
assert.deepEqual(currentUser, installed)
assert.notEqual(legacyUser, currentUser)
})
```
- [ ] **Step 2: Run tests to verify RED**
Run: `node scripts/run-node-tests.mjs tests/work-order-migration/fixed-user-info-mock.test.mjs`
Expected: FAIL because `utils/fixedUserInfoMock.js` does not exist.
- [ ] **Step 3: Implement the minimal fixed-user module**
```js
export const FIXED_USER_INFO_MOCK_ENABLED = true
export function createFixedUserInfo() {
return JSON.parse(JSON.stringify(FIXED_USER_INFO))
}
export function resolveRuntimeUserInfo(readStoredUserInfo) {
return FIXED_USER_INFO_MOCK_ENABLED
? createFixedUserInfo()
: readStoredUserInfo()
}
export function installFixedUserInfoMock(writers) {
if (!FIXED_USER_INFO_MOCK_ENABLED) return null
const installed = createFixedUserInfo()
writers.setLegacyUserInfo(createFixedUserInfo())
writers.setCurrentUserInfo(createFixedUserInfo())
return installed
}
```
- [ ] **Step 4: Connect the runtime**
In `utils/util.js`, make `getUserInfo()` call `resolveRuntimeUserInfo()` with the existing legacy-storage reader as its fallback.
In `app.js`, call `installFixedUserInfoMock()` after `wx.$storage` and `wx.$util` are mounted but before `gobalCheckYqdSuper()`. Bind the writers to `util.setUserInfo()` and `$Storage.set('userInfo', value)`.
- [ ] **Step 5: Run the focused migration tests**
Run: `npm run test:workOrderMigration`
Expected: PASS with no user-object logging.
### Task 2: Temporary-login documentation and regression verification
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
**Interfaces:**
- Consumes: `FIXED_USER_INFO_MOCK_ENABLED`
- Produces: login-migration removal guidance for maintainers
- [ ] **Step 1: Document the temporary simulation**
Add a “临时用户模拟” section explaining:
- fixed-user mode is active while login is absent;
- both `dj_boutique_user_info` and environment-scoped `userInfo` are initialized;
- `wx.$util.getUserInfo()` returns a fresh fixed-user copy;
- disable/remove the mock when login migration is completed.
Update the automated acceptance summary with the fixed-user case, the actual
Node 24 pass/skip counts, and the distinction between local user context and
live API credentials.
- [ ] **Step 2: Run complete verification**
Run:
```powershell
npm run test:workOrder
git diff --check
git status --short
```
Expected: all tests and closure checks pass; diff contains only the fixed-user implementation, tests, plan, and documentation.
# 精品工单用户上下文适配器实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 新增仅供精品工单迁移使用的用户上下文适配器,并让新增工单主链路统一消费规范化的园区、门店、场景和操作人字段。
**Architecture:** 在 `createOrder/services` 中新增无副作用的映射函数和一个集中读取 `wx.$util.getUserInfo()` 的运行时入口。新增工单页面持有 `workOrderUserContext`,专用员工选择服务接收该上下文,共享客户组件只通过页面显式传参获得门店 ID;共享 Router、全局用户工具和请求层保持不变。
**Tech Stack:** 微信小程序 JavaScript、ES modules、Node.js 24、`node:test`、现有 migration readiness 脚本。
## Global Constraints
- 只改本次精品工单迁移闭包,不改目标项目其他原有功能。
- 当前分支直接开发,不创建分支或 worktree。
- 工作台新建入口继续传递 `skipOrderGuards=true`。
- 固定用户模拟保持启用;sessionId 沿用系统原有登录态缓存。
- OCR 不新增用户上下文依赖。
- 生产代码必须在对应失败测试验证后再写入。
---
### Task 1: 建立迁移证据和失败测试
**Files:**
- Create: `docs/migrations/work-order-user-context/manifest.json`
- Create: `docs/migrations/work-order-user-context/api-inventory.md`
- Create: `docs/migrations/work-order-user-context/test-acceptance.md`
- Create: `tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
**Interfaces:**
- Consumes: `createWorkOrderUserContext(userInfo)`(测试先定义期望,生产模块尚不存在)
- Produces: 已通过 pre 门禁的迁移清单和可观察的 RED 测试
- [ ] **Step 1: 写映射行为测试**
```js
import { createWorkOrderUserContext } from '../services/workOrderUserContext.js'
test('separates park and shop identities while preferring the sub-login operator', () => {
const context = createWorkOrderUserContext({
merchantId: 44211025,
shopMerchantId: 44210895,
sceneType: 1,
phone: '18372203315',
merchantName: '流程测试园区门店',
uuid: 'top-user',
name: 'top-name',
subLoginUser: { uuid: 'sub-user', name: 'sub-name', sceneType: 7 }
})
assert.deepEqual(context, {
sceneType: 1,
phone: '18372203315',
parkMerchantId: 44211025,
shopMerchantId: 44210895,
operatorId: 'sub-user',
operatorName: 'sub-name',
parkMerchantName: '流程测试园区门店'
})
})
```
- [ ] **Step 2: 运行测试并确认 RED**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
Expected: FAIL,因为 `services/workOrderUserContext.js` 尚不存在。
- [ ] **Step 3: 创建迁移 manifest 和配套文档**
Manifest 记录受影响目录、场景/门店/员工/客户/提交接口、RED 测试状态和最终验证命令;接口清单记录每个上下文字段的接口消费者;验收文档记录固定用户的字面期望值。
- [ ] **Step 4: 执行迁移 pre 门禁**
Run: `npm run check:migration -- --manifest docs/migrations/work-order-user-context/manifest.json --phase pre`
Expected: PASS,允许开始业务代码修改。
### Task 2: 实现纯用户上下文适配器
**Files:**
- Create: `tabWorkOrder/pages/createOrder/services/workOrderUserContext.js`
- Test: `tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
**Interfaces:**
- Consumes: 原始登录用户对象或 `wx.$util.getUserInfo()`
- Produces: `createWorkOrderUserContext(userInfo)`、`getWorkOrderUserContext(readUserInfo?)`
- [ ] **Step 1: 实现最小映射和集中读取函数**
```js
export function createWorkOrderUserContext(userInfo = {}) {
const user = userInfo || {}
const subUser = user.subLoginUser || {}
return {
sceneType: user.sceneType ?? '',
phone: user.phone || subUser.phone || '',
parkMerchantId: user.merchantId || subUser.merchantId || '',
shopMerchantId:
user.shopMerchantId ||
subUser.shopMerchantId ||
user.default4SStoreInfo?.merchantId ||
'',
operatorId: subUser.uuid || user.uuid || '',
operatorName: subUser.name || user.name || '',
parkMerchantName: user.merchantName || subUser.merchantName || ''
}
}
export function getWorkOrderUserContext(
readUserInfo = () => wx.$util.getUserInfo()
) {
return createWorkOrderUserContext(readUserInfo?.() || {})
}
```
- [ ] **Step 2: 运行适配器测试并确认 GREEN**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
Expected: PASS。
- [ ] **Step 3: 补充回退和空值用例**
增加顶层字段缺失时对子用户/default4SStoreInfo 的回退测试,以及空输入输出完整空上下文的测试。
- [ ] **Step 4: 运行完整适配器测试**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
Expected: PASS。
### Task 3: 接入新增工单页面和专用服务
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml`
- Modify: `tabWorkOrder/pages/createOrder/components/merchant-staff-picker/merchant-staff-picker.js`
- Modify: `tabWorkOrder/pages/createOrder/services/merchantStaffSelection.js`
- Test: `tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
**Interfaces:**
- Consumes: `getWorkOrderUserContext()` 和 `createWorkOrderUserContext(userInfo)`
- Produces: 页面数据 `workOrderUserContext`,员工服务上下文参数 `userContext`
- [ ] **Step 1: 写页面消费契约的失败测试**
测试加载真实页面模块时捕获 `Page` 配置,调用 Router `init`,断言页面保存完整上下文,并使用规范化的园区和操作人字段写入提交对象。场景、门店配置和员工服务的字段映射由同一个纯适配器测试覆盖。
- [ ] **Step 2: 运行契约测试并确认 RED**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/workOrderUserContext.test.mjs`
Expected: FAIL,因为页面尚未保存或消费 `workOrderUserContext`。
- [ ] **Step 3: 最小接入页面方法**
将页面初始化、最近场景、场景列表、最近销售、Router `init` 和门店配置改为使用上下文。原始 `userInfo` 仅保留给非本次范围的扫码礼券兼容判断。
- [ ] **Step 4: 接入员工选择和客户档案显式门店参数**
将 picker 属性改为 `userContext`,服务使用 `parkMerchantId/shopMerchantId/operatorId`;WXML 的 `customerInfo` 显式传递 `merchantId="{{ workOrderUserContext.shopMerchantId || 0 }}"`。
- [ ] **Step 5: 运行新增工单测试**
Run: `npm run test:createOrder`
Expected: PASS。
### Task 4: 更新迁移状态并完成验证
**Files:**
- Modify: `docs/migrations/work-order-user-context/manifest.json`
- Modify: `docs/migrations/work-order-user-context/test-acceptance.md`
**Interfaces:**
- Consumes: 已实现功能和测试结果
- Produces: post 门禁可复核的最终迁移证据
- [ ] **Step 1: 运行专项与全量迁移验证**
Run:
```powershell
npm run test:workOrderMigration
npm run test:createOrder
npm run test:orderLifecycle
npm run check:workOrderClosure
```
Expected: 全部 PASS。
- [ ] **Step 2: 更新 manifest 状态**
将适配器测试从 `expectedBefore: "fail"` 更新为 `expectedBefore: "pass"`、`status: "pass"`,并登记上面的成功命令。
- [ ] **Step 3: 执行迁移 post 门禁**
Run: `npm run check:migration -- --manifest docs/migrations/work-order-user-context/manifest.json --phase post`
Expected: PASS。
- [ ] **Step 4: 检查差异质量**
Run: `git diff --check`
Expected: 无空白错误;工作区其他既有修改保持不变。
# 低价单下单门店选择实施计划
1. 新增低价单门店上下文纯函数与单元测试,覆盖 `shopWithYqList` 多种返回结构、搜索、选择及提交字段。
2. 新增接口契约和页面集成失败测试,固定 9 个接口、低价单列表页签及参数传递行为。
3. 建立 `docs/migrations/low-price-order-store-selection` manifest、接口清单和验收矩阵,执行 pre 门禁。
4. 扩展 `order-prompt-pop` 为可选的两步低价单模式,在工作台接入门店加载、搜索、选择及支付确认。
5. 将门店上下文传入待补录分页、待补录统计和创建页;确保普通下单/补录提交含 `lowPriceFlag` 与 `sellerMerchantId`。
6. 切换列表/统计接口及审批页签映射,新增 `shopWithYqList` 封装并用于新建低价单第一步及筛选,保留详情 `lowPriceFlag`。
7. 同步精品工单接口文档、迁移验收文档,使用 Node 24 执行全量相关测试、闭包检查和 post 门禁。
# 新增工单客户档案与已选门店上下文实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 收敛客户档案提示,并保证精品工单新增页的门店相关查询持续使用前置弹框所选门店。
**Architecture:** 页面模板直接消费 `orderObj` 的低价门店上下文;路由/客户回显后重新覆盖该上下文;共享园区配置 getter 增加显式门店入参和按门店缓存。非低价流程保留原用户上下文兜底。
**Tech Stack:** 微信小程序 WXML/JavaScript、Node 24 `node:test`。
## Global Constraints
- 只修改精品工单迁移范围及共享 getter 的兼容扩展。
- `merchantId` 表示前置选择的 4S 店。
- `yqMerchantId/sellerMerchantId` 表示所属园区店。
- 不写死 sessionId,不提交或推送代码。
---
### Task 1: 客户档案单行入口
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml`
- Test: `tabWorkOrder/pages/createOrder/tests/customerProfileOnlyTemplate.test.mjs`
- [x] 增加失败测试,要求提示只出现一次、`iconSrc="{{ recordIcon }}"` 存在、客户档案组件绑定 `orderObj.merchantId`。
- [x] 运行目标测试并确认因重复提示、缺图标和错误门店绑定失败。
- [x] 修改 WXML:仅姓名行保留“请通过选择客户档案”,补图标,其余空值不显示重复提示。
- [x] 运行目标测试并确认通过。
### Task 2: 客户回显保留前置门店
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/selectedMerchantContext.integration.test.mjs`
- [x] 增加失败测试,输入历史客户订单门店和当前低价门店时,结果必须保留当前低价门店。
- [x] 在 `setOrderObj` 写回数据后调用既有 `mergeLowPriceOrderContext` 覆盖门店字段。
- [x] 运行目标测试并确认通过。
### Task 3: 园区配置使用已选园区店
**Files:**
- Modify: `store/index.js`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
- Test support: `tests/work-order-migration/shims/mock-api.mjs`
- [x] 增加失败测试:显式选中园区店时只接受该园区店的配置响应,并拒绝复用其他园区缓存。
- [x] 扩展 `getYQorderInfo({ merchantId, merchantName })`,显式入参优先并记录缓存对应园区店。
- [x] 创建页 `getSetting()` 传入 `orderObj.yqMerchantId || orderObj.sellerMerchantId` 及对应名称;低价单缺少园区店时不回退固定用户。
- [x] 运行目标测试并确认通过。
### Task 4: 文档与完整验证
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
- Modify: `docs/tabWorkOrder/精品工单页面接口清单.md`
- [x] 同步客户档案入口、门店参数来源和园区配置缓存说明。
- [x] 使用 Node 24 运行 `npm run test:workOrder`。
- [x] 运行 `npm run check:migration -- --manifest docs/migrations/low-price-order-store-selection/manifest.json --phase post`。
- [x] 运行 `git diff --check` 并核对无缺失依赖、死路由和公共 API。
# 新增工单直接下单跳过业务守卫 Implementation Plan
> 已由 [2026-08-07 实施计划](./2026-08-07-direct-order-without-daily-guard.md) 取代;本文记录的 `newOrderGuardPolicy` 已从运行代码清理。
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 让新增工单“直接下单”稳定跳过日报、学习任务和锁单业务守卫,同时保留订单数据校验。
**Architecture:** 由提交上下文表达直接下单语义,守卫策略同时识别提交上下文和原路由标记。异步前置校验只提前结束业务守卫部分,后续校验链不变。
**Tech Stack:** 微信小程序 JavaScript、Node 24 `node:test`。
## Global Constraints
- 只修改精品工单创建页提交守卫范围。
- 不跳过手机号配置、商品、必填、VIN、价格及总价校验。
- 不创建分支,不提交或推送代码。
---
### Task 1: 直接下单守卫策略
**Files:**
- Modify: `tests/work-order-migration/new-order-guard-policy.test.mjs`
- Modify: `tabWorkOrder/pages/createOrder/services/newOrderGuardPolicy.js`
- Modify: `tabWorkOrder/pages/createOrder/submitStrategy.js`
**Interfaces:**
- Consumes: `SubmitContext.execute(event)` 中的 `event.currentTarget.dataset.save`
- Produces: `shouldSkipOrderBusinessGuards(pageContext, submitContext): boolean`
- [x] 增加失败测试:`directSubmit=true` 必须跳过,`directSubmit=false` 且无入口标记时不得跳过。
- [x] 运行目标测试并确认当前策略对直接下单返回 `false`。
- [x] 扩展策略第二入参,并由 `SubmitContext` 传入 `directSubmit: !save`。
- [x] 运行目标测试和创建页测试并确认通过。
### Task 2: 文档和完整验证
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
- [x] 记录直接下单按钮语义,不再把跳过能力仅描述为入口参数。
- [x] 使用 Node 24 运行 `npm run test:workOrder`。
- [x] 运行迁移 post 门禁和 `git diff --check`。
# Low-price Order Popup and Staff Context Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 让低价单收款方式在可用高度内完整滚动,并让销售顾问使用前一步选定的 4S 店及所属园区店。
**Architecture:** 弹层局部采用统一响应式高度、safe-area slot 和 flex scroll,不修改公共 Popup。低价单员工选择直接把 `orderObj` 中已选 4S 店作为唯一合作门店;非低价单仍通过用户园区上下文查询并过滤门店。
**Tech Stack:** 微信小程序 JavaScript、WXML、Sass/WXSS、Node.js 24、`node:test`
## Global Constraints
- 当前分支直接开发,不创建分支或 worktree。
- 只修改精品工单迁移闭包,不改变目标项目其他业务。
- 固定用户信息保持现状,sessionId 继续使用系统原登录态。
- 先运行失败测试,再写生产代码。
- 不提交或推送改动。
---
### Task 1: 低价单弹层可用高度与滚动
**Files:**
- Modify: `tests/work-order-migration/low-price-api-contract.test.mjs`
- Modify: `components/orderPromptPop/orderPromptPop.wxml`
- Modify: `components/orderPromptPop/orderPromptPop.js`
- Modify: `components/orderPromptPop/orderPromptPop.sass`
**Interfaces:**
- Consumes: `lowPriceMode`, `merchantHeight`, `currentStep`, `infoData.payFlag`
- Produces: 低价单统一 popup 高度、safe-area slot、固定头部和可滚动内容区
- [x] **Step 1: 写失败测试**
断言低价单高度不再依赖 `payFlag`,slot 高度包含 `env(safe-area-inset-bottom)`,且收款方式
内容位于启用 `scroll-y` 的 `scroll-view` 中。
- [x] **Step 2: 验证 RED**
Run: `node scripts/run-node-tests.mjs tests/work-order-migration/low-price-api-contract.test.mjs`
Expected: FAIL,因为当前第二步仍使用旧高度且收款区域是普通 `view`。
- [x] **Step 3: 最小实现**
将低价单两步的 popup 高度统一为 `merchantHeight`;slot 高度扣除 footer 和 safe-area;用
`.prompt-layout` 纵向 flex 包裹标题、步骤条及内容,收款方式改为占据剩余高度的
`scroll-view`,门店列表改为 flex 剩余高度滚动。
- [x] **Step 4: 验证 GREEN**
Run: `node scripts/run-node-tests.mjs tests/work-order-migration/low-price-api-contract.test.mjs`
Expected: PASS。
### Task 2: 销售顾问继承已选下单门店
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/tests/merchantStaffSelection.test.mjs`
- Modify: `tabWorkOrder/pages/createOrder/services/merchantStaffSelection.helpers.js`
- Modify: `tabWorkOrder/pages/createOrder/services/merchantStaffSelection.js`
**Interfaces:**
- Produces: `resolveStaffMerchantScope(orderObj, userContext): { parkMerchantId, shopMerchantId }`
- Consumes: `orderObj.lowPriceFlag/merchantId/yqMerchantId/sellerMerchantId` 和用户上下文兜底
- [x] **Step 1: 写失败测试**
用不同的用户默认门店和低价单所选门店构造数据,断言解析结果使用订单园区/4S 店;另写非
低价单断言确保仍使用用户上下文。
- [x] **Step 2: 验证 RED**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/merchantStaffSelection.test.mjs`
Expected: FAIL,因为 `resolveStaffMerchantScope` 尚不存在。
- [x] **Step 3: 最小实现并接线**
在纯函数层实现 `resolveStaffMerchantScope` 并导出;低价单 `fetchMerchantList` 直接返回
`orderObj.merchantId/merchantName` 组成的唯一门店。非低价单继续用解析出的
`parkMerchantId` 请求园区下 4S 店,并用 `shopMerchantId` 过滤。
- [x] **Step 4: 验证 GREEN**
Run: `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/merchantStaffSelection.test.mjs`
Expected: PASS。
- [x] **Step 5: 增加空关联列表集成回归**
`merchantStaffSelection.integration.test.mjs` 模拟关联门店接口返回空数组,验证订单已有
4S 店仍作为唯一 active 合作门店返回。
### Task 3: 文档与完整验证
**Files:**
- Modify: `docs/order-lifecycle/test-acceptance.md`
- Modify: `docs/migrations/low-price-order-store-selection/test-acceptance.md`
**Interfaces:**
- Consumes: 两项回归的最终测试结果
- Produces: 更新后的验收场景和实际测试计数
- [x] **Step 1: 更新验收文档**
新增弹层滚动和销售顾问继承门店的验收项,并按实际输出更新测试计数。
- [x] **Step 2: 完整验证**
Run: `npm run test:workOrder`
Expected: 全部本地自动化通过,真实 API/UI 用例仅按安全开关跳过。
- [x] **Step 3: 迁移后置门禁与格式检查**
Run: `npm run check:migration -- --manifest docs/migrations/low-price-order-store-selection/manifest.json --phase post`
Run: `git diff --check`
Expected: 两条命令均退出 0。
# 新增工单直接下单不调用日报接口 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 保证新增工单页面点击“直接下单”时不调用 `dj.api.smartcarlife.staff.daily.report.popup.need`,而是在订单数据校验通过后直接调用既有下单接口。
**Architecture:** 从创建页依赖闭包中移除 `ModalToQueueControl` 和异步业务守卫策略,把手机号配置处理保留在 `SubmitContext.execute` 的本地校验入口。使用 Node ESM loader 构造依赖边界测试,只要创建页重新导入业务守卫模块就失败。
**Tech Stack:** 微信小程序 JavaScript、Node.js 24、`node:test`、ESM loader、现有迁移检查脚本。
## Global Constraints
- 仅修改精品工单迁移涉及的新增工单创建页;其他页面原有业务守卫不动。
- 固定使用 Node.js 24 LTS 测试,不兼容 Node.js 14。
- 保留手机号配置、必填项、商品、VIN、错单金额和总价校验。
- 保留现有下单接口选择及请求参数处理。
- 在当前分支实施,不创建分支、不提交。
---
### Task 1: 创建页业务守卫依赖边界
**Files:**
- Create: `tests/work-order-migration/shims/create-order-without-business-guards-loader.mjs`
- Create: `tests/work-order-migration/direct-order-without-daily-guard.test.mjs`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Modify: `tabWorkOrder/pages/createOrder/submitStrategy.js`
**Interfaces:**
- Consumes: `SubmitContext.execute(event)`、创建页 `Page` 配置和现有 `create-order-context-loader` 解析规则。
- Produces: 创建页依赖闭包不包含 `~/store/ModalToQueueControl`;提交入口继续调用 `checkPhoneUseConfig()` 后执行本地订单校验。
- [x] **Step 1: 写依赖边界失败测试**
新 loader 复用创建页测试的 API/util 替身与路径补全逻辑,但在解析
`~/store/ModalToQueueControl` 时抛出 `FORBIDDEN_CREATE_ORDER_BUSINESS_GUARD`。测试注册 loader、准备微信小程序全局对象,并导入 `createOrder.js`;导入成功且 `Page` 暴露 `submit` 才通过。
- [x] **Step 2: 运行测试并确认 RED**
Run:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' --experimental-detect-module --test tests/work-order-migration/direct-order-without-daily-guard.test.mjs
```
Expected: FAIL,错误包含 `FORBIDDEN_CREATE_ORDER_BUSINESS_GUARD`,证明当前创建页仍加载业务守卫模块。
- [x] **Step 3: 最小化移除创建页业务守卫调用**
从 `createOrder.js` 删除未使用的 `checkDailyReport/checkStudyTask` 导入;从
`submitStrategy.js` 删除 `ModalToQueueControl`、异常流水锁单和
`newOrderGuardPolicy` 导入及 `AsyncPreCheckStrategy`。在
`SubmitContext.execute` 构建本地策略数组之前直接调用:
```js
this.page.checkPhoneUseConfig()
```
策略数组从 `StatePermissionStrategy` 开始,其余订单数据校验和 `finishSubmit(save)` 保持不变。
- [x] **Step 4: 运行测试并确认 GREEN**
Run: 与 Step 2 相同。
Expected: PASS。
- [x] **Step 5: 运行创建页和迁移回归测试**
Run:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' run test:createOrder
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' run test:workOrderMigration
```
Expected: 全部通过。
### Task 2: 文档与完整迁移验收
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
- Modify: `docs/tabWorkOrder/createOrder.md`
- Modify: `docs/tabWorkOrder/精品工单页面接口清单.md`
**Interfaces:**
- Consumes: Task 1 确立的创建页依赖边界和回归测试。
- Produces: 与实际代码一致的流程、接口范围和验收证据。
- [x] **Step 1: 同步流程和接口文档**
把“按标记跳过日报等业务守卫”更新为“创建页不加载该组守卫”;明确公共日报接口仍供其他页面使用,创建页直接下单不会调用它。
- [x] **Step 2: 运行完整精品工单测试**
Run:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' run test:workOrder
```
Expected: 所有非 live 测试通过,live 测试按环境条件跳过。
- [x] **Step 3: 执行迁移 post 门禁和差异检查**
Run:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' scripts/check-migration-readiness.mjs --manifest docs/migrations/low-price-order-store-selection/manifest.json --phase post
git diff --check
```
Expected: post 门禁通过,`git diff --check` 无错误。
- [x] **Step 4: 自检影响范围**
确认 `tabWorkOrder/pages/createOrder` 不再引用 `checkDailyReport`,同时
`orderDetail.js` 等其他页面保留原有业务守卫调用;不暂存、不提交当前分支修改。
# 工单详情隐藏确认施工按钮 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 让工单详情页不再渲染“确认订单是否施工”按钮。
**Architecture:** 沿用详情页隐藏“查看施工单”的模板边界方案,只移除确认施工按钮节点。保留详情状态查询和兼容 JavaScript 方法,不扩大到其他页面或公共 API。
**Tech Stack:** 微信小程序 WXML、Node.js 24、`node:test`。
## Global Constraints
- 仅修改 `tabWorkOrder/pages/orderDetail/orderDetail` 的用户可见按钮。
- 不修改工单确认页、列表页或公共施工接口。
- 保留详情状态提示、标错和刷新逻辑。
- 在当前分支实施,不提交、不推送。
---
### Task 1: 隐藏详情页确认施工入口
**Files:**
- Modify: `tests/work-order-migration/order-detail-scope.test.mjs`
- Modify: `tabWorkOrder/pages/orderDetail/orderDetail.wxml`
- Modify: `docs/order-lifecycle/test-acceptance.md`
**Interfaces:**
- Consumes: `confirmFlagObj` 详情状态和现有 `orderDetail.wxml` 底部操作区。
- Produces: 详情模板不再绑定 `confirmConstruction`,其他详情状态和操作保持原样。
- [x] **Step 1: 写失败测试**
将原“保留确认施工”测试改为“详情页不渲染确认施工按钮”,断言模板不包含:
```js
assert.doesNotMatch(template, /btnName == ['"]confirmConstruction['"]/)
assert.doesNotMatch(template, /bindtap=['"]confirmConstruction['"]/)
```
- [x] **Step 2: 运行测试确认 RED**
Run:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' --test tests/work-order-migration/order-detail-scope.test.mjs
```
Expected: FAIL,当前模板仍包含 `confirmConstruction` 条件或点击绑定。
- [x] **Step 3: 删除按钮节点**
从 `orderDetail.wxml` 删除包含 `confirmFlagObj.showBtn` 的底部按钮容器及其中
`bindtap="confirmConstruction"` 节点,不修改其他模板内容。
- [x] **Step 4: 运行测试确认 GREEN**
Run: 与 Step 2 相同。
Expected: 详情页范围测试全部通过。
- [x] **Step 5: 同步验收文档并完整验证**
把 AC-23 更新为详情页不展示确认施工按钮,然后运行:
```powershell
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' run test:workOrder
& 'C:\Users\admin\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' run check:migration -- --manifest docs/migrations/low-price-order-store-selection/manifest.json --phase post
git diff --check
```
Expected: 自动化无失败、迁移 post 门禁通过、差异检查通过。
# 低价提单商品价格校验 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 让低价提单只允许提交已开启最低价且录入价严格低于最低价的商品,并在选品后回显最低价。
**Architecture:** 使用独立纯函数展开普通商品、SKU 和套餐子项并执行统一规则;创建页仅在 `lowPriceFlag=1` 时把规则接入选品、输入、失焦和提交。商品行组件消费校验器生成的最低价展示文本,普通工单逻辑保持不变。
**Tech Stack:** 微信小程序 JavaScript/WXML/Sass、Node.js 24 `node:test`
## Global Constraints
- 统一提醒文案必须为“价格未触发最低价,其他正常单请到生意助手侧录单”。
- 合法价格必须严格小于 `minSellPrice`,等于最低价也不允许提交。
- 只修改本次迁移的 `lowPriceFlag=1` 链路,不改变普通工单最低价规则。
- 当前分支直接开发,不创建分支、提交或推送。
---
### Task 1: 低价商品规则
**Files:**
- Create: `tabWorkOrder/pages/createOrder/services/lowPriceGoodsValidation.helpers.js`
- Create: `tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.helpers.test.mjs`
**Interfaces:**
- Produces: `LOW_PRICE_NOT_TRIGGERED_MESSAGE`、`resolveLowPriceGoodsEntries(goodsList)`、`validateLowPriceGoods(goods)`、`validateLowPriceGoodsList(goodsList)`、`applyLowPriceGoodsValidation(goodsList)`。
- [x] **Step 1: 写失败测试**:用手工 fixture 覆盖普通商品、SKU、套餐以及未开启、缺字段、空价格、等于、高于和低于边界。
- [x] **Step 2: 验证红灯**:运行 `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.helpers.test.mjs`,预期因模块不存在失败。
- [x] **Step 3: 最小实现**:展开叶子商品,按 `basePrice/sellPrice/price` 解析当前价,严格比较 `currentPrice < minSellPrice`,同步 `lowPriceMinPriceText/errorTarget/checkError/basePriceError`。
- [x] **Step 4: 验证绿灯**:重复运行定向测试,预期全部通过。
### Task 2: 创建页实时与提交接入
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Modify: `tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.integration.test.mjs`
**Interfaces:**
- Consumes: Task 1 的校验常量和函数。
- Produces: 选品确认后静默回显、普通商品/SKU/套餐子项改价提示、低价单失焦状态及提交阻断。
- [x] **Step 1: 写失败集成契约**:验证创建页只在 `lowPriceFlag=1` 调用低价规则,输入时使用统一提醒,提交前重新校验。
- [x] **Step 2: 验证红灯**:运行新集成测试,预期缺少页面接入而失败。
- [x] **Step 3: 最小接入**:在 `chooseGoods`、`changePrice`、`changeMealPrice`、`priceBlur`、`checkGoods` 和 `setGoodsTotal` 接入规则,普通单继续走旧分支。
- [x] **Step 4: 验证绿灯**:运行低价规则与集成测试,预期全部通过。
### Task 3: 商品行最低价回显
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml`
- Modify: `tabWorkOrder/pages/createOrder/components/OrderGoodsRow/order-goods-row.js`
- Modify: `tabWorkOrder/pages/createOrder/components/OrderGoodsRow/order-goods-row.wxml`
- Modify: `tabWorkOrder/pages/createOrder/components/OrderGoodsRow/order-goods-row.sass`
- Modify: `tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.integration.test.mjs`
**Interfaces:**
- Consumes: Task 1 写入叶子商品的 `lowPriceMinPriceText`。
- Produces: 仅低价单可见的“最低价:¥金额/未开启”商品行。
- [x] **Step 1: 写失败模板契约**:验证所有商品行传入 `lowPriceFlag`,组件只在低价单渲染最低价文本。
- [x] **Step 2: 验证红灯**:运行集成测试,预期模板尚未接线而失败。
- [x] **Step 3: 最小实现**:增加组件属性、WXML 展示与辅助样式,并为创建页全部 `order-goods-row` 实例传值。
- [x] **Step 4: 验证绿灯**:运行创建页测试,预期全部通过。
### Task 4: 文档与迁移验收
**Files:**
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
- Modify: `docs/tabWorkOrder/精品工单页面接口清单.md`
- Modify: `docs/migrations/low-price-order-store-selection/test-acceptance.md`
- Modify: `docs/migrations/low-price-order-store-selection/manifest.json`
**Interfaces:**
- Consumes: Tasks 1-3 的最终行为和测试文件。
- Produces: 可追溯规则、验收项和 post 门禁证据。
- [x] **Step 1: 同步规则与边界**:记录启用字段、严格小于、统一提示、三类商品和普通单隔离。
- [x] **Step 2: 更新 manifest 测试证据**:加入低价商品规则测试并标记最终状态为 `pass`。
- [x] **Step 3: 完整验证**:依次运行定向测试、`npm run test:workOrder`、`npm run check:workOrderClosure`、`git diff --check` 和迁移 post 门禁。
# 低价提单列表视觉改造 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 将工作台入口和低价单列表按设计稿统一为“低价提单”,并以最新 Swagger 返回模型驱动列表字段。
**Architecture:** 保留现有列表接口、分页、审批统计、新建与详情路由,只替换菜单资源和低价提单专属 WXML/Sass 展示层。通过源代码契约测试锁定菜单、搜索栏、卡片字段及 Swagger 字段来源,避免回退到旧通用工单卡片。
**Tech Stack:** 微信小程序 WXML/WXSS(Sass)、JavaScript、Node.js 24、`node:test`
## Global Constraints
- 仅在当前分支工作,不创建分支或 worktree。
- 不提交、不推送、不覆盖工作区既有用户改动。
- Node.js 固定使用 24 LTS。
- 列表接口固定为 `order.search.containPackageGoods.byArea`,统计接口固定为 `order.statByApplyStatus`。
- 两个接口固定携带 `sceneType=1`、`lowPriceFlag=1`。
- 保留新建低价单、详情跳转、分页刷新和撤销能力。
---
### Task 1: 锁定菜单和列表展示契约
**Files:**
- Modify: `tests/work-order-migration/workspace-source-contract.test.mjs`
- Modify: `tests/work-order-migration/work-order-list-page.test.mjs`
**Interfaces:**
- Consumes: 工作台 `storeManagementMenus` 与列表 WXML/Sass 源码。
- Produces: 菜单名称/图标、关键词搜索、无筛选按钮、低价卡片字段的失败测试。
- [ ] **Step 1: 更新工作台菜单测试**
将菜单断言改为:
```js
{
name: '低价提单',
path: '/pages/tabWorkOrder/pages/index/index',
iconUrl: '/images/low-price-order.png',
trackingCode: 'regional-assistant-customer-work-order'
}
```
- [ ] **Step 2: 增加列表模板契约**
断言导航标题包含“低价提单”、输入框为 `placeholder="关键词"`、模板不包含
`bindtap="showConfirm"` 和 `search-filter`,并包含“订单类型、销售顾问、转化人员、工单编号、
工单时间”及 `low-price-view`。
- [ ] **Step 3: 运行测试确认失败**
Run:
```powershell
node scripts/run-node-tests.mjs tests/work-order-migration/workspace-source-contract.test.mjs tests/work-order-migration/work-order-list-page.test.mjs
```
Expected: 旧菜单名称、旧图标、旧搜索提示和旧卡片模板导致断言失败。
### Task 2: 替换工作台菜单资源
**Files:**
- Create: `images/low-price-order.png`
- Modify: `pages/tab/workspace/workspace.js`
- Test: `tests/work-order-migration/workspace-source-contract.test.mjs`
**Interfaces:**
- Consumes: 产品提供的 72×72 PNG。
- Produces: 名为“低价提单”的工作台菜单,路由与历史埋点保持不变。
- [ ] **Step 1: 复制并校验图标**
将 `C:/Users/admin/AppData/Local/Temp/codex-clipboard-a5d46ac1-5437-435a-8090-378af68eb95d.png`
复制到 `images/low-price-order.png`,校验 PNG 签名和 72×72 尺寸。
- [ ] **Step 2: 更新菜单配置**
把 `name` 改为“低价提单”,把 `iconUrl` 改为 `/images/low-price-order.png`,其余路由和
埋点字段不变。
- [ ] **Step 3: 运行菜单测试确认通过**
Run:
```powershell
node scripts/run-node-tests.mjs tests/work-order-migration/workspace-source-contract.test.mjs
```
Expected: PASS。
### Task 3: 实现 Swagger 驱动的低价提单卡片
**Files:**
- Modify: `pages/tabWorkOrder/pages/index/index.js`
- Modify: `pages/tabWorkOrder/pages/index/index.wxml`
- Modify: `pages/tabWorkOrder/pages/index/index.sass`
- Test: `tests/work-order-migration/work-order-list-page.test.mjs`
- Test: `tests/work-order-migration/low-price-api-contract.test.mjs`
**Interfaces:**
- Consumes: `GoodsOrderDTO.customer.customerName`、`merchantName`、`employeeName`、
`sellerMerchantName`、`sellerName`、`orderCode`、`orderTime`、`goodsOrderApplyStatus`。
- Produces: 设计稿对应的低价提单列表卡片。
- [ ] **Step 1: 收敛展示数据**
在接口结果归一化时生成:
```js
e.lowPriceOrderTypeText = '低价订单'
e.salesConsultantText = [e.merchantName, e.employeeName].filter(Boolean).join('|')
e.conversionStaffText = [e.sellerMerchantName, e.sellerName].filter(Boolean).join('|')
```
审批文案改为 `1/2=待审批`、`3=已通过`、`4=已驳回`,颜色沿用现有黄/绿/红映射。
- [ ] **Step 2: 替换列表模板**
导航标题改为“低价提单”;搜索提示改为“关键词”并删除右侧筛选节点。将旧商品、支付、
出库和异常信息卡片替换为固定五行信息及底部“查看”按钮,客户名使用
`li.customer.customerName || '--'`。
- [ ] **Step 3: 按设计稿重写专属样式**
使用浅灰列表背景、20rpx 外间距、24rpx 卡片圆角、32rpx 内边距、灰色字段名、单行省略
值、浅蓝查看按钮;搜索框改为全宽。保留 `.touch-item/.del/.low-price-create` 的交互样式。
- [ ] **Step 4: 运行列表和接口测试确认通过**
Run:
```powershell
node scripts/run-node-tests.mjs tests/work-order-migration/work-order-list-page.test.mjs tests/work-order-migration/low-price-api-contract.test.mjs
```
Expected: PASS。
### Task 4: 同步接口清单与验收说明
**Files:**
- Modify: `docs/tabWorkOrder/精品工单页面接口清单.md`
- Modify: `docs/order-creation/README.md`
- Modify: `docs/order-lifecycle/README.md`
- Modify: `docs/order-lifecycle/test-acceptance.md`
**Interfaces:**
- Consumes: 开发 Swagger 的两个响应模型及已完成页面行为。
- Produces: 统一使用“低价提单”的菜单/页面说明和 Swagger 字段映射。
- [ ] **Step 1: 更新可见名称和交互说明**
将菜单和页面语境中的“客户工单/低价单列表”更新为“低价提单”,记录搜索提示为“关键词”
且无筛选按钮。
- [ ] **Step 2: 记录 Swagger 响应契约**
在接口清单写明列表返回 `RpcPagination<GoodsOrderDTO>`、统计返回
`GoodsOrderApplyStatDTO(totalCount/pendingCount/passCount/rejectCount)`,并列出卡片字段映射。
### Task 5: 全量验证
**Files:**
- Verify: `docs/migrations/low-price-order-store-selection/manifest.json`
**Interfaces:**
- Consumes: 本计划全部实现与现有迁移闭包。
- Produces: 可复核的测试和迁移门禁结果。
- [ ] **Step 1: 运行格式和静态检查**
用 Prettier 检查改动的 JS/WXML/Sass/Markdown 文件,并解析 JSON、JS、WXML/WXSS。
- [ ] **Step 2: 运行工作单测试集合**
Run:
```powershell
npm run test:workOrder
```
Expected: PASS。
- [ ] **Step 3: 运行迁移后置门禁**
Run:
```powershell
npm run check:migration -- --manifest docs/migrations/low-price-order-store-selection/manifest.json --phase post
```
Expected: PASS,或只报告 manifest 已登记且不阻塞的人工验证项。
### Task 6: 产品后续入口调整
**Files:**
- Create: `images/new-low-price-order.png`
- Modify: `pages/tab/workspace/workspace.js`
- Modify: `pages/tabWorkOrder/pages/index/index.wxml`
- Modify: `tests/work-order-migration/workspace-source-contract.test.mjs`
- Modify: `tests/work-order-migration/work-order-list-page.test.mjs`
**Interfaces:**
- Consumes: 产品提供的 56×56 “新建低价单” PNG。
- Produces: 隐藏工作台“新增工单”菜单、以“低价提单”为首个工单入口,并替换列表右下角图标。
- [x] **Step 1: 先更新菜单与图标契约测试并确认失败**
- [x] **Step 2: 从 `storeManagementMenus` 删除“新增工单”,保留列表新建流程**
- [x] **Step 3: 将产品 PNG 复制为 `/images/new-low-price-order.png` 并更新 WXML 引用**
- [x] **Step 4: 运行定向测试确认通过**
# Low-Price Minimum Validation Policy Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Show the full low-price catalog and validate minimum-price eligibility only at submission, accepting the order when any submitted goods entry qualifies.
**Architecture:** Remove minimum-price eligibility filtering from the catalog path and remove validation calls from selection and price-edit interactions. Keep the existing per-goods predicate, change the order aggregation to `some`, and invoke it only from `checkGoods` before the existing submission checks.
**Tech Stack:** WeChat Mini Program JavaScript, ES modules, Node.js built-in test runner.
## Global Constraints
- Preserve the user's existing `config.js` and `yarn.lock` changes.
- A goods entry qualifies only when `validMinSellPrice === 'Y'` and current base price is strictly below a numeric `minSellPrice`.
- One qualifying submitted goods entry makes the whole low-price order eligible.
- Normal-order price validation and approval behavior must remain unchanged.
- Do not add dependencies or change APIs/layouts.
---
### Task 1: Change whole-order aggregation
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/services/lowPriceGoodsValidation.helpers.js`
- Test: `tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.helpers.test.mjs`
**Interfaces:**
- Consumes: `validateLowPriceGoods(goods): { valid, enabled, minPrice, currentPrice }`.
- Produces: `validateLowPriceGoodsList(goodsList): { valid, matchedGoods, invalidGoods, entries }` where `valid === matchedGoods.length > 0`.
- [ ] Write tests proving mixed goods pass, all-invalid goods fail, and empty goods fail.
- [ ] Run the helper test and verify it fails under the old all-match rule.
- [ ] Implement `matchedGoods` and the `some`-equivalent aggregate.
- [ ] Separate minimum-price presentation from eligibility errors so presentation never marks inputs invalid.
- [ ] Run the helper test and verify it passes.
### Task 2: Restore the full selectable catalog
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Delete: `tabWorkOrder/pages/createOrder/services/lowPriceCatalogFilter.helpers.js`
- Delete: `tabWorkOrder/pages/createOrder/tests/lowPriceCatalogFilter.helpers.test.mjs`
- Modify: `tabWorkOrder/pages/createOrder/tests/lowPriceCatalogFilter.integration.test.mjs`
**Interfaces:**
- Consumes: normalized `rawCatalogData` from `getSelectOrderGoodsList`.
- Produces: unchanged full catalog passed to `classifySelectOrderCatalog` for both low-price and normal orders.
- [ ] Change the low-price catalog integration expectation to all catalog entries and all SKUs.
- [ ] Run the integration test and verify it fails against the existing filter.
- [ ] Remove the filter import/call and use `rawCatalogData` directly.
- [ ] Delete the obsolete pure filter and its obsolete tests.
- [ ] Run catalog integration and classification tests.
### Task 3: Validate only during submission
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Modify: `tabWorkOrder/pages/createOrder/tests/lowPriceGoodsValidation.integration.test.mjs`
**Interfaces:**
- Consumes: `validateLowPriceGoodsList(goodsList)` from the pure helper.
- Produces: `checkGoods(...)` returns `LOW_PRICE_NOT_TRIGGERED_MESSAGE` only when no submitted entry qualifies.
- [ ] Update static and dynamic integration tests to require no validation calls from choose, input, blur, or total calculation paths.
- [ ] Run the integration test and verify it fails against the current live-validation calls.
- [ ] Remove `applyLowPriceGoodsRules` and all interactive validation calls.
- [ ] In the low-price `priceBlur` branch, only recalculate totals and return.
- [ ] Use `validateLowPriceGoodsList` in `checkGoods` without mutating input error fields.
- [ ] Run create-order tests and verify the mixed-pass/all-invalid-block behavior.
### Task 4: Verify the complete change
**Files:**
- Modify only if an in-scope regression is found.
- [ ] Run `npm run test:createOrder`.
- [ ] Run `npm run test:workOrder`.
- [ ] Run `git diff --check` and confirm only intended files are staged.
- [ ] Request a read-only code review and fix any Critical or Important findings.
# Low-Price Order Approval Completion Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Complete the low-price order flow by exposing only the low-price order business type, requiring approval confirmation, returning successful submissions to the pending list, and rejecting invalid price boundaries.
**Architecture:** Reuse the existing low-price approval sheet and pure approval-list builder. Add low-price-aware order-type helpers, a pure price-boundary helper consumed by both input and submit paths, and a small success-navigation helper so ordinary orders retain their current flow.
**Tech Stack:** WeChat Mini Program JavaScript, ES modules, Node.js built-in test runner.
## Global Constraints
- Preserve the user's existing `config.js` and `yarn.lock` changes.
- Use only `价格未触发最低价,其他正常单请到生意助手侧录单` when no goods triggers the minimum price.
- A low-price order is eligible when any submitted goods entry has `validMinSellPrice === 'Y'` and a current base price strictly below numeric `minSellPrice`.
- Low-price pages display only `低价订单`; the compatible payload remains `djOrderType=1 + lowPriceFlag=1`.
- Reject prices below `0` with `商品价格不能小于0元` and prices above `100000` with `商品价格不能大于100000元`.
- Do not add dependencies, APIs, or `import.meta` to mini-program runtime files.
---
### Task 1: Restrict low-price order type
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/services/orderMerchantConfig.js`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs`
**Interfaces:**
- Produces: `buildOrderTypePickerList(orderTypeList, createAllGoodsFlag, lowPriceFlag)`.
- Produces: `isAllowedLimitedOrderType(djOrderType, lowPriceFlag)`.
- [x] Change tests to require only the “低价订单” display option for `lowPriceFlag=1`, while normal restricted scenes retain normal and internal settlement.
- [x] Run `node scripts/run-node-tests.mjs tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs` and verify the new assertions fail under the two-type implementation.
- [x] Add the optional `lowPriceFlag` argument and pass `orderObj.lowPriceFlag` from `applyOrderTypeConfig`; normalize low-price order data to type `1`.
- [x] Re-run the focused test and verify it passes.
### Task 2: Restore the approval confirmation gate
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/submitStrategy.js`
- Modify: `tabWorkOrder/pages/createOrder/services/minPriceApproval.js`
- Test: `tabWorkOrder/pages/createOrder/tests/minPriceApproval.test.mjs`
- Create: `tabWorkOrder/pages/createOrder/tests/lowPriceSubmitFlow.integration.test.mjs`
**Interfaces:**
- Consumes: `buildMinPriceApprovalList(goodsList): ApprovalItem[]`.
- Calls: `page.openMinPriceApprovalSheet(items, save)` on the first valid low-price submission.
- Calls: `finishSubmit(save, true)` only after `onConfirmMinPriceApprovalSubmit`.
- [x] Add tests proving approval comparison uses `minSellPrice` and first submit opens the sheet without requesting the API.
- [x] Run the two focused tests and verify failures show the missing gate and old `upgradeShopMinPrice` preference.
- [x] Import and invoke `buildMinPriceApprovalList` in `finishSubmit`; when low-price items exist and `skipApprovalSheet` is false, open the sheet and return.
- [x] Keep confirmation using `executeAfterApproval` so the API is invoked exactly once.
- [x] Re-run the focused tests and verify they pass.
### Task 3: Return successful low-price submissions to pending
**Files:**
- Create: `tabWorkOrder/pages/createOrder/services/lowPriceSubmitNavigation.helpers.js`
- Modify: `tabWorkOrder/pages/createOrder/submitStrategy.js`
- Modify: `pages/tabWorkOrder/pages/index/index.js`
- Test: `tabWorkOrder/pages/createOrder/tests/lowPriceSubmitNavigation.helpers.test.mjs`
- Test: `tabWorkOrder/pages/createOrder/tests/lowPriceSubmitFlow.integration.test.mjs`
- Test: `tests/work-order-migration/low-price-order-flow.test.mjs`
**Interfaces:**
- Produces: `buildPendingLowPriceListPatch(): { activeIndex: 1, tabIndex: 1, keyword: '', searchObj: {} }`.
- Produces: `isLowPriceSubmit(orderObj): boolean`.
- Low-price success: refresh and patch the source low-price list page before navigating back; `onShow` performs the refreshed search. If the previous page is not that list, fall back to `/pages/tabWorkOrder/pages/index/index?activeIndex=1`.
- [x] Add tests for low-price versus ordinary success navigation and route-option tab synchronization.
- [x] Run focused tests and verify current `confirmOrder` redirect fails the expectations.
- [x] Implement the pure patch helper, update list `onRoute` to synchronize both tab indexes, and branch successful submission by `lowPriceFlag`.
- [x] Re-run focused tests and verify low-price and ordinary paths pass.
### Task 4: Reject negative and over-limit prices
**Files:**
- Create: `tabWorkOrder/pages/createOrder/services/goodsPriceBoundary.helpers.js`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Modify: `tabWorkOrder/pages/createOrder/submitStrategy.js`
- Test: `tabWorkOrder/pages/createOrder/tests/goodsPriceBoundary.helpers.test.mjs`
- Test: `tabWorkOrder/pages/createOrder/tests/goodsPriceBoundary.integration.test.mjs`
**Interfaces:**
- Produces: `validateGoodsPriceInput(rawValue): { valid, value, message }`.
- Produces: `findGoodsPriceBoundaryError(goodsList): string`.
- Stores invalid input metadata on the affected goods object as `priceBoundaryError` without changing the last valid price.
- [x] Add pure tests for `-1`, `100000.01`, `0`, `100000`, and two-decimal normalization.
- [x] Add page tests proving invalid values show the exact message, do not update price, and block submission until corrected.
- [x] Run focused tests and verify failures under the current sanitizing/clamping behavior.
- [x] Implement the helper, use it in low-price `changePrice` and `changeMealPrice`, and recheck the stored values during low-price goods submission validation.
- [x] Re-run focused tests and verify they pass.
### Task 5: Update living documentation and verify
**Files:**
- Modify: `docs/tabWorkOrder/createOrder.md`
- Modify: `docs/order-lifecycle/README.md`
- Modify only if an in-scope regression is found elsewhere.
- [x] Update approval-flow and low-price order-type documentation; remove statements saying the approval entry is disabled.
- [x] Run `npm run test:createOrder`.
- [x] Run `npm run test:workOrder`.
- [x] Run `git diff --check`.
- [x] Scan mini-program runtime JavaScript for new `import.meta` and verify no new occurrence exists under the modified runtime files.
- [x] Inspect `git diff --stat` and `git status --short`; preserve unrelated `config.js` and `yarn.lock` modifications.
# Low-Price Customer Required Settings Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Make low-price customer required fields use the selected 4S store's employee-app recording settings, including vehicle fields and phone configuration.
**Architecture:** Add one pure settings adapter that normalizes the employee-app response and builds the page's managed required fields. The store queries and caches by selected 4S store while using the park store only to select phone defaults; the create page consumes the normalized result without accumulating stale required fields.
**Tech Stack:** WeChat Mini Program JavaScript, ES modules, Node.js built-in test runner.
## Global Constraints
- Query required settings for the selected 4S store, not the park store.
- Use `dj.api.smartcarlife.order.field.lightChange.setting.list` with `scene: 1`.
- Preserve customer-profile-only import; do not import goods or payment information.
- Preserve unrelated user changes in `README.md` and `config.js`.
- Do not add dependencies, runtime `import.meta`, or make a git commit unless the user asks.
---
### Task 1: Normalize employee-app order settings
**Files:**
- Create: `utils/orderRequiredSettings.helpers.js`
- Create: `tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.helpers.test.mjs`
**Interfaces:**
- Produces: `normalizeMerchantOrderSettings(data, { shopMerchantId, yqMerchantId }): object`.
- Produces: `buildCustomerRequiredList(settings, currentRequiredList): string[]`.
- Produces: `shouldValidateCustomerPhone(requiredList, phone): boolean`.
- [ ] **Step 1: Write failing pure tests**
```js
assert.deepEqual(
buildCustomerRequiredList(
{
carTypeRequiredFlag: 'Y',
standNoRequiredFlag: 'N',
plateNumRequiredFlag: 'N',
customerPhoneRequiredFlag: 'N'
},
['subShopMerchantId', 'plateNumber']
),
['subShopMerchantId', 'carBrand']
)
```
Add normalization assertions for `carBrand`, `carNo`, `plateNo`, phone aliases, boolean `isRequired`, and `yqPhoneConfig` selection.
- [ ] **Step 2: Run the pure test and verify RED**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.helpers.test.mjs`
Expected: FAIL because `utils/orderRequiredSettings.helpers.js` does not exist.
- [ ] **Step 3: Implement the minimal pure adapter**
```js
const FIELD_FLAG_MAP = {
carBrand: 'carTypeRequiredFlag',
carNo: 'standNoRequiredFlag',
plateNo: 'plateNumRequiredFlag',
customerPhone: 'customerPhoneRequiredFlag',
phone: 'customerPhoneRequiredFlag',
mobile: 'customerPhoneRequiredFlag'
}
```
Map explicit `true/false`, `1/0`, and `Y/N`; preserve non-managed required fields; default only `customerPhone` to required when the interface has no phone flag.
- [ ] **Step 4: Re-run the pure test and verify GREEN**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.helpers.test.mjs`
Expected: all assertions pass.
### Task 2: Query and cache by selected 4S store
**Files:**
- Modify: `api/api.js:165-171`
- Modify: `store/index.js:101-163`
- Modify: `tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
**Interfaces:**
- Consumes: `normalizeMerchantOrderSettings` from Task 1.
- Produces: `getYQorderInfo({ shopMerchantId, shopMerchantName, yqMerchantId }): Promise<object>`.
- [ ] **Step 1: Rewrite the store integration test for the real contract**
```js
const result = await getYQorderInfo({
shopMerchantId: 44210895,
shopMerchantName: '波波的单店门店',
yqMerchantId: 100
})
assert.deepEqual(requests, [{ scene: 1, merchantId: 44210895 }])
assert.equal(result.plateNumRequiredFlag, 'N')
assert.equal(app.globalData.YQorderSettingMerchantId, 44210895)
```
Also assert that `api/api.js` uses `dj.api.smartcarlife.order.field.lightChange.setting.list`.
- [ ] **Step 2: Run the focused test and verify RED**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
Expected: FAIL because the request still uses the park store and the response is not normalized.
- [ ] **Step 3: Implement the store/API fix**
Use `{ scene: 1, merchantId: shopMerchantId }`, normalize `orderFieldSettingList`, filter phone config by `yqMerchantId`, and cache only when both selected store identities match.
- [ ] **Step 4: Re-run the focused test and verify GREEN**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
Expected: all assertions pass.
### Task 3: Drive page required state from normalized settings
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js:209,1606-1684,2741-2774`
- Modify: `tabWorkOrder/pages/createOrder/createOrder.wxml:124-155`
- Create: `tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.integration.test.mjs`
**Interfaces:**
- Consumes: `buildCustomerRequiredList` and `shouldValidateCustomerPhone` from Task 1.
- Page data: `requiredList` contains `carBrand`, `standNo`, `plateNumber`, and/or `customerPhone` only when configured, except the employee-app-compatible phone fallback.
- [ ] **Step 1: Write failing page and template tests**
Test that `getSetting()` passes `shopMerchantId: 44210895`, a `plateNo/isRequired=false` response removes `plateNumber`, and the WXML `required` property for all four customer rows reads `requiredList`.
Test phone behavior:
```js
assert.equal(page.checkRequired(false, optionalEmptyPhoneOrder), false)
assert.equal(page.checkRequired(false, optionalInvalidPhoneOrder), true)
```
- [ ] **Step 2: Run the integration test and verify RED**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.integration.test.mjs`
Expected: FAIL because page context uses the park ID, phone is hard-coded, and model/phone stars are not dynamic.
- [ ] **Step 3: Implement minimal page wiring**
Call:
```js
getYQorderInfo({
shopMerchantId: orderObj.merchantId,
shopMerchantName: orderObj.merchantName,
yqMerchantId: orderObj.yqMerchantId || orderObj.sellerMerchantId
})
```
Replace the managed customer portion of `requiredList`; validate phone format only when required or non-empty; fix the configured-phone `.find` callback without mutating the list; bind model and phone stars to `requiredList`.
- [ ] **Step 4: Re-run focused page tests and verify GREEN**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderRequiredSettings.integration.test.mjs`
Expected: all assertions pass.
### Task 4: Documentation and full verification
**Files:**
- Modify: `docs/tabWorkOrder/createOrder.md`
- Modify: `docs/order-creation/README.md`
- [ ] **Step 1: Document selected-4S-store configuration behavior**
Record the endpoint, request identity split, four managed fields, phone fallback, and that the customer remains profile-only.
- [ ] **Step 2: Run complete regression tests**
Run: `npm run test:workOrder`
Expected: exit code `0` with no failed tests.
- [ ] **Step 3: Run static compatibility checks**
Run `git diff --check`, scan modified runtime JavaScript for `import.meta`, and run `node --check` on the modified runtime files.
- [ ] **Step 4: Review final scope**
Confirm `README.md` and `config.js` remain untouched, customer import still excludes goods/payment data, and no migration manifest is required because this is a localized defect fix.
# 低价单默认场景提交修复实施计划
> 当前工作区包含同一需求链路的未提交修改,本次直接在现有分支完成,不创建新 worktree、不提交代码。
## 任务 1:用失败测试锁定提交参数缺失
**文件:**
- 修改:`tabWorkOrder/pages/createOrder/tests/submitPayload.helpers.test.mjs`
1. 构造包含 `baseSceneCode`、`baseSceneName`、`sceneType` 的低价单。
2. 断言 `buildSubmitPayload` 的结果保留三个场景字段。
3. 运行该测试并确认当前代码因删除 `baseSceneName` 而失败。
## 任务 2:用失败测试锁定默认场景初始化时序
**文件:**
- 新增:`tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs`
1. 加载真实 createOrder 页面逻辑,只在 HTTP/API 边界返回可控的最近场景和门店场景数据。
2. 以低价单所选 4S 店进入页面,断言场景列表请求使用所选门店。
3. 场景列表未返回时触发提交,断言提交不等待初始化 Promise,并使用固定场景进入校验或审批反馈。
4. 断言最近场景已返回时,当前门店场景列表为空或接口失败仍保留入口场景;两个接口均无场景时不能绕过必填校验。
5. 断言录单字段配置失败时使用默认必填配置并继续初始化场景。
6. 等待 `onLoad` 返回后,断言订单对象同时拥有场景编码、名称和类型。
7. 运行测试并确认当前提前提交和门店列表二次清空入口场景两种情况失败。
## 任务 3:最小实现修复
**文件:**
- 修改:`tabWorkOrder/pages/createOrder/createOrder.js`
- 修改:`tabWorkOrder/pages/createOrder/services/submitPayload.helpers.js`
1. 保存完整场景初始化 Promise 供 `onLoad` 收尾使用;低价单提交不等待该展示初始化任务。
2. 场景列表有效时更新场景;列表为空或失败时保留最近场景接口已经写入的入口场景。
3. 低价专用页提交保留 `baseSceneName`,并固定低价标识与场景三字段。
4. 运行任务 1、2 的测试并确认通过。
## 任务 4:兼容场景列表不返回场景类型
**文件:**
- 修改:`tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs`
- 修改:`tabWorkOrder/pages/createOrder/createOrder.js`
1. 增加场景行仅返回编码、名称和状态的回归用例,并确认旧代码会清空有效场景。
2. 场景类型按“列表行、订单已有值、当前用户请求值”的顺序回退。
3. 重新运行默认场景集成测试与完整工单测试。
## 任务 5:锁定客户档案选择前后的场景上下文
**文件:**
- 修改:`tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs`
- 修改:`tabWorkOrder/pages/createOrder/tests/customerProfileOnlyImport.integration.test.mjs`
- 修改:`tabWorkOrder/pages/createOrder/createOrder.js`
1. 最近场景预填编码、名称和类型,门店列表匹配到同一编码时允许沿用最近场景名称。
2. 门店列表无法匹配最近编码时仍选择列表首项,不把旧名称带给新编码。
3. 客户档案中的空场景字段不得覆盖进入页面已确认的场景三字段。
## 任务 6:固定低价单提交场景并回归验证
**文件:**
- 修改:`docs/tabWorkOrder/createOrder.md`
- 修改:`docs/order-creation/README.md`
1. 用失败测试锁定场景全空和接口回填其他场景两种提交情况。
2. 在 `SubmitContext` 执行本地必填校验前,仅对 `lowPriceFlag=1` 强制写入 `100101/精品升级/1`。
3. 记录固定提交场景约束,运行 createOrder 页面测试、低价单测试和迁移完整性测试。
4. 检查差异与工作区状态,确保未覆盖 `README.md`、`config.js` 等用户原有修改。
# Low-Price Order Type Display Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** 低价下单页的订单类型默认且只能显示“低价订单”,同时保持后端兼容的 `djOrderType=1 + lowPriceFlag=1`。
**Architecture:** 在现有纯函数 `buildOrderTypePickerList` 中区分低价业务身份与普通订单策略,低价单直接返回一个展示项;创建页默认数据与 `onLoad` 均固定低价业务身份,提交不再等待展示用场景初始化。共享函数保留普通订单兼容分支,但本页面没有普通订单路由。
**Tech Stack:** 微信小程序 JavaScript/WXML、Node.js `node:test`
## Global Constraints
- 低价页显示文案固定为“低价订单”。
- 低价页唯一选项为 `{ text: '低价订单', value: 1 }`。
- 提交字段保持 `djOrderType=1 + lowPriceFlag=1`。
- 本页面没有普通订单入口,即使路由缺失或误传 `lowPriceFlag` 也必须归一成低价单。
- 低价单本地必填列表移除 `baseSceneCode`,最终提交固定场景逻辑保持不变。
- 点击“直接下单”不得等待场景初始化请求,应立即进入校验或低价审批反馈。
- 当前工作区包含既有未提交改动,不创建 Git 提交。
---
### Task 1: 订单类型纯函数
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/services/orderMerchantConfig.js`
- Test: `tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs`
**Interfaces:**
- Consumes: `buildOrderTypePickerList(orderTypeList, createAllGoodsFlag, lowPriceFlag)`
- Produces: 低价单固定返回 `[{ text: '低价订单', value: 1 }]`
- [x] **Step 1: Write the failing test**
把低价单断言改成手工期望值:
```js
assert.deepEqual(buildOrderTypePickerList(all, 0, 1), [
{ text: '低价订单', value: 1 }
])
```
- [x] **Step 2: Run test to verify it fails**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs`
Expected: FAIL,实际文案仍为“正常订单”。
- [x] **Step 3: Write minimal implementation**
导出统一低价订单展示项,并在 `lowPriceFlag=1` 分支返回新对象副本:
```js
export const LOW_PRICE_ORDER_TYPE_OPTION = Object.freeze({
text: '低价订单',
value: ORDER_TYPE_NORMAL
})
```
- [x] **Step 4: Run test to verify it passes**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs`
Expected: PASS。
### Task 2: 创建页展示接线
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
**Interfaces:**
- Consumes: `LOW_PRICE_ORDER_TYPE_OPTION`
- Produces: `applyOrderTypeConfig` 对低价单写入 `orderTypeName='低价订单'`、`orderObj.djOrderType=1`
- [x] **Step 1: Write the failing integration test**
构造 `lowPriceFlag=1` 页面,调用真实 `applyOrderTypeConfig` 后断言:
```js
assert.equal(page.data.orderTypeName, '低价订单')
assert.deepEqual(page.data.orderTypePickerList, [
{ text: '低价订单', value: 1 }
])
assert.equal(page.data.orderObj.djOrderType, 1)
```
- [x] **Step 2: Run test to verify it fails**
Run: `node --test tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs`
Expected: FAIL,页面名称仍为“正常订单”。
- [x] **Step 3: Write minimal implementation**
在低价分支使用统一展示项,不修改场景字段或提交策略。
- [x] **Step 4: Run focused tests**
Run:
```powershell
node --test tabWorkOrder/pages/createOrder/tests/orderMerchantConfig.test.mjs
node --test tabWorkOrder/pages/createOrder/tests/orderSettingMerchantContext.test.mjs
node --test tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs
```
Expected: 全部 PASS。
### Task 3: 文档与完整回归
**Files:**
- Modify: `docs/tabWorkOrder/createOrder.md`
- Modify: `docs/order-creation/README.md`
**Interfaces:**
- Consumes: 已实现的低价单页面行为
- Produces: 与实现一致的维护文档和验收说明
- [x] **Step 1: Update behavior documentation**
明确低价单页面显示“低价订单”,底层仍提交 `djOrderType=1 + lowPriceFlag=1`,并注明与 `baseSceneCode` 必填校验互不相关。
- [x] **Step 2: Run complete regression**
Run: `npm run test:workOrder`
Expected: 所有自动化测试通过;仅既有真实环境测试保持跳过。
- [x] **Step 3: Check patch integrity**
Run: `git diff --check`
Expected: exit code 0。
### Task 4: 低价单场景本地校验放行
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs`
**Interfaces:**
- Consumes: 页面稳定低价入口判断 `isLowPriceOrder()`
- Produces: 低价单 `checkRequired` 不检查 `baseSceneCode`
- [x] **Step 1: Add a failing test for an empty low-price scene and a regression assertion for ordinary orders.**
- [x] **Step 2: Verify the low-price assertion fails with `baseSceneCode`.**
- [x] **Step 3: Filter `baseSceneCode` from the required target only when `isLowPriceOrder()` is true.**
- [x] **Step 4: Re-run the focused test and verify both branches pass.**
### Task 5: 专用低价入口与提交响应
**Files:**
- Modify: `tabWorkOrder/pages/createOrder/createOrder.js`
- Test: `tabWorkOrder/pages/createOrder/tests/defaultSceneInitialization.integration.test.mjs`
**Interfaces:**
- Consumes: 任意页面路由参数、可能仍在等待的场景初始化 Promise
- Produces: 固定 `lowPriceFlag=1`、仅展示“低价订单”,点击后不等待场景接口并立即进入审批流程
- [x] **Step 1: 增加路由传 `lowPriceFlag=0` 时仍归一为低价单的失败测试。**
- [x] **Step 2: 增加场景列表请求挂起时提交仍立即完成同步校验并打开审批弹层的失败测试。**
- [x] **Step 3: 将页面默认数据和 `onLoad` 固定为低价单,移除提交对场景初始化 Promise 的等待。**
- [x] **Step 4: 运行入口、提交时序和完整创建订单回归。**
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!