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
c7d02352
Commit
c7d02352
authored
Aug 19, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solve question that btn of kanjia not show,because modify to course detial question
parent
2b4d789c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
src/components/detail/btnstatus/index.js
+11
-10
src/components/detail/index.js
+4
-1
No files found.
src/components/detail/btnstatus/index.js
View file @
c7d02352
...
...
@@ -18,7 +18,7 @@ class BtnStatus extends Component {
group_status
:
3
,
in_cart
:
false
,
countdown
:
0
,
barInfo
:
''
//
barInfo: ''
}
}
...
...
@@ -40,9 +40,9 @@ class BtnStatus extends Component {
// }
componentWillReceiveProps
(
nextProps
)
{
if
(
nextProps
.
data
&&
nextProps
.
data
.
is_bargain
)
{
this
.
getBargainInfo
()
}
//
if(nextProps.data && nextProps.data.is_bargain) {
//
this.getBargainInfo()
//
}
this
.
setState
({
...
nextProps
.
data
.
course_info
,
countdown
:
nextProps
.
countdown
,
...
...
@@ -110,12 +110,12 @@ class BtnStatus extends Component {
};
// 直接购买
tobuy
=
()
=>
{
const
{
user
}
=
this
.
props
const
{
user
,
barInfo
}
=
this
.
props
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
if
(
!
uid
)
{
this
.
props
.
history
.
push
(
'/passport/login'
)
}
else
{
if
(
this
.
state
.
barInfo
.
bargain_status
===
2
)
{
if
(
barInfo
.
bargain_status
===
2
)
{
// this.toCart(2)
// 新需求 不需要加入购物车 直接走普通课程的立即报名流程 跳到订单页
this
.
simpleCourse
();
...
...
@@ -228,7 +228,8 @@ class BtnStatus extends Component {
const
{
countdown
}
=
this
.
state
;
const
{
user
}
=
this
.
props
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
const
{
barInfo
=
{}
}
=
this
.
props
;
console
.
log
(
this
.
props
);
return
(
<
div
>
...
...
@@ -312,15 +313,15 @@ class BtnStatus extends Component {
<
span
onClick
=
{
this
.
tobuy
}
>
直接购买
<
/span
>
<
/button
>
{
(
this
.
state
.
barInfo
.
bargain_status
===
2
||
!
uid
)
&&
(
barInfo
.
bargain_status
===
2
||
!
uid
)
&&
<
button
className
=
'btn btn-s bg-E02E24'
onClick
=
{
this
.
toKanjia
}
>
我要砍价
<
/button
>
}
{
(
this
.
state
.
barInfo
.
bargain_status
===
0
||
this
.
state
.
barInfo
.
bargain_status
===
1
)
&&
(
uid
)
&&
(
barInfo
.
bargain_status
===
0
||
barInfo
.
bargain_status
===
1
)
&&
(
uid
)
&&
<
button
className
=
'btn btn-s bg-E02E24'
>
<
span
>
¥
{
this
.
state
.
barInfo
.
amount
}
<
/span
>
<
span
>
¥
{
barInfo
.
amount
}
<
/span
>
<
span
onClick
=
{
this
.
bargainToOrder
}
>
去支付
<
/span
>
<
/button
>
}
...
...
src/components/detail/index.js
View file @
c7d02352
...
...
@@ -37,6 +37,10 @@ class Detail extends Component {
if
(
getParam
(
'isIn'
))
{
this
.
props
.
getCourses
();
}
const
{
courseInfo
}
=
this
.
props
;
if
(
courseInfo
.
is_bargain
)
{
this
.
getBargainInfo
();
}
}
// 点击子组件试听按钮
...
...
@@ -274,7 +278,6 @@ class Detail extends Component {
data
=
{
this
.
props
.
courseInfo
}
user
=
{
this
.
props
.
user
}
barInfo
=
{
this
.
state
.
barInfo
}
getBargainInfo
=
{
this
.
getBargainInfo
}
invitedFriends
=
{
this
.
invitedFriends
}
addCourseToCart
=
{
this
.
props
.
addCourseToCart
}
history
=
{
this
.
props
.
history
}
><
/BtnStatus
>
...
...
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