|
@ -51,7 +51,7 @@ |
|
|
<i class="iconfont" :class="item.icon"></i> |
|
|
<i class="iconfont" :class="item.icon"></i> |
|
|
<span> |
|
|
<span> |
|
|
<countTo :start="1" :end="item.value" :duration="item.time"></countTo> |
|
|
<countTo :start="1" :end="item.value" :duration="item.time"></countTo> |
|
|
<span v-if="item.total!=0"><i>/</i>{{ item.total }}</span> |
|
|
<span v-if="item.total != 0"><i>/</i>{{ item.total }}</span> |
|
|
</span> |
|
|
</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -78,7 +78,7 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { useDateFormat, useNow, useTransition, TransitionPresets } from '@vueuse/core'; |
|
|
import { useDateFormat, useNow, useTransition, TransitionPresets } from '@vueuse/core'; |
|
|
import { useUserStore } from '@/store/modules/user'; |
|
|
import { useUserStore } from '@/store/modules/user'; |
|
|
import { getWeather } from '@/api/user/index'; |
|
|
import { getWeather, userVersionRelation } from '@/api/user/index'; |
|
|
// import { transitionNum } from '@/utils/index'; |
|
|
// import { transitionNum } from '@/utils/index'; |
|
|
import calendar from '@/utils/lunar'; |
|
|
import calendar from '@/utils/lunar'; |
|
|
import countTo from '@/utils/countTo'; |
|
|
import countTo from '@/utils/countTo'; |
|
@ -92,6 +92,7 @@ const isCurrentRoute = ref(true); |
|
|
const userStore = useUserStore(); |
|
|
const userStore = useUserStore(); |
|
|
const duration = 5000; |
|
|
const duration = 5000; |
|
|
const userNumber = ref(2800); |
|
|
const userNumber = ref(2800); |
|
|
|
|
|
const notice = ref({}); |
|
|
// const vsitsNumber = transitionNum(720, 5000); |
|
|
// const vsitsNumber = transitionNum(720, 5000); |
|
|
const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss'); |
|
|
const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss'); |
|
|
const hoursNow = useNow().value.getHours(); |
|
|
const hoursNow = useNow().value.getHours(); |
|
@ -169,10 +170,35 @@ const timePeriod = computed(() => { |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
getWeatherData(); |
|
|
getWeatherData(); |
|
|
|
|
|
const webVersion = sessionStorage.getItem('webVersion'); |
|
|
|
|
|
if (webVersion != '') { |
|
|
|
|
|
const version = JSON.parse(webVersion); |
|
|
|
|
|
notice.value = ElNotification({ |
|
|
|
|
|
title: '更新日志', |
|
|
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
|
|
customClass: 'notice', |
|
|
|
|
|
duration: 0, |
|
|
|
|
|
message: version.versionDesc.replace(/\n/g, '<br>'), |
|
|
|
|
|
onClose: () => { |
|
|
|
|
|
noticeCloce(version.id); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
function noticeCloce(id: any) { |
|
|
|
|
|
//更新日志关闭事件 |
|
|
|
|
|
const params = { |
|
|
|
|
|
versionId: id |
|
|
|
|
|
}; |
|
|
|
|
|
userVersionRelation(params).then((res: any) => { |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
console.log('更新日志关闭!') |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
function getWeatherData() { |
|
|
function getWeatherData() { |
|
|
//获取天气 |
|
|
//获取天气 |
|
|
getWeather().then(res => { |
|
|
getWeather().then((res: any) => { |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
if (isCurrentRoute.value) { |
|
|
if (isCurrentRoute.value) { |
|
|
timer.value = setTimeout(async () => { |
|
|
timer.value = setTimeout(async () => { |
|
|