From a8ea0a75b5353d7bb97ba7825e3db261f85bcff7 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期一, 16 十月 2023 12:30:57 +0800
Subject: [PATCH] #

---
 pages/project/ps/home/home.vue |   72 ++++++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 23 deletions(-)

diff --git a/pages/project/ps/home/home.vue b/pages/project/ps/home/home.vue
index 62f380d..e12b4e1 100644
--- a/pages/project/ps/home/home.vue
+++ b/pages/project/ps/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/project/ps' + item.url" 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>
@@ -10,7 +10,7 @@
 					<text :class="'cuIcon-' + item.cuIcon"></text>
 				</navigator>
 			</view>
-			<view class="cu-tabbar-height"></view>
+			<view class="cu-tabbar-height"></view> 
 		</scroll-view>
 	</view>
 </template>
@@ -29,7 +29,14 @@
 						name: 'pakin',
 						color: 'cyan',
 						cuIcon: 'pullup',
-						url: '/tzsk/pakin/pakin2'
+						url: '/pakin/pakin'
+					},
+					{
+						title: '鎵樼洏瑙g粦',
+						name: 'untie',
+						color: 'cyan',
+						cuIcon: 'pullup',
+						url: '/tzsk/pakin/untie'
 					},
 					{
 						title: '缁勬墭涓婃灦',
@@ -54,7 +61,7 @@
 					},
 					{
 						title: 'AGV鐩樼偣/鎷f枡',
-						name: 'pakin',
+						name: 'AGVPick',
 						color: 'cyan',
 						cuIcon: 'pullup',
 						url: '/tzsk/AGV/AGVPick'
@@ -93,6 +100,13 @@
 						color: 'brown',
 						// cuIcon: 'pullup',
 						url: '/tzsk/AGV/AGVPakinOn'
+					},
+					{
+						title: 'AGV瀹瑰櫒绂诲満',
+						name: 'pakin',
+						color: 'cyan',
+						cuIcon: 'pullup',
+						url: '/tzsk/AGV/AGVContainerMove'
 					},
 					{
 						title: '璁㈠崟鍏ュ簱',
@@ -184,46 +198,58 @@
 			};
 		},
 		onShow() {
-			this.baseUrl = uni.getStorageSync('baseUrl');
+			let network = uni.getStorageSync('Network')
+			this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` 
 			this.token = uni.getStorageSync('token');
 			this.getAuth()
+			this.backGroundRepeat()
 		},
 		methods: {
+			backGroundRepeat() {
+				let len = this.colorList.length
+				let i = 0
+				for (let k in this.elements2) {
+					if (i == len) {
+						i = 0
+					}
+					this.elements2[k].color = this.colorList[i]
+					i++
+				}
+			},
 			getAuth() {
-				let that = this
+				let _this = this
 				uni.request({
-					url: 'http://127.0.0.1:8089/bfwms/menu/pda/auth',
+					url: `${_this.baseUrl}/menu/pda/auth`,
 					data: {},
 					header: { 'token': uni.getStorageSync('token') },
 					method: 'POST',
 					success(res) {
-						that.elements = []
-						console.log(res.statusCode);
-						res = res.data
-						if (res.statusCode == 404) {
-							console.log(res.statusCode);
-							that.elements = that.elements2
-							return
+						console.log(res);
+						if (res.statusCode === 404) {
+							_this.elements = _this.elements2
+							return 
 						}
+ 						res = res.data
+						_this.elements = []
 						if (res.code === 200) {
 							if (res.data == undefined || res.data == null || res.data == "") {
-								that.elements = that.elements2
+								_this.elements = _this.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({
+								_this.getIcon(res.data[i].title)
+								_this.elements.unshift({
 									title: res.data[i].name,
 									name: res.data[i].title,
-									color: that.colorList[i],
-									cuIcon: that.icon,
+									color: _this.colorList[i],
+									cuIcon: _this.icon,
 									url: res.data[i].action
 								})
 							}
-							that.elements.push({
+							_this.elements.push({
 								title: '閫�鍑虹櫥褰�',
 								name: 'logOut',
 								color: 'grey',
@@ -242,7 +268,7 @@
 								});
 							}, 1000);
 						} else if(res.status === 404) {
-							that.elements = that.elements2
+							_this.elements = _this.elements2
 							// uni.showToast({
 							// 	title: '榛樿涓婚〉',
 							// 	icon: "none",
@@ -257,8 +283,8 @@
 						}
 					},
 					fail(err) {
-						that.elements = []
-						that.elements = that.elements2
+						console.log(err);
+						_this.elements = _this.elements2
 					}
 				})
 			},

--
Gitblit v1.9.1