|
@@ -5,6 +5,7 @@
|
|
|
<uni-list>
|
|
|
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon[0]" title="报名时间" :rightText="`${info.regStartTime}至${info.regEndTime}`"></uni-list-item>
|
|
|
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon[0]" title="活动时间" :rightText="`${info.startTime}至${info.endTime}`"></uni-list-item>
|
|
|
+ <uni-list-item :show-extra-icon="true" :extra-icon="extraIcon[1]" title="招募人数" :rightText="info.regMaxCount + '人'"></uni-list-item>
|
|
|
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon[1]" title="负责人" :rightText="info.sponsorName"></uni-list-item>
|
|
|
<uni-list-item :show-extra-icon="true" :extra-icon="extraIcon[2]" title="联系电话" :rightText="info.sponsorPhone"></uni-list-item>
|
|
|
</uni-list>
|
|
@@ -71,12 +72,13 @@
|
|
|
this.info = res.data;
|
|
|
this.statusInfo = statusInfo.status
|
|
|
const newDateTime = new Date().getTime();
|
|
|
- const isTime = Date.parse(res.data.regEndTime);
|
|
|
+ const endTime = Date.parse(res.data.regEndTime);
|
|
|
const startTime = Date.parse(res.data.regStartTime);
|
|
|
const startActiveTime = Date.parse(res.data.startTime);
|
|
|
+ const endActiveTime = Date.parse(res.data.endTime);
|
|
|
|
|
|
// 报名按钮状态设置
|
|
|
- if (!statusInfo.status) {
|
|
|
+ if (!statusInfo.status && newDateTime > startTime && newDateTime < endTime && newDateTime > startActiveTime && newDateTime < endActiveTime) {
|
|
|
this.buttonGroup[0].backgroundColor = '#ff0000';
|
|
|
this.buttonGroup[0].text = '报名活动';
|
|
|
delete this.buttonGroup[0].status
|
|
@@ -84,19 +86,19 @@
|
|
|
this.buttonGroup[1].disable = true;
|
|
|
this.buttonGroup[1].backgroundColor = '#999';
|
|
|
}
|
|
|
- if (statusInfo.status) {
|
|
|
+ if (statusInfo.status && newDateTime > startTime && newDateTime < endTime && newDateTime > startActiveTime && newDateTime < endActiveTime) {
|
|
|
this.buttonGroup[0].backgroundColor = '#999';
|
|
|
this.buttonGroup[0].text = '取消报名';
|
|
|
this.buttonGroup[0].status = true;
|
|
|
delete this.buttonGroup[1].disable;
|
|
|
this.buttonGroup[1].backgroundColor = '#ffa200';
|
|
|
}
|
|
|
- if (newDateTime < startTime) {
|
|
|
+ if (newDateTime < startTime || newDateTime < startActiveTime) {
|
|
|
this.buttonGroup[0].backgroundColor = '#999';
|
|
|
this.buttonGroup[0].text = '报名未开始';
|
|
|
this.buttonGroup[0].disable = true;
|
|
|
}
|
|
|
- if (newDateTime > isTime) {
|
|
|
+ if (newDateTime > endTime || newDateTime > endActiveTime) {
|
|
|
this.buttonGroup[0].backgroundColor = '#999';
|
|
|
this.buttonGroup[0].text = '报名已结束';
|
|
|
this.buttonGroup[0].disable = true;
|
|
@@ -111,22 +113,28 @@
|
|
|
this.buttonGroup[0].text = '报名已结束';
|
|
|
this.buttonGroup[0].disable = true;
|
|
|
|
|
|
- }else if(res.data.status == 0) {
|
|
|
+ }
|
|
|
+ if(res.data.status == 0) {
|
|
|
if(newDateTime < startActiveTime){
|
|
|
this.buttonGroup[1].text = '活动未开始';
|
|
|
this.buttonGroup[1].backgroundColor = '#999';
|
|
|
this.buttonGroup[1].disable = true;
|
|
|
- }else{
|
|
|
- if(statusInfo.status){
|
|
|
- this.buttonGroup[1].text = '获取积分';
|
|
|
- this.buttonGroup[1].backgroundColor = '#ffa200';
|
|
|
- delete this.buttonGroup[1].disable;
|
|
|
- }else{
|
|
|
- this.buttonGroup[1].text = '活动进行中';
|
|
|
- this.buttonGroup[1].backgroundColor = '#999';
|
|
|
- this.buttonGroup[1].disable = true;
|
|
|
- }
|
|
|
}
|
|
|
+ if(newDateTime > endActiveTime){
|
|
|
+ this.buttonGroup[1].text = '活动已结束';
|
|
|
+ this.buttonGroup[1].backgroundColor = '#999';
|
|
|
+ this.buttonGroup[1].disable = true;
|
|
|
+ }
|
|
|
+ if(statusInfo.status && newDateTime < endActiveTime && newDateTime > startActiveTime){
|
|
|
+ this.buttonGroup[1].text = '获取积分';
|
|
|
+ this.buttonGroup[1].backgroundColor = '#ffa200';
|
|
|
+ delete this.buttonGroup[1].disable;
|
|
|
+ }
|
|
|
+ if (!statusInfo.status && newDateTime < endActiveTime && newDateTime > startActiveTime){
|
|
|
+ this.buttonGroup[1].text = '活动进行中';
|
|
|
+ this.buttonGroup[1].backgroundColor = '#999';
|
|
|
+ this.buttonGroup[1].disable = true;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
buttonClick(e) {
|