From a2019ade7b884799e639150021c3cdeef27eea72 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期六, 09 十一月 2024 11:40:52 +0800
Subject: [PATCH] 增加工号ui修改

---
 components/z-input/z-input.vue |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/components/z-input/z-input.vue b/components/z-input/z-input.vue
index 8d94627..287ed1b 100644
--- a/components/z-input/z-input.vue
+++ b/components/z-input/z-input.vue
@@ -3,6 +3,13 @@
 		<view class="main">
 			<view class="inner1">{{desc}}</view>
 			<view class="put inner2">
+				<uni-icons class="p-icon"
+					type="scan" 
+					size="16" 
+					color="#a6a6a6" 
+					@click="scanCode"
+					>
+				</uni-icons>
 				<input class="p-input" 
 					type="text" 
 					:placeholder="placeholder" 
@@ -78,6 +85,7 @@
 					return
 				}
 				if (val.length != this.lenCheck) {
+					console.log(val);
 					setTimeout(()=>{
 						this.data = ''
 						this.$emit('input','')
@@ -108,7 +116,17 @@
 				this.$emit('clickBtn');
 			},
 			inputVal() {
-				this.$emit('inputVal',[this.data,this.name]);
+				this.$emit('inputVal',{title:this.name,value:this.data});
+			},
+			scanCode() {
+				let _this = this
+				uni.scanCode({
+					onlyFromCamera: true,
+					success(res) {
+						_this.data = res.result
+						_this.$emit('inputVal',{title:_this.name,value:_this.data})
+					}
+				})
 			}
 		}
 	}
@@ -118,9 +136,8 @@
 	.main {
 		display: flex;
 		align-items: center;
-		min-height: 35px;
-		background-color: #f8f8f8;
-		margin: 8px;
+		min-height: 50px;
+		background-color: #fff;
 	}
 	.put {
 		display: flex;
@@ -135,12 +152,13 @@
 		font-family:'Helvetica Neue';
 	}
 	.inner2 {
-		background-color: #FFF;
+		background-color: #f8f8f8;
 		flex: 1;
 		display: flex;
 		align-items: center;
 		justify-content: center;
 		border-radius: 5px;
+		margin-right: 32rpx;
 		color: #606266;
 	}
 	.p-input {
@@ -148,11 +166,11 @@
 		padding: 4px;
 	}
 	.p-icon {
-		margin-left: 8px;
-		margin-right: 8px;
+		margin-left: 4px;
+		margin-right: 4px;
 	}
 	.inner3 {
-		width: 100px;
+		width: 90px;
 		display: flex;
 		align-items: center;
 		justify-content: center;

--
Gitblit v1.9.1