All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 2m31s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m0s
The product page is rebuilt around mockup 1. The two ways to send are
cards under the title; the PNG/CDR route choice is gone (it never changed
the price, and the picker now takes every allowed format). Each file card
has a thumbnail, its size, check chips with a plain sentence for any
problem, a "Ver detalhes da conferência" link and a copies stepper; a CDR
file says "Conferência manual · preço cheio" and asks for the length. The
buy box shows the price scale in DPI with the customer's step, the metre
and 10 cm length, the total and what the resolution saved, and "Sai em N
partes" only above 20 m. Folha já montada gets "Ampliar" instead of zoom.
Pricing, grade and checks are unchanged.
Fixes on top: the card thumbnail is a small image made once, not the full
preview re-parsed on every repaint; sizes from 1 GB up read in GB; a failed
upload is shown with "Tentar de novo" instead of retrying silently on every
cart change. The browser suites wait for the product and the reloaded page
instead of racing them, and the artwork suite delays imagemDaArte, which
the packing now uses, fixing the CI failure of f4aacb5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
2.1 KiB
JavaScript
42 lines
2.1 KiB
JavaScript
/* Site DTF — the product page's buy box: price ladder, price per metre, billed length,
|
|
total and the add-to-cart button, beside the live sheet. It shows the item
|
|
the other site-*.js files already priced (itemAtual) and never computes a
|
|
price of its own, so the box and the cart always agree. */
|
|
(function(){
|
|
const vals=$('compraVals'), add=$('bAdd');
|
|
function pintaCompra(){
|
|
const it=itemAtual;
|
|
vals.hidden=!it;
|
|
add.disabled=!it || !itemPodeEnviar(it);
|
|
if(!it) return;
|
|
const semNota=!it.nota;
|
|
// The price ladder in resolution: nota = DPI ÷ 3, so 90 is 270 DPI.
|
|
const faixas=FAIXAS[it.modo], ativa=faixas.findIndex(([min])=>it.nota>=min);
|
|
$('cEscada').innerHTML=faixas.map(([min,v],i)=>
|
|
'<li'+(i===ativa?' class="on" aria-current="true"':'')+'><span>'+
|
|
(min? min*3+'+'+(i? '' : ' DPI') : semNota? 'cheio' : 'menos')+'</span>'+
|
|
'<b>'+rs(v).slice(3)+'</b></li>').join('');
|
|
const analisadas=ehFolha(it.modo) && folhas.length && folhas.every(x=>x.an);
|
|
$('cMetroLbl').textContent = semNota ? 'Metro · preço cheio'
|
|
: analisadas && folhas.every(x=>x.an.vetor) ? 'Metro · arte vetorial'
|
|
: analisadas ? 'Metro · '+Math.min(...folhas.map(x=>x.an.dpi))+' DPI'
|
|
: 'Metro';
|
|
$('cMetro').textContent=rs(it.unit);
|
|
$('cMetragem').textContent=fmtM(it.cob)+' m';
|
|
const economia=(TABELA[it.modo]-it.unit)*it.cob;
|
|
$('cEco').textContent = economia>0.005 ? rs(economia)+' a menos pela resolução da arte' : '';
|
|
const partes=ehFolha(it.modo) ? Math.ceil(it.metros/20) : 1;
|
|
$('cPartes').textContent = partes>1 ? ' Sai em '+partes+' partes de até 20 m.' : '';
|
|
const sobraCm=Math.round((it.cob-it.metros)*100);
|
|
$('cObs').textContent =
|
|
it.cob===MINIMO_M && it.metros<MINIMO_M
|
|
? (ehFolha(it.modo) ? 'Pedido mínimo de 1 m.'
|
|
: 'Pedido mínimo de 1 m: ainda cabem '+sobraCm+' cm de artes sem custo.')
|
|
: '';
|
|
$('cTotal').textContent=rs(it.total);
|
|
}
|
|
add.addEventListener('click',()=>adicionaAoCarrinho());
|
|
addEventListener('dtf-cart-changed',pintaCompra);
|
|
pintaCompra();
|
|
})();
|