Browse Source

fix: 🧩 返回屏保时间设置为0时 弹框直接出现

pull/1/head
jiangx 3 years ago
parent
commit
40a3f40f7d
  1. 5
      src/base/Message/Message.vue
  2. 5
      src/composables/useHandleScreen.ts
  3. 2
      src/router/index.ts

5
src/base/Message/Message.vue

@ -59,15 +59,12 @@ onMounted(() => {
top: 200px; top: 200px;
left: 50%; left: 50%;
z-index: 9999; z-index: 9999;
min-width: 300px;
height: 50px;
padding: 0 25px;
padding: 40px 80px;
color: #999; color: #999;
background: #f5f5f5; background: #f5f5f5;
border: 1px solid #e4e4e4; border: 1px solid #e4e4e4;
border-radius: 100px; border-radius: 100px;
transform: translate3d(-50%, 0, 0); transform: translate3d(-50%, 0, 0);
line-height: 50px;
.text-tips { .text-tips {
font-size: 24px; font-size: 24px;

5
src/composables/useHandleScreen.ts

@ -84,9 +84,10 @@ export const useHandleScreen = (callback: () => void) => {
onMounted(() => { onMounted(() => {
//获取返回首页和进入屏保的具体时间 //获取返回首页和进入屏保的具体时间
getBackTime().then(({ data }) => { getBackTime().then(({ data }) => {
totalTime.value = data
const noWallpaper = data[1] === 0
totalTime.value = noWallpaper ? [data[0], -1] : data
toIndexTime.value = data[0] toIndexTime.value = data[0]
toWallpaperTime.value = data[1]
toWallpaperTime.value = noWallpaper ? -1 : data[1]
}) })
}) })
return { return {

2
src/router/index.ts

@ -2,7 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'
import { routes } from './routes' import { routes } from './routes'
import type { App } from 'vue' import type { App } from 'vue'
const router = createRouter({
export const router = createRouter({
history: createWebHashHistory(), history: createWebHashHistory(),
routes routes
}) })

Loading…
Cancel
Save