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
98da329f
Commit
98da329f
authored
Nov 02, 2019
by
FE
Browse files
Options
Browse Files
Download
Plain Diff
3
parents
1b556ef3
6dd7b3c9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletions
+36
-1
src/components/blessingPreheat/collectBlessing/index.js
+1
-1
src/components/blessingPreheat/courseList/index.js
+35
-0
src/components/blessingPreheat/index.js
+0
-0
No files found.
src/components/blessingPreheat/collectBlessing/index.js
View file @
98da329f
...
@@ -8,7 +8,7 @@ import ListHeader from './../listHeader';
...
@@ -8,7 +8,7 @@ import ListHeader from './../listHeader';
import
'./index.scss'
;
import
'./index.scss'
;
@
connect
(({
user
})
=>
({
@
connect
(({
user
})
=>
({
uid
:
user
.
data
.
uid
||
''
uid
:
user
&&
user
.
data
&&
user
.
data
.
uid
?
user
.
data
.
uid
:
''
}))
}))
class
CollectBlessing
extends
Component
{
class
CollectBlessing
extends
Component
{
...
...
src/components/blessingPreheat/courseList/index.js
View file @
98da329f
...
@@ -6,6 +6,7 @@ import ListFrame from './../listFrame/index';
...
@@ -6,6 +6,7 @@ import ListFrame from './../listFrame/index';
import
CourseItem
from
'./../courseItem/index'
;
import
CourseItem
from
'./../courseItem/index'
;
import
ListHeader
from
'./../listHeader'
;
import
ListHeader
from
'./../listHeader'
;
import
'./index.scss'
;
import
'./index.scss'
;
import
cookie
from
"js-cookie"
;
class
CourseList
extends
Component
{
class
CourseList
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -62,6 +63,27 @@ class CourseList extends Component {
...
@@ -62,6 +63,27 @@ class CourseList extends Component {
this
.
fetchAICourse
(
'four'
);
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
)
=>
{
fetchAICourse
=
(
key
)
=>
{
const
{
basic
,
advanced
,
higher
,
expand
}
=
this
.
state
;
const
{
basic
,
advanced
,
higher
,
expand
}
=
this
.
state
;
http
.
get
(
`
${
API
.
home
}
/sys/ai_grow_up_courses/
${
key
}
`
).
then
(
res
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/ai_grow_up_courses/
${
key
}
`
).
then
(
res
=>
{
...
@@ -222,6 +244,9 @@ class CourseList extends Component {
...
@@ -222,6 +244,9 @@ class CourseList extends Component {
toReceiveCoupon
(
id
,
key
=
''
)
{
toReceiveCoupon
(
id
,
key
=
''
)
{
const
{
isLogin
,
toLogin
}
=
this
.
props
;
const
{
isLogin
,
toLogin
}
=
this
.
props
;
alert
(
cookie
.
get
(
"uid"
))
if
(
isLogin
)
{
if
(
isLogin
)
{
http
.
post
(
`
${
API
.
home
}
/sys/activity/coupon/receive`
,
{
http
.
post
(
`
${
API
.
home
}
/sys/activity/coupon/receive`
,
{
course_id
:
id
course_id
:
id
...
@@ -405,12 +430,22 @@ class CourseList extends Component {
...
@@ -405,12 +430,22 @@ class CourseList extends Component {
<
em
>
¥
{
item
.
coupon
}
<
/em
>
<
em
>
¥
{
item
.
coupon
}
<
/em
>
<
i
>
代金券
<
/i
>
<
i
>
代金券
<
/i
>
<
/span
>
<
/span
>
<<<<<<<
HEAD
<
span
className
=
"coupon-course__button-label"
>
立即领券
<
/span
>
<
span
className
=
"coupon-course__button-label"
>
立即领券
<
/span
>
<
/a
>
<
/a
>
}
}
{
{
(
isFormal
===
0
&&
item
.
course_status
===
2
)
&&
(
isFormal
===
0
&&
item
.
course_status
===
2
)
&&
<
a
className
=
"coupon-course__button"
>
<
a
className
=
"coupon-course__button"
>
=======
<
span
className
=
"coupon-course__button-label"
>
立即领券
<
/span
>
<
/a
>
}
{
(
isFormal
===
0
&&
item
.
course_status
===
2
)
&&
<
a
className
=
"coupon-course__button"
>
>>>>>>>
6
dd7b3c93601d587e25fa3320135ff2407451de6
<
span
className
=
"coupon-course__button-price"
>
<
span
className
=
"coupon-course__button-price"
>
<
em
>
¥
{
item
.
coupon
}
<
/em
>
<
em
>
¥
{
item
.
coupon
}
<
/em
>
<
i
>
代金券
<
/i
>
<
i
>
代金券
<
/i
>
...
...
src/components/blessingPreheat/index.js
View file @
98da329f
This diff is collapsed.
Click to expand it.
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