fix: 注册表单仅输入区域滚动,暗色主题输入框颜色优化

- 注册Tab结构: Text(固定) + VScrollPanel(仅Form) + Button(固定)
- 暗色主题输入框背景 #0f172a -> #1e293b,更协调
This commit is contained in:
yumoqing 2026-05-30 14:27:33 +08:00
parent d1b3ca0914
commit b0d6b59613
2 changed files with 26 additions and 26 deletions

View File

@ -217,7 +217,7 @@
border-bottom-color: #818cf8 !important; border-bottom-color: #818cf8 !important;
} }
[data-theme="dark"] .login-window .inputbox { [data-theme="dark"] .login-window .inputbox {
background: #0f172a !important; background: #1e293b !important;
border-color: #475569 !important; border-color: #475569 !important;
color: #e2e8f0 !important; color: #e2e8f0 !important;
} }

View File

@ -121,21 +121,21 @@
"name": "register", "name": "register",
"label": "注册账号", "label": "注册账号",
"content": { "content": {
"widgettype": "VScrollPanel", "widgettype": "VBox",
"options": {"height": "100%"}, "options": {"gap": "8px", "height": "100%"},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "Text",
"options": {"gap": "8px"}, "options": {
"otext": "手机号需短信验证后方可注册",
"i18n": true,
"css": "login-desc"
}
},
{
"widgettype": "VScrollPanel",
"options": {"height": "100%", "flex": "1"},
"subwidgets": [ "subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "手机号需短信验证后方可注册",
"i18n": true,
"css": "login-desc"
}
},
{ {
"widgettype": "Form", "widgettype": "Form",
"id": "register_form", "id": "register_form",
@ -162,20 +162,20 @@
} }
} }
] ]
}, }
]
},
{
"widgettype": "Button",
"id": "reg_sms_btn",
"options": {"label": "发送验证码", "i18n": true, "css": "sms-send-btn"},
"binds": [
{ {
"widgettype": "Button", "wid": "self",
"id": "reg_sms_btn", "event": "click",
"options": {"label": "发送验证码", "i18n": true, "css": "sms-send-btn"}, "actiontype": "script",
"binds": [ "target": "self",
{ "script": "var form=bricks.getWidgetById('register_form',bricks.app);if(!form)return;var cell=form._getValue().mobile;if(!cell||cell.length<11){alert('请输入正确的手机号');return;}var btn=this;btn.disabled=true;btn.text_w&&btn.text_w.set_otext('发送中...');fetch('{{sms_code_url}}?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){if(d.status==='ok'){var w=form.name_inputs['codeid'];if(w)w.setValue(d.data.key);btn.text_w&&btn.text_w.set_otext('已发送');var s=60;var t=setInterval(function(){s--;if(s<=0){clearInterval(t);btn.disabled=false;btn.text_w&&btn.text_w.set_otext('重新发送')}else btn.text_w&&btn.text_w.set_otext(s+'s')},1000)}else{alert(d.data.message||'发送验证码出错');btn.disabled=false;btn.text_w&&btn.text_w.set_otext('发送验证码')}}).catch(function(e){alert('网络错误: '+e);btn.disabled=false;btn.text_w&&btn.text_w.set_otext('发送验证码')})"
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "var form=bricks.getWidgetById('register_form',bricks.app);if(!form)return;var cell=form._getValue().mobile;if(!cell||cell.length<11){alert('请输入正确的手机号');return;}var btn=this;btn.disabled=true;btn.text_w&&btn.text_w.set_otext('发送中...');fetch('{{sms_code_url}}?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){if(d.status==='ok'){var w=form.name_inputs['codeid'];if(w)w.setValue(d.data.key);btn.text_w&&btn.text_w.set_otext('已发送');var s=60;var t=setInterval(function(){s--;if(s<=0){clearInterval(t);btn.disabled=false;btn.text_w&&btn.text_w.set_otext('重新发送')}else btn.text_w&&btn.text_w.set_otext(s+'s')},1000)}else{alert(d.data.message||'发送验证码出错');btn.disabled=false;btn.text_w&&btn.text_w.set_otext('发送验证码')}}).catch(function(e){alert('网络错误: '+e);btn.disabled=false;btn.text_w&&btn.text_w.set_otext('发送验证码')})"
}
]
} }
] ]
} }