| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const now = moment() |
| | | const year = moment().year() |
| | | const now = moment().hour(0).minute(0).second(0).millisecond(0) |
| | | const year = now.year() |
| | | const schedules = [] |
| | | let totals = 0 |
| | | for (let m = 1; m <= 12; m++) { |
| | |
| | | category: `${year}年${m}月环保工作日程`, |
| | | details: [] |
| | | } |
| | | const mon = m > 9 ? m : `0${m}` |
| | | //10,15,20 |
| | | let t1 = moment(`${year}-${m}-10`) |
| | | let t1 = moment(`${year}-${mon}-10`) |
| | | let d1 = t1.diff(now, 'days') |
| | | s.details.push({ |
| | | time: t1.format('MM月DD日'), |
| | | name: '环保日程环保日程环保日程环保日程环保日程环保日程', |
| | | left: d1, |
| | | }) |
| | | let t2 = moment(`${year}-${m}-15`) |
| | | let t2 = moment(`${year}-${mon}-15`) |
| | | let d2 = t2.diff(now, 'days') |
| | | s.details.push({ |
| | | time: t2.format('MM月DD日'), |
| | | name: '环保日程', |
| | | left: d2, |
| | | }) |
| | | let t3 = moment(`${year}-${m}-20`) |
| | | let t3 = moment(`${year}-${mon}-20`) |
| | | let d3 = t3.diff(now, 'days') |
| | | s.details.push({ |
| | | time: t3.format('MM月DD日'), |