feat: one order, one machine: UV and textile never share an order (Marcus, 2026-11-26)
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 7m56s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m16s
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 7m56s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m16s
The server refuses a cart (and a review) with UV and textile items; the Site says so as soon as the customer opens a product of the other line, or adds it, with "Finalizar este pedido" and "Trocar o carrinho por este item". Basic and premium textile still go together. Proof cards copy their order's items, so they follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -974,6 +974,13 @@ h2 em{font-style:normal;color:var(--laranja)}
|
||||
<div class="mistaBot"><button type="button" class="ec-go" id="mistaSegue">Imprimir assim mesmo (C1)</button><button type="button" id="mistaSep">Quero subir em dois arquivos</button></div>
|
||||
</div>
|
||||
</dialog>
|
||||
<dialog class="ampliaDlg mistaDlg" id="linhaDlg" aria-labelledby="linhaTit">
|
||||
<div class="ampliaCab"><b id="linhaTit">Pedido separado</b></div>
|
||||
<div class="mistaCorpo">
|
||||
<p>Esse produto é impresso em outra máquina e precisa de um pedido separado. Finalize este pedido e faça um novo com ele.</p>
|
||||
<div class="mistaBot"><button type="button" class="ec-go" id="linhaFim">Finalizar este pedido</button><button type="button" id="linhaTroca">Trocar o carrinho por este item</button></div>
|
||||
</div>
|
||||
</dialog>
|
||||
<dialog class="ampliaDlg" id="ampliaDlg" aria-labelledby="ampliaTit">
|
||||
<div class="ampliaCab"><b id="ampliaTit">Sua folha</b>
|
||||
<button type="button" id="ampliaFecha" aria-label="Fechar"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button></div>
|
||||
|
||||
@@ -24,6 +24,7 @@ function guardaItem(){
|
||||
$('ciente').scrollIntoView({behavior:'smooth',block:'center'});
|
||||
return false;
|
||||
}
|
||||
if(itemAtual && outraMaquina(itemAtual.modo)){ avisaOutraMaquina(itemAtual.modo,adicionaAoCarrinho); return false; }
|
||||
if(itemAtual){ pedido.push(itemAtual); itemAtual=null; }
|
||||
$('atual').style.display='none'; $('carrLin').innerHTML='';
|
||||
$('foco').classList.remove('on');
|
||||
|
||||
@@ -9,6 +9,25 @@ function escolheProduto(m){
|
||||
if(modo===m && $('foco').classList.contains('on')) vaiPara(PAGINAS[m]);
|
||||
else abrir(m);
|
||||
}
|
||||
// Um pedido, uma máquina (Marcus, 26/11/2026): UV e têxtil nunca no mesmo
|
||||
// pedido, que vira um card numa máquina só. Têxtil e Premium vão juntos.
|
||||
// Conta todo o carrinho, também o que ficou guardado para depois; o servidor
|
||||
// recusa o mesmo pedido misto (app/core/models.py check_one_machine).
|
||||
const linhaUV=m=>m==='uvfile'||m==='uv';
|
||||
function outraMaquina(m){ return pedido.some(it=>linhaUV(it.modo)!==linhaUV(m)); }
|
||||
function avisaOutraMaquina(m,depois){
|
||||
const dlg=$('linhaDlg');
|
||||
if(!dlg || dlg.open) return;
|
||||
$('linhaFim').onclick=()=>{ dlg.close(); vaiPara(CARRINHO); };
|
||||
$('linhaTroca').onclick=()=>{
|
||||
dlg.close();
|
||||
const antes=pedido.slice();
|
||||
pedido=[]; pintaPedido();
|
||||
avisaDesfazer('Carrinho trocado por '+MODOS[m].tit+'.',()=>{ pedido=antes; pintaPedido(); });
|
||||
if(depois) depois();
|
||||
};
|
||||
dlg.showModal();
|
||||
}
|
||||
function abrir(m){
|
||||
modo=m; artes=[]; folhas=[]; metros=0; nota=0; reencaixado=false;
|
||||
montagemCm=0;
|
||||
@@ -19,6 +38,8 @@ function abrir(m){
|
||||
$('vMt').textContent='—'; previaAoVivo(); agendaAvaliacao();
|
||||
limpaPaineis(); // o carrinho só some se o pedido estiver vazio
|
||||
vaiPara(PAGINAS[m]);
|
||||
// Produto da outra máquina: avisa já ao abrir, antes de o cliente subir arquivos.
|
||||
if(outraMaquina(m)) avisaOutraMaquina(m);
|
||||
}
|
||||
function pintaModo(){
|
||||
const m=modo;
|
||||
|
||||
Reference in New Issue
Block a user