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
dcdb8adf
Commit
dcdb8adf
authored
Aug 23, 2019
by
wangshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单集购买
parent
91713bf6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/components/detail/index.js
+5
-0
src/components/detail/single/singleSuccess.js
+8
-3
No files found.
src/components/detail/index.js
View file @
dcdb8adf
...
@@ -41,6 +41,7 @@ class Detail extends Component {
...
@@ -41,6 +41,7 @@ class Detail extends Component {
nowPrice
:
0
,
nowPrice
:
0
,
laterPrice
:
0
,
laterPrice
:
0
,
isPdd
:
0
,
// 是否是拼团课程 控制首次单集购买后的 全集购买 接口: 拼团课程走拼团接口,否则直接走购买接口
}
}
}
}
...
@@ -97,6 +98,7 @@ class Detail extends Component {
...
@@ -97,6 +98,7 @@ class Detail extends Component {
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
singleType
:
2
,
singleType
:
2
,
isPdd
:
res
.
data
.
data
.
data
.
is_pdd
,
})
})
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
...
@@ -159,6 +161,7 @@ class Detail extends Component {
...
@@ -159,6 +161,7 @@ class Detail extends Component {
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
singleType
:
2
,
singleType
:
2
,
isPdd
:
res
.
data
.
data
.
data
.
is_pdd
,
})
})
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
Toast
.
info
(
res
.
data
.
data
.
msg
,
2
)
...
@@ -218,6 +221,7 @@ class Detail extends Component {
...
@@ -218,6 +221,7 @@ class Detail extends Component {
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
nowPrice
:
res
.
data
.
data
.
data
.
now_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
laterPrice
:
res
.
data
.
data
.
data
.
three_day_later_price
,
singleType
:
2
,
singleType
:
2
,
isPdd
:
res
.
data
.
data
.
data
.
is_pdd
,
})
})
}
else
{
}
else
{
...
@@ -543,6 +547,7 @@ class Detail extends Component {
...
@@ -543,6 +547,7 @@ class Detail extends Component {
vcourseId
=
{
course_info
.
v_course_id
}
vcourseId
=
{
course_info
.
v_course_id
}
videoId
=
{
this
.
state
.
singMess
.
video_id
}
videoId
=
{
this
.
state
.
singMess
.
video_id
}
nowPrice
=
{
this
.
state
.
nowPrice
}
nowPrice
=
{
this
.
state
.
nowPrice
}
isPdd
=
{
this
.
state
.
isPdd
}
laterPrice
=
{
this
.
state
.
laterPrice
}
laterPrice
=
{
this
.
state
.
laterPrice
}
courseId
=
{
course_info
.
course_id
}
courseId
=
{
course_info
.
course_id
}
/
>
/
>
...
...
src/components/detail/single/singleSuccess.js
View file @
dcdb8adf
...
@@ -89,14 +89,19 @@ class Single extends Component {
...
@@ -89,14 +89,19 @@ class Single extends Component {
// 特价购买全集
// 特价购买全集
toBuyAll
=
(
vcourseId
)
=>
{
toBuyAll
=
(
vcourseId
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/cart/addtopreorder/
${
vcourseId
}
`
).
then
((
res
)
=>
{
if
(
Number
(
this
.
props
.
isPdd
)
===
1
)
{
this
.
props
.
history
.
push
(
`/order?id=
${
this
.
props
.
courseId
}
`
,
{
group
:
1
})
}
else
{
let
cidArr
=
JSON
.
stringify
([
Number
(
vcourseId
)]);
http
.
get
(
`
${
API
[
'base-api'
]}
/m/cart/addtopreorder/
${
cidArr
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
errno
===
0
)
{
if
(
res
.
data
.
errno
===
0
)
{
this
.
props
.
history
.
push
(
"/order?id="
+
res
.
data
.
data
[
0
],
{
typ
e
:
1
});
this
.
props
.
history
.
push
(
"/order?id="
+
res
.
data
.
data
[
0
],
{
simpl
e
:
1
});
}
else
{
}
else
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
Toast
.
info
(
res
.
data
.
msg
,
2
);
}
}
})
})
}
}
}
// 0元购买全集
// 0元购买全集
zerobuyReceive
=
()
=>
{
zerobuyReceive
=
()
=>
{
Toast
.
success
(
'购买全集成功'
,
3
)
Toast
.
success
(
'购买全集成功'
,
3
)
...
@@ -193,7 +198,7 @@ class Single extends Component {
...
@@ -193,7 +198,7 @@ class Single extends Component {
<
div
className
=
"dec"
>
·
3
天内购买全集,可直接抵扣该集费用,
{
this
.
props
.
nowPrice
}
元购买。
<
/div
>
<
div
className
=
"dec"
>
·
3
天内购买全集,可直接抵扣该集费用,
{
this
.
props
.
nowPrice
}
元购买。
<
/div
>
<
div
className
=
"dec"
>
·
超过
3
天,按照未购集数
/
全部集数等比例计费,
{
this
.
props
.
laterPrice
}
元购买全集。
<
/div
>
<
div
className
=
"dec"
>
·
超过
3
天,按照未购集数
/
全部集数等比例计费,
{
this
.
props
.
laterPrice
}
元购买全集。
<
/div
>
<
Link
to
=
{
`/play/video?id=
${
this
.
props
.
vcourseId
}
&video_id=
${
videoID
}
`
}
className
=
'btn btn-18B4ED'
>
开始学习
<
/Link
>
<
Link
to
=
{
`/play/video?id=
${
this
.
props
.
vcourseId
}
&video_id=
${
videoID
}
`
}
className
=
'btn btn-18B4ED'
>
开始学习
<
/Link
>
<
div
className
=
'btn btn-FF4000'
onClick
=
{()
=>
{
this
.
toBuyAll
(
this
.
props
.
v
courseId
)}}
>
¥
{
this
.
props
.
nowPrice
}
购买全集
<
div
className
=
'btn btn-FF4000'
onClick
=
{()
=>
{
this
.
toBuyAll
(
this
.
props
.
courseId
)}}
>
¥
{
this
.
props
.
nowPrice
}
购买全集
<
/div
>
<
/div
>
<
/div
>
<
/div
>
}
}
...
...
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