活动:修改活动的时间配置规则

This commit is contained in:
qiaoxin
2021-06-29 20:57:57 +08:00
parent 04d72a1956
commit 5e732e6d05
14 changed files with 174 additions and 112 deletions
+10 -8
View File
@@ -100,14 +100,16 @@ export class DailyCoinData extends ActivityBase {
for (let obj of dataObj.coinRewardFormula) {
this.coinRewardFormulaItem.push(new CoinRewardFormulaItem(obj))
}
let curDate = moment(new Date());
if (curDate.hour() < REFRESH_TIME) {
this.beginTime = curDate.startOf('d').add(-1, 'd').add(REFRESH_TIME, 'h').valueOf();
this.endTime = moment(this.beginTime).add(1, 'd').valueOf();
} else {
this.beginTime = curDate.startOf('d').add(REFRESH_TIME, 'h').valueOf();
this.endTime = moment(this.beginTime).add(1, 'd').valueOf()
}
// let curDate = moment(new Date());
// if (curDate.hour() < REFRESH_TIME) {
// this.beginTime = curDate.startOf('d').add(-1, 'd').add(REFRESH_TIME, 'h').valueOf();
// this.endTime = moment(this.beginTime).add(1, 'd').valueOf();
// } else {
// this.beginTime = curDate.startOf('d').add(REFRESH_TIME, 'h').valueOf();
// this.endTime = moment(this.beginTime).add(1, 'd').valueOf()
// }
// console.log('ddddddddddddbbbbbbb')
}
constructor(activityData: ActivityModelType) {