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
67718390
Commit
67718390
authored
Nov 02, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
pull
parents
f61f8135
9d9cc01d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
8 deletions
+31
-8
src/components/blessingPreheat/collectBlessing/index.js
+1
-1
src/components/blessingPreheat/courseList/index.js
+22
-2
src/components/blessingPreheat/index.js
+8
-5
No files found.
src/components/blessingPreheat/collectBlessing/index.js
View file @
67718390
...
...
@@ -8,7 +8,7 @@ import ListHeader from './../listHeader';
import
'./index.scss'
;
@
connect
(({
user
})
=>
({
uid
:
user
.
data
.
uid
||
''
uid
:
user
&&
user
.
data
&&
user
.
data
.
uid
?
user
.
data
.
uid
:
''
}))
class
CollectBlessing
extends
Component
{
...
...
src/components/blessingPreheat/courseList/index.js
View file @
67718390
...
...
@@ -62,6 +62,27 @@ class CourseList extends Component {
this
.
fetchAICourse
(
'four'
);
}
shouldComponentUpdate
(
nextProps
,
nextState
,
nextContext
)
{
if
(
this
.
props
.
isApp
!==
nextProps
.
isApp
)
{
// 精品课程-集训营、就业班/AI特训营
this
.
fetchCourseData
();
// AI之路-基础
this
.
fetchAICourse
(
'one'
);
// AI之路-进阶
this
.
fetchAICourse
(
'two'
);
// AI之路-高阶
this
.
fetchAICourse
(
'three'
);
// AI之路-拓展
this
.
fetchAICourse
(
'four'
);
return
false
;
}
return
true
;
}
fetchAICourse
=
(
key
)
=>
{
const
{
basic
,
advanced
,
higher
,
expand
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/sys/ai_grow_up_courses/
${
key
}
`
).
then
(
res
=>
{
...
...
@@ -221,8 +242,7 @@ class CourseList extends Component {
}
toReceiveCoupon
(
id
,
key
=
''
)
{
const
{
isLogin
,
toLogin
,
uid
}
=
this
.
props
;
alert
(
uid
)
const
{
isLogin
,
toLogin
}
=
this
.
props
;
if
(
isLogin
)
{
http
.
post
(
`
${
API
.
home
}
/sys/activity/coupon/receive`
,
{
course_id
:
id
...
...
src/components/blessingPreheat/index.js
View file @
67718390
...
...
@@ -81,7 +81,8 @@ class BlessingPreheat extends Component {
},
],
index
:
0
,
userHasError
:
props
.
user
.
hasError
userHasError
:
props
.
user
.
hasError
,
isApp
:
false
}
}
...
...
@@ -110,7 +111,6 @@ class BlessingPreheat extends Component {
this
.
handleToAddBlessing
(
result
);
}
}
...
...
@@ -138,6 +138,9 @@ class BlessingPreheat extends Component {
if
(
cookie
.
get
(
"token"
)
&&
cookie
.
get
(
"uid"
))
{
this
.
fetchUserBlessing
();
this
.
setState
({
isApp
:
true
})
}
this
.
props
.
setCurrentUser
(
this
.
transformUser
(
this
.
state
.
userInfoList
))
...
...
@@ -419,11 +422,11 @@ class BlessingPreheat extends Component {
isSign
,
showRecordList
,
shareMark
,
index
index
,
isApp
}
=
this
.
state
;
const
{
history
}
=
this
.
props
;
const
isLogin
=
!
this
.
props
.
user
.
hasError
const
uid
=
this
.
props
.
user
.
data
.
uid
return
(
<
div
id
=
{
'blessing-preheat'
}
>
<
Banner
...
...
@@ -473,9 +476,9 @@ class BlessingPreheat extends Component {
{
/* 精品课程特惠专区 */
}
<
ListHeader
id
=
{
'best-courses'
}
text
=
"精品课程特惠专区"
styles
=
{{
margin
:
'30px 0 15px'
}}
/
>
<
CourseList
isApp
=
{
isApp
}
isFormal
=
{
isFormal
}
isLogin
=
{
isLogin
}
uid
=
{
uid
}
history
=
{
this
.
props
.
history
}
toLogin
=
{
this
.
toLogin
}
/
>
...
...
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