# 小程序满减/折扣 — 对接说明 > 基础路径:`/store/app/storeOrder` > **无需新增接口、无需新增请求/响应字段**,沿用原有 `confirm` → `computed` → `create` → 支付。 --- ## 流程 ``` confirm → computed → create → 支付 ``` 后端在 **`computed` / `create` 内部**按购物车商品 + 活动表配置**自动匹配**满减/折扣,直接体现在 `payPrice` 里。 --- ## 前端 与改造前完全一致,**不用传活动 ID**,**不用调** `/promotion/list` 等接口。 ```javascript // 算价 const res = await computed({ orderKey, addressId, useIntegral, couponUserId, }) this.payPrice = res.data.payPrice // 下单 await create({ orderKey, addressId, payType, useIntegral, couponUserId, mark }) ``` 多店仍用 `confirmMultiStore` → `computedMultiStore` → `createMultiStore`,参数不变。 --- ## 自动匹配规则(后端) `IFsStorePromotionComputeService.autoApplyBestPromotion`: | 活动表配置 | 处理 | |-----------|------| | `manual_status=1` 且时间在有效期内 | 才参与 | | `scope_type` 1/2/3 | 全场 / 分类 / 指定商品 | | `tier_type` 1 | 金额满减(可 `is_capped` 上不封顶) | | `tier_type` 2 | 件数折扣 | | `limit_per_user` | 仅统计已支付 usage | | `is_stackable=0` | 已选优惠券时跳过该活动 | 在可用活动中取**优惠金额最大**的一条,扣减顺序:**积分 → 满减 → 优惠券**。 --- ## 代码位置 | 模块 | 类 | |------|-----| | 小程序入口 | `fs-user-app` → `StoreOrderScrmAmountService` | | 算价扣减 | `FsStoreOrderScrmServiceImpl.subtractAutoPromotionDiscount` | | 自动匹配 | `FsStorePromotionComputeServiceImpl.autoApplyBestPromotion` | | 下单落库 | `createOrder` 写订单 `promotion_*` + usage | --- ## 前置条件 执行 `docs/sql/fs_store_promotion_init.sql`(活动表 + 订单扩展字段)。