From 30991d69333a9f7e4ab31c6012d23159077a1d0e Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期日, 08 十月 2023 19:41:35 +0800
Subject: [PATCH] #

---
 pages/project/demo/home/home.vue |  160 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 160 insertions(+), 0 deletions(-)

diff --git a/pages/project/demo/home/home.vue b/pages/project/demo/home/home.vue
index 02409e3..dac4ec3 100644
--- a/pages/project/demo/home/home.vue
+++ b/pages/project/demo/home/home.vue
@@ -1,8 +1,168 @@
 <template>
+	<view>
+		<z-input v-for="it in zInputList" 
+			:desc="it.desc" :btn="it.btn" :btn-name="it.btnName" v-model="it.val" 
+			:lenCheck="it.lenCheck" :focus="it.focus" @clickBtn='entry(it.name)'>
+		</z-input>
+		<view>杈撳叆妗�1</view>
+		<view>{{zInputList[0].val}}</view>
+		
+		<view>杈撳叆妗�2</view>
+		<view>{{zInputList[1].val}}</view>
+		
+		<view>杈撳叆妗�2</view>
+		<view>{{zInputList[2].val}}</view>
+		
+		<button @click="focus">focus</button>
+		
+		<hr>
+		
+		<z-data-list class="data-list" 
+			v-for="(it,i) in zDataList" 
+			:key="i"  
+			:list="it.detl" 
+			:index="i+1"
+			@goDetail='goDetail(it.detl,i)' 
+			
+		></z-data-list>
+		
+		
+		<button @click="add">add</button>
+		
+		<hr>
+		
+		<!-- 鍨珮 -->
+		<view style="height: 100rpx;"></view>
+	</view>
 </template>
 
 <script>
+	import addMat, { isEmpty } from '@/pages/api/addMat.js'
+	export default {
+		data() {
+			return {
+				zInputList: [ 
+					{name: 'ccc',desc: '璁㈠崟鍙�',btn: true,btnName: '闃挎柉椤�',val: 'orderNo',focus: true},
+					{name: 'yyy',desc: '鎵樼洏鐮�',val: '2',lenCheck: 8,focus: false},
+					{name: 'aaa',desc: '鐗╂枡鐮�',btn: true,btnName: '鎻愬彇',placeholder: '',val: '1',focus: false}
+				],
+				zDataList: [
+					{
+						detl: [
+							{key: '鍟嗗搧鐮�',value: 'LSH90152025',valText: 'val-text'},
+							{key: '鍟嗗搧鍚嶇О',value: '灏奸緳澶达紙鐏扮櫧锛�5.2x25'},
+							{key: '瑙勬牸',value: '700*699*80'},
+							{key: '鎵瑰彿',value: '20231007204944',type: 'input'},
+							{key: '鏁伴噺',value: 951326478,type: 'number-box',valText: 'val-num'},
+							{key: '搴忓彿',value: 1},
+						]
+					},
+					{
+						detl: [
+							{key: '鍟嗗搧鐮�',value: 'LSH90152025',valText: 'val-text'},
+							{key: '鍟嗗搧鍚嶇О',value: '灏奸緳澶达紙鐏扮櫧锛�5.2x25'},
+							{key: '瑙勬牸',value: '700*699*80'},
+							{key: '鎵瑰彿',value: '20231007204944',type: 'input'},
+							{key: '鏁伴噺',value: 951326478,type: 'number-box',valText: 'val-num'},
+							{key: '搴忓彿',value: 2},
+						]
+					},
+					{
+						detl: [
+							{key: '鍟嗗搧鐮�',value: 'LSH90152025',valText: 'val-text'},
+							{key: '鍟嗗搧鍚嶇О',value: '灏奸緳澶达紙鐏扮櫧锛�5.2x25'},
+							{key: '瑙勬牸',value: '700*699*80'},
+							{key: '鎵瑰彿',value: '20231007204944',type: 'input'},
+							{key: '鏁伴噺',value: 951326478,type: 'number-box',valText: 'val-num'},
+							{key: '搴忓彿',value: 3},
+						]
+					},
+					{
+						detl: [
+							{key: '鍟嗗搧鐮�',value: 'LSH90152025',valText: 'val-text'},
+							{key: '鍟嗗搧鍚嶇О',value: '灏奸緳澶达紙鐏扮櫧锛�5.2x25'},
+							{key: '瑙勬牸',value: '700*699*80'},
+							{key: '鎵瑰彿',value: '20231007204944',type: 'input'},
+							{key: '鏁伴噺',value: 951326478,type: 'number-box',valText: 'val-num'},
+							{key: '搴忓彿',value: 4},
+						]
+					},
+					{
+						detl: [
+							{key: '鍟嗗搧鐮�',value: 'LSH90152025',valText: 'val-text'},
+							{key: '鍟嗗搧鍚嶇О',value: '灏奸緳澶达紙鐏扮櫧锛�'},
+							{key: '瑙勬牸',value: '700*699*80'},
+							{key: '鎵瑰彿',value: '20231007204944',type: 'input'},
+							{key: '鏁伴噺',value: 951326478,type: 'number-box',valText: 'val-num'},
+							{key: '搴忓彿',value: 5},
+						]
+					}
+				],
+			}
+		},
+		methods: {
+			entry(e) {
+			},
+			ccc() {
+			},
+			async add() {
+				let mat = await addMat.addMat()
+				if (!addMat.isEmpty(mat)) {
+					this.zDataList.push(mat)
+				}
+			},
+			focus() {
+				if (this.zInputList[0].focus) {
+					this.zInputList[0].focus = false
+					this.zInputList[1].focus = true
+					this.zInputList[2].focus = false
+				} else if (this.zInputList[1].focus){
+					this.zInputList[0].focus = false
+					this.zInputList[1].focus = false
+					this.zInputList[2].focus = true
+				} else {
+					this.zInputList[0].focus = true
+					this.zInputList[1].focus = false
+					this.zInputList[2].focus = false
+				}
+				
+			},
+			goDetail(param,index) {
+				let _this = this
+				uni.navigateTo({
+					url: '/pages/common/data-list/dataDetail',
+					// 浼�
+					success: function(data) {
+						data.eventChannel.emit('param', {
+							param: param,
+							index: index
+						})
+					},
+					// 鎺�
+					events: {
+						dataList: function(data) {
+							console.log(data);
+						},
+						del: function(data) {
+							_this.zDataList.splice(data.data,1)
+						}
+					},
+				})
+			}
+		}
+		
+	}
 </script>
 
 <style>
+	.data-list {
+		
+	}
+	.data-list:last-child {
+		margin-bottom: 100px;
+	}
+	hr {
+		margin-top: 10px;
+		margin-bottom: 10px;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1