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
b103a56c
Commit
b103a56c
authored
Nov 04, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
ui问题
parents
6a329e43
5fe4637c
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
147 additions
and
67 deletions
+147
-67
src/App.js
+3
-0
src/common/closable-popup/index.scss
+1
-1
src/components/activity/index.js
+1
-1
src/components/blessingPreheat/ReserveCourse/index.js
+1
-1
src/components/blessingPreheat/banner/index.scss
+2
-2
src/components/blessingPreheat/coursePopup/index.scss
+1
-1
src/components/blessingPreheat/levelTest/index.js
+1
-1
src/components/blessingPreheat/levelTest/index.scss
+4
-0
src/components/blessingPreheat/live/index.js
+49
-13
src/components/blessingPreheat/live/index.scss
+16
-1
src/components/blessingPreheat/luckDraw/index.scss
+1
-1
src/components/blessingPreheat/recordPopup/index.js
+3
-1
src/components/blessingPreheat/recordPopup/index.scss
+9
-6
src/components/blessingPreheat/sharePopup/index.js
+1
-1
src/components/blessingPreheat/sharePopup/index.scss
+4
-0
src/components/order/deposit/final-order/index.js
+3
-2
src/components/passport/bindingTel/index.js
+15
-14
src/components/passport/index.js
+5
-2
src/components/passport/setPassword/index.js
+24
-18
src/utils/index.js
+3
-1
No files found.
src/App.js
View file @
b103a56c
...
@@ -63,6 +63,9 @@ class App extends Component {
...
@@ -63,6 +63,9 @@ class App extends Component {
if
(
cookie
.
get
(
'uid'
)
&&
this
.
props
.
user
.
hasError
)
{
if
(
cookie
.
get
(
'uid'
)
&&
this
.
props
.
user
.
hasError
)
{
this
.
getUser
()
this
.
getUser
()
}
}
if
(
location
.
pathname
===
'/passport'
){
window
.
localStorage
.
setItem
(
'binding_redirect'
,
JSON
.
stringify
(
this
.
previousLocation
))
}
const
{
pathname
,
state
}
=
location
const
{
pathname
,
state
}
=
location
if
(
pathname
.
startsWith
(
'/passport'
))
{
if
(
pathname
.
startsWith
(
'/passport'
))
{
location
.
state
=
{
location
.
state
=
{
...
...
src/common/closable-popup/index.scss
View file @
b103a56c
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
.close
{
.close
{
position
:
absolute
;
position
:
absolute
;
bottom
:
-
88
px
;
bottom
:
-
74
px
;
left
:
50%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
font-size
:
36px
;
font-size
:
36px
;
...
...
src/components/activity/index.js
View file @
b103a56c
...
@@ -26,7 +26,7 @@ class Activity extends Component {
...
@@ -26,7 +26,7 @@ class Activity extends Component {
getGift
=
()
=>
{
getGift
=
()
=>
{
if
(
this
.
props
.
user
.
hasError
)
{
if
(
this
.
props
.
user
.
hasError
)
{
this
.
props
.
history
.
push
(
'/passport'
);
this
.
props
.
history
.
push
(
'/passport'
,
{
from
:
this
.
props
.
location
.
pathname
}
);
}
else
{
}
else
{
Toast
.
info
(
'领取成功,你可前往七月在线官网/APP进行查看'
,
2
);
Toast
.
info
(
'领取成功,你可前往七月在线官网/APP进行查看'
,
2
);
localStorage
.
setItem
(
'lingqu'
,
1
);
localStorage
.
setItem
(
'lingqu'
,
1
);
...
...
src/components/blessingPreheat/ReserveCourse/index.js
View file @
b103a56c
...
@@ -34,7 +34,7 @@ class ReserveCourse extends Component {
...
@@ -34,7 +34,7 @@ class ReserveCourse extends Component {
const
{
code
,
data
,
msg
}
=
res
.
data
;
const
{
code
,
data
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
if
(
code
===
200
)
{
this
.
setState
({
this
.
setState
({
courseData
:
data
.
filter
((
item
,
index
)
=>
index
<
4
),
courseData
:
JSON
.
stringify
(
data
)
==
'{}'
?
[]:
data
.
filter
((
item
,
index
)
=>
index
<
4
),
courseDataAll
:
data
courseDataAll
:
data
})
})
}
else
{
}
else
{
...
...
src/components/blessingPreheat/banner/index.scss
View file @
b103a56c
...
@@ -24,11 +24,11 @@
...
@@ -24,11 +24,11 @@
li
{
li
{
flex
:
1
;
flex
:
1
;
width
:
63px
;
width
:
63px
;
height
:
3
0px
;
height
:
4
0px
;
font-size
:
11px
;
font-size
:
11px
;
color
:
#fff
;
color
:
#fff
;
text-align
:
center
;
text-align
:
center
;
line-height
:
3
0px
;
line-height
:
4
0px
;
&
.active
{
&
.active
{
background
:
#FF42F9
;
background
:
#FF42F9
;
}
}
...
...
src/components/blessingPreheat/coursePopup/index.scss
View file @
b103a56c
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
.iconfont
{
.iconfont
{
margin
:
16px
0
0
;
margin
:
16px
0
0
;
font-size
:
2
4
px
;
font-size
:
2
8
px
;
color
:
#fff
;
color
:
#fff
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
...
...
src/components/blessingPreheat/levelTest/index.js
View file @
b103a56c
...
@@ -75,7 +75,7 @@ class LevelTest extends Component {
...
@@ -75,7 +75,7 @@ class LevelTest extends Component {
<>
<>
<
div
className
=
"level__test_module"
>
<
div
className
=
"level__test_module"
>
<
div
className
=
'start__test'
onClick
=
{
this
.
startTest
}
>
<
div
className
=
'start__test'
onClick
=
{
this
.
startTest
}
>
<
img
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/test_icon.png"
/>
<
img
className
=
'test-img'
src
=
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/test_icon.png"
/>
<
div
className
=
"button__text"
>
<
div
className
=
"button__text"
>
<
p
>
点击测试
<
/p
>
<
p
>
点击测试
<
/p
>
<
/div
>
<
/div
>
...
...
src/components/blessingPreheat/levelTest/index.scss
View file @
b103a56c
...
@@ -29,6 +29,10 @@
...
@@ -29,6 +29,10 @@
font-size
:
12px
;
font-size
:
12px
;
}
}
}
}
.test-img
{
width
:
14px
;
height
:
14px
;
}
}
}
.test__number
{
.test__number
{
...
...
src/components/blessingPreheat/live/index.js
View file @
b103a56c
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
'./index.scss'
import
'./index.scss'
import
{
Tabs
,
Toast
}
from
"antd-mobile"
import
{
Tabs
,
Toast
}
from
"antd-mobile"
import
{
getParam
,
http
,
SendMessageToApp
}
from
"@/utils"
import
{
getParam
,
http
,
SendMessageToApp
,
browser
}
from
"@/utils"
import
{
Popup
}
from
"@common/index"
import
{
Popup
}
from
"@common/index"
import
QRCode
from
'qrcode'
import
QRCode
from
'qrcode'
import
{
uniqBy
}
from
'lodash'
import
{
uniqBy
}
from
'lodash'
...
@@ -12,12 +12,15 @@ import { withRouter } from 'react-router-dom'
...
@@ -12,12 +12,15 @@ import { withRouter } from 'react-router-dom'
@
connect
(
state
=>
({
user
:
state
.
user
}))
@
connect
(
state
=>
({
user
:
state
.
user
}))
class
Live
extends
Component
{
class
Live
extends
Component
{
popupInstance
=
null
state
=
{
state
=
{
tabs
:
[],
tabs
:
[],
lives
:
{},
lives
:
{},
preheatLives
:
[],
preheatLives
:
[],
today
:
''
,
today
:
''
,
isApp
:
getParam
(
'version'
)
isApp
:
getParam
(
'version'
),
QRCodeUrl
:
''
,
}
}
...
@@ -69,22 +72,33 @@ class Live extends Component {
...
@@ -69,22 +72,33 @@ class Live extends Component {
}
}
toLiveRoom
=
id
=>
{
toLiveRoom
=
id
=>
{
const
{
history
,
isLogin
}
=
this
.
props
;
const
{
history
,
isLogin
}
=
this
.
props
if
(
this
.
state
.
isApp
)
{
if
(
this
.
state
.
isApp
)
{
if
(
isLogin
)
{
if
(
isLogin
)
{
SendMessageToApp
(
'toLiveRoom'
,
id
)
SendMessageToApp
(
'toLiveRoom'
,
id
)
}
else
{
}
else
{
SendMessageToApp
(
"toLogin"
)
SendMessageToApp
(
"toLogin"
)
}
}
}
else
{
}
else
{
if
(
isLogin
)
{
if
(
isLogin
)
{
window
.
location
.
href
=
`
${
window
.
location
.
protocol
}
//www.julyedu.com/live/m_room/
${
id
}
`
window
.
location
.
href
=
`
${
window
.
location
.
protocol
}
//www.julyedu.com/live/m_room/
${
id
}
`
}
else
{
}
else
{
history
.
push
(
'/passport'
)
history
.
push
(
'/passport'
)
}
}
}
}
}
}
saveImage
=
()
=>
{
let
version
=
getParam
(
'version'
)
version
=
typeof
version
===
'string'
?
version
.
replace
(
'.'
,
''
).
replace
(
'.'
,
''
).
slice
(
0
,
3
)
:
''
const
{
QRCodeUrl
}
=
this
.
state
if
(
version
&&
parseInt
(
version
)
<
451
)
{
Toast
.
info
(
'当前不支持此功能,升级到最新版本app可以点击保存二维码!'
,
2
,
null
,
false
)
}
else
{
SendMessageToApp
(
'generateQRCode'
,
QRCodeUrl
)
}
}
makeSubscribe
=
id
=>
{
makeSubscribe
=
id
=>
{
const
{
user
,
history
}
=
this
.
props
const
{
user
,
history
}
=
this
.
props
if
(
user
.
hasError
)
{
if
(
user
.
hasError
)
{
...
@@ -94,12 +108,30 @@ class Live extends Component {
...
@@ -94,12 +108,30 @@ class Live extends Component {
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
data
}
=
res
const
{
data
}
=
res
if
(
data
.
errno
==
200
)
{
if
(
data
.
errno
==
200
)
{
this
.
setState
(()
=>
({
QRCodeUrl
:
data
.
data
.
url
,
}))
QRCode
.
toDataURL
(
data
.
data
.
url
,
(
err
,
url
)
=>
{
QRCode
.
toDataURL
(
data
.
data
.
url
,
(
err
,
url
)
=>
{
Popup
({
if
(
!
this
.
popupInstance
)
{
this
.
popupInstance
=
Popup
({
title
:
'扫码关注“七月在线”服务号即可预约'
,
title
:
'扫码关注“七月在线”服务号即可预约'
,
content
:
<
img
id
=
{
'live-qr-code'
}
src
=
{
url
}
alt
=
""
/>
content
:
(
<>
<
img
id
=
{
'live-qr-code'
}
src
=
{
url
}
alt
=
""
/>
{
browser
.
isAndroidApp
?
(
<
button
className
=
{
'save-image'
}
onClick
=
{
this
.
saveImage
}
>
保存二维码
<
/button
>
)
:
null
}
<
/
>
),
close
:
()
=>
new
Promise
(
resolve
=>
{
this
.
popupInstance
=
null
resolve
()
})
})
})
})
}
})
}
else
{
}
else
{
Toast
.
info
(
data
.
msg
,
2
,
null
,
false
)
Toast
.
info
(
data
.
msg
,
2
,
null
,
false
)
}
}
...
@@ -136,21 +168,23 @@ class Live extends Component {
...
@@ -136,21 +168,23 @@ class Live extends Component {
{
{
todayLives
.
map
((
item
,
index
)
=>
{
todayLives
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
LiveContent
item
=
{
item
}
key
=
{
index
}
makeSubscribe
=
{
this
.
makeSubscribe
}
toLiveRoom
=
{
this
.
toLiveRoom
}
/
>
<
LiveContent
item
=
{
item
}
key
=
{
index
}
makeSubscribe
=
{
this
.
makeSubscribe
}
toLiveRoom
=
{
this
.
toLiveRoom
}
/
>
)
)
})
})
}
}
<
/div
>
<
/div
>
)
)
})
})
:
tabs
.
map
((
item
,
index
)
=>
{
:
tabs
.
map
((
item
,
index
)
=>
{
const
todayLives
=
preheatLives
[
item
.
title
]
const
todayLives
=
preheatLives
[
item
.
title
]
return
(
return
(
<
div
key
=
{
index
}
>
<
div
key
=
{
index
}
>
{
{
todayLives
.
map
((
item
,
index
)
=>
{
todayLives
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
LiveContent
item
=
{
item
}
key
=
{
index
}
makeSubscribe
=
{
this
.
makeSubscribe
}
toLiveRoom
=
{
this
.
toLiveRoom
}
/
>
<
LiveContent
item
=
{
item
}
key
=
{
index
}
makeSubscribe
=
{
this
.
makeSubscribe
}
toLiveRoom
=
{
this
.
toLiveRoom
}
/
>
)
)
})
})
}
}
...
@@ -201,7 +235,9 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) {
...
@@ -201,7 +235,9 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) {
<
/div
>
<
/div
>
{
{
item
[
'on_live'
]
item
[
'on_live'
]
?
<
button
className
=
{
'on-living'
}
onClick
=
{()
=>
{
toLiveRoom
(
item
[
'room_url'
])}}
>
正在直播
<
/button
>
?
<
button
className
=
{
'on-living'
}
onClick
=
{()
=>
{
toLiveRoom
(
item
[
'room_url'
])
}}
>
正在直播
<
/button
>
:
:
item
[
'is_end'
]
item
[
'is_end'
]
?
<
button
className
=
{
'subscribed'
}
>
已结束
<
/button
>
?
<
button
className
=
{
'subscribed'
}
>
已结束
<
/button
>
...
...
src/components/blessingPreheat/live/index.scss
View file @
b103a56c
...
@@ -227,12 +227,27 @@
...
@@ -227,12 +227,27 @@
.content
{
.content
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
flex-direction
:
column
;
align-items
:
center
;
img
{
img
{
width
:
120px
;
width
:
120px
;
height
:
120px
;
height
:
120px
;
margin-top
:
10px
;
}
}
}
}
.save-image
{
width
:
133px
;
height
:
30px
;
margin-top
:
16px
;
background
:
rgba
(
83
,
39
,
250
,
1
);
border-radius
:
15px
;
font-size
:
14px
;
color
:
#fff
;
-webkit-appearance
:
none
;
outline
:
0
;
border
:
none
;
}
}
}
src/components/blessingPreheat/luckDraw/index.scss
View file @
b103a56c
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
.prize__content
{
.prize__content
{
display
:
flex
;
display
:
flex
;
flex-wrap
:
nowrap
;
flex-wrap
:
nowrap
;
padding
:
10px
7px
0
;
padding
:
10px
7px
0
0
;
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
...
...
src/components/blessingPreheat/recordPopup/index.js
View file @
b103a56c
...
@@ -41,6 +41,7 @@ export default class RecordPopup extends Component {
...
@@ -41,6 +41,7 @@ export default class RecordPopup extends Component {
<
/div
>
<
/div
>
<
div
className
=
"table__body"
>
<
div
className
=
"table__body"
>
{
{
recordList
.
length
>
0
?
recordList
.
map
((
item
,
index
)
=>
{
recordList
.
map
((
item
,
index
)
=>
{
return
(
<
div
className
=
"tr__container"
key
=
{
index
}
>
return
(
<
div
className
=
"tr__container"
key
=
{
index
}
>
<
span
className
=
"tr"
>
{
item
.
submit_time
}
<
/span
>
<
span
className
=
"tr"
>
{
item
.
submit_time
}
<
/span
>
...
@@ -54,7 +55,8 @@ export default class RecordPopup extends Component {
...
@@ -54,7 +55,8 @@ export default class RecordPopup extends Component {
<
/span
>
<
/span
>
<
/div
>
<
/div
>
)
)
})
}):
<
div
className
=
{
'notdata'
}
>
暂无测试记录
<
/div
>
}
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/components/blessingPreheat/recordPopup/index.scss
View file @
b103a56c
...
@@ -14,10 +14,9 @@
...
@@ -14,10 +14,9 @@
.gift__record
{
.gift__record
{
width
:
300px
;
width
:
300px
;
height
:
250px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
5px
;
border-radius
:
5px
;
padding
:
18px
24px
0
24px
;
padding
:
18px
24px
30px
24px
;
position
:
relative
;
position
:
relative
;
span
.tr
{
span
.tr
{
display
:
flex
;
display
:
flex
;
...
@@ -60,7 +59,6 @@
...
@@ -60,7 +59,6 @@
}
}
.table__body
{
.table__body
{
width
:
250px
;
width
:
250px
;
height
:
102px
;
border
:
1px
solid
rgba
(
207
,
219
,
229
,
0
.4
);
border
:
1px
solid
rgba
(
207
,
219
,
229
,
0
.4
);
border-radius
:
0px
0px
1px
1px
;
border-radius
:
0px
0px
1px
1px
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
...
@@ -78,10 +76,15 @@
...
@@ -78,10 +76,15 @@
}
}
}
}
}
}
.notdata
{
text-align
:
center
;
color
:
#999999
;
line-height
:
35px
;
}
.close__button
{
.close__button
{
width
:
32
px
;
width
:
24
px
;
height
:
32
px
;
height
:
24
px
;
border-radius
:
50%
;
border-radius
:
50%
;
position
:
absolute
;
position
:
absolute
;
left
:
50%
;
left
:
50%
;
...
@@ -92,7 +95,7 @@
...
@@ -92,7 +95,7 @@
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
i
{
i
{
font-size
:
32
px
;
font-size
:
24
px
;
color
:
#fff
;
color
:
#fff
;
}
}
}
}
...
...
src/components/blessingPreheat/sharePopup/index.js
View file @
b103a56c
...
@@ -19,7 +19,7 @@ export default class SharePopup extends Component {
...
@@ -19,7 +19,7 @@ export default class SharePopup extends Component {
<
div
className
=
"share__content"
>
<
div
className
=
"share__content"
>
<
p
className
=
"share__text"
>
分享活动页到朋友圈、
qq
、微博分别
<
/p
>
<
p
className
=
"share__text"
>
分享活动页到朋友圈、
qq
、微博分别
<
/p
>
<
div
className
=
'share__rule'
>
<
div
className
=
'share__rule'
>
<
img
src
=
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/add2.png'
/>
<
img
className
=
{
'share__add2'
}
src
=
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/add2.png'
/>
<
span
>
(每个平台每天一次)
<
/span
>
<
span
>
(每个平台每天一次)
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
src/components/blessingPreheat/sharePopup/index.scss
View file @
b103a56c
...
@@ -45,5 +45,8 @@
...
@@ -45,5 +45,8 @@
font-size
:
12px
;
font-size
:
12px
;
color
:
#525C65
;
color
:
#525C65
;
}
}
.share__add2
{
width
:
95px
;
}
}
}
}
}
\ No newline at end of file
src/components/order/deposit/final-order/index.js
View file @
b103a56c
...
@@ -400,8 +400,9 @@ class FinalDepositOrder extends Component {
...
@@ -400,8 +400,9 @@ class FinalDepositOrder extends Component {
getBalanceOffset
=
()
=>
{
getBalanceOffset
=
()
=>
{
let
originalTotalPrice
=
this
.
getOriginTotalPrice
()
let
originalTotalPrice
=
this
.
getOriginTotalPrice
()
let
offset
=
parseFloat
(
this
.
state
.
user_account
)
-
parseFloat
(
originalTotalPrice
)
let
currentPrice
=
this
.
moneyOff
(
originalTotalPrice
)
offset
=
offset
>=
0
?
originalTotalPrice
:
this
.
state
.
user_account
let
offset
=
parseFloat
(
this
.
state
.
user_account
)
-
parseFloat
(
currentPrice
)
offset
=
offset
>=
0
?
currentPrice
:
this
.
state
.
user_account
return
offset
return
offset
}
}
...
...
src/components/passport/bindingTel/index.js
View file @
b103a56c
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
import
'./binding-tel.scss'
import
'./binding-tel.scss'
import
{
withFormik
,
Field
,
Form
}
from
"formik"
;
import
{
withFormik
,
Field
,
Form
}
from
"formik"
import
{
http
,
getParam
}
from
"@/utils"
;
import
{
http
,
getParam
}
from
"@/utils"
import
{
compose
}
from
"redux"
;
import
{
compose
}
from
"redux"
import
{
connect
}
from
"react-redux"
;
import
{
connect
}
from
"react-redux"
import
{
setCurrentUser
}
from
"@/store/userAction"
;
import
{
setCurrentUser
}
from
"@/store/userAction"
import
Captcha
from
'@/common/Captcha'
import
Captcha
from
'@/common/Captcha'
import
{
HeaderBar
}
from
'@/common'
import
{
HeaderBar
}
from
'@/common'
...
@@ -13,8 +13,8 @@ import { HeaderBar } from '@/common'
...
@@ -13,8 +13,8 @@ import { HeaderBar } from '@/common'
import
ClearableInput
from
'../common/clearableInputWithCountryCodes'
import
ClearableInput
from
'../common/clearableInputWithCountryCodes'
import
Button
from
'../common/Button'
import
Button
from
'../common/Button'
import
VeriCodeInput
from
'../common/veriCodeInput'
import
VeriCodeInput
from
'../common/veriCodeInput'
import
{
Toast
}
from
"antd-mobile"
;
import
{
Toast
}
from
"antd-mobile"
import
{
isEmpty
}
from
"lodash"
;
import
{
isEmpty
}
from
"lodash"
class
BindingTel
extends
Component
{
class
BindingTel
extends
Component
{
...
@@ -95,7 +95,7 @@ class BindingTel extends Component {
...
@@ -95,7 +95,7 @@ class BindingTel extends Component {
<
/Form
>
<
/Form
>
<
/div
>
<
/div
>
<
/
>
<
/
>
);
)
}
}
}
}
...
@@ -123,22 +123,23 @@ const formikConfig = {
...
@@ -123,22 +123,23 @@ const formikConfig = {
phone_num
:
values
.
tel
,
phone_num
:
values
.
tel
,
phone_code
:
values
.
veriCode
,
phone_code
:
values
.
veriCode
,
mkey
:
getParam
(
'mkey'
),
mkey
:
getParam
(
'mkey'
),
area_code
:
'00'
+
props
.
country
.
num
,
area_code
:
'00'
+
props
.
country
.
num
,
plat
:
5
plat
:
5
}).
then
(
res
=>
{
}).
then
(
res
=>
{
const
data
=
res
.
data
const
data
=
res
.
data
if
(
data
.
errno
==
200
)
{
if
(
data
.
errno
==
200
)
{
if
(
data
.
data
[
'is_set_pwd'
])
{
if
(
data
.
data
[
'is_set_pwd'
])
{
props
.
setCurrentUser
({
const
{
history
}
=
props
history
.
replace
(
`/passport/set-password`
,
{
user
:
{
hasError
:
false
,
hasError
:
false
,
data
:
{
data
:
{
uid
:
data
.
data
.
uid
uid
:
data
.
data
.
uid
},
},
msg
:
data
.
data
.
msg
,
msg
:
data
.
data
.
msg
,
stage
:
'binding'
stage
:
'binding'
}
})
})
props
.
history
.
replace
(
`/passport/set-password`
)
}
else
{
}
else
{
location
.
assign
(
data
.
data
[
'jump_url'
])
location
.
assign
(
data
.
data
[
'jump_url'
])
}
}
...
@@ -156,4 +157,4 @@ export default compose(
...
@@ -156,4 +157,4 @@ export default compose(
{
setCurrentUser
}
{
setCurrentUser
}
),
),
withFormik
(
formikConfig
),
withFormik
(
formikConfig
),
)(
BindingTel
)
;
)(
BindingTel
)
src/components/passport/index.js
View file @
b103a56c
...
@@ -23,6 +23,7 @@ class Passport extends Component {
...
@@ -23,6 +23,7 @@ class Passport extends Component {
redirectURL
=
'/'
redirectURL
=
'/'
count
=
1
count
=
1
blackList
=
new
Set
([
'/passport/binding-tel'
,
'/passport/set-password'
])
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
...
@@ -85,7 +86,7 @@ class Passport extends Component {
...
@@ -85,7 +86,7 @@ class Passport extends Component {
routeWhenUserLoggedIn
=
()
=>
{
routeWhenUserLoggedIn
=
()
=>
{
let
{
hasError
}
=
this
.
props
.
user
let
{
hasError
}
=
this
.
props
.
user
if
(
!
hasError
)
{
if
(
!
hasError
&&
!
this
.
blackList
.
has
(
this
.
props
.
location
.
pathname
)
)
{
const
redirectURI
=
getParam
(
'redirect'
)
const
redirectURI
=
getParam
(
'redirect'
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
this
.
props
.
history
.
go
(
-
this
.
count
)
redirectURI
?
(
window
.
location
.
href
=
redirectURI
)
:
this
.
props
.
history
.
go
(
-
this
.
count
)
}
}
...
@@ -108,7 +109,9 @@ class Passport extends Component {
...
@@ -108,7 +109,9 @@ class Passport extends Component {
<
Route
path
=
{
match
.
url
+
'/account-login'
}
component
=
{
AccountLogin
}
/
>
<
Route
path
=
{
match
.
url
+
'/account-login'
}
component
=
{
AccountLogin
}
/
>
<
Route
path
=
{
match
.
url
+
'/forgot-password'
}
component
=
{
ForgotPassword
}
/
>
<
Route
path
=
{
match
.
url
+
'/forgot-password'
}
component
=
{
ForgotPassword
}
/
>
<
Route
path
=
{
match
.
url
+
'/forgot-password-email'
}
component
=
{
ForgotPasswordEmail
}
/
>
<
Route
path
=
{
match
.
url
+
'/forgot-password-email'
}
component
=
{
ForgotPasswordEmail
}
/
>
<
Route
path
=
{
match
.
url
+
'/set-password'
}
component
=
{
SetPassword
}
/
>
<
Route
path
=
{
match
.
url
+
'/set-password'
}
render
=
{
props
=>
{
return
<
SetPassword
{...
props
}
count
=
{
this
.
count
}
/
>
}}
/
>
<
Route
path
=
{
match
.
url
+
'/binding-tel'
}
component
=
{
BindingTel
}
/
>
<
Route
path
=
{
match
.
url
+
'/binding-tel'
}
component
=
{
BindingTel
}
/
>
<
/Switch
>
<
/Switch
>
<
/div
>
<
/div
>
...
...
src/components/passport/setPassword/index.js
View file @
b103a56c
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
import
'./set-password.scss'
import
'./set-password.scss'
import
{
withFormik
,
Form
,
Field
}
from
"formik"
;
import
{
withFormik
,
Form
,
Field
}
from
"formik"
import
PasswordInput
from
'../common/passwordInput'
import
PasswordInput
from
'../common/passwordInput'
import
Button
from
'../common/Button'
import
Button
from
'../common/Button'
import
classnames
from
'classnames'
import
classnames
from
'classnames'
import
{
compose
}
from
'redux'
import
{
compose
}
from
'redux'
import
{
HeaderBar
}
from
"@/common"
;
import
{
HeaderBar
}
from
"@/common"
import
{
http
,
api
}
from
"@/utils"
;
import
{
http
}
from
"@/utils"
import
{
Toast
}
from
"antd-mobile"
;
import
{
Toast
}
from
"antd-mobile"
import
{
encrypt
}
from
"@/components/passport/encryption"
;
import
{
encrypt
}
from
"@/components/passport/encryption"
import
{
Link
}
from
"react-router-dom"
;
import
{
Link
}
from
"react-router-dom"
import
{
isEmpty
}
from
"lodash"
;
import
{
isEmpty
}
from
"lodash"
import
{
connect
}
from
"react-redux"
;
import
{
connect
}
from
"react-redux"
import
{
setCurrentUser
}
from
'@/store/userAction'
class
SetPassword
extends
Component
{
class
SetPassword
extends
Component
{
render
()
{
render
()
{
...
@@ -56,7 +56,7 @@ class SetPassword extends Component {
...
@@ -56,7 +56,7 @@ class SetPassword extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
>
<
/
>
);
)
}
}
}
}
...
@@ -71,7 +71,7 @@ const formikConfig = {
...
@@ -71,7 +71,7 @@ const formikConfig = {
let
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
||
{
pathname
:
'/'
}
let
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
||
{
pathname
:
'/'
}
if
(
from
.
pathname
.
includes
(
'forgot-password'
))
{
if
(
from
.
pathname
.
includes
(
'forgot-password'
))
{
forgotPasswordReset
(
values
,
props
);
forgotPasswordReset
(
values
,
props
)
}
else
{
}
else
{
bindMobileSetPassword
(
values
,
props
)
bindMobileSetPassword
(
values
,
props
)
}
}
...
@@ -80,7 +80,7 @@ const formikConfig = {
...
@@ -80,7 +80,7 @@ const formikConfig = {
validateOnChange
:
false
,
validateOnChange
:
false
,
validate
:
values
=>
{
validate
:
values
=>
{
let
errors
=
{}
let
errors
=
{}
const
re
=
/^
(?![
0-9
]
+$
)(?![
a-zA-Z
]
+$
)[
0-9A-Za-z
]{6,16}
$/
;
const
re
=
/^
(?![
0-9
]
+$
)(?![
a-zA-Z
]
+$
)[
0-9A-Za-z
]{6,16}
$/
if
(
!
re
.
test
(
values
.
password
))
{
if
(
!
re
.
test
(
values
.
password
))
{
errors
.
password
=
'密码需要包含6-16位字母及数字'
errors
.
password
=
'密码需要包含6-16位字母及数字'
Toast
.
info
(
errors
.
password
,
2
,
null
,
false
)
Toast
.
info
(
errors
.
password
,
2
,
null
,
false
)
...
@@ -122,10 +122,17 @@ function bindMobileSetPassword(values, props) {
...
@@ -122,10 +122,17 @@ function bindMobileSetPassword(values, props) {
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
data
.
errno
==
200
)
{
if
(
res
.
data
.
errno
==
200
)
{
const
{
location
,
history
}
=
props
Toast
.
info
(
'密码设置成功'
)
Toast
.
info
(
'密码设置成功'
)
let
from
=
props
.
location
.
state
&&
props
.
location
.
state
.
from
||
{
pathname
:
'/'
}
let
from
=
location
.
state
&&
location
.
state
.
from
||
{
pathname
:
'/'
}
let
local_redirect_url
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'binding_redirect'
))
setTimeout
(
function
()
{
setTimeout
(
function
()
{
props
.
history
.
replace
(
from
.
pathname
)
if
(
local_redirect_url
)
{
const
{
pathname
,
search
,
hash
}
=
local_redirect_url
history
.
replace
(
pathname
+
search
+
hash
)
}
else
{
history
.
replace
(
from
.
pathname
)
}
},
1000
)
},
1000
)
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
,
null
,
false
)
Toast
.
info
(
res
.
data
.
msg
,
2
,
null
,
false
)
...
@@ -136,7 +143,7 @@ function bindMobileSetPassword(values, props) {
...
@@ -136,7 +143,7 @@ function bindMobileSetPassword(values, props) {
export
default
compose
(
export
default
compose
(
connect
(
connect
(
state
=>
({
user
:
state
.
user
}),
state
=>
({
user
:
state
.
user
}),
null
{
setCurrentUser
}
),
),
withFormik
(
formikConfig
)
withFormik
(
formikConfig
)
)(
SetPassword
);
)(
SetPassword
)
\ No newline at end of file
src/utils/index.js
View file @
b103a56c
...
@@ -83,7 +83,9 @@ const browser = (function () {
...
@@ -83,7 +83,9 @@ const browser = (function () {
isWeixin
:
/MicroMessenger/i
.
test
(
ua
),
isWeixin
:
/MicroMessenger/i
.
test
(
ua
),
isAndroid
:
/Android/i
.
test
(
ua
),
isAndroid
:
/Android/i
.
test
(
ua
),
isIOS
:
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/i
.
test
(
ua
),
isIOS
:
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/i
.
test
(
ua
),
isIPad
:
/iPad/i
.
test
(
ua
)
isIPad
:
/iPad/i
.
test
(
ua
),
isAndroidApp
:
/Android/i
.
test
(
ua
)
&&
getParam
(
'version'
),
isIOSApp
:
/iPhone/i
.
test
(
ua
)
&&
getParam
(
'version'
)
}
}
})()
})()
...
...
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