From bbfe4dd2532bbd41c7f9d26285c7f0aae84ccb54 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 17 七月 2024 14:59:06 +0800
Subject: [PATCH] #

---
 pages/home/home.vue |   71 +++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/pages/home/home.vue b/pages/home/home.vue
index c9364f0..91dea64 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -2,7 +2,7 @@
 	<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 elements" :key="index">
 					<view class="nav-title">{{item.title}}</view>
@@ -23,20 +23,21 @@
 				token: '',
 				icon: '',
 				elements: [],
+				project: 'tzsk',
 				elements2: [
 					{
 						title: 'AGV缁勬墭',
 						name: 'AGVPakin',
 						color: 'blue',
 						// cuIcon: 'pullup',
-						url: '/tzsk/AGV/AGVPakin'
+						url: `/tzsk/AGV/AGVPakin`
 					},
 					{
 						title: 'AGV鐩樼偣/鎷f枡',
 						name: 'AGVPick',
 						color: 'cyan',
 						// cuIcon: 'pullup',
-						url: '/tzsk/AGV/AGVPick'
+						url: `/tzsk/AGV/AGVPick` 
 					},
 					
 					{
@@ -67,16 +68,29 @@
 						// cuIcon: 'pullup',
 						url: '/tzsk/AGV/AGVContainerMove'
 					},
-					
 					{
-						title: '缁勬墭鍏ュ簱',
+						title: 'AGV鏉$爜',
+						name: 'AGVCode',
+						color: 'cyan',
+						// cuIcon: 'pullup',
+						url: '/tzsk/AGV/AGVCode'
+					},
+					{
+						title: '骞冲簱缁勬墭鍏ュ簱',
 						name: 'pakin',
 						color: 'cyan',
 						// cuIcon: 'pullup',
 						url: '/tzsk/pakin/pakin2'
 					},
 					{
-						title: '缁勬墭涓婃灦',
+						title: '鍥涢」缁勬墭鍏ュ簱',
+						name: 'pakin',
+						color: 'cyan',
+						// cuIcon: 'pullup',
+						url: '/tzsk/pakin/pakin3'
+					},
+					{
+						title: '骞冲簱缁勬墭涓婃灦',
 						name: 'PutOn',
 						color: 'cyan',
 						// cuIcon: 'pullup',
@@ -170,7 +184,7 @@
 						name: 'stockQuery',
 						color: 'green',
 						cuIcon: 'check',
-						url: '/stock/stockQuery'
+						url: `/tzsk/stock/stockQuery`
 					},
 					{
 						title: '鐩樼偣',
@@ -230,6 +244,7 @@
 		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
+			// this.project = uni.getStorageSync('project')
 			this.getAuth()
 			this.backGroundRepeat()
 		},
@@ -249,30 +264,27 @@
 				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);
+						if (res.statusCode === 404) {
+							that.elements = that.elements2
+							return
+						}
 						res = res.data
 						that.elements = []
 						if (res.code === 200) {
-							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;
-								}
-								that.getIcon(res.data[i].title)
-								that.elements.unshift({
-									title: res.data[i].name,
-									name: res.data[i].title,
-									color: that.colorList[i],
-									cuIcon: that.icon,
-									url: res.data[i].action
-								})
-							}
+							that.getIcon(res.data[i].title)
+							that.elements.unshift({
+								title: res.data[i].name,
+								name: res.data[i].title,
+								color: that.colorList[i],
+								cuIcon: that.icon,
+								id: res.data[i].id,
+								url: `${res.data[i].code}`
+							})
 							that.elements.push({
 								title: '閫�鍑虹櫥褰�',
 								name: 'logOut',
@@ -322,6 +334,15 @@
 </script>
 
 <style>
+	.nav-list {
+		padding: 0px 40upx 0px;
+	}
+	.nav-li {
+		padding: 30upx;
+		border-radius: 12upx;
+		width: 90%;
+		margin: 0 2.5% 40upx;
+	}
 	.page {
 		height: 100vh;
 	}

--
Gitblit v1.9.1