调整样式

This commit is contained in:
xianyi
2026-01-27 16:35:56 +08:00
parent 362b13ac43
commit f75e19cf85

View File

@@ -254,9 +254,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
currentPrice:
item.actual_received_amount !== undefined && item.actual_received_amount !== null
? Number(item.actual_received_amount).toFixed(2)
: item.original_price !== undefined && item.original_price !== null
? Number(item.original_price).toFixed(2)
: '0.00',
: '0.00',
combinationItemCode: item.combination_item_code ?? null,
isEnjoyDiscount: item.is_enjoy_discount ?? null,
discount_name: item.discount_rate ?? null,
@@ -1077,10 +1075,13 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
<div className='mt-auto pt-1'>
<div className='flex flex-col'>
{origPrice >= 0 && origPrice >= currPrice && (
<span className='text-xs text-gray-400 line-through'>¥{origPrice.toFixed(2)}</span>
<span className='text-xs text-gray-400 line-through'>¥{origPrice.toFixed(2)}</span>
)}
<span className='text-[13px] font-bold text-red-600'>¥{currPrice.toFixed(2)}</span>
<div className='flex items-center justify-between gap-2'>
<span className='text-[14px] font-bold text-red-600'>¥{currPrice.toFixed(2)}</span>
<span></span>
<span className={`text-[10px] px-2 rounded-full bg-[#EAFCF1] text-[#447955] whitespace-nowrap`}>
{getDiscountText(item)}
</span>
@@ -1140,7 +1141,7 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
: 'bg-blue-600 hover:bg-blue-700'
)}
>
</Button>
</div>
)}
@@ -1378,36 +1379,32 @@ export const ExamAddonPanel = ({ client, onGoToSign }: ExamAddonPanelProps) => {
{customSettlementType === 1 ? (
<div className='space-y-3'>
<div className='flex items-center justify-between'>
<label className='text-sm text-gray-700 font-medium'></label>
<span className='text-sm font-semibold text-blue-600'>{customDiscountRatio / 10}</span>
<label className='text-sm text-gray-700 font-medium'> (%)</label>
<span className='text-sm font-semibold text-blue-600'>
{(customDiscountRatio / 10).toFixed(1)}
</span>
</div>
<div className='relative'>
<input
type='range'
<div className='flex items-center gap-2'>
<Input
type='number'
min='10'
max='100'
step='5'
step='1'
value={customDiscountRatio}
onChange={(e) => {
setCustomDiscountRatio(Number(e.target.value));
}}
className='w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-blue-600'
style={{
background: `linear-gradient(to right, #3b82f6 0%, #3b82f6 ${((customDiscountRatio - 10) / (100 - 10)) * 100}%, #e5e7eb ${((customDiscountRatio - 10) / (100 - 10)) * 100}%, #e5e7eb 100%)`
const val = Number(e.target.value);
if (Number.isNaN(val)) return;
if (val < 10) {
setCustomDiscountRatio(10);
} else if (val > 100) {
setCustomDiscountRatio(100);
} else {
setCustomDiscountRatio(val);
}
}}
className='w-28 text-sm'
/>
{/* 刻度标记 */}
<div className='flex justify-between mt-1 px-1'>
{[10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100].map((value) => (
<span
key={value}
className='text-[10px] text-gray-400'
style={{ width: '10px' }}
>
{value / 10}
</span>
))}
</div>
<span className='text-xs text-gray-500'>10-100100 </span>
</div>
<div className='text-xs text-gray-500'>
: <span className='font-semibold text-red-600'>¥{(totalCurrent * (customDiscountRatio / 100)).toFixed(2)}</span>