Commit f4ccf1de by xuzhenghua

强制拼团

parent 8e67e54b
......@@ -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>
......
......@@ -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)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment