var date = new Date()// 结束日期 let ms = date.getTime() let end = ms + 604800000 //未来一周的时间戳 var time = new Date(end) console.log(time);//当前时间 console.log(time.getFullYear()+"年");//年份 console.log(time.getMonth()+1+"月");//月份 console.log(time.getDate()+"日");//几号 console.log("周"+time.getDay());//星期几 var y = time.getFullYear() var m = time.getMonth()+1 var d = time.getDate() this.endDate = y + '-' + m + '-' + d