Files
cmautobuy/docs/task/161-商品页补采滑动上限调整为6次.md
T
2026-08-11 16:10:34 +08:00

51 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# #161 Client:商品详情补采最大滑动次数调整为6次
- 工单号:#161
- 类型:优化
- 父级:Epic #1、MVP #2
- 版本:Client 可运行任务闭环
- 状态:待验收
- 日期:2026-08-11
- Gitea:<http://ilaer.eicp.net:8418/chengma/cmautobuy/issues/161>
## 背景与目标
商品详情页为了补采评价数量和店铺名,原来默认最多向下滑动 12 次。用户确认将
上限调整为 6 次,减少进入规格面板前的等待时间。
## 最终方案
把 `PddCollectService` 的 `max_goods_page_swipes` 默认值从 12 改为 6。找到评价
数量和店铺名时立即停止、页面连续不变化时提前停止的规则保持不变;单次滑动
距离和 0.8 秒等待也不改变。
最终实现与建单方案一致,不涉及数据库、Admin 接口或规格采集逻辑。
## 改了哪些文件
- `client/src/pdd_collect_service.py`:默认商品页补采上限改为 6。
- `client/test/test_pdd_collect_service.py`:增加默认上限恰好为 6 的测试。
## 验收结果
- [x] 默认配置下商品详情页最多向下滑动 6 次。
- [x] 找齐评价数量和店铺名后仍立即停止。
- [x] 页面连续不变化时仍提前停止。
- [x] 未改变规格面板、逐色采价、滑动距离和等待间隔。
- [x] 精确测试、Client 完整测试和语法检查通过。
- [ ] 用户使用真机确认采集耗时和字段结果。
## 测试
在 `client/` 目录执行:
```powershell
C:/Python310/python.exe -m unittest discover -s test -p "test_pdd_collect_service.py"
C:/Python310/python.exe -m unittest discover -s test -p "test_*.py"
C:/Python310/python.exe -m py_compile src/pdd_collect_service.py test/test_pdd_collect_service.py
```
结果:采集服务 50 项通过,Client 完整 407 项通过,语法检查通过。
未验证到的部分:未使用真机复验;未执行采购、下单或付款。