From 0e686b26dc3000eb2602929ba03c8429e9aa1517 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 24 六月 2024 12:38:41 +0800
Subject: [PATCH] #

---
 pages/home/wrkMastManage.vue |   24 ++++++------
 pages/home/locMastManage.vue |   24 ++++++------
 pages/home/orderManage.vue   |   33 +++++++++-------
 pages/home/menuHome.vue      |   14 +++---
 4 files changed, 49 insertions(+), 46 deletions(-)

diff --git a/pages/home/locMastManage.vue b/pages/home/locMastManage.vue
index eb2ab94..9defcce 100644
--- a/pages/home/locMastManage.vue
+++ b/pages/home/locMastManage.vue
@@ -44,11 +44,18 @@
 				colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ]
 			};
 		},
-		onShow() {
+		// onShow() {
+		// 	this.baseUrl = uni.getStorageSync('baseUrl');
+		// 	this.token = uni.getStorageSync('token');
+		// 	this.project = uni.getStorageSync('project')
+		// 	// this.getAuth()
+		// 	this.backGroundRepeat()
+		// },
+		onLoad(option) {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
 			this.project = uni.getStorageSync('project')
-			this.getAuth()
+			this.getAuth(option.id)
 			this.backGroundRepeat()
 		},
 		methods: {
@@ -63,11 +70,11 @@
 					i++
 				}
 			},
-			getAuth() {
+			getAuth(id) {
 				let that = this
 				uni.request({
 					url: that.baseUrl + '/menu/pda/auth',
-					data: {},
+					data: {level:2 ,id: id},
 					header: { 'token': uni.getStorageSync('token') },
 					method: 'POST',
 					success(res) {
@@ -93,16 +100,9 @@
 									name: res.data[i].title,
 									color: that.colorList[i],
 									cuIcon: that.icon,
-									url: `/${that.project}${res.data[i].action}`
+									url: `${res.data[i].code}`
 								})
 							}
-							that.elements.push({
-								title: '閫�鍑虹櫥褰�',
-								name: 'logOut',
-								color: 'grey',
-								cuIcon: 'exit',
-								url: '/login/logOut'
-							})
 						} else if (res.code === 403) {
 							uni.showToast({
 								title: res.msg,
diff --git a/pages/home/menuHome.vue b/pages/home/menuHome.vue
index dc8a2c3..2477f53 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,7 +23,7 @@
 				token: '',
 				icon: '',
 				elements: [],
-				project: 'tzsk',
+				project: 'phyz',
 				elements2: [
 					{
 						title: '绔欑偣鏌ヨ缁存姢',
@@ -96,7 +96,6 @@
 		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
-			this.project = uni.getStorageSync('project')
 			this.getAuth()
 			// this.backGroundRepeat()
 		},
@@ -116,11 +115,10 @@
 				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) {
@@ -138,9 +136,11 @@
 									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}`
 								})
 							}
+							console.log(that.elements);
 							that.elements.push({
 								title: '閫�鍑虹櫥褰�',
 								name: 'logOut',
diff --git a/pages/home/orderManage.vue b/pages/home/orderManage.vue
index 8079061..7efccb5 100644
--- a/pages/home/orderManage.vue
+++ b/pages/home/orderManage.vue
@@ -27,7 +27,7 @@
 				elements2: [
 					{
 						title: '閲囪喘鍏ュ簱鍗�',
-						name: 'outPakin',
+						name: 'pakinOrder',
 						color: 'blue',
 						// cuIcon: 'pullup',
 						url: `/phyz/order/pakinOrderSelect`
@@ -93,11 +93,18 @@
 				colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ]
 			};
 		},
-		onShow() {
+		// onShow() {
+		// 	this.baseUrl = uni.getStorageSync('baseUrl');
+		// 	this.token = uni.getStorageSync('token');
+		// 	this.project = uni.getStorageSync('project')
+		// 	// this.getAuth()
+		// 	this.backGroundRepeat()
+		// },
+		onLoad(option) {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
 			this.project = uni.getStorageSync('project')
-			this.getAuth()
+			this.getAuth(option.id)
 			this.backGroundRepeat()
 		},
 		methods: {
@@ -112,11 +119,11 @@
 					i++
 				}
 			},
-			getAuth() {
+			getAuth(id) {
 				let that = this
 				uni.request({
 					url: that.baseUrl + '/menu/pda/auth',
-					data: {},
+					data: {level:2 ,id: id},
 					header: { 'token': uni.getStorageSync('token') },
 					method: 'POST',
 					success(res) {
@@ -129,8 +136,11 @@
 						that.elements = []
 						if (res.code === 200) {
 							if (res.data == undefined || res.data == null || res.data == "") {
-								that.elements = that.elements2
-								return
+								if (res.data.length == 0) {
+									return
+								} else {
+									that.elements = that.elements2
+								}
 							}
 							for (var i = 0; i < res.data.length; i++) {
 								if (res.data.length < 0) {
@@ -142,16 +152,9 @@
 									name: res.data[i].title,
 									color: that.colorList[i],
 									cuIcon: that.icon,
-									url: `/${that.project}${res.data[i].action}`
+									url: `${res.data[i].code}`
 								})
 							}
-							that.elements.push({
-								title: '閫�鍑虹櫥褰�',
-								name: 'logOut',
-								color: 'grey',
-								cuIcon: 'exit',
-								url: '/login/logOut'
-							})
 						} else if (res.code === 403) {
 							uni.showToast({
 								title: res.msg,
diff --git a/pages/home/wrkMastManage.vue b/pages/home/wrkMastManage.vue
index 6ddf5b1..3e1c41a 100644
--- a/pages/home/wrkMastManage.vue
+++ b/pages/home/wrkMastManage.vue
@@ -64,11 +64,18 @@
 				colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ]
 			};
 		},
-		onShow() {
+		// onShow() {
+		// 	this.baseUrl = uni.getStorageSync('baseUrl');
+		// 	this.token = uni.getStorageSync('token');
+		// 	this.project = uni.getStorageSync('project')
+		// 	// this.getAuth()
+		// 	this.backGroundRepeat()
+		// },
+		onLoad(option) {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
 			this.project = uni.getStorageSync('project')
-			this.getAuth()
+			this.getAuth(option.id)
 			this.backGroundRepeat()
 		},
 		methods: {
@@ -83,11 +90,11 @@
 					i++
 				}
 			},
-			getAuth() {
+			getAuth(id) {
 				let that = this
 				uni.request({
 					url: that.baseUrl + '/menu/pda/auth',
-					data: {},
+					data: {level:2 ,id: id},
 					header: { 'token': uni.getStorageSync('token') },
 					method: 'POST',
 					success(res) {
@@ -113,16 +120,9 @@
 									name: res.data[i].title,
 									color: that.colorList[i],
 									cuIcon: that.icon,
-									url: `/${that.project}${res.data[i].action}`
+									url: `${res.data[i].code}`
 								})
 							}
-							that.elements.push({
-								title: '閫�鍑虹櫥褰�',
-								name: 'logOut',
-								color: 'grey',
-								cuIcon: 'exit',
-								url: '/login/logOut'
-							})
 						} else if (res.code === 403) {
 							uni.showToast({
 								title: res.msg,

--
Gitblit v1.9.1