Commit 36161d6d by sendya

fix: register phone

parent 180439c8
......@@ -9,7 +9,7 @@
<a-input size="large" type="text" placeholder="邮箱"></a-input>
</a-form-item>
<a-popover placement="right" trigger="click" :visible="state.passwordLevelChecked">
<a-popover placement="rightTop" trigger="click" :visible="state.passwordLevelChecked">
<template slot="content">
<div :style="{ width: '240px' }" >
<div :class="['user-register', passwordLevelClass]">强度:<span>{{ passwordLevelName }}</span></div>
......@@ -36,15 +36,22 @@
<a-form-item
fieldDecoratorId="mobile"
:fieldDecoratorOptions="{rules: [{ required: true, message: '手机号' }], validateTrigger: '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%" placeholder="11 位手机号"></a-input>
<a-input style="width: 80%" size="large" placeholder="11 位手机号"></a-input>
</a-input-group>
-->
<a-input size="large" placeholder="11 位手机号">
<a-select slot="addonBefore" 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>
</a-form-item>
<a-row :gutter="16">
......@@ -180,6 +187,14 @@
callback()
},
handlePhoneCheck (rule, value, callback) {
console.log('rule:', rule)
console.log('value', value)
console.log('callback', callback)
callback()
},
handlePasswordInputClick () {
if (!this.isMobile) {
this.state.passwordLevelChecked = true
......
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