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
9002dfc5
Commit
9002dfc5
authored
Aug 22, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detail
parent
aee2b63b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
src/components/bargainMiddlePage/index.js
+25
-14
src/components/detail/bargain/index.js
+2
-6
No files found.
src/components/bargainMiddlePage/index.js
View file @
9002dfc5
...
...
@@ -135,31 +135,42 @@ class BargainMiddlePage extends Component {
})
}
//
加入购物车
//
直接支付
toCart
=
()
=>
{
let
data
=
{
course_id
:
getParam
(
'id'
)
}
http
.
post
(
`
${
API
.
home
}
/m/cart/add`
,
data
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
||
res
.
data
.
code
===
15001
)
{
this
.
props
.
history
.
push
(
'/shopcart'
)
http
.
get
(
`
${
API
[
'base-api'
]}
/m/cart/addtopreorder/[
${
getParam
(
'id'
)}
]`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
this
.
props
.
history
.
push
(
`/order?id=[
${
getParam
(
'id'
)}
]`
,
{
bargain
:
1
});
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
}
})
// let data = {
// course_id: getParam('id')
// }
// http.post(`${API.home}/m/cart/add`, data).then((res) => {
// if (res.data.code === 200 || res.data.code === 15001) {
// this.props.history.push('/shopcart')
// } else {
// Toast.info(res.data.msg, 2);
// }
// })
}
// 我要砍价列表的去支付
toCartBottom
=
(
id
)
=>
{
let
data
=
{
course_id
:
id
}
http
.
post
(
`
${
API
.
home
}
/m/cart/add`
,
data
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
===
200
||
res
.
data
.
code
===
15001
)
{
this
.
props
.
history
.
push
(
'/shopcart'
)
http
.
get
(
`
${
API
[
'base-api'
]}
/m/cart/addtopreorder/[
${
id
}
]`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
this
.
props
.
history
.
push
(
`/order?id=[
${
getParam
(
'id'
)}
]`
,
{
bargain
:
1
});
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
}
})
// http.post(`${API.home}/m/cart/add`, data).then((res) => {
// if (res.data.code === 200 || res.data.code === 15001) {
// this.props.history.push('/shopcart')
// } else {
// Toast.info(res.data.msg, 2);
// }
// })
}
// 查看更多
...
...
@@ -565,7 +576,7 @@ function CourseBottom(props) {
}
<
button
onClick
=
{
props
.
toCartBottom
}
<
button
onClick
=
{
()
=>
props
.
toCartBottom
(
props
.
item
.
course_id
)
}
className
=
{
'purchase-btn'
}
>
¥
{
props
.
item
.
pay_price
}
去支付
<
/button
>
<
/div
>
...
...
src/components/detail/bargain/index.js
View file @
9002dfc5
...
...
@@ -29,10 +29,7 @@ class Bargain extends Component {
}
componentDidMount
()
{
const
{
user
=
{}
}
=
this
.
props
;
if
(
user
.
data
&&
user
.
data
.
uid
)
{
this
.
getBargainInfo
();
}
this
.
getBargainInfo
();
}
// 获取助理好友
...
...
@@ -184,7 +181,6 @@ class Bargain extends Component {
render
()
{
const
{
list
,
outList
,
barInfo
}
=
this
.
state
;
console
.
log
(
barInfo
)
const
{
user
}
=
this
.
props
const
uid
=
user
&&
user
.
data
&&
user
.
data
.
uid
return
(
...
...
@@ -260,7 +256,7 @@ function BargainIntro(props) {
<
Flex
direction
=
{
'column'
}
justify
=
{
'center'
}
className
=
{
'intro-wrapper'
}
>
<
p
>
邀请
<
span
className
=
{
'indicator'
}
>
{
props
.
limit
_p
eople
}
位
<
/span
>
<
span
className
=
{
'indicator'
}
>
{
props
.
limit
P
eople
}
位
<
/span
>
好友帮忙砍价可获得
<
span
className
=
{
'indicator'
}
>
【砍价神器】
<
/span
>
<
/p
>
...
...
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