Files
xinlong-shop-taro/.workbuddy/memory/2026-06-27.md
赵忠林 7693c7a3d6 fix(SkuSelector): 修正价格显示逻辑避免价格错误
- 调整fakeSku中price字段优先使用product.price,确保价格正确显示
- 修改currentPrice计算顺序,使price优先于salePrice,符合实际售价需求
- 统一价格逻辑,避免SKU弹窗和商品详情页价格不一致问题
- 添加注释说明ShopGoods和ShopGoodsSku中price与salePrice的区别及优先级规则
2026-06-27 01:13:51 +08:00

28 lines
1.6 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.

# 2026-06-27 工作日志
## SKU选择器价格显示错误修复
- **文件**: `src/components/business/SkuSelector/index.tsx`
- **问题**: 商品详情页价格显示 ¥1019但点击"立即购买"后SKU弹窗显示 ¥2519
- **根因**: `currentPrice` 计算式中 `salePrice` 优先级高于 `price`。ShopGoods 模型中 `price`=实际售价(1019)`salePrice`=市场/原价(2519)
- **修复**:
1. 第190行: `currentPrice` 优先级改为 `price` 优先于 `salePrice`
2. 第160行: 单规格 fakeSku 的 price 字段同样修正
## 确认订单页:货到付款 → 货到付款
- **文件**: `src/pages/shop/checkout.tsx`
- **改动内容**:
1. 支付方式名称:货到付款 → 货到付款,图标"余"→"货",副文案改为"商品送达后付款"
2. 移除用户余额加载逻辑loadUserBalance、userBalance、loadingBalance 状态)
3. 移除余额不足校验和充值引导弹窗
4. payType=0 改为货到付款:提交后直接创建订单并跳转,不走在线支付流程
5. 清理未使用的导入payByBalance、getUserBalance、repairOrder
## 确认订单页:下单成功跳转修复
- **文件**: `src/pages/shop/checkout.tsx`
- **问题**: 下单成功后无法跳转到订单列表页
- **根因**: `pages/order/list` 是 tabBar 页面,`redirectTo` 无法跳转 tabBar 页,必须用 `switchTab`
- **修复**:
1. `redirectTo``switchTab`
2. 购物车数据清理移到 payType 分支前,确保货到付款也清理购物车
3. 货到付款(payType=0)和微信支付(payType=1)统一走同一跳转逻辑toast 文案区分"下单成功"/"支付成功"