From 632539e8dc2f460bdd337cfe30939e1886a693b8 Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Wed, 26 Aug 2026 09:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8E=B0=E5=9C=BA=E6=8F=90?= =?UTF-8?q?=E8=B4=A7=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursor/skills/dukang-coding/SKILL.md | 2 +- .cursor/skills/dukang-v3/SKILL.md | 2 +- .../skills/dukang-v3/reference-req-index.md | 6 +- AGENTS.md | 2 +- agent.md | 2 +- apps/admin-web/src/pages/CitiesPage.tsx | 25 ++++- .../src/pages/FulfillmentProvidersPage.tsx | 1 + .../src/components/ContactCsButton.tsx | 6 +- apps/mini-user/src/lib/wecom-cs.ts | 99 +++++++++++------ apps/mini-user/src/pages/home/index.tsx | 2 +- .../src/pages/order-confirm-pickup/index.tsx | 11 +- .../src/pages/order-confirm/index.tsx | 4 +- .../src/pages/product-detail/index.tsx | 2 +- docs/杜康好客-v3-PRD.md | 3 + docs/杜康好客-v3-现状对照.md | 2 + docs/杜康好客-v3.5.11-开发文档.md | 102 ++++++++++++++++++ docs/杜康好客-v3编码手册.md | 4 +- packages/domain/src/index.test.ts | 45 +++++--- packages/domain/src/index.ts | 50 +++++---- .../src/fulfillment-provider.test.ts | 39 ++++++- .../shared-types/src/fulfillment-provider.ts | 46 ++++++-- server/dukang-api/prisma/init_v3.sql | 1 + .../migrate-city-pickup-min-qty-v3511.sql | 3 + server/dukang-api/prisma/schema.prisma | 1 + server/dukang-api/prisma/seed-v31.ts | 2 + .../src/modules/ops/admin-cities.service.ts | 1 + .../src/modules/ops/dto/admin-mutate.dto.ts | 9 ++ .../src/modules/trade/trade.service.ts | 26 +++-- 28 files changed, 393 insertions(+), 105 deletions(-) create mode 100644 docs/杜康好客-v3.5.11-开发文档.md create mode 100644 server/dukang-api/prisma/migrate-city-pickup-min-qty-v3511.sql diff --git a/.cursor/skills/dukang-coding/SKILL.md b/.cursor/skills/dukang-coding/SKILL.md index b2b2417..58e1c3c 100644 --- a/.cursor/skills/dukang-coding/SKILL.md +++ b/.cursor/skills/dukang-coding/SKILL.md @@ -89,7 +89,7 @@ await this.prisma.order.update({ ... }); ```typescript const benefitAmount = product.benefitAmount ?? product.price; // 核销:直接核销按全部 ACTIVE 权益总余额;带单据核销按该单据可用金额 -// 同城 min 2 瓶 / 跨城 min 6 瓶 +// 起购:提货/同城 min 2 瓶 / 跨城 min 6 瓶(城市配置,非承运商) // 支付成功 → log_third_party + user_order.pay_status=PAID // → user_benefit_coupon + common_event(BENEFIT_LEDGER, GRANT) diff --git a/.cursor/skills/dukang-v3/SKILL.md b/.cursor/skills/dukang-v3/SKILL.md index 13de81f..4ea8f56 100644 --- a/.cursor/skills/dukang-v3/SKILL.md +++ b/.cursor/skills/dukang-v3/SKILL.md @@ -37,7 +37,7 @@ disable-model-invocation: true ``` 权益额 = 订单实付 1:1(永久) -同城起购 2 瓶 / 跨城 1 箱(6瓶) +起购:现场提货 2 瓶 / 同城 2 瓶 / 跨城 1 箱(6瓶);属城市,非承运商 门店结算 = 核销额 × 60% 单合伙人:订单佣金 + 核销佣金 ≤ 5%(默认 0% + 3%) 核销码 TTL = 3 分钟;试核销固定 ¥100 diff --git a/.cursor/skills/dukang-v3/reference-req-index.md b/.cursor/skills/dukang-v3/reference-req-index.md index 0715e2c..c5636b0 100644 --- a/.cursor/skills/dukang-v3/reference-req-index.md +++ b/.cursor/skills/dukang-v3/reference-req-index.md @@ -12,9 +12,9 @@ | REQ-U-004 | 定位 | 右上角市区;默认 IP;可授权精确定位 | | REQ-U-005 | 首页商品 | 4 款酒祖杜康;大图、标题加粗、价格标红、权益金额 | | REQ-U-006 | 商品详情 | 规格瓶/箱、度数、价格、权益、详情图 | -| REQ-U-007 | 同城 | 小飞侠;≥2 瓶免运费;物流节点+拍照;24h 自动完成 | -| REQ-U-008 | 现场提货 | 隐藏入口;支付即完成;强提示在现场 | -| REQ-U-009 | 跨城 | 未开通城市;≥1 箱;总部物流到付 | +| REQ-U-007 | 同城 | 小飞侠;起购 ≥2 瓶(城市 `localMinQty`);≥2 瓶免运费;物流节点+拍照;24h 自动完成 | +| REQ-U-008 | 现场提货 | 隐藏入口;起购 ≥2 瓶(城市 `pickupMinQty`);支付即完成;强提示在现场 | +| REQ-U-009 | 跨城 | 未开通城市;起购 ≥1 箱(城市 `crossMinQty`=6 瓶当量);总部物流到付 | | REQ-U-010 | 锁单 | 待付款 30 分钟取消 | | REQ-U-011 | 权益 | 支付成功 1:1 永久 | | REQ-U-012 | 客服 | 已付款起电话/微信客服 | diff --git a/AGENTS.md b/AGENTS.md index be10f31..ab08559 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ ``` 权益额 = benefit_amount ?? price -同城起购 2 瓶 / 跨城 6 瓶 +起购:现场提货 2 瓶 / 同城 2 瓶 / 跨城 6 瓶(1 箱);属城市,非承运商 核销:直接核销 0 < amount ≤ 全部 ACTIVE 权益总余额;带单据核销 0 < amount ≤ 该单据可用金额;Redis 码 3 分钟 C 端门店仅 status=OPEN 订单 Tab:待付款 | 已付款 | 已完成 diff --git a/agent.md b/agent.md index ff0be89..8d3240b 100644 --- a/agent.md +++ b/agent.md @@ -92,7 +92,7 @@ ```text 权益发放额 = common_product_item.benefit_amount ?? price -同城起购 2 瓶 / 跨城 6 瓶 +起购:现场提货 2 瓶 / 同城 2 瓶 / 跨城 6 瓶(1 箱);属城市,非承运商 核销:直接核销 0 < amount ≤ 全部 ACTIVE 权益总余额;带单据核销 0 < amount ≤ 该单据可用金额 C 端门店列表仅 status=OPEN 订单 Tab:all | pending_pay | pending_ship | pending_receive | completed diff --git a/apps/admin-web/src/pages/CitiesPage.tsx b/apps/admin-web/src/pages/CitiesPage.tsx index b1dc8ff..883e67d 100644 --- a/apps/admin-web/src/pages/CitiesPage.tsx +++ b/apps/admin-web/src/pages/CitiesPage.tsx @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'; import { Button, Descriptions, + Divider, Drawer, Form, Input, @@ -362,8 +363,28 @@ export default function CitiesPage() {