From ed410791a62bb5dc11d8be22c42084c88aca78a9 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 13 十月 2023 17:29:42 +0800
Subject: [PATCH] #

---
 pages/LoginDemo/LoginDemo.vue |  131 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 128 insertions(+), 3 deletions(-)

diff --git a/pages/LoginDemo/LoginDemo.vue b/pages/LoginDemo/LoginDemo.vue
index 7058a42..0f267b0 100644
--- a/pages/LoginDemo/LoginDemo.vue
+++ b/pages/LoginDemo/LoginDemo.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="main">
 		<!-- 璁剧疆鎸夐挳 -->
-		<uni-icons type="gear" size="30" color="#b1b3b8" class="setting"></uni-icons>
+		<uni-icons type="gear" size="30" color="#b1b3b8" class="setting" @click="settings"></uni-icons>
 		<view class="left">
 			<!-- logo -->
 			<view class="logo-box">
@@ -17,10 +17,40 @@
 					<switch :checked='remberPassword' color="#FFCC33" style="zoom:.5" @change="remberChange"/>
 				</view>
 			</view>
-			<view class="button">
+			<view class="button" @click="login">
 				鐧诲綍
 			</view>
 		</view>
+		<!-- 璁剧疆寮圭獥鍖哄煙 -->
+		<uni-popup ref="settings" type="dialog">
+			<view class="popup">
+				<!-- 鏍囬 -->
+				<view class="title">缃� 缁� 閰� 缃�</view>
+					<scroll-view scroll-y="true" style="height: 23vh;touch-action: none;">
+						<view style="margin: 4px; color: #606266;font-size: 12px; " v-for="net in network">
+							<text style="font-size: 14px;">{{net.name}}</text>
+							<view style="display: flex;align-items: center;">
+								<input class="settings-input1" type="text" v-model="net.ip"> 
+								<text style="font-weight: 900;">:</text>
+								<input class="settings-input2" type="text" v-model="net.port"> 
+								<text style="font-weight: 900;">/</text>
+								<input class="settings-input3" type="text" v-model="net.address">
+							</view>
+						</view>
+					</scroll-view>
+				<view class="operate">
+					<view class="operate-cancel" @click="cancel">
+						鍙栨秷
+					</view>
+					<view class="operate-confirm" @click="confirm">
+						纭
+					</view>
+				</view>
+			</view>
+		</uni-popup>
+		
+		
+		
 		<!-- 鐗堟湰鍙� -->
 		<!-- #ifdef APP-PLUS -->
 		<view class="version">
@@ -35,7 +65,16 @@
 		data() {
 			return {
 				version: '',
-				remberPassword: true
+				remberPassword: true,
+				network: [
+					{name: 'wms',ip:'192.168.1.1',port: '8080',address: 'pswms'},
+					{name: 'wcs',ip:'192.168.1.1',port: '9090',address: 'pswcs'}
+				],
+				url: {
+					ip: '',
+					port: '',
+					project: ''
+				},
 			}
 		},
 		mounted() {
@@ -55,6 +94,32 @@
 		methods: {
 			remberChange() {
 				
+			},
+			settings() {
+				this.$refs.settings.open()
+			},
+			cancel() {
+				console.log(uni.getStorageSync('Network'));
+				this.$refs.settings.close()
+			},
+			confirm() {
+				uni.setStorageSync('Network', this.network);
+				this.$refs.settings.close()
+			},
+			login() {
+				let _this = this
+				let path = 'demo'
+				if(uni.getStorageSync('Network')) {
+					path = uni.getStorageSync('Network')[0].address
+					path = path.substring(0, path.length - 3);
+				}
+				uni.navigateTo({
+					url: `/pages/project/${path}/home/home`,
+					fail(res) {
+						console.log(`娌℃湁${path}椤圭洰,璇疯仈绯荤鐞嗗厓`);
+					}
+					
+				})
 			}
 		}
 	}
@@ -70,6 +135,7 @@
 					inset -2px -2px 2px rgba(255,255,255,.7),
 					-2px -2px 2px rgba(0,0,0,.4);
 	}
+	
 	.main {
 		height: 100%;
 		width: 100%;
@@ -174,4 +240,63 @@
 		font-size: 10px;
 		color: #909399;
 	}
+	
+	.popup {
+		width: 90vw;
+		height: 40vh;
+		background-color: #fff;
+		border-radius: 16px;
+	}
+	.title {
+		height: 10vh;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		font-size: 24px;
+		color: #a8abb2;
+	}
+	.settings-input1 {
+		border: 1px solid #dcdfe6;
+		flex: 2;
+		margin: 2px;
+		padding: 4px;
+		border-radius: 4px;
+	}
+	.settings-input2 {
+		border: 1px solid #dcdfe6;
+		flex: 1;
+		margin: 2px;
+		padding: 4px;
+		border-radius: 4px;
+	}
+	.settings-input3 {
+		border: 1px solid #dcdfe6;
+		flex: 2;
+		margin: 2px;
+		padding: 4px;
+		border-radius: 4px;
+		
+	}
+	.operate {
+		height: 7vh;
+		display: flex;
+		text-align: center;
+		border-top: 1px solid #dcdfe6;
+		font-size: 16px;
+	}
+	.operate-cancel {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		color: #606266;
+	}
+	.operate-confirm {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		border-left: 1px solid #dcdfe6;
+		color: #00aeec;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1