ccj 2 vuotta sitten
vanhempi
commit
7317c5259c
1 muutettua tiedostoa jossa 15 lisäystä ja 20 poistoa
  1. 15 20
      pages/erpbusiness/sendCommand.vue

+ 15 - 20
pages/erpbusiness/sendCommand.vue

@@ -10,6 +10,7 @@
 			<view style='margin-top:4%;display: flex;flex-direction: column;'>
 				<button type='primary' class="btn" @tap='receiptTest' :loading='isReceiptSend'
 					:disabled='isReceiptSend'>打印质检单小票</button>
+				<button type='primary' class="btn" @tap='clearBlue'>重新连接蓝牙</button>
 				<button type='primary' class="btn" @tap='goToList'>返回列表页</button>
 				<!-- <button type='primary' @tap='labelTest' :loading='isLabelSend' :disabled='isLabelSend'>标签测试</button> -->
 			</view>
@@ -448,12 +449,10 @@
 				var time = that.oneTimeData;
 				var looptime = parseInt(buff.length / time);
 				var lastData = parseInt(buff.length % time); //console.log(looptime + "---" + lastData)
-
-				that.setData({
-					looptime: looptime + 1,
-					lastData: lastData,
-					currentTime: 1
-				});
+				
+				this.looptime = looptime + 1
+				this.lastData = lastData 
+				this.currentTime =  1
 				that.Send(buff);
 			},
 			//查询打印机状态
@@ -519,25 +518,21 @@
 						currentTime++;
 
 						if (currentTime <= loopTime) {
-							that.setData({
-								currentTime: currentTime
-							});
+							that.currentTime = currentTime
+							
 							that.Send(buff);
 						} else {
 							if (currentPrint == printNum) {
-								that.setData({
-									looptime: 0,
-									lastData: 0,
-									currentTime: 1,
-									isReceiptSend: false,
-									currentPrint: 1
-								});
+								that.looptime = 0
+								that.lastData = 0
+								that.currentTime = 1
+								that.isReceiptSend = false
+								that.currentPrint = 1
 							} else {
 								currentPrint++;
-								that.setData({
-									currentPrint: currentPrint,
-									currentTime: 1
-								});
+								that.currentPrint = currentPrint
+								that.currentTime = 1
+								
 								that.Send(buff);
 							}
 						}