From 5525ed0398c496b43a09377d0c59d143e7ff3e98 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期二, 24 九月 2024 19:04:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'remote-v2/master-2.0' into master-2.0

---
 sub_pages/supplier/print/print-list.vue |   63 ++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/sub_pages/supplier/print/print-list.vue b/sub_pages/supplier/print/print-list.vue
index c35c8dd..a4e73c9 100644
--- a/sub_pages/supplier/print/print-list.vue
+++ b/sub_pages/supplier/print/print-list.vue
@@ -106,11 +106,11 @@
 				returnResult: "",
 				canvasWidth: 80,
 				canvasHeight: 80,
-				buffSize: [],
-				buffIndex: 0,
-				printNum: [],
-				printNumIndex: 0,
-				printerNum: 1,
+				// buffSize: [],
+				// buffIndex: 0,
+				// printNum: [],
+				// printNumIndex: 0,
+				// printerNum: 1,
 				currentPrint: 1,
 				isReceiptSend: false,
 				isLabelSend: false,
@@ -128,21 +128,24 @@
 		 * 生命周期函数--监听页面初次渲染完成
 		 */
 		onReady: function() {
-			var list = []
-			var numList = []
-			var j = 0
-			for (var i = 20; i < 200; i += 10) {
-				list[j] = i;
-				j++
-			}
-			for (var i = 1; i < 10; i++) {
-				numList[i - 1] = i
-			}
+			// var list = []
+			// var numList = []
+			// var j = 0
+			// for (var i = 20; i < 400; i += 10) {
+			// 	list[j] = i;
+			// 	j++
+			// }
+			
+			// for (var i = 1; i < 10; i++) {
+			// 	numList[i - 1] = i
+			// }
 			let that = this
-			that.buffSize = list
-			that.oneTimeData = list[0]
-			that.printNum = numList
-			that.printerNum = numList[0]
+			// that.buffSize = list
+			// that.oneTimeData = list[0]
+			that.oneTimeData = 20
+			// that.printNum = numList
+			// that.printerNum = numList[0]
+			
 		},
 		async onLoad() {
 			var t = this.$storage.getItem('cache_delivery_order_print') || ''
@@ -679,8 +682,8 @@
 				var loopTime = that.looptime
 				var lastData = that.lastData
 				var onTimeData = that.oneTimeData
-				var printNum = that.printerNum
-				var currentPrint = that.currentPrint
+				// var printNum = that.printerNum
+				let currentPrint = that.currentPrint
 				var buf
 				var dataView
 				if (currentTime < loopTime) {
@@ -696,7 +699,8 @@
 						dataView.setUint8(i, buff[(currentTime - 1) * onTimeData + i])
 					}
 				}
-				console.log("第" + currentTime + "次发送数据大小为:" + buf.byteLength)
+
+				console.log("第" + currentTime + "次发送数据大小为:" + buf.byteLength, that.$util.toDateTime(new Date()))
 				wx.writeBLECharacteristicValue({
 					deviceId: that.deviceId,
 					serviceId: that.writeServiceId,
@@ -745,10 +749,17 @@
 
 								}
 							} else {
-								currentPrint++
-								that.currentPrint = currentPrint
-								that.currentTime = 1
-								that.Send(that.buffs[that.currentPrint - 1])
+								console.log('已打印第' + currentPrint + '张')
+								setTimeout(() => {
+									currentPrint++
+									that.currentPrint = currentPrint
+									that.currentTime = 1
+									// that.Send(that.buffs[that.currentPrint - 1])
+									that.prepareSend(that.buffs[that.currentPrint - 1])
+									
+									
+								}, 500)
+
 							}
 
 							// } else {

--
Gitblit v1.9.3