From c3cad2140f9009d27dc4959a1d64b1ebb079cc54 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 4 Jul 2026 20:33:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8json.dumps=E5=8C=85=E8=A3=B9?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=8A=A8=E6=80=81=E5=80=BC=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?JSON=E5=AE=89=E5=85=A8=EF=BC=8Cin=5Fplan=E7=94=A8=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E6=AF=94=E8=BE=83'1'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/discount_setting/index.ui | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/wwwroot/discount_setting/index.ui b/wwwroot/discount_setting/index.ui index c81bfae..e99e22b 100644 --- a/wwwroot/discount_setting/index.ui +++ b/wwwroot/discount_setting/index.ui @@ -11,7 +11,7 @@ { "widgettype": "Text", "options": { - "text": "产品折扣设置 - {{info.name or ''}}{% if info.customer %} ({{info.customer}}){% endif %}", + "text": "产品折扣设置 - {{json.dumps(info.name, ensure_ascii=False) if info.name else ''}}", "fontSize": "16px", "fontWeight": "600", "color": "#F1F5F9", @@ -59,16 +59,16 @@ "width": "100%" }, "subwidgets": [ - {"widgettype": "Text", "options": {"text": "{{p.category_name or ''}}", "width": "20%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}}, - {"widgettype": "Text", "options": {"text": "{{p.product_name or ''}}", "width": "28%", "padding": "0 8px", "fontSize": "12px", "color": "#F1F5F9"}}, - {"widgettype": "Text", "options": {"text": "{{p.product_code or ''}}", "width": "18%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}}, + {"widgettype": "Text", "options": {"text": {{json.dumps(p.category_name or '')}}, "width": "20%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}}, + {"widgettype": "Text", "options": {"text": {{json.dumps(p.product_name or '')}}, "width": "28%", "padding": "0 8px", "fontSize": "12px", "color": "#F1F5F9"}}, + {"widgettype": "Text", "options": {"text": {{json.dumps(p.product_code or '')}}, "width": "18%", "padding": "0 8px", "fontSize": "12px", "color": "#E2E8F0"}}, { "widgettype": "UiFloat", "options": { "width": "14%", "padding": "0 8px", "name": "discount", - "value": "{{p.discount or '1.0'}}", + "value": {{json.dumps(p.discount or '1.0')}}, "placeholder": "0~1", "dec_len": 2, "fontSize": "12px" @@ -83,16 +83,16 @@ "options": { "url": "{{entire_url('./save_discount.dspy')}}", "params": { - "discountid": "{{params_kw.discountid}}", - "old_discount": "{{p.discount or '1.0'}}", - "productid": "{{p.productid}}", - "detail_id": "{{p.detail_id or ''}}" + "discountid": {{json.dumps(params_kw.discountid)}}, + "old_discount": {{json.dumps(p.discount or '1.0')}}, + "productid": {{json.dumps(p.productid)}}, + "detail_id": {{json.dumps(p.detail_id or '')}} } } } ] }, - {"widgettype": "Text", "options": {"text": "{% if p.in_plan == 1 %}✓方案内{% endif %}", "width": "16%", "padding": "0 8px", "fontSize": "11px", "color": "#34D399"}} + {"widgettype": "Text", "options": {"text": {% if p.in_plan == '1' %}"✓方案内"{% else %}""{% endif %}, "width": "16%", "padding": "0 8px", "fontSize": "11px", "color": "#34D399"}} ] }{% if not loop.last %},{% endif %} {% endfor %}