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
eb75aa47
Commit
eb75aa47
authored
Aug 22, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
course detail not use redux store about cousre info and bargin middle page style midfy
parent
1a33390c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
36 deletions
+49
-36
src/components/bargainMiddlePage/bargain-middle-page.scss
+2
-2
src/components/bargainMiddlePage/index.js
+1
-1
src/components/detail/bargain/index.js
+9
-7
src/components/detail/btnstatus/index.js
+10
-5
src/components/detail/group/index.js
+19
-13
src/components/detail/index.js
+0
-0
src/components/detail/outline/index.js
+2
-2
src/components/detail/shareRank/index.js
+6
-6
No files found.
src/components/bargainMiddlePage/bargain-middle-page.scss
View file @
eb75aa47
...
...
@@ -307,10 +307,10 @@
.bargain
{
width
:
165px
;
height
:
30px
;
background
:
$bg_
FADD29
;
background
:
$bg_
077FD0
;
border-radius
:
2px
;
border
:
none
;
color
:
$
color_FF4000
;
color
:
$
white
;
-webkit-appearance
:
none
;
display
:
inline-block
;
text-align
:
center
;
...
...
src/components/bargainMiddlePage/index.js
View file @
eb75aa47
...
...
@@ -434,7 +434,7 @@ class BargainMiddlePage extends Component {
}
<
/ul
>
<
/div
>
<
Link
to
=
{
'/
preferential
'
}
className
=
{
'preferential'
}
>
查看更多精品课程
>><
/Link
>
<
Link
to
=
{
'/
classify
'
}
className
=
{
'preferential'
}
>
查看更多精品课程
>><
/Link
>
{
/*更多好友砍价*/
}
...
...
src/components/detail/bargain/index.js
View file @
eb75aa47
...
...
@@ -22,12 +22,13 @@ class Bargain extends Component {
limitPeople
:
''
,
status
:
''
,
bargainCode
:
''
,
time
:
''
time
:
''
,
barInfo
:
{}
}
}
componentDidMount
()
{
//
this.getBargainInfo()
this
.
getBargainInfo
()
}
// 获取助理好友
...
...
@@ -57,9 +58,10 @@ class Bargain extends Component {
http
.
post
(
`
${
API
.
home
}
/m/bargain/courseDetail`
,
data
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
)
{
this
.
setState
({
info
:
res
.
data
.
data
,
limitPeople
:
res
.
data
.
data
.
limit_people
,
bargainCode
:
res
.
data
.
data
.
bargain_code
barInfo
:
res
.
data
.
data
,
// info: res.data.data,
// limitPeople: res.data.data.limit_people,
// bargainCode: res.data.data.bargain_code
})
if
(
res
.
data
.
data
.
bargain_status
===
0
)
{
this
.
getBargainRankList
(
getParam
(
'id'
),
0
)
...
...
@@ -119,7 +121,7 @@ class Bargain extends Component {
}
// 继续砍价
continueBargain
=
()
=>
{
const
{
barInfo
=
{}
}
=
this
.
props
;
const
{
barInfo
=
{}
}
=
this
.
state
;
const
code
=
barInfo
.
bargain_code
;
this
.
props
.
history
.
push
(
`/bargain-middle-page?id=
${
getParam
(
'id'
)}
&bargaincode=
${
code
}
&is_originator=1`
)
}
...
...
@@ -171,7 +173,7 @@ class Bargain extends Component {
}
render
()
{
const
{
list
,
outList
,
barInfo
}
=
this
.
props
;
const
{
list
,
outList
,
barInfo
}
=
this
.
state
;
return
(
<
div
className
=
{
'bargain-func'
}
>
{
/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/
}
...
...
src/components/detail/btnstatus/index.js
View file @
eb75aa47
...
...
@@ -17,7 +17,7 @@ class BtnStatus extends Component {
group_status
:
3
,
in_cart
:
false
,
countdown
:
0
,
// barInfo: ''
barInfo
:
{}
}
}
...
...
@@ -39,6 +39,10 @@ class BtnStatus extends Component {
// }
componentWillReceiveProps
(
nextProps
)
{
const
{
data
=
{}}
=
nextProps
;
if
(
data
.
is_bargain
)
{
this
.
getBargainInfo
();
}
// if(nextProps.data && nextProps.data.is_bargain) {
// this.getBargainInfo()
// }
...
...
@@ -111,7 +115,8 @@ class BtnStatus extends Component {
};
// 直接购买
tobuy
=
()
=>
{
const
{
user
,
barInfo
}
=
this
.
props
const
{
user
}
=
this
.
props
;
const
{
barInfo
}
=
this
.
state
;
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
if
(
!
uid
)
{
this
.
props
.
history
.
push
(
'/passport/login'
)
...
...
@@ -199,7 +204,7 @@ class BtnStatus extends Component {
parent_uid
:
0
// 被助力人id 【自己本人操作传0】
}
http
.
post
(
`
${
API
.
home
}
/m/bargain/toBargain`
,
data
).
then
((
res
)
=>
{
const
{
data
:
{
data
,
code
,
msg
}}
=
res
;
const
{
data
,
code
,
msg
}
=
res
.
data
;
if
(
code
===
200
)
{
history
.
push
(
`/bargain-middle-page?id=
${
course_id
}
&bargaincode=
${
data
.
bargain_code
}
&is_originator=1`
)
}
else
{
...
...
@@ -230,8 +235,8 @@ class BtnStatus extends Component {
render
()
{
// data 课程信息;barInfo 砍价信息
const
{
data
:
info
=
{},
barInfo
=
{},
user
=
{}
}
=
this
.
props
;
const
{
countdown
}
=
this
.
state
;
const
{
data
:
info
=
{},
user
=
{}
}
=
this
.
props
;
const
{
countdown
,
barInfo
}
=
this
.
state
;
const
uid
=
user
.
data
&&
user
.
data
.
uid
;
return
(
<
div
>
...
...
src/components/detail/group/index.js
View file @
eb75aa47
...
...
@@ -36,10 +36,9 @@ class Group extends Component {
}
toPay
=
(
pdd_order_id
)
=>
{
const
courseInfo
=
this
.
props
.
courseInfo
.
courseInfo
.
course_info
;
const
{
courseInfo
,
history
}
=
this
.
props
;
if
(
courseInfo
.
group_status
===
3
)
{
this
.
props
.
history
.
push
(
`/order?id=
${
getParam
(
'id'
)}
`
,
{
group
:
1
})
history
.
push
(
`/order?id=
${
getParam
(
'id'
)}
`
,
{
group
:
1
});
}
else
{
this
.
setState
({
isShowMore
:
false
,
...
...
@@ -114,8 +113,9 @@ class Group extends Component {
}
componentDidMount
()
{
if
(
this
.
props
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
.
course_info
&&
this
.
props
.
courseInfo
.
courseInfo
.
course_info
.
pdd_group_info
)
{
let
now_groupon_list
=
this
.
props
.
courseInfo
.
courseInfo
.
course_info
.
pdd_group_info
.
now_groupon_list
;
const
{
courseInfo
=
{}
}
=
this
.
props
;
if
(
courseInfo
.
pdd_group_info
)
{
let
now_groupon_list
=
courseInfo
.
pdd_group_info
.
now_groupon_list
;
if
(
now_groupon_list
&&
now_groupon_list
.
length
>
0
)
{
setInterval
(()
=>
{
now_groupon_list
.
map
(
item
=>
{
...
...
@@ -149,12 +149,16 @@ class Group extends Component {
}
render
()
{
const
{
courseInfo
}
=
this
.
props
;
const
{
alreadyIn
,
countdown
,
now_groupon_list
}
=
this
.
state
;
let
groupInfo
=
''
,
groupon_member
=
''
,
group_status
=
-
1
,
groupSuccessMbc
=
null
;
if
(
this
.
props
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
.
course_info
)
{
groupInfo
=
this
.
props
.
courseInfo
.
courseInfo
.
course_info
.
pdd_group_info
;
let
groupInfo
=
''
,
groupon_member
=
''
,
group_status
=
-
1
,
groupSuccessMbc
=
null
;
if
(
courseInfo
)
{
groupInfo
=
courseInfo
.
pdd_group_info
;
groupon_member
=
groupInfo
.
groupon_member
;
group_status
=
this
.
props
.
courseInfo
.
courseInfo
.
course_i
nfo
.
group_status
;
group_status
=
courseI
nfo
.
group_status
;
}
if
(
group_status
===
4
)
{
if
(
groupon_member
.
member
)
{
...
...
@@ -287,7 +291,9 @@ class Group extends Component {
}
}
export
default
connect
(
state
=>
({
courseInfo
:
state
}),
null
)(
Group
)
// export default connect(
// state => ({ courseInfo: state }),
// null
// )(Group)
export
default
Group
;
src/components/detail/index.js
View file @
eb75aa47
This diff is collapsed.
Click to expand it.
src/components/detail/outline/index.js
View file @
eb75aa47
...
...
@@ -45,8 +45,8 @@ class OutLine extends Component {
{
title
:
'大纲'
}
];
let
introduce
=
''
if
(
this
.
props
.
data
.
course_info
)
{
introduce
=
this
.
props
.
data
.
course_info
if
(
this
.
props
.
data
)
{
introduce
=
this
.
props
.
data
}
return
(
<
div
className
=
'course-detail'
>
...
...
src/components/detail/shareRank/index.js
View file @
eb75aa47
...
...
@@ -18,7 +18,6 @@ class ShareRank extends Component {
}
componentDidMount
()
{
console
.
log
(
this
.
props
);
this
.
getRankList
()
this
.
getCode
()
}
...
...
@@ -87,10 +86,11 @@ class ShareRank extends Component {
}
render
()
{
let
info
=
''
if
(
this
.
props
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
&&
this
.
props
.
courseInfo
.
courseInfo
.
course_info
)
{
info
=
this
.
props
.
courseInfo
.
courseInfo
.
course_info
}
const
{
courseInfo
:
info
=
''
}
=
this
.
props
;
// let info = ''
// if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
// info = this.props.courseInfo.courseInfo.course_info
// }
return
(
<
div
className
=
'share-ranking'
>
<
Flex
className
=
'share-container'
justify
=
'between'
>
...
...
@@ -157,7 +157,7 @@ class ShareRank extends Component {
export
default
compose
(
connect
(
state
=>
({
courseInfo
:
state
,
//
courseInfo: state,
user
:
state
.
user
}),
null
...
...
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