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
e5c819e7
Commit
e5c819e7
authored
Dec 16, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录功能和APP进行交互
parent
dd481c7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
+12
-3
src/components/activity/newyear-2019/treasure-box/team.js
+12
-3
No files found.
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
View file @
e5c819e7
...
@@ -41,7 +41,7 @@ class LiveRoom extends Component {
...
@@ -41,7 +41,7 @@ class LiveRoom extends Component {
// 检查是否已登录
// 检查是否已登录
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
this
.
toLogin
(
);
}
else
{
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/createLiveQrcode/
${
id
}
`
).
then
(
res
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/createLiveQrcode/
${
id
}
`
).
then
(
res
=>
{
let
{
errno
,
data
,
msg
}
=
res
.
data
;
let
{
errno
,
data
,
msg
}
=
res
.
data
;
...
@@ -67,7 +67,7 @@ class LiveRoom extends Component {
...
@@ -67,7 +67,7 @@ class LiveRoom extends Component {
toLivingRoom
=
(
id
)
=>
{
toLivingRoom
=
(
id
)
=>
{
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
this
.
toLogin
(
);
}
else
{
}
else
{
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
}
`
}
}
...
@@ -76,7 +76,7 @@ class LiveRoom extends Component {
...
@@ -76,7 +76,7 @@ class LiveRoom extends Component {
checkVideo
=
(
url
)
=>
{
checkVideo
=
(
url
)
=>
{
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
this
.
toLogin
(
);
}
else
{
}
else
{
const
vCourseId
=
url
.
split
(
'/'
)[
0
];
const
vCourseId
=
url
.
split
(
'/'
)[
0
];
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
...
@@ -103,6 +103,15 @@ class LiveRoom extends Component {
...
@@ -103,6 +103,15 @@ class LiveRoom extends Component {
}
}
}
}
// 去登录
toLogin
=
()
=>
{
if
(
!
getParam
(
'version'
))
{
this
.
props
.
history
.
push
(
'/passport/login'
)
}
else
{
SendMessageToApp
(
"toLogin"
)
}
}
render
()
{
render
()
{
const
{
list
,
showMark
,
subUrl
}
=
this
.
state
;
const
{
list
,
showMark
,
subUrl
}
=
this
.
state
;
return
(
return
(
...
...
src/components/activity/newyear-2019/treasure-box/team.js
View file @
e5c819e7
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
'./team.scss'
import
'./team.scss'
import
{
getParam
,
http
,
SendMessageToApp
,
browser
}
from
"@/utils"
import
{
getParam
,
http
,
SendMessageToApp
}
from
"@/utils"
import
{
Toast
}
from
'antd-mobile'
;
import
{
Toast
}
from
'antd-mobile'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
{
withRouter
}
from
'react-router-dom'
;
import
{
compose
}
from
"redux"
import
{
compose
}
from
"redux"
...
@@ -54,7 +54,7 @@ class TeamInfo extends Component {
...
@@ -54,7 +54,7 @@ class TeamInfo extends Component {
// 跳转到我的宝箱页
// 跳转到我的宝箱页
toYearTreasure
=
(
close
)
=>
{
toYearTreasure
=
(
close
)
=>
{
if
(
this
.
props
.
user
.
hasError
)
{
if
(
this
.
props
.
user
.
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
this
.
toLogin
(
);
}
else
{
}
else
{
let
search
=
''
;
let
search
=
''
;
if
(
close
)
{
if
(
close
)
{
...
@@ -69,10 +69,19 @@ class TeamInfo extends Component {
...
@@ -69,10 +69,19 @@ class TeamInfo extends Component {
}
}
// 去登录
toLogin
=
()
=>
{
if
(
!
getParam
(
'version'
))
{
this
.
props
.
history
.
push
(
'/passport/login'
)
}
else
{
SendMessageToApp
(
"toLogin"
)
}
}
// 邀请好友组队
// 邀请好友组队
createTeam
=
()
=>
{
createTeam
=
()
=>
{
if
(
this
.
props
.
user
.
hasError
)
{
if
(
this
.
props
.
user
.
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
this
.
toLogin
(
);
}
else
{
}
else
{
const
{
is_my_team
,
my_team
:
{
treasure_code
}}
=
this
.
state
;
const
{
is_my_team
,
my_team
:
{
treasure_code
}}
=
this
.
state
;
if
(
is_my_team
)
{
// 有自己的队伍
if
(
is_my_team
)
{
// 有自己的队伍
...
...
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