lilei 2 gadi atpakaļ
vecāks
revīzija
f99c313c11

+ 4 - 4
components/kk-printer/utils/bluetoolth.js

@@ -292,7 +292,7 @@ export function senBlData(deviceId, serviceId, characteristicId,uint8Array,laste
 			},
 			fail(e) {
 				console.log('发送数据失败',e)
-				lasterError()
+				lasterError(e)
 			}
 		})
 	}
@@ -303,7 +303,7 @@ export function senBlData(deviceId, serviceId, characteristicId,uint8Array,laste
 export function sendDataToDevice(options) {
 	let byteLength = options.value.byteLength;
 	//这里默认一次20个字节发送
-	const speed = plus.os.name != 'Android' ? 180 : 15; //20; 
+	const speed = plus.os.name != 'Android' ? 180 : 20; //20; 
 	console.log("send data 20");
 	console.log(options,byteLength,options.value);
 	if (byteLength > 0) {
@@ -318,14 +318,14 @@ export function sendDataToDevice(options) {
 							...options,
 							value: options.value.slice(speed, byteLength),
 						});
-					},50)
+					},100)
 				} else {
 					options.lasterSuccess && options.lasterSuccess();
 				}
 			})
 			.catch((res) => {
 				console.log(res);
-				options.lasterError && options.lasterError();
+				options.lasterError && options.lasterError(res);
 			});
 	}
 } 

+ 2 - 1
pages/shelfSetting/batchPrint.vue

@@ -157,7 +157,8 @@
 				this.isParinting = false
 				uni.hideLoading()
 			},
-			onPrintError(){
+			onPrintError(res){
+				console.log(res)
 				this.$refs.kkprinter.onPrintFail()
 				this.isParinting = false
 				this.show = false