From 5d62f0a16c8475aff2103f476fe827ec3e16046c Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期一, 24 三月 2025 19:49:17 +0800
Subject: [PATCH] 1

---
 pages/home/menuHome.vue |   89 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 70 insertions(+), 19 deletions(-)

diff --git a/pages/home/menuHome.vue b/pages/home/menuHome.vue
index 1ac1ba0..21cc225 100644
--- a/pages/home/menuHome.vue
+++ b/pages/home/menuHome.vue
@@ -2,9 +2,9 @@
 	<view>
 		<scroll-view scroll-y class="page">
 			<view class="nav-list">
-				<navigator hover-class='none' :url="'/pages' + item.url" class="nav-li" navigateTo
+				<navigator hover-class='none' :url="'/pages' + item.url + '?id=' + item.id" class="nav-li" navigateTo
 					:class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]"
-					v-for="(item,index) in elements2" :key="index">
+					v-for="(item,index) in elements" :key="index">
 					<view class="nav-title">{{item.title}}</view>
 					<view class="nav-name">{{item.name}}</view>
 					<text :class="'cuIcon-' + item.cuIcon"></text>
@@ -23,23 +23,51 @@
 				token: '',
 				icon: '',
 				elements: [],
-				project: 'tzsk',
+				project: 'phyz',
 				elements2: [
 					{
-						title: 'AGV绠$悊',
-						name: 'AGVManage',
+						title: '绔欑偣鏌ヨ缁存姢',
+						name: 'stationManage',
 						color: 'cyan',
 						// cuIcon: 'pullup',
-						url: `/home/agvManage`
+						url: `/phyz/stationManage/stationManage`
+					},
+					// {
+					// 	title: '鍏ュ嚭搴撶鐞�',
+					// 	name: 'inOutManage',
+					// 	color: 'purple',
+					// 	// cuIcon: 'pullup',
+					// 	url: `/home/inOutManage`
+					// },
+					{
+						title: '鍗曟嵁绠$悊',
+						name: 'ordeManage',
+						color: 'mauve',
+						// cuIcon: 'pullup',
+						url: `/home/orderManage`
 					},
 					{
-						title: '鍥涢」搴撶鐞�',
-						name: 'FourWayManage',
+						title: '搴撲綅绠$悊',
+						name: 'locManage',
 						color: 'blue',
 						// cuIcon: 'pullup',
-						url: `/home/fourWayManage` 
+						url: `/home/locMastManage`
 					},
 					{
+						title: '浠诲姟绠$悊',
+						name: 'ordeManage',
+						color: 'olive',
+						// cuIcon: 'pullup',
+						url: `/home/wrkMastManage`
+					},
+					// {
+					// 	title: '娴嬭瘯',
+					// 	name: 'testView',
+					// 	color: 'blue',
+					// 	// cuIcon: 'pullup',
+					// 	url: `/home/testView` 
+					// },
+					/* {
 						title: '骞充粨绠$悊',
 						name: 'basicStore',
 						color: 'mauve',
@@ -52,7 +80,7 @@
 						color: 'brown',
 						// cuIcon: 'pullup',
 						url: '/home/other'
-					},
+					}, */
 					{
 						title: '閫�鍑虹櫥褰�',
 						name: 'logOut',
@@ -62,14 +90,16 @@
 					},
 
 				],
+				menu: [],
 				colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ]
 			};
 		},
 		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
-			this.project = uni.getStorageSync('project')
-			// this.getAuth()
+			this.menu = uni.getStorageSync('menu');
+			// console.log(this.menu);
+			this.getAuth()
 			// this.backGroundRepeat()
 		},
 		methods: {
@@ -84,22 +114,42 @@
 					i++
 				}
 			},
+			getAuth2() {
+				this.elements = []
+				for (let i in this.menu) {
+					this.getIcon(this.menu[i].title)
+					this.elements.unshift({
+						title: this.menu[i].name,
+						name: this.menu[i].title,
+						color: this.colorList[i],
+						cuIcon: this.icon,
+						id: this.menu[i].id,
+						url: `${this.menu[i].code}`
+					})
+				}
+				this.elements.push({
+					title: '閫�鍑虹櫥褰�',
+					name: 'logOut',
+					color: 'grey',
+					cuIcon: 'exit',
+					url: '/login/logOut'
+				})
+			},
 			getAuth() {
 				let that = this
 				uni.request({
 					url: that.baseUrl + '/menu/pda/auth',
-					data: {},
+					data: {level:1,id: '0'},
 					header: { 'token': uni.getStorageSync('token') },
 					method: 'POST',
 					success(res) {
-						console.log(res);
 						res = res.data
 						that.elements = []
 						if (res.code === 200) {
-							if (res.data == undefined || res.data == null || res.data == "") {
-								that.elements = that.elements2
-								return
-							}
+							// if (res.data == undefined || res.data == null || res.data == "") {
+							// 	that.elements = that.elements2
+							// 	return
+							// }
 							for (var i = 0; i < res.data.length; i++) {
 								if (res.data.length < 0) {
 									break;
@@ -110,7 +160,8 @@
 									name: res.data[i].title,
 									color: that.colorList[i],
 									cuIcon: that.icon,
-									url: `/${that.project}${res.data[i].action}`
+									id: res.data[i].id,
+									url: `${res.data[i].code}`
 								})
 							}
 							that.elements.push({

--
Gitblit v1.9.1