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
ffd2edad
Commit
ffd2edad
authored
Oct 31, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '11-11' of gitlab.julyedu.com:baiguangyao/mr-julyedu into 11-11
parents
685cdb40
b04ec87d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
src/components/blessingPreheat/index.js
+1
-1
src/components/blessingPreheat/live/index.js
+22
-7
No files found.
src/components/blessingPreheat/index.js
View file @
ffd2edad
...
...
@@ -404,7 +404,7 @@ class BlessingPreheat extends Component {
<
RankList
><
/RankList
>
<
Live
><
/Live
>
<
Live
isFormal
=
{
isFormal
}
><
/Live
>
<
/div
>
)
}
...
...
src/components/blessingPreheat/live/index.js
View file @
ffd2edad
import
React
,
{
Component
}
from
'react'
import
'./index.scss'
import
{
Tabs
,
Toast
}
from
"antd-mobile"
import
{
htt
p
}
from
"@/utils"
import
{
getParam
,
http
,
SendMessageToAp
p
}
from
"@/utils"
import
{
Popup
}
from
"@common/index"
import
QRCode
from
'qrcode'
import
{
uniqBy
}
from
'lodash'
import
{
connect
}
from
'react-redux'
import
{
withRouter
}
from
'react-router-dom'
const
isFormal
=
false
@
connect
(
state
=>
({
user
:
state
.
user
}))
class
Live
extends
Component
{
state
=
{
...
...
@@ -16,7 +18,8 @@ class Live extends Component {
preheatLives
:
[],
visible
:
false
,
qrcode
:
''
,
today
:
''
today
:
''
,
isApp
:
getParam
(
'version'
)
}
...
...
@@ -36,7 +39,7 @@ class Live extends Component {
},
{})
let
tabs
,
today
if
(
isFormal
)
{
if
(
this
.
props
.
isFormal
)
{
tabs
=
Object
.
keys
(
lives
).
map
(
item
=>
({
title
:
item
}))
today
=
uniqBy
(
data
.
data
[
'data_active'
],
value
=>
value
.
date
).
findIndex
(
item
=>
item
[
'is_today'
])
}
else
{
...
...
@@ -59,7 +62,19 @@ class Live extends Component {
})
}
toLiveRoom
=
id
=>
{
if
(
this
.
state
.
isApp
)
{
SendMessageToApp
(
'toLiveRoom'
,
id
)
}
else
{
window
.
location
.
href
=
`
${
window
.
location
.
protocol
}
//www.julyedu.com/live/m_room/
${
id
}
`
}
}
makeSubscribe
=
id
=>
{
const
{
user
,
history
}
=
this
.
props
if
(
user
.
hasError
)
{
history
.
push
(
'/passport/login'
)
}
http
.
get
(
`
${
API
.
home
}
/sys/createLiveQrcode/
${
id
}
`
)
.
then
(
res
=>
{
const
{
data
}
=
res
...
...
@@ -102,7 +117,7 @@ class Live extends Component {
initialPage
=
{
today
}
>
{
isFormal
this
.
props
.
isFormal
?
tabs
.
map
((
item
,
index
)
=>
{
const
todayLives
=
lives
[
item
.
title
]
return
(
...
...
@@ -172,7 +187,7 @@ function LiveContent({item, makeSubscribe}) {
<
/div
>
{
item
[
'on_live'
]
?
<
button
className
=
{
'on-living'
}
>
正在直播
<
/button
>
?
<
button
className
=
{
'on-living'
}
onClick
=
{
this
.
toLiveRoom
.
bind
(
this
,
item
[
'live_id'
])}
>
正在直播
<
/button
>
:
item
[
'is_subscribe'
]
?
<
button
className
=
{
'subscribed'
}
>
已预约
<
/button
>
...
...
@@ -183,4 +198,4 @@ function LiveContent({item, makeSubscribe}) {
)
}
export
default
Live
export
default
withRouter
(
Live
)
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