v1.0.7, fix bugs and UI improvments

This commit is contained in:
2026-09-19 03:05:36 +03:00
parent cbd44a0516
commit ecb93e14aa
6 changed files with 566 additions and 140 deletions

View File

@ -36,6 +36,17 @@
function isOffice(file) {
return file?.fileType === 'office';
}
/** Можно ли разрешить двустороннюю печать для файла */
function canDuplex(file) {
if (!file) return false;
// Для office число страниц неизвестно.
// Если нужно блокировать и office, убери эту строку.
if (file.fileType === 'office') return true;
return (file.selectedPages?.size ?? 0) > 1;
}
</script>
{#if as === 'button'}
@ -149,12 +160,14 @@
<GearOption value={formatText(file)} open={formatOpen} onclick={() => (formatOpen = !formatOpen)} />
</div>
<div class="duo-row">
<ToggleOption
label="Печать"
options={SIDES_OPTIONS}
value={file.sides ?? 'Односторонняя'}
onchange={(v) => props.onUpdate?.(file.id, { sides: v })}
/>
<ToggleOption
label="Печать"
options={SIDES_OPTIONS}
value={file.sides ?? 'Односторонняя'}
disabled={!canDuplex(file)}
hint={canDuplex(file) ? '' : 'Двусторонняя доступна при выборе 2 и более страниц'}
onchange={(v) => props.onUpdate?.(file.id, { sides: v })}
/>
<ToggleOption
label="Цветность"
options={COLOR_LABELS}
@ -221,11 +234,23 @@
{#if props.extraCopies > 0}, {props.extraCopies} {props.plCopies(props.extraCopies)}{/if}
</p>
{/if}
<div class="pricing-info">
<span class="price-tier" class:active={props.hasTierSmall}>10р от 1</span>
<span class="price-tier" class:active={props.hasTierMedium}>9р от 25</span>
<span class="price-tier" class:active={props.hasTierLarge}>4р от 1000</span>
</div>
<div class="pricing-info">
<div class="pricing-row pricing-row-duplex">
<span class="price-tier" class:active={!!props.hasDuplex}>
Двусторонняя 15р
</span>
</div>
<div class="pricing-row">
<span class="price-tier" class:active={props.hasTierSmall}>
10р/л от 1
</span>
<span class="price-tier" class:active={props.hasTierMedium}>
9р/л от 25
</span>
</div>
</div>
<div class="price-summary">
<span class="summary-itogo">Итого</span>
<span class="summary-price">{props.totalPrice}</span>
@ -272,7 +297,26 @@
.empty-hint { color: #8b93a1; font-size: 15px; margin: 0; }
.actions { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 12px; }
.file-count { color: #8b93a1; font-size: 13px; margin: 0; text-align: center; line-height: 1.4; }
.pricing-info { display: flex; justify-content: center; gap: 12px; font-size: 10px; line-height: 1.2; color: rgba(255,255,255,0.25); margin-bottom: 4px; user-select: none; flex-wrap: wrap; }
.pricing-info {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
margin-bottom: 4px;
user-select: none;
}
.pricing-row {
display: flex;
justify-content: center;
gap: 12px;
font-size: 10px;
line-height: 1.2;
color: rgba(255, 255, 255, 0.25);
flex-wrap: wrap;
}
.pricing-row-duplex {
margin-bottom: 2px;
}
.price-tier { transition: color 0.2s ease; }
.price-tier.active { color: rgba(255,255,255,0.6); }
.price-summary { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }