feat(config): 新增网站配置字段和自定义Hook

- 在cmsWebsiteField模型中新增deliveryText、guaranteeText和openComments三个字段
- 创建useConfig自定义Hook用于获取和管理网站配置数据
- 更新Banner组件中的默认轮播图高度从200px调整为300px- 修改Banner组件中热门商品列表项的右边距样式
- 在ArticleList组件中为map函数添加类型注解
- 移除IsDealer组件中旧的配置获取逻辑,改用新的useConfig Hook
- 删除src/pages/user_bak目录下的所有旧版用户相关组件文件
- 删除src/pages/user_bak目录下的配置文件和样式文件
This commit is contained in:
2025-09-29 17:07:48 +08:00
parent dd3d6b43a4
commit 5270cab7e9
22 changed files with 227 additions and 1061 deletions

View File

@@ -74,20 +74,20 @@ const OrderConfirm = () => {
const getGoodsTotal = () => {
if (!goods) return 0
const price = parseFloat(goods.price || '0')
const total = price * quantity
// const total = price * quantity
// 🔍 详细日志,用于排查数值精度问题
console.log('💵 商品总价计算:', {
goodsPrice: goods.price,
goodsPriceType: typeof goods.price,
parsedPrice: price,
quantity: quantity,
total: total,
totalFixed2: total.toFixed(2),
totalString: total.toString()
})
// console.log('💵 商品总价计算:', {
// goodsPrice: goods.price,
// goodsPriceType: typeof goods.price,
// parsedPrice: price,
// quantity: quantity,
// total: total,
// totalFixed2: total.toFixed(2),
// totalString: total.toString()
// })
return total
return price * quantity
}
// 计算优惠券折扣
@@ -418,9 +418,9 @@ const OrderConfirm = () => {
couponId: parseInt(String(bestCoupon.id), 10)
}
);
console.log('🎯 使用推荐优惠券的订单数据:', updatedOrderData);
// 执行支付
await PaymentHandler.pay(updatedOrderData, currentPaymentType);
return; // 提前返回,避免重复执行支付