Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6de596f3
authored
Aug 17, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: allow boutique list root field fallback
1 parent
81ff37ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
docs/superpowers/specs/2026-08-17-boutique-list-customer-source-design.md
docs/superpowers/specs/2026-08-17-boutique-list-customer-source-design.md
View file @
6de596f
...
@@ -2,16 +2,16 @@
...
@@ -2,16 +2,16 @@
## 背景
## 背景
精品工单管理列表的日报标签和实际交付日期
属于客户信息。接口约定这两个字段位于
每条工单的
`customer`
对象中:
精品工单管理列表的日报标签和实际交付日期
可能由接口返回在
每条工单的
`customer`
对象中:
-
`item.customer.customerTags`
-
`item.customer.customerTags`
-
`item.customer.actualDeliveryDate`
-
`item.customer.actualDeliveryDate`
列表根节点出现同名字段时不得读取,也不得作为兼容回退
。
主客户工单 Tab 的实际页面是
`pages/tabWorkOrder/pages/index/index`
。接口也可能把两个字段返回在列表根节点,因此需要兼容两种结构
。
## 目标
## 目标
为精品列表建立明确、可执行的数据源契约:
列表显示状态只能由
`item.customer`
构建。
`customer`
缺失或为空时,日报标签和实际交付日期都不显示,即使根节点存在同名值也一样
。
为精品列表建立明确、可执行的数据源契约:
每个字段优先读取
`item.customer`
中的值;嵌套字段为空或
`customer`
缺失时,回退到列表根节点同名字段。两处都无值时才隐藏
。
## 设计
## 设计
...
@@ -21,21 +21,22 @@
...
@@ -21,21 +21,22 @@
buildBoutiqueCustomerDailyListDisplay
(
orderItem
)
buildBoutiqueCustomerDailyListDisplay
(
orderItem
)
```
```
该适配器
只
执行以下映射:
该适配器
按字段
执行以下映射:
```
text
```
text
orderItem.customer
orderItem.customer
.field || orderItem.field
-> buildBoutiqueCustomerDailyDisplay(
c
ustomer)
-> buildBoutiqueCustomerDailyDisplay(
normalizedC
ustomer)
-> customerDailyDisplay
-> customerDailyDisplay
```
```
精品列表页面使用该适配器处理每条接口记录
。现有
`buildBoutiqueCustomerDailyDisplay`
继续负责标签解析、日期格式化和显示状态,不复制这些逻辑。
主客户工单 Tab 页面使用该适配器处理每条接口记录,并在现有
`order-list`
中条件渲染两个字段
。现有
`buildBoutiqueCustomerDailyDisplay`
继续负责标签解析、日期格式化和显示状态,不复制这些逻辑。
## 边界行为
## 边界行为
-
`orderItem.customer`
有值:读取其中的
`customerTags`
和
`actualDeliveryDate`
。
-
`orderItem.customer`
有值:优先读取其中的
`customerTags`
和
`actualDeliveryDate`
。
-
根节点与
`customer`
同时有值且冲突:只显示
`customer`
中的值。
-
某个嵌套字段为空而根节点同名字段有值:该字段回退读取根节点。
-
`orderItem.customer`
缺失、为
`null`
或为空对象:两个字段都不显示。
-
根节点与
`customer`
同时有非空值且冲突:显示
`customer`
中的值。
-
`orderItem.customer`
缺失、为
`null`
或为空对象:读取根节点同名字段;根节点也无值时隐藏。
-
`customer.actualDeliveryDate`
为合法 13 位毫秒时间戳:继续通过共享 UTC+8 formatter 格式化。
-
`customer.actualDeliveryDate`
为合法 13 位毫秒时间戳:继续通过共享 UTC+8 formatter 格式化。
-
非法日期或无效标签:沿用现有显示 helper 的处理规则。
-
非法日期或无效标签:沿用现有显示 helper 的处理规则。
...
@@ -44,7 +45,7 @@ orderItem.customer
...
@@ -44,7 +45,7 @@ orderItem.customer
-
不修改权益列表根节点取值规则。
-
不修改权益列表根节点取值规则。
-
不修改精品详情、确认页、创建/编辑回显或提交数据来源。
-
不修改精品详情、确认页、创建/编辑回显或提交数据来源。
-
不修改日期格式化、字段可见性、显示即必填、日期选择上限和手机号来源规则。
-
不修改日期格式化、字段可见性、显示即必填、日期选择上限和手机号来源规则。
-
不修改
WXML 展示结构
。
-
不修改
详情、表单或其他列表的 WXML 展示结构;只在主客户工单 Tab 的现有
`order-list`
内增加两个条件展示行
。
## 测试策略
## 测试策略
...
@@ -52,7 +53,8 @@ orderItem.customer
...
@@ -52,7 +53,8 @@ orderItem.customer
1.
先添加列表适配器测试并确认因接口尚不存在而失败。
1.
先添加列表适配器测试并确认因接口尚不存在而失败。
2.
测试嵌套
`customer`
值能够显示,包括时间戳格式化。
2.
测试嵌套
`customer`
值能够显示,包括时间戳格式化。
3.
测试根节点冲突值被忽略。
3.
测试嵌套值与根节点冲突时嵌套值优先。
4.
测试
`customer`
缺失时不回退根节点且两个字段隐藏。
4.
测试
`customer`
缺失或单个嵌套字段为空时读取根节点。
5.
最小实现适配器并让精品列表调用它。
5.
测试主客户工单 Tab 完成列表加工并渲染两个字段。
6.
运行相关 helper/UI 测试、
`npm run test:createOrder`
,最后运行完整
`npm test`
。
6.
最小实现 adapter 回退逻辑并接入主页面 JS/WXML。
7.
运行相关 helper/UI 测试、
`npm run test:createOrder`
,最后运行完整
`npm test`
。
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment