dsdq
This commit is contained in:
parent
4491ed5548
commit
4d2f74c0e1
@ -33,22 +33,23 @@ Page({
|
|||||||
page: 1,
|
page: 1,
|
||||||
page_size: 30,
|
page_size: 30,
|
||||||
})
|
})
|
||||||
const today = new Date()
|
const today = new Date();
|
||||||
today.setHours(0, 0, 0, 0)
|
const todayDate = new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
||||||
const list = res.list.map(item => {
|
|
||||||
const startDate = new Date(item.start_date)
|
|
||||||
const endDate = new Date(item.end_date)
|
|
||||||
|
|
||||||
if (today > endDate) {
|
const list = res.list.map(item => {
|
||||||
item.status = '已结束'
|
const startDate = new Date(item.start_date + 'T00:00:00'); // 将时间设置为午夜
|
||||||
} else if (today < startDate) {
|
const endDate = new Date(item.end_date + 'T00:00:00'); // 将时间设置为午夜
|
||||||
item.status = '未开始'
|
if (todayDate > endDate) {
|
||||||
} else if (today >= startDate && today <= endDate) {
|
item.status = '已结束';
|
||||||
item.status = '进行中'
|
} else if (todayDate < startDate) {
|
||||||
|
item.status = '未开始';
|
||||||
|
} else {
|
||||||
|
item.status = '进行中';
|
||||||
}
|
}
|
||||||
item.detail = JSON.parse(item.detail)
|
|
||||||
return item
|
item.detail = JSON.parse(item.detail);
|
||||||
})
|
return item;
|
||||||
|
});
|
||||||
this.setData({
|
this.setData({
|
||||||
list: list
|
list: list
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user