diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 68b1cfc..de2f5c6 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -36,7 +36,8 @@ top: 0.65rem; } .header-weather { - left: 1.25rem; + left: 1rem; + // top: 0.32rem; } .header-date { right: 0.375rem; diff --git a/src/utils/index.js b/src/utils/index.js index c7d190d..3356ab6 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -32,3 +32,15 @@ export function debounce(func, wait, immediate) { return result } } + +// 获取当前日期时间 +export function getCurrentTime() { + const yy = new Date().getFullYear() + const mm = new Date().getMonth() + 1 + const dd = new Date().getDate() + const hh = new Date().getHours() + const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes() + const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds() + const time = yy + '年' + mm + '月' + dd + '日 ' + hh + ':' + mf + ':' + ss + return time +} diff --git a/src/views/header/index.vue b/src/views/header/index.vue index 2a99eb4..4d989b0 100644 --- a/src/views/header/index.vue +++ b/src/views/header/index.vue @@ -1,19 +1,28 @@