From 9d961bd20d2dfa877b8411c9104b00f98b3a4983 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期三, 24 十二月 2025 09:15:23 +0800
Subject: [PATCH] 海川开心-配置文件更改

---
 src/pages/index.vue |   55 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/src/pages/index.vue b/src/pages/index.vue
index 8f96f6f..462b20e 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -154,9 +154,10 @@
 		nextTick,
 		reactive
 	} from 'vue';
+	import dayjs from "dayjs"
 	import {
 		userLoginFacotryList,
-		noticesCount
+		noticesList
 	} from "@/api/login";
 	import modal from "@/plugins/modal";
 	import useUserStore from "@/store/modules/user";
@@ -260,7 +261,11 @@
 		{
 			icon: '/static/images/icon/kehubaifang@2x.png',
 			label: '瀹㈡埛鎷滆',
-		}
+		},
+		{
+			icon: '/static/images/icon/qingjiaguanli@2x.png',
+			label: '閫氱煡鍏憡',
+		},
 	]);
 	// 鍗忓悓鍔炲叕鍔熻兘鏁版嵁inventoryManagement/receiptManagement
 	const inventoryManagement = reactive([{
@@ -429,6 +434,11 @@
 					url: '/pages/cooperativeOffice/clientVisit/index'
 				});
 				break;
+			case '閫氱煡鍏憡':
+				uni.navigateTo({
+					url: '/pages/cooperativeOffice/noticeManagement/index'
+				});
+				break;
 			case '鑷畾涔夊叆搴�':
 				uni.navigateTo({
 					url: '/pages/inventoryManagement/receiptManagement/index'
@@ -567,14 +577,21 @@
 			uToastRef.value.success(`鐐瑰嚮浜嗙${name + 1}涓猔); // 娉ㄦ剰锛氳繖閲屽姞1鏄洜涓洪�氬父鎴戜滑鏄粠绗�1涓紑濮嬭鏁扮殑
 		}
 	};
-	const isShowNoticesCount = ref(true)
+	const isShowNoticesList = ref(true)
 	// 鑾峰彇鍏憡鏁伴噺
-	const getNoticesCount = () => {
-		if(!isShowNoticesCount.value){
+	const getNoticesList = () => {
+		if(!isShowNoticesList.value){
 			return
 		}
-		noticesCount({}).then(resp => {
-			if (resp.code != 200 || !resp.data) {
+		const current_date = dayjs().format('YYYY-MM-DD')
+		noticesList({
+			current:-1,
+			size:-1,
+			status: 1,
+			current_date
+		}).then(resp => {
+			console.log('noticesList',resp)
+			if (resp.code != 200 || !resp.data||!resp.data.records||!resp.data.records.length) {
 				return
 			}
 			const res = uni.getAppAuthorizeSetting();
@@ -585,34 +602,31 @@
 					success: (res) => {
 						if (res.confirm) {
 							uni.openAppAuthorizeSetting({
-								success: (res) => {
-									console.log('openAppAuthorizeSetting',res)
-									// if (res.authSetting['scope.push']) {
-									// 	createPushMessage(resp.data)
-									// }
-								}
+								success: (res) => {}
 							});
 						}else{
-							isShowNoticesCount.value = false
+							isShowNoticesList.value = false
 						}
 					}
 				});
 				return
 			}
-			createPushMessage(resp.data)
+			resp.data.records.map(item=>{
+				createPushMessage(item.title)
+			})
+			
 		}).catch(error => {
 			modal.msgError('鑾峰彇鍏憡鏁伴噺:', error)
-			console.log('鑾峰彇鍏憡鏁伴噺:', error)
 		})
 	}
 
-	const createPushMessage = (_noticesCount) => {
+	const createPushMessage = (text) => {
 		uni.createPushMessage({
 			title: '鍏憡閫氱煡',
-			content: `褰撳墠鏈�${_noticesCount}鏉″叕鍛婇�氱煡锛屾敞鎰忔煡鐪媊,
+			content: text||'',
 			success: (resp) => {
 				console.log('success', resp)
-				isShowNoticesCount.value = false
+				isShowNoticesList.value = false
 			},
 			fail: (resp) => {
 				console.log('fail', resp)
@@ -626,10 +640,9 @@
 		getUserLoginFacotryList()
 		// 鍚姩閫氱煡鐘舵�佸畾鏃跺櫒
 		startStatusTimer()
-		// getNoticesCount()
 	});
 	onShow(()=>{
-		getNoticesCount()
+		getNoticesList()
 	})
 </script>
 

--
Gitblit v1.9.3