|
|
@ -51,7 +51,7 @@ |
|
|
|
<i class="iconfont" :class="item.icon"></i> |
|
|
|
<span> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -78,7 +78,7 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
import { useDateFormat, useNow, useTransition, TransitionPresets } from '@vueuse/core'; |
|
|
|
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 calendar from '@/utils/lunar'; |
|
|
|
import countTo from '@/utils/countTo'; |
|
|
@ -92,6 +92,7 @@ const isCurrentRoute = ref(true); |
|
|
|
const userStore = useUserStore(); |
|
|
|
const duration = 5000; |
|
|
|
const userNumber = ref(2800); |
|
|
|
const notice = ref({}); |
|
|
|
// const vsitsNumber = transitionNum(720, 5000); |
|
|
|
const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss'); |
|
|
|
const hoursNow = useNow().value.getHours(); |
|
|
@ -169,10 +170,35 @@ const timePeriod = computed(() => { |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
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() { |
|
|
|
//获取天气 |
|
|
|
getWeather().then(res => { |
|
|
|
getWeather().then((res: any) => { |
|
|
|
if (res.code === 200) { |
|
|
|
if (isCurrentRoute.value) { |
|
|
|
timer.value = setTimeout(async () => { |
|
|
|