From 112bb1d3ca7e5c813adc9514f6b56b5e4886f49b Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期二, 12 八月 2025 10:26:29 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/index/tab2.vue |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/pages/index/tab2.vue b/pages/index/tab2.vue
index 19ea4d8..d5f8310 100644
--- a/pages/index/tab2.vue
+++ b/pages/index/tab2.vue
@@ -26,10 +26,13 @@
 </template>
 
 <script>
+	import { CommonUtils } from '../../utils/common'
+	import { getMenuList, setMenuList } from '../../utils/menuListApp'
 	export default {
 		data() {
 			return {
-				menuListRowName: 'tab2',
+				updateCount: 0,
+				menuListName: 'tab2',
 				canEdit: false,
 				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
 				itemData: [{
@@ -198,21 +201,29 @@
 			this.getHiddenItem()
 		},
 		methods: {
-			getHiddenItem() {
-				let itemCache = uni.getStorageSync('HTab2ItemData') || ''
-				console.log('itemCache: ', itemCache);
-				if (itemCache !== '') {
-					this.itemData = itemCache
-				}
+			async getHiddenItem() {
+				let data = await getMenuList({
+					menuName: this.menuListName
+				})
+				Array.from(data).forEach(e => {
+					this.itemData[e["HIndex"]].hidden = !CommonUtils.stringToBoolean(e["HShowMode"]) 
+				})
 			},
 			switchHidden(index) {
+				this.updateCount ++;
 				this.itemData[index].hidden = !this.itemData[index].hidden
 			},
 			switchIconsModeHandler() {
 				this.canEdit = !this.canEdit
-				if (this.canEdit == false) {
+				if(this.canEdit == false && this.updateCount > 0) {
 					this.$nextTick(() => {
-						uni.setStorageSync("HTab2ItemData", this.itemData)
+						// uni.setStorageSync("HIndexItemData", this.itemData)
+						setMenuList({
+							menuName: this.menuListName,
+							payload: this.itemData
+						})
+						
+						this.updateCount = 0
 					})
 				}
 				this.$forceUpdate()

--
Gitblit v1.9.1