diff --git a/src/api/base.ts b/src/api/base.ts index b259a4f..1994fcf 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -4,14 +4,22 @@ import { AxiosRequestConfig, CustomSuccessData } from 'axios'; import { getValue } from '@/utils/common'; import { message } from 'ant-design-vue'; import router from '@/router'; +import { MessageType } from 'ant-design-vue/types/message'; // 泛型接口 export interface Get { (url: string, params?: unknown, config?: AxiosRequestConfig): Promise>; } +const login:MessageType[] = [] +axios.interceptors.request.use((config)=>{ + login.push(message.loading('加载中..', 0)) + return config; +}) axios.interceptors.response.use((response)=>{ // console.log(response) + login[0](); + login.splice(0,1); if(response.data.code == 1001){ router.push("/") } diff --git a/src/utils/date.ts b/src/utils/date.ts index 9da443c..deb83a2 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -89,7 +89,9 @@ export function getweek(zhou?: number){ for(let j = 0;j < 24; j++){ date[i].list?.push({ start:"", - num:"" + num:"", + title: "", + time:"" }) } } @@ -103,4 +105,24 @@ export function getDay(date: string){ const now = dayjs(date) console.log(now.date()) return now.date(); +} + +export function gethour(date: string){ + const now = dayjs(date) + console.log(now.hour(), now.date(), now.minute()) + return now.hour(); +} + +export function getminute(date: string){ + const now = dayjs(date) + // console.log(now.hour(), now.date(), now.minute()) + return now.minute(); +} + +export function gettime(date: string, num: number){ + let now = dayjs(date) + const start = `${now.hour() > 9 ? now.hour() : '0' + now.hour()}:${now.minute() > 9 ? now.minute() : '0' + now.minute()}` + now = now.minute(now.minute() + num); + const end = `${now.hour() > 9 ? now.hour() : '0' + now.hour()}:${now.minute() > 9 ? now.minute() : '0' + now.minute()}` + return start + "-" + end; } \ No newline at end of file diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue index 72a8657..25f9073 100644 --- a/src/views/regime/week.vue +++ b/src/views/regime/week.vue @@ -39,21 +39,21 @@
-
- {{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{ - item > 9 ? item : "0" + item - }}:00 -
-
-
-
-
- one-line-hideon +
+ {{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{ + item > 9 ? item : "0" + item + }}:00 +
+
+
+
-
11:00-11:00
-
-
@@ -176,7 +176,8 @@ align-items: center; justify-content: center; font-size: 11px; - + border-radius: 6px; + overflow: hidden; > div:last-child { font-size: 11px; margin-top: 8px; @@ -185,6 +186,7 @@ .old { background-color: #f7f7f7; color: #111; + } .ing { background-color: #0dbba4; @@ -206,17 +208,42 @@