Forráskód Böngészése

feat: 实现轮播消息置为已读功能

Jack Zhou 1 hónapja
szülő
commit
3abb5dc761

+ 13 - 1
src/views/Layout/src/components/Header/components/TrainingCard.vue

@@ -11,7 +11,20 @@ const notificationMsgStore = useNotificationMessage()
 const notificationList = ref([])
 
 const curIndex = ref(0)
+// const displayedList = ref([])
+// const isNewCard = (id) => {
+//   if (!id) return false
+//   return !displayedList.value.some((item) => item.info.id === id)
+// }
 const curCard = computed(() => {
+  // if (
+  //   notificationList.value[curIndex.value] &&
+  //   isNewCard(notificationList.value[curIndex.value].info.id)
+  // ) {
+  //   displayedList.value.push(notificationList.value[curIndex.value])
+  // } else {
+  //   console.log('no curCard')
+  // }
   return notificationList.value[curIndex.value] || null
 })
 
@@ -132,7 +145,6 @@ const closeMessage = () => {
       <span class="font_family icon-icon_reject_b"></span>
     </el-button>
     <NotificationMessageCard
-      :isObserver="false"
       v-if="curCard"
       :data="[curCard]"
       :topOffset="0"