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
d420b218
Commit
d420b218
authored
Aug 26, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Plain Diff
微信分享
parents
906e5c09
d659bd8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
3 deletions
+57
-3
src/components/detail/group/togroup.js
+57
-3
No files found.
src/components/detail/group/togroup.js
View file @
d420b218
...
...
@@ -5,7 +5,7 @@ import { HeaderBar, VList } from '../../../common'
import
{
getParam
,
http
,
browser
,
wxShare
}
from
"@/utils"
;
import
{
connect
}
from
"react-redux"
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'
;
@
connect
()
...
...
@@ -21,6 +21,8 @@ class ToGroup extends Component {
is_success
:
false
,
// 是否拼团成功
userInfo
:
{},
number
:
0
,
// 差几人成团
isBuy
:
false
,
modal
:
false
,
}
}
...
...
@@ -66,6 +68,7 @@ class ToGroup extends Component {
userInfo
,
number
:
res
.
data
.
data
.
number
,
countdown
:
''
,
isBuy
:
res
.
data
.
data
.
is_buy
});
if
(
res
.
data
.
data
.
is_success
===
0
)
{
...
...
@@ -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
()
{
const
{
data
:
{
course_id
,
course_title
,
simpledescription
,
price0
,
price1
},
pdd_price
,
is_success
,
person_num
,
groupon_member
,
course_list
}
=
this
.
state
;
const
Info
=
(
...
...
@@ -114,7 +135,29 @@ class ToGroup extends Component {
)
return
(
<
div
className
=
'to-group-box'
>
<<<<<<<
HEAD
<
HeaderBar
title
=
'拼团'
cart
=
{
false
}
toHref
=
{
'/'
}
><
/HeaderBar
>
=======
<
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
>
>>>>>>>
d659bd8e9b1fabb7dd84ff9e7a2d90926b678d0f
{
!
is_success
&&
<
VList
...
...
@@ -125,7 +168,11 @@ class ToGroup extends Component {
/
>
}
<
GorupContent
data
=
{
this
.
state
}
invitedFriends
=
{
this
.
invitedFriends
}
/
>
<
GorupContent
data
=
{
this
.
state
}
invitedFriends
=
{
this
.
invitedFriends
}
handleToGroup
=
{
this
.
handleToGroup
}
/
>
<
WhiteSpace
><
/WhiteSpace
>
<
div
className
=
"group-course"
>
...
...
@@ -222,7 +269,14 @@ function GorupContent(props) {
dec
=
<
p
className
=
'dec'
>
分享到
3
个群后,成团率高达
98
%<
/p
>
}
else
{
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
>
}
}
...
...
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