|
@@ -268,19 +268,39 @@ export default {
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x40])); //16进制
|
|
arrPrint.push(util.sendDirective([0x1B, 0x40])); //16进制
|
|
|
//正文
|
|
//正文
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
|
- arrPrint.push(util.hexStringToBuff(BleVal.sendNum+ "\n"));
|
|
|
|
|
|
|
+ //字体宽高加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x11]));
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff(BleVal.sendNum));
|
|
|
|
|
+ //字体不放大,宽高不再加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x00]));
|
|
|
|
|
+
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff(" |纯彩花艺\n"));
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
|
|
|
+
|
|
|
arrPrint.push(util.hexStringToBuff("--------------------------------\n"));
|
|
arrPrint.push(util.hexStringToBuff("--------------------------------\n"));
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
|
- arrPrint.push(util.hexStringToBuff(BleVal.custom.fullAddress+ "\n"));
|
|
|
|
|
- arrPrint.push(util.hexStringToBuff(BleVal.custom.customName+' '+BleVal.custom.customMobile+ "\n"));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //字体宽高加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x11]));
|
|
|
|
|
+
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff(BleVal.custom.fullAddress+ "\n"));
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff(BleVal.custom.customName+"\n"+BleVal.custom.customMobile+ "\n"));
|
|
|
|
|
+
|
|
|
|
|
+ //字体不放大,宽高不再加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x00]));
|
|
|
|
|
|
|
|
if(BleVal.remark.length > 0){
|
|
if(BleVal.remark.length > 0){
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
|
arrPrint.push(util.hexStringToBuff("--------------------------------\n"));
|
|
arrPrint.push(util.hexStringToBuff("--------------------------------\n"));
|
|
|
arrPrint.push(util.hexStringToBuff("备注:\n"));
|
|
arrPrint.push(util.hexStringToBuff("备注:\n"));
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x0E]));
|
|
|
|
|
+ //字体宽高加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x11]));
|
|
|
arrPrint.push(util.hexStringToBuff(BleVal.remark+"\n"));
|
|
arrPrint.push(util.hexStringToBuff(BleVal.remark+"\n"));
|
|
|
|
|
+ //字体不放大,宽高不再加倍
|
|
|
|
|
+ arrPrint.push(util.sendDirective([0x1d, 0x21, 0x00]));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x14]));
|
|
@@ -297,11 +317,18 @@ export default {
|
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("优惠:", BleVal.discountAmount)));
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("优惠:", BleVal.discountAmount)));
|
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("应付金额:", BleVal.realPrice)));
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("应付金额:", BleVal.realPrice)));
|
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("实付金额:", BleVal.debt == 1 ? '0.00' : BleVal.realPrice)));
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("实付金额:", BleVal.debt == 1 ? '0.00' : BleVal.realPrice)));
|
|
|
|
|
+ if(BleVal.debtAmount > 0){
|
|
|
|
|
+ //加粗
|
|
|
|
|
+ //arrPrint.push(util.sendDirective([0x1b, 0x45, 0x01]));
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff(util.printTwoData("累计欠款:", BleVal.debtAmount)));
|
|
|
|
|
+ //取消加粗
|
|
|
|
|
+ //arrPrint.push(util.sendDirective([0x1b, 0x45, 0x00]));
|
|
|
|
|
+ }
|
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("订单日期:", BleVal.date)));
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("订单日期:", BleVal.date)));
|
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("订单编号:", BleVal.orderSn)));
|
|
arrPrint.push(util.hexStringToBuff(util.printTwoData("订单编号:", BleVal.orderSn)));
|
|
|
arrPrint.push(util.sendDirective([0x1B, 0x61, 0x00]));
|
|
arrPrint.push(util.sendDirective([0x1B, 0x61, 0x00]));
|
|
|
arrPrint.push(util.hexStringToBuff("门店地址:"+BleVal.address+"\n"));
|
|
arrPrint.push(util.hexStringToBuff("门店地址:"+BleVal.address+"\n"));
|
|
|
- arrPrint.push(util.hexStringToBuff("\n\n"));
|
|
|
|
|
|
|
+ arrPrint.push(util.hexStringToBuff("\n\n\n\n"));
|
|
|
|
|
|
|
|
// const ctx = uni.createCanvasContext('canvas');
|
|
// const ctx = uni.createCanvasContext('canvas');
|
|
|
// ctx.clearRect(0, 0, 130, 130);
|
|
// ctx.clearRect(0, 0, 130, 130);
|
|
@@ -328,8 +355,8 @@ export default {
|
|
|
// const buffer = toArrayBuffer(Buffer.from(cmds, 'gb2312'));
|
|
// const buffer = toArrayBuffer(Buffer.from(cmds, 'gb2312'));
|
|
|
// console.log(123456789)
|
|
// console.log(123456789)
|
|
|
// arrPrint.push(util.sendDirective([0x1B, 0x40]));
|
|
// arrPrint.push(util.sendDirective([0x1B, 0x40]));
|
|
|
- // for (let i = 0; i < buffer.byteLength; i = i + 50) {
|
|
|
|
|
- // arrPrint.push(buffer.slice(i, i + 50));
|
|
|
|
|
|
|
+ // for (let i = 0; i < buffer.byteLength; i = i + 20) {
|
|
|
|
|
+ // arrPrint.push(buffer.slice(i, i + 20));
|
|
|
// }
|
|
// }
|
|
|
// arrPrint.push(util.hexStringToBuff("\n"));
|
|
// arrPrint.push(util.hexStringToBuff("\n"));
|
|
|
// arrPrint.push(util.sendDirective([0x1B, 0x61, 0x01])); //居中
|
|
// arrPrint.push(util.sendDirective([0x1B, 0x61, 0x01])); //居中
|