From 86bccbfa3fc4b3961914f9750091b412e7a126a4 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期五, 15 三月 2024 13:47:46 +0800
Subject: [PATCH] #

---
 pages.json                       |   11 ++
 pages/LoginDemo/LoginDemo.vue    |   15 +--
 pages/project/jmAGV/floorOne.vue |  165 +++++++++++++++++++++++++++++++++++++++++
 pages/project/jmAGV/home.vue     |   18 ++++
 4 files changed, 198 insertions(+), 11 deletions(-)

diff --git a/pages.json b/pages.json
index 2c9f3f3..b25a1fc 100644
--- a/pages.json
+++ b/pages.json
@@ -123,6 +123,17 @@
 				
 		    }
 		    
+		},
+		{
+			"path" : "pages/project/jmAGV/floorOne",
+			"style" : 
+			{
+				"navigationBarTitleText" : "涓�妤�",
+				"enablePullDownRefresh" : false,
+				"navigationStyle": "custom"
+				// 鍘绘帀椤堕儴瀵艰埅鏍�
+				
+			}
 		}
     ],
 	"globalStyle": {
diff --git a/pages/LoginDemo/LoginDemo.vue b/pages/LoginDemo/LoginDemo.vue
index 09d9eef..9c0a9d4 100644
--- a/pages/LoginDemo/LoginDemo.vue
+++ b/pages/LoginDemo/LoginDemo.vue
@@ -30,11 +30,11 @@
 					<view class="scroll-item" v-for="net in network">
 						<view class="item-title" style="">{{net.name}}</view>
 						<view style="display: flex;align-items: center;">
-							<input class="settings-input1" type="text" v-model="net.ip">
+							<input class="settings-input1" type="text" v-model="net.ip" placeholder="璇疯緭鍏p">
 							<text style="font-weight: 900;">:</text>
-							<input class="settings-input2" type="text" v-model="net.port">
+							<input class="settings-input2" type="text" v-model="net.port" placeholder="璇疯緭鍏ョ鍙�">
 							<text style="font-weight: 900;">/</text>
-							<input class="settings-input3" type="text" v-model="net.address">
+							<input class="settings-input3" type="text" v-model="net.address" placeholder="璇疯緭鍏ュ湴鍧�">
 						</view>
 					</view>
 				</scroll-view>
@@ -74,14 +74,7 @@
 					username: '',
 					password: ''
 				},
-				network: [
-					{
-						name: 'wcs',
-						ip: '10.10.10.200',
-						port: '9090',
-						address: 'jmwcs'
-					}
-				],
+				network: [{}],
 				load: {
 					loading: false,
 					btnText: '鐧诲綍'
diff --git a/pages/project/jmAGV/floorOne.vue b/pages/project/jmAGV/floorOne.vue
new file mode 100644
index 0000000..fee0577
--- /dev/null
+++ b/pages/project/jmAGV/floorOne.vue
@@ -0,0 +1,165 @@
+<template>
+	<view  class="container">
+		<uni-icons type="bars" size="30" color="#b1b3b8" class="select" @click="jump()"></uni-icons>
+		<!-- 宸� -->
+		<view class="zcard">
+			<view class="zcard-flex">
+				<view class="button-nk" @click="click('left')">涓婃灦</view>
+			</view>
+		</view>
+		<!-- 鍙� -->
+		<view class="zcard">
+			<view class="zcard-flex">
+				<view class="button-nk" style="background-color: brown;" @click="click('right')">涓嬫灦</view>
+			</view>
+		</view>
+		
+		<view>
+			<uni-popup ref="revise" type="dialog">
+				<view class="popup">
+					<view  class="popup3-input-title">{{text}}</view>
+					<view class="button-nk" @click="option(item)" v-for="item in btns">{{item.name}}</view>
+				</view>
+			</uni-popup>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseUrl: '',
+				token: '',
+				onBtns: [
+					{name: '1鍙风┖鐩樹綅涓婃灦',code:'1-Q1',traget: '12-F1',type: 'foolr'},
+					{name: '2鍙风┖鐩樹綅涓婃灦',code:'1-Q1',traget: '12-F1',type: 'foolr'},
+				],
+				outBtns: [
+					{name: '涓嬫灦鑷�1鍙蜂綅',code:'11-Q1',traget: '1-F1',type: 'foolr'},
+					{name: '涓嬫灦鑷�2鍙蜂綅',code:'11-Q1',traget: '2-F1',type: 'foolr'},
+					{name: '涓嬫灦鑷�3鍙蜂綅',code:'11-Q1',traget: '3-F1',type: 'foolr'},
+				],
+				btns: [],
+				outType: '',
+				text: '',
+				btnTitle: '',
+				type: ''
+				
+			}
+		},
+		onShow() {
+			if (uni.getStorageSync('Network')) {
+				let network = uni.getStorageSync('Network')
+				this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}`
+				this.token = uni.getStorageSync('token');
+			}
+		},
+		methods: {
+			jump() {
+				uni.navigateTo({
+					url: '/pages/project/jmAGV/home'
+				})
+			},
+			click(type) {
+				if (type == 'left') {
+					this.btns = this.onBtns
+					this.text = '涓婃灦'
+					this.type = 'load'
+				} else {
+					this.btns = this.outBtns
+					this.type = 'unload'
+					this.text = '涓嬫灦'
+				}
+				this.$refs.revise.open(type)
+			},
+			option(item) {
+				let _this = this
+				let data = {
+					originLocal: item.code,
+					targetLocal: item.traget,
+					type: this.type,
+				}
+				uni.request({
+					url: `${_this.baseUrl}/agv/requestTask`,
+					data: data,
+					header: { 'token': uni.getStorageSync('token') },
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							setTimeout(()=>{
+								this.$refs.revise.close()
+							},300)
+							uni.showToast({ title: '鎿嶄綔鎴愬姛', icon: "none", position: 'top' })
+						} else {
+							uni.showToast({ title: res.msg, icon: "none", position: 'top' })
+						}
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	.container {
+		height: 100%;
+		display: grid;
+		grid-template-columns: 50% 50%;
+		width: 100%;
+	}
+	.zcard-flex {
+		/* background-color: coral; */
+		margin-top: 20rpx;
+		width: 100%;
+		height: 100%;
+		display: flex;
+		flex-wrap: wrap;
+		/* flex-direction: column; */
+		justify-content: space-around;
+		align-items: center;
+	}
+	.button-nk {
+		margin: 10rpx 0rpx;
+		/* padding: 20rpx 70rpx; */
+		/* background-color: azure; */
+		min-width: 150rpx;
+		/* margin: 0 auto; */
+		height: 50rpx;
+		text-align: center;
+		line-height: 50rpx;
+		font-size: 20rpx;
+		background-color: #409EFF;
+		color: #ECF0F1;
+		border-radius: 7px;
+		box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3),
+			inset -4px -4px 4px rgba(255, 255, 255, .4),
+			-4px -4px 5px rgba(0, 0, 0, .4);
+	}
+	.button-nk:active {
+		transform: translateY(2px) scale(0.99, 0.99);
+		box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3),
+			inset -4px -4px 8px rgba(255, 255, 255, .7),
+			-5px -5px 5px rgba(0, 0, 0, .3);
+	}
+	.popup {
+		background-color: #eee;
+		width: 30vw;
+		height: 100%;
+		padding: 0 10vw;
+		display: flex;
+		flex-direction: column;
+		justify-content: space-around;
+	}
+	.select {
+		position: absolute;
+		bottom: 12px;
+		right: 16px;
+		border-radius: 10px;
+		padding: 4px 10px;
+		box-shadow: inset 2px 2px 2px rgba(0, 0, 0, .3),
+			inset -2px -2px 2px rgba(255, 255, 255, .7),
+			-2px -2px 2px rgba(0, 0, 0, .4);
+	}
+</style>
diff --git a/pages/project/jmAGV/home.vue b/pages/project/jmAGV/home.vue
index 9797922..14b68d2 100644
--- a/pages/project/jmAGV/home.vue
+++ b/pages/project/jmAGV/home.vue
@@ -1,5 +1,6 @@
 <template>
 	<view class="container">
+		<uni-icons type="bars" size="30" color="#b1b3b8" class="select" @click="jump()"></uni-icons>
 		<!-- 宸� -->
 		<view class="zcard">
 			<view class="zcard-flex">
@@ -12,6 +13,7 @@
 				<view class="button-nk" style="background-color: brown;" v-for="item in traySiteList" @click="click(item,'right')">{{item.name}}</view>
 			</view>
 		</view>
+		
 		
 		<view>
 			<uni-popup ref="revise" type="dialog">
@@ -119,6 +121,11 @@
 			this.token = uni.getStorageSync('token');
 		},
 		methods: {
+			jump() {
+				uni.navigateTo({
+					url: '/pages/project/jmAGV/floorOne'
+				})
+			},
 			click(item,type) {
 				this.item = item
 				this.text = item.name
@@ -296,6 +303,7 @@
 		/* background-color: aqua; */
 		display: grid;
 		grid-template-columns: 50% 50%;
+		width: 100%;
 
 	}
 	.btn-box {
@@ -395,4 +403,14 @@
 		background-color: #09d174;
 		color: #cecece;
 	}
+	.select {
+		position: absolute;
+		bottom: 12px;
+		right: 16px;
+		border-radius: 10px;
+		padding: 4px 10px;
+		box-shadow: inset 2px 2px 2px rgba(0, 0, 0, .3),
+			inset -2px -2px 2px rgba(255, 255, 255, .7),
+			-2px -2px 2px rgba(0, 0, 0, .4);
+	}
 </style>

--
Gitblit v1.9.1