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
d0d4d922
Commit
d0d4d922
authored
Aug 26, 2019
by
FE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
judge is buy after get into share page throught share link
parent
d866e55f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
3 deletions
+54
-3
src/components/detail/group/togroup.js
+53
-3
src/components/order/index.js
+1
-0
No files found.
src/components/detail/group/togroup.js
View file @
d0d4d922
...
@@ -5,7 +5,7 @@ import { HeaderBar, VList } from '../../../common'
...
@@ -5,7 +5,7 @@ import { HeaderBar, VList } from '../../../common'
import
{
getParam
,
http
,
browser
,
wxShare
}
from
"@/utils"
;
import
{
getParam
,
http
,
browser
,
wxShare
}
from
"@/utils"
;
import
{
connect
}
from
"react-redux"
import
{
connect
}
from
"react-redux"
import
{
Link
}
from
"react-router-dom"
import
{
Link
}
from
"react-router-dom"
import
{
WingBlank
,
WhiteSpace
,
Flex
,
Toast
}
from
'antd-mobile'
import
{
WingBlank
,
WhiteSpace
,
Flex
,
Toast
,
Modal
}
from
'antd-mobile'
import
{
getCourses
}
from
'./../../detail/actions'
;
import
{
getCourses
}
from
'./../../detail/actions'
;
@
connect
()
@
connect
()
...
@@ -21,6 +21,8 @@ class ToGroup extends Component {
...
@@ -21,6 +21,8 @@ class ToGroup extends Component {
is_success
:
false
,
// 是否拼团成功
is_success
:
false
,
// 是否拼团成功
userInfo
:
{},
userInfo
:
{},
number
:
0
,
// 差几人成团
number
:
0
,
// 差几人成团
isBuy
:
false
,
modal
:
false
,
}
}
}
}
...
@@ -66,6 +68,7 @@ class ToGroup extends Component {
...
@@ -66,6 +68,7 @@ class ToGroup extends Component {
userInfo
,
userInfo
,
number
:
res
.
data
.
data
.
number
,
number
:
res
.
data
.
data
.
number
,
countdown
:
''
,
countdown
:
''
,
isBuy
:
res
.
data
.
data
.
is_buy
});
});
if
(
res
.
data
.
data
.
is_success
===
0
)
{
if
(
res
.
data
.
data
.
is_success
===
0
)
{
...
@@ -94,6 +97,24 @@ class ToGroup extends Component {
...
@@ -94,6 +97,24 @@ class ToGroup extends Component {
// }));
// }));
}
}
handleToGroup
=
()
=>
{
const
{
isBuy
=
false
,
data
=
{}
}
=
this
.
state
;
const
{
history
}
=
this
.
props
;
if
(
!
isBuy
){
history
.
push
(
`/order?id=
${
data
.
course_id
}
`
,
{
group
:
1
}
)
}
else
{
this
.
setState
({
modal
:
true
})
}
console
.
log
(
this
.
state
);
}
render
()
{
render
()
{
const
{
data
:
{
course_id
,
course_title
,
simpledescription
,
price0
,
price1
},
pdd_price
,
is_success
,
person_num
,
groupon_member
,
course_list
}
=
this
.
state
;
const
{
data
:
{
course_id
,
course_title
,
simpledescription
,
price0
,
price1
},
pdd_price
,
is_success
,
person_num
,
groupon_member
,
course_list
}
=
this
.
state
;
const
Info
=
(
const
Info
=
(
...
@@ -114,6 +135,24 @@ class ToGroup extends Component {
...
@@ -114,6 +135,24 @@ class ToGroup extends Component {
)
)
return
(
return
(
<
div
className
=
'to-group-box'
>
<
div
className
=
'to-group-box'
>
<
Modal
transparent
visible
=
{
this
.
state
.
modal
}
title
=
"提示"
footer
=
{[
{
text
:
'确定'
,
onPress
:
()
=>
{
this
.
setState
({
modal
:
false
});
this
.
props
.
history
.
push
(
'/'
);
}
}
]}
>
<
p
>
您已经购买过该课程~
<
/p
>
<
/Modal
>
<
HeaderBar
title
=
'拼团'
cart
=
{
false
}
toHref
=
{()
=>
this
.
toCourseDetail
(
course_id
)}
><
/HeaderBar
>
<
HeaderBar
title
=
'拼团'
cart
=
{
false
}
toHref
=
{()
=>
this
.
toCourseDetail
(
course_id
)}
><
/HeaderBar
>
{
{
!
is_success
&&
!
is_success
&&
...
@@ -125,7 +164,11 @@ class ToGroup extends Component {
...
@@ -125,7 +164,11 @@ class ToGroup extends Component {
/
>
/
>
}
}
<
GorupContent
data
=
{
this
.
state
}
invitedFriends
=
{
this
.
invitedFriends
}
/
>
<
GorupContent
data
=
{
this
.
state
}
invitedFriends
=
{
this
.
invitedFriends
}
handleToGroup
=
{
this
.
handleToGroup
}
/
>
<
WhiteSpace
><
/WhiteSpace
>
<
WhiteSpace
><
/WhiteSpace
>
<
div
className
=
"group-course"
>
<
div
className
=
"group-course"
>
...
@@ -222,7 +265,14 @@ function GorupContent(props) {
...
@@ -222,7 +265,14 @@ function GorupContent(props) {
dec
=
<
p
className
=
'dec'
>
分享到
3
个群后,成团率高达
98
%<
/p
>
dec
=
<
p
className
=
'dec'
>
分享到
3
个群后,成团率高达
98
%<
/p
>
}
else
{
}
else
{
tip
=
<
p
className
=
'tip'
>
{
`拼团省¥
${
data
.
price1
-
pdd_price
}
元`
}
<
/p
>
tip
=
<
p
className
=
'tip'
>
{
`拼团省¥
${
data
.
price1
-
pdd_price
}
元`
}
<
/p
>
btn
=
<
Link
to
=
{
`/order?id=
${
data
.
course_id
}
`
}
className
=
'group-btn'
>
一键参团
<
/Link
>
// btn = <Link to={{
// pathname: '/order',
// search: `?id=${data.course_id}`,
// state: {
// group: 1
// }
// }} className='group-btn'>一键参团</Link>
btn
=
<
a
href
=
"javascript:;"
className
=
'group-btn'
onClick
=
{
props
.
handleToGroup
}
>
一键参团
<
/a
>
}
}
}
}
...
...
src/components/order/index.js
View file @
d0d4d922
...
@@ -349,6 +349,7 @@ class Order extends Component {
...
@@ -349,6 +349,7 @@ class Order extends Component {
// this.publicLocalStorage();
// this.publicLocalStorage();
// })
// })
// }else{
// }else{
console
.
log
(
8
);
http
.
get
(
`
${
API
[
'base-api'
]}
/m/order/preorder`
).
then
((
res
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/order/preorder`
).
then
((
res
)
=>
{
console
.
log
(
'为了验证什么条件下会走这段代码'
);
console
.
log
(
'为了验证什么条件下会走这段代码'
);
if
(
res
.
data
.
errno
!==
200
)
{
if
(
res
.
data
.
errno
!==
200
)
{
...
...
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