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
1bb24abd
Commit
1bb24abd
authored
Dec 19, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bargain status modify
parent
a73c3fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
8 deletions
+72
-8
src/components/activity/newyear-2019/preheat/YearCourse/index.js
+11
-3
src/components/activity/newyear-2019/year-wish/index.js
+61
-5
No files found.
src/components/activity/newyear-2019/preheat/YearCourse/index.js
View file @
1bb24abd
...
...
@@ -846,8 +846,10 @@ class YearCourse extends Component {
>
<
div
className
=
"coupon-course__footer"
>
{
/* type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付 */
}
{
val
.
type
===
4
&&
(
val
.
type
===
4
||
val
.
type
===
8
)
&&
<
div
className
=
"bargain-price"
>
已砍
{
val
.
already_bargain
}
元
<
/div
>
}
...
...
@@ -882,7 +884,7 @@ class YearCourse extends Component {
<
/
>
}
{
(
val
.
type
===
3
||
val
.
type
===
4
)
&&
(
val
.
type
===
3
||
val
.
type
===
4
||
val
.
type
===
8
)
&&
<>
<
div
className
=
"type"
>
<
span
className
=
"tag"
data
-
color
=
"green"
>
好友帮帮砍
<
/span
>
...
...
@@ -904,7 +906,6 @@ class YearCourse extends Component {
}
<
div
className
=
"status"
>
{
/* type 1 立即参团 2 已参团 3 我要砍价 4 待支付 5 马上抢 6 开始学习 */
}
{
val
.
type
===
0
&&
<
a
...
...
@@ -948,6 +949,13 @@ class YearCourse extends Component {
<
/
>
}
{
val
.
type
===
8
&&
<
a
onClick
=
{()
=>
this
.
bargainToOrder
(
val
.
course_id
)}
className
=
"status-btn to-group"
>
支付
{
val
.
actual_payment
}
元
<
/a
>
}
{
val
.
type
===
6
&&
<
a
onClick
=
{()
=>
this
.
toCourse
(
val
.
course_id
)}
...
...
src/components/activity/newyear-2019/year-wish/index.js
View file @
1bb24abd
...
...
@@ -26,7 +26,6 @@ class YarnWish extends Component {
}
}
fetchCourse
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/wish_course`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
...
...
@@ -39,6 +38,7 @@ class YarnWish extends Component {
}
})
}
getStage
=
()
=>
{
http
.
get
(
`
${
API
.
home
}
/activity/stage`
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
.
data
...
...
@@ -75,6 +75,21 @@ class YarnWish extends Component {
}
}
toContinueBargain
=
(
id
,
code
)
=>
{
const
{
history
}
=
this
.
props
;
if
(
getParam
(
'version'
))
{
let
data
=
{
title
:
'AI充电节,积福气享1折秒课,超10万元奖品来就送!!'
,
desc
:
'把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线'
,
link
:
`https://m.julyedu.com/bargain-middle-page?id=
${
id
}
&bargaincode=
${
code
}
&is_originator=1`
,
imgUrl
:
'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png'
,
}
SendMessageToApp
(
"toShare"
,
data
)
}
else
{
history
.
push
(
`/bargain-middle-page?id=
${
id
}
&bargaincode=
${
code
}
&is_originator=1`
);
}
}
toCart
=
(
id
)
=>
{
const
{
history
}
=
this
.
props
;
http
.
post
(
`
${
API
.
home
}
/m/cart/add`
,
{
...
...
@@ -94,7 +109,28 @@ class YarnWish extends Component {
Toast
.
info
(
msg
,
2
);
}
})
};
}
// 砍完价去支付
bargainToOrder
=
(
id
)
=>
{
const
{
history
,
user
}
=
this
.
props
;
if
(
user
.
hasError
)
{
this
.
toLogin
();
}
else
{
if
(
getParam
(
'version'
))
{
SendMessageToApp
(
'toPay'
,
id
)
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/cart/addtopreorder/[
${
id
}
]`
).
then
((
res
)
=>
{
const
{
errno
,
msg
}
=
res
.
data
;
if
(
errno
===
0
)
{
history
.
push
(
`/order?id=[
${
id
}
]`
,
{
bargain
:
1
});
}
else
{
Toast
.
info
(
msg
,
2
);
}
})
}
}
}
render
()
{
const
{
list
,
activityStage
}
=
this
.
state
...
...
@@ -125,13 +161,13 @@ class YarnWish extends Component {
>
{
/*
* 拼团,正常:未开团1 已开2;一分:未开团5 已开7
* type 1 立即参团 2 已参团 3 我要砍价 4
待支付 5 马上抢 6 开始学习
* type 1 立即参团 2 已参团 3 我要砍价 4
已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付
*/
}
<
div
className
=
"coupon-course__footer"
>
{
item
.
type
===
4
&&
(
item
.
type
===
4
||
item
.
type
===
8
)
&&
<
div
className
=
"bargain-price"
>
已砍
{
item
.
already_bargain
}
元
<
/div
>
}
...
...
@@ -181,7 +217,7 @@ class YarnWish extends Component {
<
/
>
}
{
(
item
.
type
===
3
||
item
.
type
===
4
)
&&
(
item
.
type
===
3
||
item
.
type
===
4
||
val
.
type
===
8
)
&&
<>
<
div
className
=
"type"
>
<
span
className
=
"tag"
data
-
color
=
"green"
>
好友帮帮砍
<
/span
>
...
...
@@ -233,6 +269,26 @@ class YarnWish extends Component {
>
我要砍价
<
/a
>
}
{
item
.
type
===
4
&&
<>
<
a
onClick
=
{()
=>
this
.
toContinueBargain
(
item
.
bargain_code
)}
className
=
"status-btn to-group"
>
继续砍价
<
/a
>
<
a
onClick
=
{()
=>
this
.
bargainToOrder
(
item
.
course_id
)}
className
=
"status-btn to-group"
>
支付
{
item
.
actual_payment
}
元
<
/a
>
<
/
>
}
{
item
.
type
===
8
&&
<
a
onClick
=
{()
=>
this
.
bargainToOrder
(
item
.
course_id
)}
className
=
"status-btn to-group"
>
支付
{
item
.
actual_payment
}
元
<
/a
>
}
{
item
.
type
===
5
&&
<
a
onClick
=
{()
=>
this
.
toCourse
(
item
.
course_id
)}
...
...
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