ts-glitter 18.4.2 → 18.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lowcode/Entry.js CHANGED
@@ -131,7 +131,7 @@ export class Entry {
131
131
  }
132
132
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
133
133
  console.log(`Entry-time:`, window.renderClock.stop());
134
- glitter.share.editerVersion = 'V_18.4.2';
134
+ glitter.share.editerVersion = 'V_18.4.3';
135
135
  glitter.share.start = new Date();
136
136
  const vm = { appConfig: [] };
137
137
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -131,7 +131,7 @@ export class Entry {
131
131
  }
132
132
  (window as any).renderClock = (window as any).renderClock ?? createClock();
133
133
  console.log(`Entry-time:`, (window as any).renderClock.stop());
134
- glitter.share.editerVersion = 'V_18.4.2';
134
+ glitter.share.editerVersion = 'V_18.4.3';
135
135
  glitter.share.start = new Date();
136
136
  const vm = { appConfig: [] };
137
137
  (window as any).saasConfig = {
@@ -1,14 +1,37 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1
+ var __awaiter = (this && this.__awaiter) || function(thisArg, _arguments, P, generator) {
2
+ function adopt(value) {
3
+ return value instanceof P ? value : new P(function(resolve) {
4
+ resolve(value);
5
+ });
6
+ }
7
+
8
+ return new (P || (P = Promise))(function(resolve, reject) {
9
+ function fulfilled(value) {
10
+ try {
11
+ step(generator.next(value));
12
+ } catch (e) {
13
+ reject(e);
14
+ }
15
+ }
16
+
17
+ function rejected(value) {
18
+ try {
19
+ step(generator['throw'](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+
25
+ function step(result) {
26
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
27
+ }
28
+
7
29
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
30
  });
9
31
  };
10
32
  import { PayConfig } from './pay-config.js';
11
33
  import { PaymentPage } from './payment-page.js';
34
+
12
35
  export class IminModule {
13
36
  static printInvoice(invoice, orderID, staff_title) {
14
37
  return __awaiter(this, void 0, void 0, function* () {
@@ -17,6 +40,7 @@ export class IminModule {
17
40
  return;
18
41
  }
19
42
  const IminPrintInstance = window.IminPrintInstance;
43
+
20
44
  function generateBarcodeBase64(barcodeString) {
21
45
  const canvas = document.createElement('canvas');
22
46
  JsBarcode(canvas, barcodeString, {
@@ -30,6 +54,7 @@ export class IminModule {
30
54
  console.log('Base64 Barcode:', base64String);
31
55
  return base64String;
32
56
  }
57
+
33
58
  yield IminPrintInstance.setAlignment(1);
34
59
  yield IminPrintInstance.setTextSize(50);
35
60
  yield IminPrintInstance.setTextStyle(1);
@@ -128,9 +153,11 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
128
153
  }), 1000);
129
154
  });
130
155
  }
156
+
131
157
  static printInvoiceSunMi(invoice, orderID, staff_title) {
132
158
  return __awaiter(this, void 0, void 0, function* () {
133
159
  const glitter = window.glitter;
160
+
134
161
  function mergeQRCodes(code) {
135
162
  return __awaiter(this, void 0, void 0, function* () {
136
163
  return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
@@ -159,6 +186,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
159
186
  }));
160
187
  });
161
188
  }
189
+
162
190
  function generateQRCode(text, size) {
163
191
  return new Promise((resolve) => {
164
192
  const div = document.createElement('div');
@@ -174,6 +202,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
174
202
  }, 200);
175
203
  });
176
204
  }
205
+
177
206
  const ba = (new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size)) * 1.1;
178
207
  for (let a = 0; a <= ba; a++) {
179
208
  invoice.qrcode_1 += '*';
@@ -239,7 +268,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
239
268
  {
240
269
  key: 'print-text', data: {
241
270
  style: 'normal',
242
- text: `${invoice.random_code} ${invoice.total}`,
271
+ text: `${invoice.random_code} ${invoice.total}`,
243
272
  font_size: 24,
244
273
  align: 0,
245
274
  },
@@ -443,6 +472,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
443
472
  });
444
473
  });
445
474
  }
475
+
446
476
  static printCodeSumi(code) {
447
477
  return __awaiter(this, void 0, void 0, function* () {
448
478
  const glitter = window.glitter;
@@ -465,6 +495,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
465
495
  }, {});
466
496
  });
467
497
  }
498
+
468
499
  static printQrCodeSumi(code) {
469
500
  return __awaiter(this, void 0, void 0, function* () {
470
501
  const glitter = window.glitter;
@@ -488,6 +519,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
488
519
  }, 200);
489
520
  });
490
521
  }
522
+
491
523
  generateQRCode(code, 185).then((res) => {
492
524
  glitter.runJsInterFace('start-print', {
493
525
  'command-list': [
@@ -511,9 +543,11 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
511
543
  });
512
544
  });
513
545
  }
546
+
514
547
  static printCode(code) {
515
548
  return __awaiter(this, void 0, void 0, function* () {
516
549
  const IminPrintInstance = window.parent.IminPrintInstance;
550
+
517
551
  function generateBarcodeBase64(barcodeString) {
518
552
  const canvas = window.parent.document.createElement('canvas');
519
553
  window.parent.JsBarcode(canvas, barcodeString, {
@@ -527,6 +561,7 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
527
561
  console.log('Base64 Barcode:', base64String);
528
562
  return base64String;
529
563
  }
564
+
530
565
  IminPrintInstance.printSingleBitmap(generateBarcodeBase64(code));
531
566
  yield IminPrintInstance.printAndFeedPaper(70);
532
567
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "18.4.2",
3
+ "version": "18.4.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {