Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
5d467882
Commit
5d467882
authored
Sep 17, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快捷登录
parent
b41c453e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
src/components/passport/common/inputWithCountryCodes/index.js
+6
-7
src/components/passport/forgotPassword/index.js
+2
-2
src/components/passport/login/index.js
+8
-7
No files found.
src/components/passport/common/inputWithCountryCodes/index.js
View file @
5d467882
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
'./index.scss'
import
'./index.scss'
import
Input
from
'../Input'
import
Input
from
'../Input'
import
{
Link
}
from
"react-router-dom"
;
class
InputWithCountryCodes
extends
Component
{
class
InputWithCountryCodes
extends
Component
{
static
defaultProps
=
{
countryCode
:
'86'
}
render
()
{
render
()
{
const
{
country
Code
,
...
rest
}
=
this
.
props
const
{
country
,
...
rest
}
=
this
.
props
return
(
return
(
<
div
className
=
{
'input-with-country-codes'
}
>
<
div
className
=
{
'input-with-country-codes'
}
>
<
div
className
=
"country-codes"
>
<
div
className
=
"country-codes"
>
+
{
countryCode
}
<
Link
to
=
{
'/country'
}
>
<
i
className
=
{
'iconfont iconiconfront-69'
}
/
>
+
{
country
&&
country
.
num
||
86
}
<
i
className
=
{
'iconfont iconiconfront-69'
}
/
>
<
/Link
>
<
/div
>
<
/div
>
<
Input
{...
rest
}
/
>
<
Input
{...
rest
}
/
>
<
/div
>
<
/div
>
...
...
src/components/passport/forgotPassword/index.js
View file @
5d467882
...
@@ -8,7 +8,7 @@ import { compose } from 'redux';
...
@@ -8,7 +8,7 @@ import { compose } from 'redux';
import
{
Toast
}
from
"antd-mobile"
;
import
{
Toast
}
from
"antd-mobile"
;
import
{
HeaderBar
,
Captcha
}
from
"@/common"
;
import
{
HeaderBar
,
Captcha
}
from
"@/common"
;
import
ClearableInput
from
'../common/clearableInputWithCountryCodes'
import
ClearableInput
from
'../common/clearableInputWithCountryCodes'
import
{
validateTel
,
http
,
api
}
from
"@/utils"
;
import
{
http
}
from
"@/utils"
;
import
{
quickLogin
}
from
'@/store/userAction'
;
import
{
quickLogin
}
from
'@/store/userAction'
;
import
OnSubmissionError
from
'../common/OnSubmissionError'
import
OnSubmissionError
from
'../common/OnSubmissionError'
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
;
...
@@ -111,7 +111,7 @@ const formikConfig = {
...
@@ -111,7 +111,7 @@ const formikConfig = {
validateOnBlur
:
true
,
validateOnBlur
:
true
,
validate
:
values
=>
{
validate
:
values
=>
{
let
errors
=
{}
let
errors
=
{}
if
(
!
validateTel
(
values
.
tel
))
{
if
(
!
/
\d
/
.
test
(
values
.
tel
))
{
errors
.
tel
=
'请输入正确的手机号'
errors
.
tel
=
'请输入正确的手机号'
}
}
values
.
veriCode
.
toString
().
length
!==
6
&&
(
errors
.
veriCode
=
'验证码格式不正确'
)
values
.
veriCode
.
toString
().
length
!==
6
&&
(
errors
.
veriCode
=
'验证码格式不正确'
)
...
...
src/components/passport/login/index.js
View file @
5d467882
...
@@ -13,7 +13,7 @@ import { connect } from 'react-redux';
...
@@ -13,7 +13,7 @@ import { connect } from 'react-redux';
import
{
compose
}
from
'redux'
;
import
{
compose
}
from
'redux'
;
import
{
isEmpty
}
from
'lodash'
import
{
isEmpty
}
from
'lodash'
import
{
Toast
}
from
'antd-mobile'
;
import
{
Toast
}
from
'antd-mobile'
;
import
{
validateTel
,
getParam
}
from
"@/utils"
;
import
{
validateTel
}
from
"@/utils"
;
import
{
HeaderBar
}
from
"@/common"
;
import
{
HeaderBar
}
from
"@/common"
;
...
@@ -70,7 +70,8 @@ class Login extends Component {
...
@@ -70,7 +70,8 @@ class Login extends Component {
const
{
const
{
loginWays
,
loginWays
,
errors
,
errors
,
values
values
,
country
}
=
this
.
props
}
=
this
.
props
return
(
return
(
<
div
className
=
'login'
>
<
div
className
=
'login'
>
...
@@ -85,9 +86,7 @@ class Login extends Component {
...
@@ -85,9 +86,7 @@ class Login extends Component {
type
=
{
'tel'
}
type
=
{
'tel'
}
placeholder
=
{
'手机号快捷登录(免注册)'
}
placeholder
=
{
'手机号快捷登录(免注册)'
}
wrapperClass
=
{
'tel-input'
}
wrapperClass
=
{
'tel-input'
}
/*icon={<i className={'iconfont iconshouji'}
country
=
{
country
}
style={{fontSize: '22px', left: '10px'}}
/>}*/
/
>
/
>
)}
)}
>
>
...
@@ -109,6 +108,7 @@ class Login extends Component {
...
@@ -109,6 +108,7 @@ class Login extends Component {
errors
=
{
errors
}
errors
=
{
errors
}
placeholder
=
{
'请输入验证码'
}
placeholder
=
{
'请输入验证码'
}
instance
=
{
this
.
state
.
captchaInstance
}
instance
=
{
this
.
state
.
captchaInstance
}
country
=
{
country
}
/
>
/
>
)}
)}
/
>
/
>
...
@@ -133,7 +133,8 @@ const FormikConfig = {
...
@@ -133,7 +133,8 @@ const FormikConfig = {
handleSubmit
(
values
,
{
props
})
{
handleSubmit
(
values
,
{
props
})
{
props
.
quickLogin
({
props
.
quickLogin
({
phone_num
:
values
.
tel
,
phone_num
:
values
.
tel
,
phone_code
:
values
.
veriCode
phone_code
:
values
.
veriCode
,
area_code
:
props
.
country
.
num
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
hasError
)
{
if
(
res
.
hasError
)
{
Toast
.
info
(
res
.
msg
);
Toast
.
info
(
res
.
msg
);
...
@@ -159,7 +160,7 @@ const FormikConfig = {
...
@@ -159,7 +160,7 @@ const FormikConfig = {
export
default
compose
(
export
default
compose
(
connect
(
connect
(
null
,
state
=>
({
country
:
state
.
country
})
,
{
quickLogin
}
{
quickLogin
}
),
),
withFormik
(
FormikConfig
),
withFormik
(
FormikConfig
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment