Переглянути джерело

Merge branch 'test' into dev_zyh

zhouyuhao 7 місяців тому
батько
коміт
cb59b48756

+ 5 - 2
src/views/Layout/src/components/Header/components/TrainingCard.vue

@@ -27,7 +27,7 @@ const pollingNewMessage = () => {
     getNotificationList(dayjs().format('MM/DD/YYYY HH:mm:ss'))
   }, 300000)
 }
-pollingNewMessage()
+userStore.isLogin && pollingNewMessage()
 
 // 登录后自动轮播消息
 const trainingCardAfterLogin = () => {
@@ -60,6 +60,7 @@ const nextNotification = () => {
 
 // 轮询时的轮播定时器
 const initTrainingCard = () => {
+  // 类型为event时才设置定时器,不为event类型时需要手动关闭消息
   if (curCard.value?.notificationType === 'event') {
     trainingIntervalId = setInterval(nextNotification, 2000)
   }
@@ -147,7 +148,6 @@ const closeMessage = () => {
   z-index: 2300;
   width: 432px;
   padding: 16px;
-  padding-bottom: 0;
   background-color: var(--color-dialog-body-bg);
   border-radius: 12px;
   box-shadow: 4px 4px 32px 0px rgba(0, 0, 0, 0.2);
@@ -161,5 +161,8 @@ const closeMessage = () => {
     cursor: pointer;
     z-index: 3000;
   }
+  :deep(.notification-card) {
+    margin-bottom: 0px;
+  }
 }
 </style>