feat: above 10 m the payment asks for the proof in a pop-up, not mandatory (Marcus, 2026-12-02)
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 8m36s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m6s
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 8m36s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m6s
The proof checkbox in the cart becomes a pop-up when the customer presses pay on an order above 10 m: "Quero aprovar uma prova" sends proof=true, "Seguir sem prova", Escape or closing goes on without one. Same text as the old box. Below 10 m nothing is asked. A cart already sent goes straight to its payment without asking again. The dialog sits outside the panels so it shows wherever pay is pressed. The automatic proof above 10 m is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -224,6 +224,26 @@ function folhasEstreitas(it){
|
||||
'Folha de '+n1(Number(s.width_cm))+' cm no tamanho real, centralizada no filme de '+
|
||||
String(filme).replace('.',',')+' cm');
|
||||
}
|
||||
// A prova é para pedidos acima de 10 m (Dropstar, 2026-10-28; o
|
||||
// PROOF_ABOVE_METRES do servidor) e não é obrigatória: no pagamento um pop-up
|
||||
// pergunta (Marcus, 2026-12-02). Fechar sem escolher é seguir sem prova.
|
||||
let querProva=false;
|
||||
function pedidoLongo(aPagar=itensAPagar()){
|
||||
return aPagar.reduce((t,it)=>t+(it.cob||0),0)>10;
|
||||
}
|
||||
// Resolve com a escolha; null quando o pop-up já está aberto (clique repetido).
|
||||
function perguntaProva(){
|
||||
const dlg=$('provaDlg');
|
||||
if(dlg?.open) return Promise.resolve(null);
|
||||
querProva=false;
|
||||
if(!dlg || !pedidoLongo()){ pintaPedido(); return Promise.resolve(false); }
|
||||
return new Promise(resolve=>{
|
||||
dlg.returnValue='';
|
||||
dlg.onclose=()=>{ dlg.onclose=null; querProva=dlg.returnValue==='sim'; pintaPedido(); resolve(querProva); };
|
||||
dlg.showModal();
|
||||
$('provaSim').focus();
|
||||
});
|
||||
}
|
||||
// O carrinho junta itens de produtos diferentes e cobra uma vez só.
|
||||
function pintaPedido(){
|
||||
const aPagar = itensAPagar();
|
||||
@@ -309,7 +329,7 @@ function pintaPedido(){
|
||||
' · +24 h</span><b>'+rs(tratamento)+'</b></div>':'')+
|
||||
(redesenho?'<div class="l"><span>Ajuste Fino Redesenho · '+artesRedesenho+
|
||||
(artesRedesenho===1?' arte':' artes')+' · +48 h</span><b>'+rs(redesenho)+'</b></div>':'')+
|
||||
($('fProva')?.checked?'<div class="l"><span>Prova antes de imprimir</span>'+
|
||||
(querProva && pedidoLongo(aPagar)?'<div class="l"><span>Prova antes de imprimir</span>'+
|
||||
'<b><span style="color:var(--verde-ml)">Grátis</span></b></div>':'')+
|
||||
'<div class="l"><span>Revisão e reencaixe</span>'+
|
||||
'<b><span style="color:var(--verde-ml)">Grátis</span></b></div>';
|
||||
@@ -322,12 +342,6 @@ function pintaPedido(){
|
||||
: n>1
|
||||
? 'Pagar os '+n+' itens de uma vez'
|
||||
: 'Ir para o pagamento';
|
||||
// The proof is only for orders above 10 m (Dropstar, 2026-10-28; the server's
|
||||
// PROOF_ABOVE_METRES). Below it the box stays, closed, and says the rule
|
||||
// (Rodada 5, B3).
|
||||
const prova=$('fProva');
|
||||
if(prova){ const longo=aPagar.reduce((t,it)=>t+(it.cob||0),0)>10;
|
||||
prova.disabled=!longo; if(!longo) prova.checked=false; $('provaMin').hidden=longo; }
|
||||
$('bPagar').disabled = !cartPodeEnviar() || !entrega.cotado || !clienteOk() || !enderecoOk() || falta>0;
|
||||
if(pedido.length || itemAtual) $('carr').classList.add('on');
|
||||
if($('cartN')){ $('cartN').textContent=noCarrinho>99?'99+':noCarrinho; $('cartN').hidden=!noCarrinho;
|
||||
@@ -432,7 +446,8 @@ function avisaDesfazer(texto,acao){
|
||||
function fechaDesfazer(){ clearTimeout(desfazerTimer); desfazerAcao=null; $('desfazer').hidden=true; }
|
||||
addEventListener('dtf-page-changed',fechaDesfazer);
|
||||
$('desfazerBtn').addEventListener('click',()=>{ const acao=desfazerAcao; fechaDesfazer(); if(acao) acao(); });
|
||||
$('fProva')?.addEventListener('change',()=>pintaPedido());
|
||||
$('provaSim')?.addEventListener('click',()=>$('provaDlg').close('sim'));
|
||||
$('provaNao')?.addEventListener('click',()=>$('provaDlg').close('nao'));
|
||||
$('fTratamento')?.addEventListener('change',()=>{
|
||||
if($('fTratamento').checked){ ajusteTudo=true; limpaRedesenho(); }
|
||||
else limpaAjuste();
|
||||
|
||||
Reference in New Issue
Block a user