From 3d775bfea16b5ac26ff0baac10f43b3367b0bf95 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期日, 08 十月 2023 13:28:42 +0800
Subject: [PATCH] #

---
 pages/component/demo.vue |  109 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 86 insertions(+), 23 deletions(-)

diff --git a/pages/component/demo.vue b/pages/component/demo.vue
index 81b4618..5b072c8 100644
--- a/pages/component/demo.vue
+++ b/pages/component/demo.vue
@@ -17,7 +17,19 @@
 		
 		<hr>
 		
-		<z-data-list class="data-list" v-for="it in zDataList"  @goDetail='goDetail' :list="it" :keyName="zDataKey"></z-data-list>
+		<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>
@@ -25,6 +37,7 @@
 </template>
 
 <script>
+	import addMat, { isEmpty } from '../api/addMat.js'
 	export default {
 		data() {
 			return {
@@ -36,29 +49,55 @@
 				zDataList: [
 					{
 						detl: [
-							{key: '鍟嗗搧鐮�',value: '3CPPJ.B.GMB.LZ.QBY4-10/15P316LL'},
-							{key: '鍟嗗搧鍚嶇О',value: '涓嶉攬閽㈢珛鏌�'},
-							{key: '瑙勬牸',value: 'QBY4-10/15P316LLZ'},
-							{key: '鏁伴噺',value: 10},
-						],
+							{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: '3CPPJ.B.GMB.LZ.'},
-							{key: '鍟嗗搧鍚嶇О',value: '绔嬫煴'},
-							{key: '瑙勬牸',value: '15P316LLZ'},
-							{key: '鏁伴噺',value: 8},
-						],
+							{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},
+						]
 					}
 				],
-				zDataKey: {str1: '鐗╂枡缂栫爜',str2: '璁㈠崟鍙�', str3: '鎵樼洏鐮�'},
-				pData: [
-					{key: '鍟嗗搧鐮�',value: '3CPPJ.B.GMB.LZ.QBY4-10/15P316LL'},
-					{key: '鍟嗗搧鍚嶇О',value: '涓嶉攬閽㈢珛鏌�'},
-					{key: '瑙勬牸',value: 'QBY4-10/15P316LLZ'},
-					{key: '鏁伴噺',value: 10},
-				]
-				
 			}
 		},
 		methods: {
@@ -66,8 +105,11 @@
 			},
 			ccc() {
 			},
-			aaa() {
-				
+			async add() {
+				let mat = await addMat.addMat()
+				if (!addMat.isEmpty(mat)) {
+					this.zDataList.push(mat)
+				}
 			},
 			focus() {
 				if (this.zInputList[0].focus) {
@@ -85,9 +127,26 @@
 				}
 				
 			},
-			goDetail() {
+			goDetail(param,index) {
+				let _this = this
 				uni.navigateTo({
-					url: '/pages/common/data-list/dataDetail'
+					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)
+						}
+					},
 				})
 			}
 		}
@@ -102,4 +161,8 @@
 	.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