From ff03efb50aff492fac2f969a707a4c6675218182 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 28 May 2026 17:00:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Button=20label=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=94=B9=E7=94=A8set=5Fotext()=E6=94=AF=E6=8C=81=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set_text()直接设置innerHTML跳过i18n翻译, set_otext()会先调用i18n._()翻译再set_text, 与Button初始化时i18n:true的配置保持一致。 --- wwwroot/user/login.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wwwroot/user/login.ui b/wwwroot/user/login.ui index abbb230..c735737 100644 --- a/wwwroot/user/login.ui +++ b/wwwroot/user/login.ui @@ -105,7 +105,7 @@ "event": "click", "actiontype": "script", "target": "self", - "script": "var form=bricks.getWidgetById('phone_form',bricks.app);if(!form){alert('form not found');return;}var vals=form._getValue();var cell=vals.cell_no;if(!cell){alert('请输入手机号');return;}var btn=bricks.getWidgetById('gen_code_btn',bricks.app);if(btn&&btn.text_w){btn.text_w.set_text('发送中...')}fetch(bricks.app.baseUrl+'/rbac/gen_sms_code.dspy?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){if(d.status==='ok'){form.setValue({codeid:d.data.key});if(btn&&btn.text_w){btn.text_w.set_text('已发送('+cell+')')}}else{alert(d.data.message);if(btn&&btn.text_w){btn.text_w.set_text('发送验证码')}}}).catch(function(e){alert('发送失败:'+e);if(btn&&btn.text_w){btn.text_w.set_text('发送验证码')}})" + "script": "var form=bricks.getWidgetById('phone_form',bricks.app);if(!form){alert('form not found');return;}var vals=form._getValue();var cell=vals.cell_no;if(!cell){alert('请输入手机号');return;}var btn=bricks.getWidgetById('gen_code_btn',bricks.app);if(btn&&btn.text_w){btn.text_w.set_otext('发送中...')}fetch(bricks.app.baseUrl+'/rbac/gen_sms_code.dspy?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){if(d.status==='ok'){form.setValue({codeid:d.data.key});if(btn&&btn.text_w){btn.text_w.set_otext('已发送('+cell+')')}}else{alert(d.data.message);if(btn&&btn.text_w){btn.text_w.set_otext('发送验证码')}}}).catch(function(e){alert('发送失败:'+e);if(btn&&btn.text_w){btn.text_w.set_otext('发送验证码')}})" } ] }