zhb 1 ヶ月 前
コミット
5a2b8c51a8

+ 4 - 0
components/cwg-notice.vue

@@ -87,6 +87,10 @@ const getData = async () => {
 }
 onMounted(() => {
     if (!userToken.value) return
+    uni.$on('open-notice', () => {
+        getData()
+        getList()
+    })
     getData()
     getList()
 })

+ 0 - 2
components/cwg-page-wrapper.vue

@@ -112,14 +112,12 @@ const handleOpenRightDrawer = () => {
 onMounted(() => {
   // 只在组件挂载时注册事件监听器
   uni.$once('open-ib', handleOpenIb)
-  uni.$on('open-notice-drawer', handleOpenNoticeDrawer)
   uni.$on('open-right-drawer', handleOpenRightDrawer)
 })
 
 onUnmounted(() => {
   // 在组件销毁时移除事件监听器
   uni.$off('open-ib', handleOpenIb)
-  uni.$off('open-notice-drawer', handleOpenNoticeDrawer)
   uni.$off('open-right-drawer', handleOpenRightDrawer)
 })
 

+ 1 - 0
pages/analytics/detail.vue

@@ -155,6 +155,7 @@ const getNewsSingle = async () => {
             const noticeRes = await newsApi.newsNoticeSingle({ id: id.value })
             if (noticeRes.code === Code.StatusOK && noticeRes.data) {
                 info.value = noticeRes.data
+                uni.$emit('open-notice')
             } else {
                 uni.showToast({ title: noticeRes.msg, icon: 'none' })
             }