//显示当前时间(年月日时分秒) function timeFormate() { let that = this let year = new Date().getFullYear(); let month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1; let date = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate(); let hh = new Date().getHours() < 10 ? '0' + new Date().getHours() : new Date().getHours(); let mm = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes(); let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds(); let week = new Date().getDay(); let weeks = ['日', '一', '二', '三', '四', '五', '六']; let getWeek = '星期' + weeks[week]; /* that.datebox.date = year + ' ' + month + ' ' + date; that.datebox.time = hh + ':' + mm + ':' + ss; that.datebox.week = getWeek; */ /* $('.h-date .d').text(year + '-' + month + '-' + date); $('.date .time').text(hh + ':' + mm + ':' + ss);*/ $('.date .d2').text(month + '月' + date + '日' + getWeek); $('.date .time2').text(hh + ':' + mm); $('.h-date').text(year + '-' + month + '-' + date + ' ' + hh + ':' + mm); } /** * 功能页面跳转 * @param tag */ function toPage(tag) { window.location.href = "../dzhwk/" + tag; }