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
17e3abe3
Commit
17e3abe3
authored
Dec 10, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决TODO遗留问题
parent
17f16952
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
20 deletions
+45
-20
src/components/activity/newyear-2019/myTreasure/index.js
+4
-0
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
+17
-14
src/components/activity/newyear-2019/treasure-box/team.js
+24
-6
No files found.
src/components/activity/newyear-2019/myTreasure/index.js
View file @
17e3abe3
...
...
@@ -64,6 +64,10 @@ class MyTreasure extends Component {
isEmpty
:
false
,
teams
,
});
}
else
{
this
.
setState
({
isEmpty
:
true
,
});
}
}
});
...
...
src/components/activity/newyear-2019/preheat/LiveRoom/index.js
View file @
17e3abe3
...
...
@@ -39,12 +39,13 @@ class LiveRoom extends Component {
// 预约直播
subscribe
=
(
id
)
=>
{
// 检查是否已登录
this
.
checkLogin
();
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/sys/createLiveQrcode/
${
id
}
`
).
then
(
res
=>
{
let
{
errno
,
data
,
msg
}
=
res
.
data
;
console
.
log
(
res
);
if
(
errno
===
200
)
{
// TODO 显示二维码地址 并且传递给二维码的图片/地址
QRCode
.
toDataURL
(
data
.
url
,
(
err
,
url
)
=>
{
this
.
setState
({
showMark
:
true
,
...
...
@@ -56,22 +57,31 @@ class LiveRoom extends Component {
}
});
}
}
// 已预约 给提示
tip
=
()
=>
{
Toast
.
info
(
'你已预约该直播'
);
}
// 去直播间
toLivingRoom
=
(
id
)
=>
{
this
.
checkLogin
();
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
}
else
{
window
.
location
.
href
=
`
${
window
.
location
.
protocol
}
//www.julyedu.com/live/m_room/
${
id
}
`
}
}
// 查看回放
checkVideo
=
(
url
)
=>
{
this
.
checkLogin
();
// TODO 这里需要课程ID 如何获取?
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
}
else
{
const
vCourseId
=
url
.
split
(
'/'
)[
0
];
history
.
push
(
`/play/video?id=
${
vCourseId
}
`
)
}
}
// 关闭弹框
closePopup
=
()
=>
{
this
.
setState
({
...
...
@@ -80,15 +90,8 @@ class LiveRoom extends Component {
// 关闭弹框的时候再次查询接口 查询预约状态
this
.
getLiveInfo
();
}
// 检查是否登录
checkLogin
=
()
=>
{
const
{
hasError
,
data
=
{}}
=
this
.
props
.
user
;
if
(
hasError
)
{
// 未登录
return
;
}
}
//
TODO
APP内需要保存图片 是否还是这样做 需要确认
// APP内需要保存图片 是否还是这样做 需要确认
saveImage
=
()
=>
{
let
version
=
getParam
(
'version'
)
version
=
typeof
version
===
'string'
?
version
.
replace
(
'.'
,
''
).
replace
(
'.'
,
''
).
slice
(
0
,
3
)
:
''
...
...
src/components/activity/newyear-2019/treasure-box/team.js
View file @
17e3abe3
...
...
@@ -10,7 +10,7 @@ class TeamInfo extends Component {
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
is_my_team
:
tru
e
,
// 是否有自己的队伍
is_my_team
:
fals
e
,
// 是否有自己的队伍
prize_info
:
[],
info
:
{
removable
:
0
,
...
...
@@ -18,6 +18,7 @@ class TeamInfo extends Component {
},
member
:
[],
removable_data
:
[],
my_team
:
{},
}
}
...
...
@@ -30,13 +31,14 @@ class TeamInfo extends Component {
http
.
get
(
`
${
API
.
home
}
/sys/treasure/teamInfo`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
const
{
prize_info
,
is_my_team
,
info
,
member
,
removable_data
}
=
data
;
const
{
prize_info
,
is_my_team
,
info
,
member
,
removable_data
,
my_team
}
=
data
;
this
.
setState
({
prize_info
,
is_my_team
,
info
,
member
:
this
.
fillTeam
(
member
),
removable_data
removable_data
,
my_team
})
}
else
{
Toast
.
info
(
msg
);
...
...
@@ -51,10 +53,12 @@ class TeamInfo extends Component {
}
else
{
let
search
=
''
;
if
(
close
)
{
const
{
removable_data
}
=
this
.
state
;
const
{
removable_data
,
info
:
{
removable
}}
=
this
.
state
;
if
(
removable
>
0
)
{
let
current
=
removable_data
[
0
];
search
=
`?team_num=
${
current
.
team_num
}
&owner_uid=
${
current
.
captain_uid
}
`
;
}
}
this
.
props
.
history
.
push
(
`/year/yearTreasure
${
search
}
`
);
}
...
...
@@ -65,8 +69,22 @@ class TeamInfo extends Component {
if
(
this
.
props
.
user
.
hasError
)
{
this
.
props
.
history
.
push
(
'/passport/login'
);
}
else
{
// TODO 跳转到邀请落地页需要什么参数
this
.
props
.
history
.
push
(
'/activity/newyear-2019/landing'
)
const
{
is_my_team
,
my_team
:
{
treasure_code
}}
=
this
.
state
;
if
(
is_my_team
)
{
// 有自己的队伍
// 直接跳转
this
.
props
.
history
.
push
(
'/activity/newyear-2019/landing?origin=1&treasure_code='
+
treasure_code
);
}
else
{
// 没自己的队伍
// 请求创建队伍的接口
http
.
get
(
`
${
API
.
home
}
/sys/treasure/createMyTeam`
).
then
(
res
=>
{
const
{
code
,
data
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
const
{
treasure_code
}
=
data
;
this
.
props
.
history
.
push
(
'/activity/newyear-2019/landing?origin=1&treasure_code='
+
treasure_code
);
}
else
{
Toast
.
info
(
msg
);
}
});
}
}
}
...
...
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