From f398ddd14530d2f0695865c8a4dede6205d91d09 Mon Sep 17 00:00:00 2001
From: guoyujie <guoyujie@ng.com>
Date: 星期二, 09 十二月 2025 11:07:25 +0800
Subject: [PATCH] 提交 app 初始化设计

---
 qrcodeScaner/pages/login/login.vue |   62 ++++++++++++++++++++----------
 1 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/qrcodeScaner/pages/login/login.vue b/qrcodeScaner/pages/login/login.vue
index 03ad647..f6b4961 100644
--- a/qrcodeScaner/pages/login/login.vue
+++ b/qrcodeScaner/pages/login/login.vue
@@ -1,6 +1,3 @@
-
-
-
 <template>
 	<view class="content" >
 		<image class="logo" src="/static/favicon.ico"></image>
@@ -8,16 +5,28 @@
 			<text class="title">NorthGlass_Scaner 鍒濆鍖�</text>
 		</view>
 		
-		
 		<view class="text-area" >
 			<uni-easyinput
-				@blur="changeIP"
 				class='input_1'
 				style="text-align: center;"
 				placeholder="璇疯緭鍏ユ湇鍔″櫒ip" 
 				:passwordIcon='false'
-				v-model="ipVal" 
+				v-model.trim="ipVal" 
 				type="input" />
+				
+		</view>
+		<view class="text-area" >
+			<uni-easyinput
+				class='input_1'
+				style="text-align: center;"
+				placeholder="璇疯緭鍏ョ鍙e彿" 
+				:passwordIcon='false'
+				v-model="portVal" 
+				type="number" />
+		</view>
+		
+		<view class="text-area" >
+			<button @click="save" type="primary" size="mini">淇濆瓨</button>
 		</view>
 		
 		<view>
@@ -34,6 +43,7 @@
   import userInfo from '@/stores/userInfo'
 	import request from '@/utils/request'
 	import {ip,webPort} from '@/utils/config.js'
+		import { debounce } from 'lodash'
 	
   const store=userInfo()
 	let searchUserList = ref({
@@ -46,15 +56,15 @@
 	const messageText=ref('')
 	const viewShow = ref(false)
 	let ipVal = ref(null)
+	let portVal = ref(null)
 	
-	onMounted(async()=>{
+	onMounted(() => {
 		
-		/* if(ip===null){
-			return
+		if(uni.getStorageSync('port') === ""){
+			portVal.value = 8086
+		}else{
+			portVal.value = uni.getStorageSync('port')
 		}
-		uni.reLaunch({
-		  url: `/pages/login/login`
-		}) */
 	})
 	
 	
@@ -67,17 +77,27 @@
 	}
 	
 	
-	const changeIP =async () => {
-		const ipRegex = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
-		if(ipRegex.test(ipVal.value)){
-			await uni.setStorageSync('ip', ipVal.value);
-			plus.runtime.restart()
+	// const changeIP =async () => {
+	// 	const ipRegex = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
+	// 	if(ipRegex.test(ipVal.value)){
+	// 		await uni.setStorageSync('ip', ipVal.value);
+	// 		plus.runtime.restart()
 			
-		}else{
-			messageToggle('error','璇疯緭鍏P鑼冨洿锛�0.0.0.0~255.255.255.255')
-		}
-	}
+	// 	}else{
+	// 		messageToggle('error','璇疯緭鍏P鑼冨洿锛�0.0.0.0~255.255.255.255')
+	// 	}
+	// }
 
+const save = debounce(async() => {
+	if(portVal.value === null || portVal.value === "" || ipVal === null || ipVal === ""){
+		 messageToggle('error','ip鎴栫鍙e彿涓嶈兘涓虹┖')
+		 return
+	}
+	await uni.setStorageSync('ip', ipVal.value);
+	await uni.setStorageSync('port', portVal.value);
+	plus.runtime.restart()
+	
+},200)
 </script>
 
 <style>

--
Gitblit v1.8.0