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
b35786a0
Commit
b35786a0
authored
Oct 30, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
浏览课程加福气值
parent
2da66b1e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
3 deletions
+82
-3
src/components/blessingPreheat/coursePopup/index.js
+1
-1
src/components/detail/index.js
+57
-2
src/components/detail/index.scss
+24
-0
No files found.
src/components/blessingPreheat/coursePopup/index.js
View file @
b35786a0
...
...
@@ -48,7 +48,7 @@ class CoursePopup extends Component {
{
courseList
.
map
(
item
=>
(
<
Link
to
=
{
`/detail?id=
${
item
.
course_id
}
`
}
to
=
{
`/detail?id=
${
item
.
course_id
}
&ac=11
`
}
className
=
"course-popup__item"
key
=
{
item
.
course_id
}
>
...
...
src/components/detail/index.js
View file @
b35786a0
...
...
@@ -48,7 +48,9 @@ class Detail extends Component {
nowPrice
:
0
,
laterPrice
:
0
,
isPdd
:
0
,
// 是否是拼团课程 控制首次单集购买后的 全集购买 接口: 拼团课程走拼团接口,否则直接走购买接口
isRedPacket
:
true
isRedPacket
:
true
,
countDownTime
:
'20s'
,
}
}
...
...
@@ -73,6 +75,51 @@ class Detail extends Component {
isRedPacket
:
true
});
}
if
(
getParam
(
'ac'
)
&&
Number
(
getParam
(
'ac'
))
===
11
)
{
this
.
getBorwerCourse
();
}
}
getBorwerCourse
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/sys/user/blessing`
,
{
type
:
4
,
course_id
:
getParam
(
'id'
)}).
then
(
res
=>
{
let
{
code
,
data
:
{
today_browsed_courses
}}
=
res
.
data
;
if
(
code
===
200
)
{
let
currentCourseId
=
getParam
(
'id'
);
if
(
today_browsed_courses
.
includes
(
Number
(
currentCourseId
)))
{
this
.
setState
({
countDownTime
:
'任务完成'
});
}
else
{
this
.
startActivity
();
}
}
})
}
startActivity
=
()
=>
{
let
_this
=
this
;
let
countDownInterval
=
setInterval
(
function
()
{
let
countDown
=
parseInt
(
_this
.
state
.
countDownTime
);
countDown
--
;
if
(
countDown
>
0
)
{
_this
.
setState
({
countDownTime
:
countDown
+
's'
});
}
else
if
(
countDown
===
0
)
{
clearInterval
(
countDownInterval
);
countDownInterval
=
null
;
http
.
post
(
`
${
API
.
home
}
/sys/add/blessing`
,
{
type
:
4
,
course_id
:
getParam
(
'id'
)}).
then
(
res
=>
{
let
{
code
}
=
res
.
data
;
if
(
code
===
200
)
{
_this
.
setState
({
countDownTime
:
'任务完成'
});
}
})
}
},
1000
)
}
// 判断时候未红包课程
...
...
@@ -443,7 +490,7 @@ class Detail extends Component {
}
render
()
{
const
{
course
:
{
course_info
=
{}},
barInfo
,
singleBox
,
singleType
,
isRedPacket
}
=
this
.
state
;
const
{
course
:
{
course_info
=
{}},
barInfo
,
singleBox
,
singleType
,
isRedPacket
,
countDownTime
}
=
this
.
state
;
let
courseInfo
=
''
,
service
=
''
,
...
...
@@ -471,6 +518,14 @@ class Detail extends Component {
let
isCent
=
course_info
.
pdd_group_info
&&
course_info
.
pdd_group_info
.
price
!=
'0.01'
;
return
(
<
div
>
{
Number
(
getParam
(
'ac'
))
===
11
?
(
<
div
className
=
'activity__blessing'
>
<
img
src
=
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/count_donw.png'
/>
<
span
className
=
'count__down__time'
>
{
`
${
countDownTime
}
`
}
<
/span
>
<
/div
>
)
:
(
null
)
}
<
div
className
=
'detail-box'
>
<
HeaderBar
title
=
'课程详情'
...
...
src/components/detail/index.scss
View file @
b35786a0
...
...
@@ -230,3 +230,26 @@
width
:
215px
;
}
}
.activity__blessing
{
position
:
fixed
;
bottom
:
170px
;
right
:
4px
;
width
:
76px
;
height
:
64px
;
z-index
:
999
;
.count__down__time
{
width
:
62px
;
height
:
20px
;
font-size
:
12px
;
font-weight
:
600
;
color
:rgba
(
36
,
0
,
119
,
1
)
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
position
:
absolute
;
bottom
:
4px
;
left
:
8px
;
}
}
\ No newline at end of file
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