getTime(week) { let time; let year = new Date().getFullYear(); let d = new Date(year, 0, 1); while (d.getDay() != 1) { d.setDate(d.getDate() + 1); } let to = new Date(year + 1, 0, 1); let i = 1; for (var from = d; from < to;) { if (i > 1) { from.setDate(from.getDate() + 7); } if (from < to) { from.setDate(from.getDate()); } console.log(year + "年第" + i + "周 " + (from.getMonth() + 1) + "月" + from.getDate() + "日 - ") if (i === week) { time = `${year}-${from.getMonth() + 1}-${from.getDate()}` } i++; } return time }