From ca73a173f008c8d7a9d700bad897ca24fe2d2203 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 16 十月 2023 09:29:57 +0800
Subject: [PATCH] 111

---
 minipro_standard/store/index.js |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/minipro_standard/store/index.js b/minipro_standard/store/index.js
index 2d5b182..cb25fd3 100644
--- a/minipro_standard/store/index.js
+++ b/minipro_standard/store/index.js
@@ -77,33 +77,37 @@
 	},
 	actions: {
 		// 鍚戝悗绔幏鍙栬彍鍗曟爮鏉冮檺
-		async getMenuList(content, type) {
+		async getMenuList(content, type) {
 			let res = await getTreeList({
 				type: type
 			})
-			if (res.code === 200) {
+			if (res && res.code === 200) {
 				content.commit('SETMENU', res.data)
 			}
 		},
 		// 鑾峰彇鐘舵�侀珮搴�
-		getHeight(context) {
-			let res = uni.getMenuButtonBoundingClientRect()
-			let status = uni.getSystemInfoSync()
-			let menuButtonWidth = res.width
-			let height = res.height
-			let statusbarHeight = status.statusBarHeight
-			let navHeight = res.height + (res.top - statusbarHeight) * 2;
-			context.commit('setHeight', {
-				statusbarHeight,
-				navHeight,
-				height,
-				menuButtonWidth
-			})
+		getHeight(context) {
+			// #ifdef MP-WEIXIN
+			let res = uni.getMenuButtonBoundingClientRect()
+			let status = uni.getSystemInfoSync()
+			let menuButtonWidth = res.width
+			let height = res.height
+			let statusbarHeight = status.statusBarHeight
+			let navHeight = res.height + (res.top - statusbarHeight) * 2;
+			context.commit('setHeight', {
+				statusbarHeight,
+				navHeight,
+				height,
+				menuButtonWidth
+			})
+			// #endif
+			
 		},
-		async getUpcomingNum() {
-			let res = await pageCount({})
-			if (res.code === 200) {
-				content.commit('SETNUM', {
+		async getUpcomingNum(context) {
+			let res = await pageCount({})
+			
+			if (res && res.code === 200) {
+				context.commit('SETNUM', {
 					d: res.data.startNum,
 					y: res.data.endNum
 				})
@@ -112,7 +116,7 @@
 		// 鍚戝悗绔幏鍙栦釜浜轰俊鎭�
 		async getUserInfos(content) {
 			let res = await getUserInfo()
-			if (res.code === 200) {
+			if (res && res.code === 200) {
 				content.commit('SETUSERINFO', res.data)
 				return true;
 			}

--
Gitblit v1.9.3