ts-glitter 19.0.4 → 19.0.6

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.
Files changed (32) hide show
  1. package/lowcode/Entry.js +3 -3
  2. package/lowcode/Entry.ts +3 -3
  3. package/lowcode/cms-plugin/POS-setting.js +1 -1
  4. package/lowcode/cms-plugin/POS-setting.ts +1 -1
  5. package/lowcode/cms-plugin/pos-pages/imin-module.js +54 -31
  6. package/lowcode/cms-plugin/pos-pages/imin-module.ts +60 -40
  7. package/lowcode/cms-plugin/pos-pages/payment-page.js +9 -6
  8. package/lowcode/cms-plugin/pos-pages/payment-page.ts +9 -6
  9. package/lowcode/cms-plugin/pos-pages/pos-function.js +1 -1
  10. package/lowcode/cms-plugin/pos-pages/pos-function.ts +1 -1
  11. package/lowcode/cms-plugin/pos-pages/products-page.js +6 -4
  12. package/lowcode/cms-plugin/pos-pages/products-page.ts +6 -4
  13. package/lowcode/cms-plugin/shopping-invoice-manager.js +67 -44
  14. package/lowcode/cms-plugin/shopping-invoice-manager.ts +81 -54
  15. package/lowcode/cms-plugin/shopping-product-setting.js +13 -3
  16. package/lowcode/cms-plugin/shopping-product-setting.ts +31 -9
  17. package/lowcode/css/front-end.css +0 -61
  18. package/lowcode/glitter-base/route/shopping.js +16 -0
  19. package/lowcode/glitter-base/route/shopping.ts +20 -0
  20. package/lowcode/jslib/qrcode-d.js +609 -0
  21. package/package.json +1 -1
  22. package/src/api-public/controllers/invoice.js +17 -0
  23. package/src/api-public/controllers/invoice.js.map +1 -1
  24. package/src/api-public/controllers/invoice.ts +17 -0
  25. package/src/api-public/services/invoice.js.map +1 -1
  26. package/src/api-public/services/invoice.ts +1 -0
  27. package/src/api-public/services/public-table-check.js +5 -3
  28. package/src/api-public/services/public-table-check.js.map +1 -1
  29. package/src/api-public/services/public-table-check.ts +5 -3
  30. package/src/api-public/services/shopping.js +17 -17
  31. package/src/api-public/services/shopping.js.map +1 -1
  32. package/src/api-public/services/shopping.ts +27 -27
package/lowcode/Entry.js CHANGED
@@ -132,7 +132,7 @@ export class Entry {
132
132
  }
133
133
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
134
134
  console.log(`Entry-time:`, window.renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.0.4';
135
+ glitter.share.editerVersion = 'V_19.0.6';
136
136
  glitter.share.start = new Date();
137
137
  const vm = { appConfig: [] };
138
138
  window.saasConfig = {
@@ -597,7 +597,7 @@ export class Entry {
597
597
  glitter.addMtScript([
598
598
  'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
599
599
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
600
- glitter.root_path + 'jslib/qrcode.min.js',
600
+ glitter.root_path + 'jslib/qrcode-d.js',
601
601
  ], () => {
602
602
  }, () => {
603
603
  });
@@ -609,7 +609,7 @@ export class Entry {
609
609
  if (res.deviceType === 'SUNMI') {
610
610
  glitter.addMtScript([
611
611
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
612
- glitter.root_path + 'jslib/qrcode.min.js',
612
+ glitter.root_path + 'jslib/qrcode-d.js',
613
613
  ], () => {
614
614
  }, () => {
615
615
  });
package/lowcode/Entry.ts CHANGED
@@ -132,7 +132,7 @@ export class Entry {
132
132
  }
133
133
  (window as any).renderClock = (window as any).renderClock ?? createClock();
134
134
  console.log(`Entry-time:`, (window as any).renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.0.4';
135
+ glitter.share.editerVersion = 'V_19.0.6';
136
136
  glitter.share.start = new Date();
137
137
  const vm = { appConfig: [] };
138
138
  (window as any).saasConfig = {
@@ -664,7 +664,7 @@ export class Entry {
664
664
  [
665
665
  'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
666
666
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
667
- glitter.root_path + 'jslib/qrcode.min.js',
667
+ glitter.root_path + 'jslib/qrcode-d.js',
668
668
  ],
669
669
  () => {
670
670
  },
@@ -682,7 +682,7 @@ export class Entry {
682
682
  glitter.addMtScript(
683
683
  [
684
684
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
685
- glitter.root_path + 'jslib/qrcode.min.js',
685
+ glitter.root_path + 'jslib/qrcode-d.js',
686
686
  ],
687
687
  () => {
688
688
  },
@@ -645,7 +645,7 @@ cursor: pointer;
645
645
  else {
646
646
  return {
647
647
  class: `d-flex nav-left flex-column`,
648
- style: `height: 100%;gap:24px;padding-top:114px;position:fixed;left:0px;top:0px;background: #FFF;box-shadow: 1px 0px 10px 0px rgba(0, 0, 0, 0.05);z-index:10;`,
648
+ style: `height: 100%;gap:24px;padding-top:114px;position:fixed;left:0px;top:0px;background: #FFF;box-shadow: 1px 0px 10px 0px rgba(0, 0, 0, 0.05);z-index:15;`,
649
649
  };
650
650
  }
651
651
  },
@@ -763,7 +763,7 @@ cursor: pointer;
763
763
  } else {
764
764
  return {
765
765
  class: `d-flex nav-left flex-column`,
766
- style: `height: 100%;gap:24px;padding-top:114px;position:fixed;left:0px;top:0px;background: #FFF;box-shadow: 1px 0px 10px 0px rgba(0, 0, 0, 0.05);z-index:10;`,
766
+ style: `height: 100%;gap:24px;padding-top:114px;position:fixed;left:0px;top:0px;background: #FFF;box-shadow: 1px 0px 10px 0px rgba(0, 0, 0, 0.05);z-index:15;`,
767
767
  };
768
768
  }
769
769
  },
@@ -10,9 +10,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { PayConfig } from './pay-config.js';
11
11
  import { PaymentPage } from './payment-page.js';
12
12
  export class IminModule {
13
+ static init() {
14
+ return new Promise((resolve, reject) => {
15
+ window.glitter.addMtScript([
16
+ 'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
17
+ 'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
18
+ window.glitter.root_path + 'jslib/qrcode-d.js',
19
+ ], () => {
20
+ resolve(true);
21
+ }, () => {
22
+ resolve(false);
23
+ });
24
+ });
25
+ }
13
26
  static printInvoice(invoice, orderID, staff_title) {
14
27
  return __awaiter(this, void 0, void 0, function* () {
15
- if (PayConfig.posType === 'SUNMI') {
28
+ yield IminModule.init();
29
+ if (window.parent.glitter.share.PayConfig.posType === 'SUNMI') {
16
30
  IminModule.printInvoiceSunMi(invoice, orderID, staff_title);
17
31
  return;
18
32
  }
@@ -161,25 +175,26 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
161
175
  }
162
176
  function generateQRCode(text, size) {
163
177
  return new Promise((resolve) => {
164
- const div = document.createElement('div');
165
- let qr = new QRCode(div, {
166
- text: text,
167
- width: size,
168
- height: size,
169
- correctLevel: 1,
170
- version: 40
171
- });
172
- setTimeout(() => {
173
- resolve(div.querySelector('canvas').toDataURL('image/png'));
174
- }, 200);
178
+ try {
179
+ const div = document.createElement('div');
180
+ var qrcode_R = new QRCode(div, {
181
+ text: text,
182
+ width: 50,
183
+ height: 50,
184
+ colorDark: "#000000",
185
+ colorLight: "#ffffff",
186
+ correctLevel: QRCode.CorrectLevel.M
187
+ });
188
+ setTimeout(() => {
189
+ resolve(div.querySelector('canvas').toDataURL('image/png'));
190
+ }, 200);
191
+ }
192
+ catch (e) {
193
+ console.log('qr生成失敗');
194
+ console.log('qr生成失敗', e);
195
+ }
175
196
  });
176
197
  }
177
- const ba = (new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size)) * 1.1;
178
- console.log(`ba=>`, invoice.qrcode_0);
179
- console.log(`ba=>`, invoice.qrcode_1);
180
- for (let a = 0; a <= ba; a++) {
181
- invoice.qrcode_1 += '*';
182
- }
183
198
  mergeQRCodes([invoice.qrcode_0, invoice.qrcode_1]).then((res) => {
184
199
  console.log(`two-qrcode=>`, res);
185
200
  glitter.runJsInterFace('start-print', {
@@ -474,29 +489,37 @@ ${tempDiv.querySelector('.invoice-detail-sum').children[2].textContent.replace(/
474
489
  glitter.addMtScript([
475
490
  'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
476
491
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
477
- glitter.root_path + 'jslib/qrcode.min.js',
492
+ glitter.root_path + 'jslib/qrcode-d.js',
478
493
  ], () => {
479
494
  function generateQRCode(text, size) {
480
495
  return new Promise((resolve) => {
481
- const div = document.createElement('div');
482
- let qr = new QRCode(div, {
483
- text: text,
484
- width: size,
485
- height: size,
486
- correctLevel: 1,
487
- version: 40,
488
- });
489
- setTimeout(() => {
490
- resolve(div.querySelector('canvas').toDataURL('image/png').split('base64,')[1]);
491
- }, 200);
496
+ try {
497
+ const div = document.createElement('div');
498
+ var qrcode_R = new QRCode(div, {
499
+ text: text,
500
+ width: 100,
501
+ height: 100,
502
+ colorDark: "#000000",
503
+ colorLight: "#ffffff",
504
+ correctLevel: QRCode.CorrectLevel.M
505
+ });
506
+ setTimeout(() => {
507
+ resolve(div.querySelector('canvas').toDataURL('image/png'));
508
+ }, 200);
509
+ }
510
+ catch (e) {
511
+ console.log('qr生成失敗');
512
+ console.log('qr生成失敗', e);
513
+ }
492
514
  });
493
515
  }
494
516
  generateQRCode(code, 185).then((res) => {
517
+ console.log(`two-qrcode=>`, res);
495
518
  glitter.runJsInterFace('start-print', {
496
519
  'command-list': [
497
520
  {
498
521
  key: 'print-bitmap', data: {
499
- base64: res,
522
+ base64: res.split('base64,')[1],
500
523
  height: 185,
501
524
  width: 185,
502
525
  },
@@ -3,10 +3,24 @@ import { PayConfig } from './pay-config.js';
3
3
  import { PaymentPage } from './payment-page.js';
4
4
 
5
5
  export class IminModule {
6
+ public static init() {
7
+ return new Promise((resolve, reject) => {
8
+ (window as any).glitter.addMtScript(
9
+ [
10
+ 'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
11
+ 'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
12
+ (window as any).glitter.root_path + 'jslib/qrcode-d.js',
13
+ ],()=>{
14
+ resolve(true)
15
+ },()=>{
16
+ resolve(false)
17
+ })
18
+ })
19
+ }
6
20
  //列印發票
7
21
  public static async printInvoice(invoice: any, orderID: string, staff_title: string) {
8
-
9
- if (PayConfig.posType === 'SUNMI') {
22
+ await IminModule.init()
23
+ if ( (window.parent as any).glitter.share.PayConfig.posType === 'SUNMI') {
10
24
  IminModule.printInvoiceSunMi(invoice, orderID, staff_title);
11
25
  return;
12
26
  }
@@ -184,30 +198,28 @@ ${tempDiv.querySelector('.invoice-detail-sum')!!.children[2].textContent!.replac
184
198
 
185
199
  function generateQRCode(text: string, size: number) {
186
200
  return new Promise((resolve) => {
187
- const div = document.createElement('div');
188
- //@ts-ignore
189
- let qr = new QRCode(div, {
190
- text: text,
191
- width: size,
192
- height: size,
193
- correctLevel: 1,
194
- version:40
195
- });
196
-
197
- // 等待 QR Code 生成完畢
198
- setTimeout(() => {
199
- resolve(div.querySelector('canvas')!!.toDataURL('image/png'));
200
- }, 200); // 延遲等待 QRCode 完成渲染
201
+ try {
202
+ const div = document.createElement('div');
203
+ //@ts-ignore
204
+ var qrcode_R = new QRCode(div, {
205
+ text: text,
206
+ width: 50,
207
+ height: 50,
208
+ colorDark: "#000000",
209
+ colorLight: "#ffffff",
210
+ //@ts-ignore
211
+ correctLevel: QRCode.CorrectLevel.M
212
+ });
213
+ // 等待 QR Code 生成完畢
214
+ setTimeout(() => {
215
+ resolve(div.querySelector('canvas')!!.toDataURL('image/png'));
216
+ }, 200); // 延遲等待 QRCode 完成渲染
217
+ }catch (e) {
218
+ console.log('qr生成失敗')
219
+ console.log('qr生成失敗',e)
220
+ }
201
221
  });
202
222
  }
203
-
204
- const ba = (new Blob([invoice.qrcode_0]).size - (new Blob([invoice.qrcode_1]).size)) * 1.1;
205
- console.log(`ba=>`, invoice.qrcode_0);
206
- console.log(`ba=>`, invoice.qrcode_1);
207
- for (let a = 0; a <= ba; a++) {
208
- invoice.qrcode_1 += '*';
209
- }
210
-
211
223
  mergeQRCodes([invoice.qrcode_0, invoice.qrcode_1]).then((res) => {
212
224
  console.log(`two-qrcode=>`, res);
213
225
  glitter.runJsInterFace('start-print', {
@@ -511,35 +523,43 @@ ${tempDiv.querySelector('.invoice-detail-sum')!!.children[2].textContent!.replac
511
523
  [
512
524
  'https://oss-sg.imin.sg/web/iMinPartner/js/imin-printer.min.js',
513
525
  'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js',
514
- glitter.root_path + 'jslib/qrcode.min.js',
526
+ glitter.root_path + 'jslib/qrcode-d.js',
515
527
  ],
516
528
  () => {
517
529
 
518
530
  function generateQRCode(text: string, size: number) {
519
531
  return new Promise((resolve) => {
520
- const div = document.createElement('div');
521
- //@ts-ignore
522
- let qr = new QRCode(div, {
523
- text: text,
524
- width: size,
525
- height: size,
526
- correctLevel: 1,
527
- version: 40,
528
- });
529
-
530
- // 等待 QR Code 生成完畢
531
- setTimeout(() => {
532
- resolve(div.querySelector('canvas')!!.toDataURL('image/png').split('base64,')[1]);
533
- }, 200); // 延遲等待 QRCode 完成渲染
532
+ try {
533
+ const div = document.createElement('div');
534
+ //@ts-ignore
535
+ var qrcode_R = new QRCode(div, {
536
+ text: text,
537
+ width: 100,
538
+ height: 100,
539
+ colorDark: "#000000",
540
+ colorLight: "#ffffff",
541
+ //@ts-ignore
542
+ correctLevel: QRCode.CorrectLevel.M
543
+ });
544
+ // 等待 QR Code 生成完畢
545
+ setTimeout(() => {
546
+
547
+ resolve(div.querySelector('canvas')!!.toDataURL('image/png'));
548
+ }, 200); // 延遲等待 QRCode 完成渲染
549
+ }catch (e) {
550
+ console.log('qr生成失敗')
551
+ console.log('qr生成失敗',e)
552
+ }
534
553
  });
535
554
  }
536
555
 
537
556
  generateQRCode(code, 185).then((res: any) => {
557
+ console.log(`two-qrcode=>`, res);
538
558
  glitter.runJsInterFace('start-print', {
539
559
  'command-list': [
540
560
  {
541
561
  key: 'print-bitmap', data: {
542
- base64: res,
562
+ base64: res.split('base64,')[1],
543
563
  height: 185,
544
564
  width: 185,
545
565
  },
@@ -169,10 +169,12 @@ export class PaymentPage {
169
169
  <div class="d-flex flex-column align-items-center justify-content-center" style="gap:5px;width:75px;">
170
170
  <div style="height: 20px;"></div>
171
171
  <div
172
- style="width: 54px;height: 54px;border-radius: 5px;background: 50%/cover url('${data.preview_image ||
172
+ style="width: 70px;height: 70px;
173
+ min-width: 70px;min-height: 70px;
174
+ border-radius: 5px;background: 50%/cover url('${data.preview_image ||
173
175
  'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}')"
174
176
  ></div>
175
- <div style="font-size: 14px;height: 20px;" class="fw-500 ${data.pre_order ? `text-danger` : ``}">
177
+ <div style="font-size: 13px;height: 20px;" class="fw-500 ${data.pre_order ? `text-danger` : ``}">
176
178
  庫存:${(() => {
177
179
  if (`${data.show_understocking}` === 'false') {
178
180
  return `不追蹤`;
@@ -184,18 +186,19 @@ export class PaymentPage {
184
186
  </div>
185
187
  </div>
186
188
  <div
187
- class="d-flex flex-column"
189
+ class="d-flex flex-column py-2"
188
190
  style="font-size: 16px;font-style: normal;font-weight: 500;letter-spacing: 0.64px;margin-left: 12px;"
189
191
  >
190
- <div class="d-flex align-items-center" style="gap:10px;">
191
- ${data.title}${(() => {
192
+ <div class="d-flex justify-content-center flex-column" style="gap:5px;">
193
+ ${(() => {
192
194
  if (!data.pre_order) {
193
195
  return ``;
194
196
  }
195
197
  else {
196
- return BgWidget.dangerInsignia('需預購');
198
+ return `<div>${BgWidget.dangerInsignia('需預購')}</div>`;
197
199
  }
198
200
  })()}
201
+ ${data.title}
199
202
  </div>
200
203
  <span
201
204
  style="color: #949494;
@@ -188,10 +188,12 @@ export class PaymentPage {
188
188
  <div class="d-flex flex-column align-items-center justify-content-center" style="gap:5px;width:75px;">
189
189
  <div style="height: 20px;"></div>
190
190
  <div
191
- style="width: 54px;height: 54px;border-radius: 5px;background: 50%/cover url('${data.preview_image ||
191
+ style="width: 70px;height: 70px;
192
+ min-width: 70px;min-height: 70px;
193
+ border-radius: 5px;background: 50%/cover url('${data.preview_image ||
192
194
  'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}')"
193
195
  ></div>
194
- <div style="font-size: 14px;height: 20px;" class="fw-500 ${data.pre_order ? `text-danger` : ``}">
196
+ <div style="font-size: 13px;height: 20px;" class="fw-500 ${data.pre_order ? `text-danger` : ``}">
195
197
  庫存:${(() => {
196
198
  if (`${data.show_understocking}` === 'false') {
197
199
  return `不追蹤`;
@@ -204,17 +206,18 @@ export class PaymentPage {
204
206
  </div>
205
207
  </div>
206
208
  <div
207
- class="d-flex flex-column"
209
+ class="d-flex flex-column py-2"
208
210
  style="font-size: 16px;font-style: normal;font-weight: 500;letter-spacing: 0.64px;margin-left: 12px;"
209
211
  >
210
- <div class="d-flex align-items-center" style="gap:10px;">
211
- ${data.title}${(() => {
212
+ <div class="d-flex justify-content-center flex-column" style="gap:5px;">
213
+ ${(() => {
212
214
  if (!data.pre_order) {
213
215
  return ``;
214
216
  } else {
215
- return BgWidget.dangerInsignia('需預購');
217
+ return `<div>${BgWidget.dangerInsignia('需預購')}</div>`;
216
218
  }
217
219
  })()}
220
+ ${data.title}
218
221
  </div>
219
222
  <span
220
223
  style="color: #949494;
@@ -311,7 +311,7 @@ export class PosFunction {
311
311
  },
312
312
  divCreate: {
313
313
  class: '',
314
- style: `width: 338px; max-height: 200px; overflow-y: auto; padding: 25px 20px; background: white; box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;`,
314
+ style: `width: 338px; max-height: 400px; overflow-y: auto; padding: 25px 20px; background: white; box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;`,
315
315
  },
316
316
  }));
317
317
  }, 'selectUserSwitch');
@@ -338,7 +338,7 @@ export class PosFunction {
338
338
  },
339
339
  divCreate: {
340
340
  class: '',
341
- style: `width: 338px; max-height: 200px; overflow-y: auto; padding: 25px 20px; background: white; box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;`,
341
+ style: `width: 338px; max-height: 400px; overflow-y: auto; padding: 25px 20px; background: white; box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15); border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;`,
342
342
  },
343
343
  }));
344
344
  }, 'selectUserSwitch');
@@ -357,7 +357,7 @@ export class ProductsPage {
357
357
  }
358
358
  return '非展會銷售規格';
359
359
  }
360
- if (selectVariant.show_understocking && selectVariant.stock === 0) {
360
+ if (selectVariant.show_understocking && selectVariant.stock <= 0) {
361
361
  return '預購商品';
362
362
  }
363
363
  return '加入購物車';
@@ -370,7 +370,7 @@ export class ProductsPage {
370
370
  !selectVariant.exhibition_type) {
371
371
  return 'gray';
372
372
  }
373
- return selectVariant.show_understocking && selectVariant.stock === 0
373
+ return selectVariant.show_understocking && selectVariant.stock <= 0
374
374
  ? `#FF6C02`
375
375
  : `#393939`;
376
376
  })()};min-height: 58px;`,
@@ -565,11 +565,13 @@ export class ProductsPage {
565
565
  .map((item, index) => {
566
566
  return html `
567
567
  ${index > 0 ? `<div style="background-color: #DDD;height:1px;width: 100%;"></div>` : ''}
568
- <div class="d-flex align-items-center" style="height: 87px;">
568
+ <div class="d-flex align-items-center" style="min-height: 87px;">
569
569
  <div
570
570
  class="rounded-3"
571
571
  style="background: 50%/cover url('${item.preview_image ||
572
- 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}');height: 67px;width: 66px;margin-right: 12px;"
572
+ 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}');height: 67px;width: 66px;margin-right: 12px;
573
+ min-height: 67px;min-width: 66px;
574
+ "
573
575
  ></div>
574
576
  <div class="d-flex flex-column flex-fill">
575
577
  <div>${item.title}</div>
@@ -486,7 +486,7 @@ export class ProductsPage {
486
486
  }
487
487
  return '非展會銷售規格';
488
488
  }
489
- if (selectVariant.show_understocking && selectVariant.stock === 0) {
489
+ if (selectVariant.show_understocking && selectVariant.stock <= 0) {
490
490
  return '預購商品';
491
491
  }
492
492
  return '加入購物車';
@@ -501,7 +501,7 @@ export class ProductsPage {
501
501
  ) {
502
502
  return 'gray';
503
503
  }
504
- return selectVariant.show_understocking && selectVariant.stock === 0
504
+ return selectVariant.show_understocking && selectVariant.stock <= 0
505
505
  ? `#FF6C02`
506
506
  : `#393939`;
507
507
  })()};min-height: 58px;`,
@@ -726,11 +726,13 @@ export class ProductsPage {
726
726
  .map((item, index) => {
727
727
  return html`
728
728
  ${index > 0 ? `<div style="background-color: #DDD;height:1px;width: 100%;"></div>` : ''}
729
- <div class="d-flex align-items-center" style="height: 87px;">
729
+ <div class="d-flex align-items-center" style="min-height: 87px;">
730
730
  <div
731
731
  class="rounded-3"
732
732
  style="background: 50%/cover url('${item.preview_image ||
733
- 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}');height: 67px;width: 66px;margin-right: 12px;"
733
+ 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg'}');height: 67px;width: 66px;margin-right: 12px;
734
+ min-height: 67px;min-width: 66px;
735
+ "
734
736
  ></div>
735
737
  <div class="d-flex flex-column flex-fill">
736
738
  <div>${item.title}</div>