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
f4ccf1de
Commit
f4ccf1de
authored
Jul 06, 2020
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
强制拼团
parent
8e67e54b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
35 deletions
+51
-35
src/components/detail/group/index.js
+32
-27
src/components/detail/index.js
+19
-8
No files found.
src/components/detail/group/index.js
View file @
f4ccf1de
...
...
@@ -40,7 +40,7 @@ class Group extends Component {
const
{
courseInfo
,
history
}
=
this
.
props
;
if
(
courseInfo
.
group_status
===
3
)
{
history
.
push
(
`/order?id=
${
getParam
(
'id'
)}
`
,
`/order?id=
${
getParam
(
'id'
)}
`
,
{
group
:
1
,
pdd_order_id
...
...
@@ -119,9 +119,9 @@ class Group extends Component {
render
()
{
const
{
courseInfo
}
=
this
.
props
;
const
{
alreadyIn
,
countdown
,
now_groupon_list
}
=
this
.
state
;
let
groupInfo
=
''
,
groupon_member
=
''
,
group_status
=
-
1
,
let
groupInfo
=
''
,
groupon_member
=
''
,
group_status
=
-
1
,
groupSuccessMbc
=
null
;
if
(
courseInfo
)
{
groupInfo
=
courseInfo
.
pdd_group_info
;
...
...
@@ -178,33 +178,38 @@ class Group extends Component {
return
(
<
div
className
=
'group-box'
>
<
div
className
=
"group-title"
>
<
span
>
{
groupInfo
.
now_groupon_total
}
人正在开团,可直接参与
<
/span
>
<
span
className
=
'more'
onClick
=
{
this
.
getMore
}
>
{
courseInfo
.
is_force
==
0
&&
<>
<
div
className
=
"group-title"
>
<
span
>
{
groupInfo
.
now_groupon_total
}
人正在开团,可直接参与
<
/span
>
<
span
className
=
'more'
onClick
=
{
this
.
getMore
}
>
查看更多
<
i
className
=
'iconfont iconiconfront-70'
><
/i
>
<
/span
>
<
/div
>
<
ul
className
=
"group-list"
>
{
groupInfo
.
now_groupon_list
&&
groupInfo
.
now_groupon_list
.
length
>
0
&&
groupInfo
.
now_groupon_list
.
map
((
item
,
index
)
=>
{
return
(
<
li
key
=
{
index
}
className
=
'group-item'
>
<
img
className
=
'avatar'
src
=
{
item
.
avatar
}
alt
=
""
/>
<
div
className
=
'user-name text-overflow-one'
>
{
item
.
user_name
}
<
/div
>
<
div
className
=
'group-status'
>
<
p
>
还差
<
span
className
=
'red'
>
{
item
.
number
}
人
<
/span>拼成</
p
>
<
p
>
剩余
{
this
.
formatTimeByMillisecond
(
item
.
end_time
)}
<
/p
>
<
/div
>
<
span
onClick
=
{()
=>
{
this
.
toPay
(
item
.
pdd_order_id
)
}}
className
=
'topay'
>
去参团
<
/span
>
<
/li
>
)
})
}
<
/ul
>
<
/
>
}
<
/div
>
<
ul
className
=
"group-list"
>
{
groupInfo
.
now_groupon_list
&&
groupInfo
.
now_groupon_list
.
length
>
0
&&
groupInfo
.
now_groupon_list
.
map
((
item
,
index
)
=>
{
return
(
<
li
key
=
{
index
}
className
=
'group-item'
>
<
img
className
=
'avatar'
src
=
{
item
.
avatar
}
alt
=
""
/>
<
div
className
=
'user-name text-overflow-one'
>
{
item
.
user_name
}
<
/div
>
<
div
className
=
'group-status'
>
<
p
>
还差
<
span
className
=
'red'
>
{
item
.
number
}
人
<
/span>拼成</
p
>
<
p
>
剩余
{
this
.
formatTimeByMillisecond
(
item
.
end_time
)}
<
/p
>
<
/div
>
<
span
onClick
=
{()
=>
{
this
.
toPay
(
item
.
pdd_order_id
)
}}
className
=
'topay'
>
去参团
<
/span
>
<
/li
>
)
})
}
<
/ul
>
<
div
className
=
"group-dec"
>
<
span
>
<
i
className
=
'iconfont iconiconfront-1'
><
/i
>
...
...
src/components/detail/index.js
View file @
f4ccf1de
...
...
@@ -86,7 +86,7 @@ class Detail extends Component {
this
.
userStatus
()
}
componentWillMount
(){
componentWillMount
()
{
this
.
showUserGiftFun
()
}
...
...
@@ -129,7 +129,7 @@ class Detail extends Component {
let
now_time
=
(
new
Date
()).
valueOf
()
// 获取当前时间
localStorage
.
setItem
(
'newer_last_time'
,
now_time
)
// 存储关闭时间
}
get_newerModal
=
()
=>
{
get_newerModal
=
()
=>
{
this
.
close
()
this
.
props
.
history
.
push
(
'/passport/login'
)
}
...
...
@@ -413,17 +413,28 @@ class Detail extends Component {
let
endTime
=
course_info
.
pdd_group_info
.
groupon_member
.
end_time
if
(
endTime
&&
endTime
>
0
)
{
let
date
=
endTime
*
1000
,
day
=
0
,
hours
=
0
,
minutes
=
0
,
seconds
=
0
setInterval
(()
=>
{
date
-=
1000
hours
=
`
${
parseInt
(
date
/
(
60
*
60
*
1000
))}
`
.
padStart
(
2
,
0
)
minutes
=
`
${
parseInt
((
date
-
hours
*
3600000
)
/
60000
)}
`
.
padStart
(
2
,
0
)
seconds
=
`
${
parseInt
((
date
-
hours
*
3600000
-
minutes
*
60000
)
/
1000
)}
`
.
padStart
(
2
,
0
)
this
.
setState
({
countdown
:
`
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
})
console
.
log
(
endTime
)
if
(
endTime
>
86400
)
{
day
=
`
${
parseInt
(
date
/
(
3600000
*
24
))}
`
.
padStart
(
2
,
0
)
hours
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
)
/
3600000
)}
`
.
padStart
(
2
,
0
)
minutes
=
`
${
parseInt
((
date
-
day
*
3600000
*
24
-
hours
*
3600000
)
/
60000
)}
`
.
padStart
(
2
,
0
)
this
.
setState
({
countdown
:
`
${
day
}
:
${
hours
}
:
${
minutes
}
`
})
}
else
{
hours
=
`
${
parseInt
(
date
/
(
60
*
60
*
1000
))}
`
.
padStart
(
2
,
0
)
minutes
=
`
${
parseInt
((
date
-
hours
*
3600000
)
/
60000
)}
`
.
padStart
(
2
,
0
)
seconds
=
`
${
parseInt
((
date
-
hours
*
3600000
-
minutes
*
60000
)
/
1000
)}
`
.
padStart
(
2
,
0
)
this
.
setState
({
countdown
:
`
${
hours
}
:
${
minutes
}
:
${
seconds
}
`
})
}
},
1000
)
}
}
...
...
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