feat: Premium built and switched off; default machine minimums (front 3, Marcus 10/11)
Premium (8 passadas, R$ 39,90/m, SKU DTFP.TX.100CM) is a fifth textile ready-sheet product: priced on the server and the Site, a hidden fifth card, a PREMIUM hot-folder class, its Tiny SKU, and a products row created disabled by a migration until Dropstar says 'testado'. A machine with no typed minimum now alerts at Dropstar's fixed minimums: 1 roll of film, 1 L of each ink, 5 kg of powder. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,8 @@
|
||||
PRECO[mode]=product.unit_cents/100;
|
||||
FAIXAS[mode]=product.bands||[];
|
||||
const card=document.querySelector('button.ec[data-modo="'+mode+'"]');
|
||||
if(card&&!product.enabled)card.hidden=true;
|
||||
// Premium starts hidden in the HTML and only appears once enabled.
|
||||
if(card)card.hidden=!product.enabled;
|
||||
}
|
||||
document.querySelectorAll('[data-preco]').forEach(el=>{
|
||||
const product=session.products[el.dataset.preco];
|
||||
|
||||
@@ -75,6 +75,7 @@ h1 em{font-style:normal;color:var(--laranja)}
|
||||
.escolha{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:24px;
|
||||
align-items:stretch}
|
||||
.escolha .ec{display:flex;flex-direction:column}
|
||||
.escolha .ec[hidden]{display:none}
|
||||
.escolha .ec .in{flex:1}
|
||||
@media(max-width:1000px){.escolha{grid-template-columns:repeat(2,1fr)}}
|
||||
@media(max-width:600px){.escolha{grid-template-columns:1fr}}
|
||||
@@ -815,6 +816,15 @@ h2 em{font-style:normal;color:var(--laranja)}
|
||||
<span class="ec-go">Enviar artes de UV</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="ec p" data-modo="premium" hidden>
|
||||
<div class="ec-top"><span class="ec-kind">DTF TÊXTIL PREMIUM · 57 CM</span></div>
|
||||
<h3>Premium · 8 passadas</h3>
|
||||
<p>Branco no máximo e cor mais fechada, para marca própria.</p>
|
||||
<div class="ec-pe">
|
||||
<div class="ec-preco"><b data-preco="premium">R$ 39,90</b><span>por metro</span></div>
|
||||
<span class="ec-go">Enviar minha folha</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@ sessionStorage.removeItem('dtf-operator');
|
||||
const FLOW=['rec','tra','imp','rev','fin'];
|
||||
const FORMER_STATES={fil:'Fila de impressão'};
|
||||
const stateName=s=>board.states[s]||FORMER_STATES[s]||s;
|
||||
const PRODUCT={file:'DTF Têxtil · folha montada',avulsa:'DTF Têxtil · artes avulsas',uvfile:'DTF UV · folha montada',uv:'DTF UV · artes avulsas'};
|
||||
const PRODUCT={file:'DTF Têxtil · folha montada',avulsa:'DTF Têxtil · artes avulsas',uvfile:'DTF UV · folha montada',uv:'DTF UV · artes avulsas',premium:'DTF Têxtil Premium · folha montada'};
|
||||
// Loose art the Site split by stroke (item 17): each sheet is an item of its own.
|
||||
const productName=item=>PRODUCT[item.mode]+(item.split?' · folha '+item.split.part+' de '+item.split.of+
|
||||
', '+(item.stroke_class==='C3'?'chapado':'traço fino'):'');
|
||||
const SHORT={file:'Têxtil folha',avulsa:'Têxtil avulsa',uvfile:'UV folha',uv:'UV avulsa'};
|
||||
const SHORT={file:'Têxtil folha',avulsa:'Têxtil avulsa',uvfile:'UV folha',uv:'UV avulsa',premium:'Premium'};
|
||||
const EVENTS={payment_approved:'Pagamento aprovado',production_started:'Produção iniciada',correction_needed:'Correção necessária',ready:'Pedido pronto',cancelled:'Pedido cancelado'};
|
||||
// Payment outcomes are recorded by the API in English; operators read Portuguese.
|
||||
function outcomeText(outcome){
|
||||
@@ -427,7 +427,7 @@ async function fetchInto(dir,file){
|
||||
await writeWhole(dir,file.name,r.body);
|
||||
}
|
||||
|
||||
// The machines' hot folders (item 10): 3. Imprimindo/<máquina>/<C1|C2|C3>/.
|
||||
// The machines' hot folders (item 10): 3. Imprimindo/<máquina>/<C1|C2|C3|PREMIUM>/.
|
||||
// The server says what this computer writes now (claimed for it alone, two
|
||||
// parts at most per machine); a written part gone from its folder was taken
|
||||
// by FlexiPRINT, and is never written again; a withdrawn one, from a card that
|
||||
@@ -757,7 +757,7 @@ const FILTER_TESTS={
|
||||
site:o=>o.origin==='site',
|
||||
dropflow:o=>o.origin==='dropflow',
|
||||
atendimento:o=>o.origin==='atendimento',
|
||||
textil:o=>o.snapshot.items.some(i=>i.mode==='file'||i.mode==='avulsa'),
|
||||
textil:o=>o.snapshot.items.some(i=>i.mode==='file'||i.mode==='avulsa'||i.mode==='premium'),
|
||||
uv:o=>o.snapshot.items.some(i=>i.mode==='uvfile'||i.mode==='uv'),
|
||||
entrega:o=>!!o.snapshot.destination,
|
||||
retirada:o=>!o.snapshot.destination,
|
||||
@@ -1114,6 +1114,7 @@ function card(order,place){
|
||||
row.append(node('span','#'+order.number,'num'),originTag(order),age);
|
||||
const name=node('span',who.title,'cname');name.title=[who.legal,who.mail].filter(Boolean).join(' · ')||who.title;
|
||||
const meta=node('span',undefined,'cmeta');meta.append(node('span',productLine(s.items)));
|
||||
if(s.items.some(i=>i.mode==='premium'))meta.append(badge('Premium','','DTF Têxtil Premium: 8 passadas, branco no máximo'));
|
||||
if(order.machine){const m=node('span',order.machine.name,'mach'+(mine?' mine':''));m.title=mine?'Sua máquina':'Máquina';meta.append(m);}
|
||||
meta.append(node('b',metres(orderMetres(order)),'mtr'));
|
||||
info.append(row,name,meta);
|
||||
@@ -1436,6 +1437,7 @@ function renderPanel(order){
|
||||
sub.append(badge('Nota '+s.grade_flags.aviso+': conferir a arte','warn',
|
||||
'A nota da arte ficou abaixo do limite configurado: confira antes de imprimir'));
|
||||
if(isTest(order))sub.append(badge('Teste','','Pedido de teste: sem pagamento, não vai ao Tiny'));
|
||||
if(s.items.some(i=>i.mode==='premium'))sub.append(badge('Premium','','DTF Têxtil Premium: 8 passadas, branco no máximo'));
|
||||
if(stalled(order)&&!order.cancelled_at)sub.append(badge('Parado há '+hoursSince(order.updated_at)+' h','bad','Sem mudar de etapa desde '+when(order.updated_at)));
|
||||
const steps=node('ol',undefined,'stepper');steps.setAttribute('aria-label','Etapas');
|
||||
const at=FLOW.indexOf(order.state);
|
||||
@@ -2815,7 +2817,11 @@ async function openMachineSheet(machineId){
|
||||
box.append(field('Preço de compra (R$)',price),field('Data de instalação',installed));
|
||||
for(const [item,[label,unit]] of Object.entries(data.catalog.supplies)){
|
||||
const input=node('input');input.type='number';input.min='0';input.step='0.001';input.inputMode='decimal';
|
||||
input.value=data.minimums[item]!==null&&data.minimums[item]!==undefined?Number(data.minimums[item]).toString():'';
|
||||
// Dropstar's fixed minimums are the defaults: a machine with none typed
|
||||
// shows and uses them until Gestão changes them.
|
||||
const typed=data.minimums[item], fallback=data.default_minimums?.[item];
|
||||
input.value=typed!==null&&typed!==undefined?Number(typed).toString()
|
||||
:fallback!==null&&fallback!==undefined?Number(fallback).toString():'';
|
||||
minimums[item]=input;
|
||||
box.append(field('Mínimo de '+label.toLowerCase()+' ('+unit+')',input));
|
||||
}
|
||||
|
||||
@@ -51,12 +51,14 @@ const MODOS={
|
||||
zt:'Arraste sua folha de UV aqui', zs:'PNG ou PDF com fundo transparente · 27 cm de largura'},
|
||||
uv: {tit:'Artes avulsas · UV', lg:'Adesivo UV · 27 cm', larg:27, multi:true,
|
||||
zt:'Arraste suas artes de UV',
|
||||
zs:'PNG com fundo transparente · informe a largura de cada arte'}
|
||||
zs:'PNG com fundo transparente · informe a largura de cada arte'},
|
||||
premium:{tit:'DTF Premium', lg:'DTF têxtil premium · 57 cm', larg:57, multi:true, folha:true,
|
||||
zt:'Arraste sua folha montada aqui', zs:'PNG ou PDF com fundo transparente · 57 cm de largura'}
|
||||
};
|
||||
// Preço único por produto (Dropstar, 23/10/2026). A nota da arte continua na
|
||||
// tela, para o cliente entender o arquivo dele, mas não mexe no preço.
|
||||
// O servidor cobra o mesmo (app/core/pricing.py, conferido em tests/test_pricing.py).
|
||||
const PRECO={file:19.90, avulsa:21.90, uvfile:79.90, uv:89.90};
|
||||
const PRECO={file:19.90, avulsa:21.90, uvfile:79.90, uv:89.90, premium:39.90};
|
||||
// Faixas por metragem (front 8.2): o preço do metro depende do total do
|
||||
// produto no pedido, não de cada item. Vem do servidor (/api/session), que
|
||||
// cobra o mesmo (app/catalog.py band_price).
|
||||
|
||||
@@ -46,7 +46,8 @@ function pintaModo(){
|
||||
// dá para voltar atrás sem recomeçar o pedido.
|
||||
function pintaTipoEnvio(){
|
||||
const el=$('tipoEnvio'); if(!el) return;
|
||||
el.hidden=!modo;
|
||||
// A product without its loose-art counterpart (Premium) has nothing to choose.
|
||||
el.hidden=!modo || (ehFolha() && !PAR[modo]);
|
||||
if(el.hidden) return;
|
||||
const folha = ehFolha() ? modo : PAR[modo];
|
||||
const avulsa = ehFolha() ? PAR[modo] : modo;
|
||||
@@ -80,7 +81,7 @@ function recusaFolha(x, md){
|
||||
'<button type="button" id="usarAvulsa">Enviar como '+MODOS[destino].tit.toLowerCase()+'</button>');
|
||||
const botao=$('usarAvulsa');
|
||||
if(botao) botao.addEventListener('click',()=>{
|
||||
avisoTipo(''); trocaTipo(PAR[modo]); sel([arquivo]);
|
||||
avisoTipo(''); trocaTipo(destino); sel([arquivo]);
|
||||
});
|
||||
}
|
||||
document.querySelectorAll('#tipoEnvio .cam').forEach(b=>b.addEventListener('click',()=>{
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
addresses. Loaded in <head> so the right page is the first one painted;
|
||||
site-steps.js does the navigation. */
|
||||
const PAGINAS={file:'/arquivo-por-metro', avulsa:'/artes-avulsas',
|
||||
uvfile:'/uv-arquivo-por-metro', uv:'/uv-artes-avulsas'};
|
||||
uvfile:'/uv-arquivo-por-metro', uv:'/uv-artes-avulsas',
|
||||
premium:'/premium'};
|
||||
const CARRINHO='/carrinho', PAGAMENTO='/pagamento', PAGAMENTO_PIX='/pagamento/pix';
|
||||
function paginaDe(caminho){
|
||||
caminho=caminho.replace(/\/+$/,'')||'/';
|
||||
|
||||
Reference in New Issue
Block a user