更新加项支付样式

This commit is contained in:
xianyi
2026-01-05 17:22:46 +08:00
parent f8fdebb955
commit 166db349ff

View File

@@ -294,9 +294,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
// 构建折扣选项列表 // 构建折扣选项列表
const discountOptions = useMemo(() => { const discountOptions = useMemo(() => {
const options: Array<{ value: number; label: string }> = [ const options: Array<{ value: number; label: string }> = [];
{ value: 1, label: '100%(无折扣)' },
];
channelDiscounts.forEach((item) => { channelDiscounts.forEach((item) => {
const rate = typeof item.discount_rate === 'number' && item.discount_rate > 0 ? item.discount_rate : 1; const rate = typeof item.discount_rate === 'number' && item.discount_rate > 0 ? item.discount_rate : 1;
const percent = Math.round(rate * 100); const percent = Math.round(rate * 100);
@@ -309,7 +307,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
// 获取当前选中的标签 // 获取当前选中的标签
const currentDiscountLabel = useMemo(() => { const currentDiscountLabel = useMemo(() => {
const option = discountOptions.find(opt => opt.value === discountRatio); const option = discountOptions.find(opt => opt.value === discountRatio);
return option?.label || '100%(无折扣)'; return option?.label;
}, [discountRatio, discountOptions]); }, [discountRatio, discountOptions]);
// 处理折扣选择 // 处理折扣选择
@@ -763,6 +761,13 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
</div> </div>
{/* <div className='text-xs text-gray-500'>结算方式: 个人支付 (微信 / 支付宝)</div> */} {/* <div className='text-xs text-gray-500'>结算方式: 个人支付 (微信 / 支付宝)</div> */}
</div> </div>
{paymentMessage && (
<div className={`text-sm text-center mt-2 ${paymentMessage.includes('成功') ? 'text-green-600' : 'text-amber-600'}`}>
{paymentMessage}
</div>
)}
<div className='flex items-center gap-3'> <div className='flex items-center gap-3'>
{/* 结算方式 */} {/* 结算方式 */}
<div className='flex items-center gap-2 text-xs text-gray-600'> <div className='flex items-center gap-2 text-xs text-gray-600'>
@@ -856,11 +861,6 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
{paymentLoading ? '处理中...' : `确认支付 ¥${totalCurrent.toFixed(2)}`} {paymentLoading ? '处理中...' : `确认支付 ¥${totalCurrent.toFixed(2)}`}
</Button> </Button>
</div> </div>
{paymentMessage && (
<div className={`text-sm text-center mt-2 ${paymentMessage.includes('成功') ? 'text-green-600' : 'text-amber-600'}`}>
{paymentMessage}
</div>
)}
</div> </div>
{/* 二维码支付弹窗 */} {/* 二维码支付弹窗 */}
{showQrcodeModal && qrcodeUrl && ( {showQrcodeModal && qrcodeUrl && (