From 3896a8145ecf5ba8e6fb14fe2a7b35fda9685f2f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 29 Jun 2026 16:18:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Form=E7=AE=80=E5=8C=96,margin:0,padding:?= =?UTF-8?q?0,=E5=8E=BBid,=E7=B2=BE=E7=AE=80script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/discount_setting/index.ui | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wwwroot/discount_setting/index.ui b/wwwroot/discount_setting/index.ui index bc1a48a..d6f8933 100644 --- a/wwwroot/discount_setting/index.ui +++ b/wwwroot/discount_setting/index.ui @@ -30,7 +30,7 @@ {"widgettype": "Text", "options": {"text": "产品分类", "width": "22%", "padding": "0 12px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}}, {"widgettype": "Text", "options": {"text": "产品名称", "width": "34%", "padding": "0 12px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}}, {"widgettype": "Text", "options": {"text": "产品编码", "width": "22%", "padding": "0 12px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}}, - {"widgettype": "Text", "options": {"text": "折扣(可编辑)", "width": "22%", "padding": "0 12px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}} + {"widgettype": "Text", "options": {"text": "折扣", "width": "22%", "padding": "0 12px", "fontSize": "12px", "fontWeight": "600", "color": "#94A3B8"}} ] }, { @@ -56,10 +56,10 @@ {"widgettype": "Text", "options": {"text": "{{p.product_code or ''}}", "width": "22%", "padding": "0 12px", "fontSize": "12px", "color": "#E2E8F0"}}, { "widgettype": "Form", - "id": "discount_form_{{loop.index}}", "options": { "width": "22%", - "padding": "0 12px", + "padding": "0", + "margin": "0", "show_label": false, "submit_url": "{{entire_url('./save_discount.dspy')}}", "fields": [ @@ -75,7 +75,7 @@ "event": "blur", "actiontype": "script", "target": "self", - "script": "var form = this.target; var d = form.getValue(); var old = form._last_val; if (d.discount === old) return; form._last_val = d.discount; fetch(form.options.submit_url, {method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(d)}).then(function(r){ return r.json(); }).then(function(resp){ if (resp.widgettype === 'Error') bricks.show_error(resp.options); else console.log('discount saved'); }).catch(function(e){ console.error(e); });" + "script": "var f=this.target;var d=f.getValue();var o=f._lv;if(d.discount===o)return;f._lv=d.discount;fetch(f.options.submit_url,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(d)}).then(function(r){return r.json()}).then(function(r){if(r.widgettype==='Error')bricks.show_error(r.options)}).catch(function(e){console.error(e)})" } ] }