From 9d27d3ed337065adade794111654fd6e5c848f53 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 26 一月 2026 13:38:24 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/tiaomachaima/tiaomachaimaCopy.vue |   78 ++++++++++++++++++---------------------
 manifest.json                           |    2 
 2 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/manifest.json b/manifest.json
index 2a3638f..3f16198 100644
--- a/manifest.json
+++ b/manifest.json
@@ -162,7 +162,7 @@
             "LcPrinter" : {
                 "__plugin_info__" : {
                     "name" : "LcPrinter",
-                    "description" : "鏂扮増鎵撳嵃鎻掍欢",
+                    "description" : "鎵撳嵃鎻掍欢",
                     "platforms" : "Android",
                     "url" : "",
                     "android_package_name" : "",
diff --git a/pages/tiaomachaima/tiaomachaimaCopy.vue b/pages/tiaomachaima/tiaomachaimaCopy.vue
index d861e04..3bc9ea3 100644
--- a/pages/tiaomachaima/tiaomachaimaCopy.vue
+++ b/pages/tiaomachaima/tiaomachaimaCopy.vue
@@ -34,7 +34,6 @@
 				<button type="default" :class="cantPrint ? 'btn-disabled' : 'btn-c'" @click="PrintHBarCode"
 					:disabled="cantPrint">鎵撳嵃</button>
 					<button type="primary" @click="printerLabel">娴嬭瘯鎵撳嵃</button>
-					<button type="primary" @click="printTest">鍥炵焊璺濈</button>
 			</view>
 		</view>
 		<view class="divide"></view>
@@ -140,12 +139,14 @@
 			};
 		},
 		methods: {
-			
 			//鎵撳嵃鏈哄垵濮嬪寲
 			initPrinter() {
 				// 璋冪敤寮傛鏂规硶
-				console.log('鏂扮増鍒濆鍖�');
-				var ret = printer.initPrinter({});
+				console.log('鍒濆鍖�');
+				var ret = printer.initPrinter({
+					name: 'unimp',
+					age: 1
+				});
 				modal.toast({
 					message: ret,
 					duration: 1.5
@@ -156,36 +157,15 @@
 				printer.setConcentration({ //璁剧疆鎵撳嵃娴撳害銆俧ont_level 鍙栧�艰寖鍥达細1~39銆�
 					level: 39
 				});
-				printer.setLineSpacing({
-					spacing: 1
-				});
-				//add by ljh
-				printer.setFontSize({
-					fontSize: 8
-				});
-				//add end
-				printer.getsupportprint();
 			
-			},
-			printTest() {
-				printer.printEnableMark({enable: false});
-				console.log('娴嬭瘯鍥炵焊璺濈');
-				printer.printBarcode({
-					text: 1234567890123456789,
-					height: 80,
-					barcodeType: 73
-				});
-				printer.setFeedPaperSpace({ space: 1000});
-				printer.setUnwindPaperLen({ length: 60 });
-				printer.printLine({
-					line_length: 5
-				});
-				
-				printer.printGoToNextMark();//鏍囩鎵撳嵃浣跨敤,寮�濮嬭蛋绾�
-				//printer.start();//鐑晱鎵撳嵃浣跨敤,寮�濮嬭蛋绾�
 			},
 			printerLabel(item) {
 				console.log('娴嬭瘯鎵撳嵃');
+				
+				printer.setLineSpacing({
+					spacing: 1.2
+				});
+				
 				printer.setUnwindPaperLen({ length: 60 });
 				printer.setFontSize({
 					fontSize: 1
@@ -220,13 +200,13 @@
 					isUnderLine: false,
 					content: '鐗╂枡绠�绉帮細12SH 鍑洪缃� 娉ㄥ鐏�011(鍚孏E鐏�)\r\n'
 				});
-				printer.printText2({
-					offset: 1,
-					fontSize:2,
-					isBold: false,
-					isUnderLine: false,
-					content: '鐗╂枡鍚嶇О锛�12SH 鍑洪缃� 娉ㄥ鐏�011(鍚孏E鐏�)\r\n'
-				});
+				// printer.printText2({
+				// 	offset: 1,
+				// 	fontSize:2,
+				// 	isBold: false,
+				// 	isUnderLine: false,
+				// 	content: '鐗╂枡鍚嶇О锛�12SH 鍑洪缃� 娉ㄥ鐏�011(鍚孏E鐏�)\r\n'
+				// });
 				
 				printer.printText2({
 					offset: 1,
@@ -254,14 +234,23 @@
 					fontSize: 2,
 					isBold: false,
 					isUnderLine: false,
-					content: '宸ュ彿锛�000001\r\n'
+					content: '娴佹按鍙凤細000001\r\n'
+				});
+				printer.printText2({
+					offset: 1,
+					fontSize: 2,
+					isBold: false,
+					isUnderLine: false,
+					content: '鎵撳嵃鏃ユ湡锛�2025-8-13\r\n'
 				});
 				printer.printQR2({
 					text: 'title',
-					height: 100,
+					height: 120,
 					offset: 3
 				});
-				
+				printer.printLine({
+					line_length: 5
+				});
 				printer.printGoToNextMark();
 				
 				console.log('娴嬭瘯鎵撳嵃QR缁撴潫');
@@ -574,6 +563,7 @@
 			this.resetButtonState();
 			// 娣诲姞鎵撳嵃鐘舵�佺洃鍚�
 			if(!isPrinterInitialized){
+				const self = this;
 				globalEvent.addEventListener('onPrintCallback', function(e) {
 					uni.showToast({
 						title: 'state: ' + JSON.stringify(e),
@@ -585,10 +575,10 @@
 							duration: 2000
 						});
 						//鎴愬姛鍚庤缃姸鎬�
-						this.isPrinting = false;
+						self.isPrinting = false;
 						//this.resetButtonState();
 					} else if (e.key == 3) {
-						this.isPrinting = false;
+						self.isPrinting = false;
 						uni.showToast({
 							title: '缂虹焊',
 							duration: 2000
@@ -609,6 +599,10 @@
 		},
 		onReady() {
 			
+		},
+		onUnload() {
+			// 璋冪敤鍚屾鏂规硶
+			
 		}
 	}
 </script>

--
Gitblit v1.9.1