ts-glitter 18.0.6 → 18.0.8

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
@@ -90,7 +90,7 @@ export class Entry {
90
90
  }
91
91
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
92
92
  console.log(`Entry-time:`, window.renderClock.stop());
93
- glitter.share.editerVersion = 'V_18.0.6';
93
+ glitter.share.editerVersion = 'V_18.0.8';
94
94
  glitter.share.start = new Date();
95
95
  const vm = {
96
96
  appConfig: [],
@@ -560,6 +560,7 @@ export class Entry {
560
560
  });
561
561
  }
562
562
  static resourceInitial(glitter, vm, callback) {
563
+ glitter.share.PayConfig = PayConfig;
563
564
  glitter.runJsInterFace('pos-device', {}, (res) => {
564
565
  PayConfig.deviceType = res.deviceType === 'neostra' ? 'pos' : 'web';
565
566
  if (PayConfig.deviceType === 'pos') {
@@ -576,7 +577,6 @@ export class Entry {
576
577
  window.IminPrintInstance.connect();
577
578
  }, 3000);
578
579
  }
579
- glitter.share.PayConfig = PayConfig;
580
580
  });
581
581
  glitter.runJsInterFace('getTopInset', {}, (response) => {
582
582
  glitter.share.top_inset = response.data;
package/lowcode/Entry.ts CHANGED
@@ -91,7 +91,7 @@ export class Entry {
91
91
  }
92
92
  (window as any).renderClock = (window as any).renderClock ?? clockF();
93
93
  console.log(`Entry-time:`, (window as any).renderClock.stop());
94
- glitter.share.editerVersion = 'V_18.0.6';
94
+ glitter.share.editerVersion = 'V_18.0.8';
95
95
  glitter.share.start = new Date();
96
96
  const vm: {
97
97
  appConfig: any;
@@ -618,6 +618,7 @@ export class Entry {
618
618
 
619
619
  // 資源初始化
620
620
  public static resourceInitial(glitter: Glitter, vm: any, callback: (data: any) => void) {
621
+ glitter.share.PayConfig=PayConfig
621
622
  //判斷是否為POS裝置的Initial
622
623
  glitter.runJsInterFace('pos-device', {}, (res) => {
623
624
  PayConfig.deviceType = res.deviceType === 'neostra' ? 'pos' : 'web';
@@ -643,7 +644,6 @@ export class Entry {
643
644
  window.IminPrintInstance.connect();
644
645
  }, 3000);
645
646
  }
646
- glitter.share.PayConfig=PayConfig
647
647
  });
648
648
  //取得APP的上間隔距離
649
649
  glitter.runJsInterFace(
@@ -128,8 +128,8 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
129
  const IminPrintInstance = window.parent.IminPrintInstance;
130
130
  function generateBarcodeBase64(barcodeString) {
131
- const canvas = document.createElement("canvas");
132
- JsBarcode(canvas, barcodeString, {
131
+ const canvas = window.parent.document.createElement("canvas");
132
+ window.parent.JsBarcode(canvas, barcodeString, {
133
133
  format: "CODE128",
134
134
  lineColor: "#000000",
135
135
  width: 2,
@@ -142,22 +142,19 @@ ${tempDiv.querySelector('.invoice-detail-sum')!!.children[2].textContent!.replac
142
142
  public static async printCode(code:string){
143
143
  const IminPrintInstance:any=(window.parent as any).IminPrintInstance
144
144
  function generateBarcodeBase64(barcodeString:any) {
145
- const canvas = document.createElement("canvas");
146
-
145
+ const canvas = (window.parent as any).document.createElement("canvas");
147
146
  // 使用 JsBarcode 將條碼字串渲染到 canvas
148
147
  //@ts-ignore
149
- JsBarcode(canvas, barcodeString, {
148
+ (window.parent as any).JsBarcode(canvas, barcodeString, {
150
149
  format: "CODE128", // 條碼格式,可根據需求更換
151
150
  lineColor: "#000000", // 條碼顏色
152
151
  width: 2, // 條碼寬度
153
152
  height: 50, // 條碼高度
154
153
  displayValue: false // 是否顯示條碼值
155
154
  });
156
-
157
155
  // 將 canvas 轉換為 base64 圖片
158
156
  const base64String = canvas.toDataURL("image/png");
159
157
  console.log("Base64 Barcode:", base64String);
160
-
161
158
  return base64String;
162
159
  }
163
160
  IminPrintInstance.printSingleBitmap(generateBarcodeBase64(code))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "18.0.6",
3
+ "version": "18.0.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {