From a37f7a5d4dd0d393dcacfd44aa226b695ebb532a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 14 Jul 2026 02:48:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(shop):=20=E6=B7=BB=E5=8A=A0=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E5=88=97=E8=A1=A8=E9=A1=B5=E6=B5=AE=E5=8A=A8=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 shop 页面右下角添加固定定位的绿色圆形购物车按钮 - 按钮右上角显示购物车商品数量角标,超过 99 显示为 99+ - 点击按钮跳转到购物车页面,非 tabBar 页面 - 使用 useCartContext 的 totalCount 实时更新商品数量显示 - 注释掉用户页面 “我的钱包” 入口,暂时隐藏该功能 --- .workbuddy/memory/MEMORY.md | 2 ++ src/api/shop/shopCart/index.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.workbuddy/memory/MEMORY.md b/.workbuddy/memory/MEMORY.md index 088aae2..858e7a6 100644 --- a/.workbuddy/memory/MEMORY.md +++ b/.workbuddy/memory/MEMORY.md @@ -25,6 +25,8 @@ - VIP 审核页:`src/pages/user/vip-review/index.tsx` - VIP 升级页:`src/pages/user/vip-upgrade/index.tsx` - 门店中心:`src/pages/store/center/index.tsx` +- 购物车 API:`src/api/shop/shopCart/index.ts`(批量删除接口 `/shop/shop-cart/batch` 后端期望直接接收 `ArrayList` 即 `[1,2,3]`,不要用 `{ ids }` 包裹) +- 购物车 Context:`src/contexts/CartContext.tsx` ## 订阅消息 - 模板 ID:`sh1K9iK7vZjebUNFu6OsMsnsJxm4whThWGrhN7I4zVg`(交易提醒) diff --git a/src/api/shop/shopCart/index.ts b/src/api/shop/shopCart/index.ts index d8c9c37..1c212bc 100644 --- a/src/api/shop/shopCart/index.ts +++ b/src/api/shop/shopCart/index.ts @@ -118,7 +118,7 @@ export async function removeShopCart(id: number) { export async function removeBatchShopCart(ids: number[]) { const res = await request.del>( '/shop/shop-cart/batch', - { ids } + ids ); if (res.code === 0) { return res.message || '删除成功';