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
a9721374
Commit
a9721374
authored
Sep 27, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bargain list btn
parent
ef9571c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
46 deletions
+57
-46
src/components/bargainMiddlePage/index.js
+57
-46
No files found.
src/components/bargainMiddlePage/index.js
View file @
a9721374
...
@@ -516,6 +516,7 @@ class BargainMiddlePage extends Component {
...
@@ -516,6 +516,7 @@ class BargainMiddlePage extends Component {
toDetail
=
{
this
.
toCourseDetail
}
toDetail
=
{
this
.
toCourseDetail
}
bottom
=
{
bottom
=
{
<
CourseBottom
<
CourseBottom
user
=
{
this
.
props
.
user
}
item
=
{
item
}
item
=
{
item
}
toCartBottom
=
{
this
.
toCartBottom
.
bind
(
this
,
item
.
course_id
)}
toCartBottom
=
{
this
.
toCartBottom
.
bind
(
this
,
item
.
course_id
)}
toDetail
=
{
this
.
toCourseDetail
}
toDetail
=
{
this
.
toCourseDetail
}
...
@@ -638,60 +639,70 @@ function CourseDes(props) {
...
@@ -638,60 +639,70 @@ function CourseDes(props) {
}
}
function
CourseBottom
(
props
)
{
function
CourseBottom
(
props
)
{
// bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
// bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
const
{
course_id
=
''
,
bargain_status
=
''
,
price1
=
''
,
pay_price
=
''
}
=
props
.
item
||
{};
const
{
course_id
=
''
,
bargain_status
=
''
,
price1
=
''
,
pay_price
=
''
}
=
props
.
item
||
{};
const
{
user
:
{
data
=
{}
}
}
=
props
;
const
price
=
bargain_status
===
2
?
price1
:
pay_price
;
const
price
=
bargain_status
===
2
?
price1
:
pay_price
;
let
Buttons
let
Buttons
// if (props.item.bargain_status === 2) {
if
(
data
.
uid
)
{
// // Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
if
(
props
.
item
.
bargain_status
===
2
)
{
// Buttons = (
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
// <div className="">
// <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a>
// </div>
// )
// } else
if
(
bargain_status
===
3
)
{
if
(
course_id
===
139
)
{
Buttons
=
(
Buttons
=
(
<
a
<
div
className
=
""
>
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
<
a
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
className
=
{
'bargain bargian-study'
}
>
我要砍价
<
/a
>
className
=
{
'bargain bargian-study'
}
<
/div
>
>
我要砍价
<
/a
>
);
)
}
else
{
}
else
if
(
bargain_status
===
3
)
{
if
(
course_id
===
139
)
{
Buttons
=
(
<
a
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
className
=
{
'bargain bargian-study'
}
>
我要砍价
<
/a
>
);
}
else
{
Buttons
=
(
<
Link
to
=
{
`/play/video?id=
${
props
.
item
.
v_course_id
}
`
}
className
=
{
classnames
(
'bargain'
,
'button--study'
)}
>
去学习
<
/Link
>
);
}
}
else
{
Buttons
=
(
Buttons
=
(
<
Link
<
div
className
=
"btns"
>
to
=
{
`/play/video?id=
${
props
.
item
.
v_course_id
}
`
}
{
/*<button className={classnames('bargain-btn', {invalid: props.item.bargain_status === 2})}>*/
}
className
=
{
classnames
(
'bargain'
,
'button--study'
)}
{
/*{props.item.bargain_status === 2 ? '砍价结束' : '继续砍价'}*/
}
>
去学习
<
/Link
>
{
/*</button>*/
}
);
{
bargain_status
===
1
&&
<
button
className
=
'invalid'
>
砍价结束
<
/button
>
}
{
bargain_status
===
0
&&
<
a
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
className
=
{
'bargain-btn'
}
>
继续砍价
<
/a
>
}
<
button
onClick
=
{()
=>
props
.
toCartBottom
(
props
.
item
.
course_id
)}
className
=
{
'purchase-btn'
}
>
¥
{
price
}
去支付
<
/button
>
<
/div
>
)
}
}
}
else
{
}
else
{
Buttons
=
(
Buttons
=
(
<
div
className
=
"btns"
>
<
a
{
/*<button className={classnames('bargain-btn', {invalid: props.item.bargain_status === 2})}>*/
}
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
{
/*{props.item.bargain_status === 2 ? '砍价结束' : '继续砍价'}*/
}
className
=
{
'bargain bargian-study'
}
{
/*</button>*/
}
>
我要砍价
<
/a
>
{
);
bargain_status
===
1
&&
<
button
className
=
'invalid'
>
砍价结束
<
/button
>
}
{
(
bargain_status
===
0
||
bargain_status
===
2
)
&&
<
a
onClick
=
{()
=>
props
.
toDetail
(
props
.
item
.
course_id
)}
className
=
{
'bargain-btn'
}
>
我要砍价
<
/a
>
}
<
button
onClick
=
{()
=>
props
.
toCartBottom
(
props
.
item
.
course_id
)}
className
=
{
'purchase-btn'
}
>
¥
{
price
}
去支付
<
/button
>
<
/div
>
)
}
}
return
(
return
(
<
div
className
=
"course-bottom"
>
<
div
className
=
"course-bottom"
>
<
div
className
=
{
'course-price'
}
>
<
div
className
=
{
'course-price'
}
>
...
...
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