Commit ec5e04d3 by Sendya

fix: mobile prefix style replace

parent 7651ec99
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister"> <a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister">
<a-form-item <a-form-item
fieldDecoratorId="email" fieldDecoratorId="email"
:fieldDecoratorOptions="{rules: [{ required: true, type: 'email', message: '请输入邮箱地址' }]}"> :fieldDecoratorOptions="{rules: [{ required: true, type: 'email', message: '请输入邮箱地址' }], validateTrigger: ['change', 'blur']}">
<a-input size="large" type="text" placeholder="邮箱"></a-input> <a-input size="large" type="text" placeholder="邮箱"></a-input>
</a-form-item> </a-form-item>
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
<a-form-item <a-form-item
fieldDecoratorId="password" fieldDecoratorId="password"
:fieldDecoratorOptions="{rules: [{ required: true, message: '至少6位密码,区分大小写'}, { validator: this.handlePasswordLevel } :fieldDecoratorOptions="{rules: [{ required: true, message: '至少6位密码,区分大小写'}, { validator: this.handlePasswordLevel }
]}"> ], validateTrigger: ['change', 'blur']}">
<a-input size="large" type="password" @click="handlePasswordInputClick" autocomplete="false" placeholder="至少6位密码,区分大小写"></a-input> <a-input size="large" type="password" @click="handlePasswordInputClick" autocomplete="false" placeholder="至少6位密码,区分大小写"></a-input>
</a-form-item> </a-form-item>
</a-popover> </a-popover>
<a-form-item <a-form-item
fieldDecoratorId="password2" fieldDecoratorId="password2"
:fieldDecoratorOptions="{rules: [{ required: true, message: '至少6位密码,区分大小写' }, { validator: this.handlePasswordCheck }]}"> :fieldDecoratorOptions="{rules: [{ required: true, message: '至少6位密码,区分大小写' }, { validator: this.handlePasswordCheck }], validateTrigger: ['change', 'blur']}">
<a-input size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input> <a-input size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input>
</a-form-item> </a-form-item>
...@@ -37,15 +37,6 @@ ...@@ -37,15 +37,6 @@
<a-form-item <a-form-item
fieldDecoratorId="mobile" fieldDecoratorId="mobile"
:fieldDecoratorOptions="{rules: [{ required: true, message: '请输入正确的手机号', pattern: /^1[3456789]\d{9}$/ }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'] }"> :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入正确的手机号', pattern: /^1[3456789]\d{9}$/ }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'] }">
<!--
<a-input-group size="large" compact>
<a-select style="width: 20%" size="large" defaultValue="+86">
<a-select-option value="+86">+86</a-select-option>
<a-select-option value="+87">+87</a-select-option>
</a-select>
<a-input style="width: 80%" size="large" placeholder="11 位手机号"></a-input>
</a-input-group>
-->
<a-input size="large" placeholder="11 位手机号"> <a-input size="large" placeholder="11 位手机号">
<a-select slot="addonBefore" size="large" defaultValue="+86"> <a-select slot="addonBefore" size="large" defaultValue="+86">
<a-select-option value="+86">+86</a-select-option> <a-select-option value="+86">+86</a-select-option>
...@@ -53,6 +44,13 @@ ...@@ -53,6 +44,13 @@
</a-select> </a-select>
</a-input> </a-input>
</a-form-item> </a-form-item>
<!--<a-input-group size="large" compact>
<a-select style="width: 20%" size="large" defaultValue="+86">
<a-select-option value="+86">+86</a-select-option>
<a-select-option value="+87">+87</a-select-option>
</a-select>
<a-input style="width: 80%" size="large" placeholder="11 位手机号"></a-input>
</a-input-group>-->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col class="gutter-row" :span="16"> <a-col class="gutter-row" :span="16">
...@@ -181,6 +179,10 @@ ...@@ -181,6 +179,10 @@
handlePasswordCheck (rule, value, callback) { handlePasswordCheck (rule, value, callback) {
let password = this.form.getFieldValue('password') let password = this.form.getFieldValue('password')
console.log('value', value)
if (value === undefined) {
callback(new Error('请输入密码'))
}
if (value && password && value.trim() !== password.trim()) { if (value && password && value.trim() !== password.trim()) {
callback(new Error('两次密码不一致')) callback(new Error('两次密码不一致'))
} }
...@@ -188,9 +190,9 @@ ...@@ -188,9 +190,9 @@
}, },
handlePhoneCheck (rule, value, callback) { handlePhoneCheck (rule, value, callback) {
console.log('rule:', rule) console.log('handlePhoneCheck, rule:', rule)
console.log('value', value) console.log('handlePhoneCheck, value', value)
console.log('callback', callback) console.log('handlePhoneCheck, callback', callback)
callback() callback()
}, },
...@@ -279,6 +281,14 @@ ...@@ -279,6 +281,14 @@
&.success { &.success {
color: #52c41a; color: #52c41a;
} }
}
.user-layout-register {
.ant-input-group-addon:first-child {
background-color: #fff;
}
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment