原生JS代码封装(获得n天以后的日期) function getDateAfterNdays(n){ var now = new Date(); now.setDate( now.getDate()+n ); return now; }