|
@@ -51,7 +51,22 @@
|
|
|
<div class="notice-box" v-if="news.length > 0">
|
|
<div class="notice-box" v-if="news.length > 0">
|
|
|
<van-notice-bar ref="noticeBarRef" left-icon="volume-o">
|
|
<van-notice-bar ref="noticeBarRef" left-icon="volume-o">
|
|
|
<template #left-icon>
|
|
<template #left-icon>
|
|
|
- <img class="bar-icon" src="../assets/home_icon_redian.png" alt="" @click="showConsoleEve" />
|
|
|
|
|
|
|
+ <van-badge
|
|
|
|
|
+ dot
|
|
|
|
|
+ :offset="[-4, 4]"
|
|
|
|
|
+ class="animate__animated animate__rubberBand animate__infinite"
|
|
|
|
|
+ v-if="hasNews"
|
|
|
|
|
+ >
|
|
|
|
|
+ <img class="bar-icon" src="../assets/home_icon_redian.png" alt="" @click="showConsoleEve" />
|
|
|
|
|
+ </van-badge>
|
|
|
|
|
+
|
|
|
|
|
+ <img
|
|
|
|
|
+ class="bar-icon"
|
|
|
|
|
+ v-else
|
|
|
|
|
+ src="../assets/home_icon_redian.png"
|
|
|
|
|
+ alt=""
|
|
|
|
|
+ @click="showConsoleEve"
|
|
|
|
|
+ />
|
|
|
<div class="driver"></div>
|
|
<div class="driver"></div>
|
|
|
</template>
|
|
</template>
|
|
|
<van-swipe
|
|
<van-swipe
|
|
@@ -180,7 +195,7 @@ import intoIcon from '@/assets/svgs/icon_inter.svg'
|
|
|
import { Swiper, SwiperSlide } from 'swiper/vue'
|
|
import { Swiper, SwiperSlide } from 'swiper/vue'
|
|
|
import SwiperCore, { Pagination, Autoplay, Parallax, Controller } from 'swiper'
|
|
import SwiperCore, { Pagination, Autoplay, Parallax, Controller } from 'swiper'
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
-import { ref, watch } from 'vue'
|
|
|
|
|
|
|
+import { ref, watch, computed } from 'vue'
|
|
|
import { onIonViewWillEnter } from '@ionic/vue'
|
|
import { onIonViewWillEnter } from '@ionic/vue'
|
|
|
import { isAfter, isBefore, parse, getYear, getMonth, getDate, addDays, getTime, format } from 'date-fns'
|
|
import { isAfter, isBefore, parse, getYear, getMonth, getDate, addDays, getTime, format } from 'date-fns'
|
|
|
import { http } from '@/plugins/http'
|
|
import { http } from '@/plugins/http'
|
|
@@ -288,6 +303,13 @@ function getNotice() {
|
|
|
news.value = res.content
|
|
news.value = res.content
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+const hasNews = computed(() => {
|
|
|
|
|
+ let info = news.value.find(item => {
|
|
|
|
|
+ let date1 = addDays(new Date(item.createdAt), 1)
|
|
|
|
|
+ return isAfter(date1, new Date())
|
|
|
|
|
+ })
|
|
|
|
|
+ return !!info
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const noticeBarRef = ref(null)
|
|
const noticeBarRef = ref(null)
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|