| | |
| | | const hasDiscountAmount = !isOperateFree && Number(fareEstimate?.discountAmount || 0) > 0; |
| | | |
| | | const formatDiscountAmountText = () => { |
| | | const couponType = Number(fareEstimate?.couponType); |
| | | const discountAmount = Number(fareEstimate?.discountAmount || 0); |
| | | if (!Number.isFinite(discountAmount) || discountAmount <= 0) { |
| | | return '0元'; |
| | | } |
| | | // 折扣券接口返回 0.6 表示 6 折,这里统一转换为用户可读文案 |
| | | // if (couponType === 1) { |
| | | // const discountValue = fareEstimate?.couponMoney; |
| | | // return `${Number.isInteger(discountValue) ? discountValue : discountValue.toFixed(1).replace(/\.0$/, '')}折`; |
| | | // } |
| | | return `${discountAmount}元`; |
| | | }; |
| | | |