ts-glitter 22.5.7 → 22.5.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.
Files changed (83) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-product.js +13 -13
  4. package/lowcode/backend-manager/bg-product.ts +13 -13
  5. package/lowcode/backend-manager/bg-shopping.js +8 -13
  6. package/lowcode/backend-manager/bg-shopping.ts +8 -15
  7. package/lowcode/backend-manager/bg-widget.js +62 -49
  8. package/lowcode/backend-manager/bg-widget.ts +129 -93
  9. package/lowcode/cms-plugin/POS-setting.js +30 -9
  10. package/lowcode/cms-plugin/POS-setting.ts +49 -16
  11. package/lowcode/cms-plugin/cms-router.js +27 -21
  12. package/lowcode/cms-plugin/cms-router.ts +116 -101
  13. package/lowcode/cms-plugin/filter-options.js +25 -17
  14. package/lowcode/cms-plugin/filter-options.ts +27 -17
  15. package/lowcode/cms-plugin/module/product-excel.js +2 -0
  16. package/lowcode/cms-plugin/module/product-excel.ts +2 -0
  17. package/lowcode/cms-plugin/module/product-setting.js +13 -12
  18. package/lowcode/cms-plugin/module/product-setting.ts +26 -23
  19. package/lowcode/cms-plugin/order/order-module.js +91 -68
  20. package/lowcode/cms-plugin/order/order-module.ts +105 -73
  21. package/lowcode/cms-plugin/pos-checkout-setting.js +46 -39
  22. package/lowcode/cms-plugin/pos-checkout-setting.ts +237 -227
  23. package/lowcode/cms-plugin/pos-config-setting.js +25 -23
  24. package/lowcode/cms-plugin/pos-config-setting.ts +35 -32
  25. package/lowcode/cms-plugin/pos-pages/payment-function.js +253 -139
  26. package/lowcode/cms-plugin/pos-pages/payment-function.ts +405 -279
  27. package/lowcode/cms-plugin/pos-pages/payment-page.js +348 -267
  28. package/lowcode/cms-plugin/pos-pages/payment-page.ts +378 -296
  29. package/lowcode/cms-plugin/pos-pages/pos-function.js +76 -19
  30. package/lowcode/cms-plugin/pos-pages/pos-function.ts +84 -19
  31. package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
  32. package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
  33. package/lowcode/cms-plugin/shopping-finance-setting.js +1590 -1701
  34. package/lowcode/cms-plugin/shopping-finance-setting.ts +1967 -2011
  35. package/lowcode/cms-plugin/shopping-order-manager.js +74 -62
  36. package/lowcode/cms-plugin/shopping-order-manager.ts +119 -85
  37. package/lowcode/cms-plugin/shopping-product-text.js +874 -531
  38. package/lowcode/cms-plugin/shopping-product-text.ts +1656 -1305
  39. package/lowcode/cms-plugin/shopping-setting-basic.js +152 -124
  40. package/lowcode/cms-plugin/shopping-setting-basic.ts +315 -247
  41. package/lowcode/css/editor.css +3 -2
  42. package/lowcode/glitter-base/global/language.js +5 -3
  43. package/lowcode/glitter-base/global/language.ts +8 -6
  44. package/lowcode/glitter-base/global/payment-config.js +6 -0
  45. package/lowcode/glitter-base/global/payment-config.ts +6 -3
  46. package/lowcode/public-components/product/pd-class.js +1 -3
  47. package/lowcode/public-components/product/pd-class.ts +1 -3
  48. package/lowcode/public-components/user-manager/um-order.js +2 -1
  49. package/lowcode/public-components/user-manager/um-order.ts +2 -1
  50. package/package.json +1 -1
  51. package/src/api-public/controllers/index.js +14 -3
  52. package/src/api-public/controllers/index.js.map +1 -1
  53. package/src/api-public/controllers/index.ts +16 -3
  54. package/src/api-public/controllers/shop.js +14 -7
  55. package/src/api-public/controllers/shop.js.map +1 -1
  56. package/src/api-public/controllers/shop.ts +14 -8
  57. package/src/api-public/services/data-analyze.d.ts +1 -1
  58. package/src/api-public/services/ezpay/tool.d.ts +0 -1
  59. package/src/api-public/services/financial-serviceV2.js +7 -17
  60. package/src/api-public/services/financial-serviceV2.js.map +1 -1
  61. package/src/api-public/services/shopee.js.map +1 -1
  62. package/src/api-public/services/updated-table-checked.js +20 -0
  63. package/src/api-public/services/updated-table-checked.js.map +1 -1
  64. package/src/api-public/services/updated-table-checked.ts +21 -0
  65. package/src/app-project/serverless/src/modules/database.d.ts +1 -1
  66. package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
  67. package/src/helper/glitter-util.d.ts +0 -1
  68. package/src/index.js +3 -3
  69. package/src/index.js.map +13 -1
  70. package/src/modules/tool.d.ts +2 -0
  71. package/src/modules/tool.js +7 -0
  72. package/src/modules/tool.js.map +1 -1
  73. package/src/modules/tool.ts +7 -0
  74. package/src/seo-config.js +3 -3
  75. package/src/seo-config.js.map +9 -1
  76. package/src/services/private_config.js +11 -0
  77. package/src/services/private_config.js.map +1 -1
  78. package/src/services/private_config.ts +11 -0
  79. package/src/services/saas-table-check.js +12 -0
  80. package/src/services/saas-table-check.js.map +1 -1
  81. package/src/services/saas-table-check.ts +12 -0
  82. package/src/services/ses.js +3 -4
  83. package/src/services/ses.js.map +1 -1
@@ -21,7 +21,7 @@ export class PosConfigSetting {
21
21
  id: string;
22
22
  tableId: string;
23
23
  filterId: string;
24
- type: 'basic' | 'function' | 'global';
24
+ type: 'basic' | 'function' | 'global' | 'finance';
25
25
  data: any;
26
26
  SEOData: any;
27
27
  domain: any;
@@ -91,7 +91,6 @@ export class PosConfigSetting {
91
91
  ApiUser.getPublicConfig('store-information', 'manager').then((response: any) => {
92
92
  const data = response.response.value;
93
93
 
94
- // 初始化 vm.data
95
94
  vm.data = {
96
95
  ubn: '',
97
96
  email: '',
@@ -285,23 +284,25 @@ ${BgWidget.customButton({
285
284
  button: { color: 'snow', size: 'md' },
286
285
  text: { name: '編輯' },
287
286
  event: gvc.event(() => {
288
- vm.data.prdouct_card_layout=vm.data.prdouct_card_layout??'16:9'
287
+ vm.data.prdouct_card_layout = vm.data.prdouct_card_layout ?? '16:9';
289
288
  BgWidget.settingDialog({
290
289
  gvc,
291
290
  title,
292
291
  width: 600,
293
292
  innerHTML: gvc => {
294
- return BgWidget.editeInput({
293
+ return BgWidget.editeInput({
295
294
  gvc: gvc,
296
295
 
297
296
  title: '卡片比例',
298
297
  default: vm.data.prdouct_card_layout,
299
298
  placeHolder: '請輸入卡片比例,範例: 16:9',
300
- callback: (text) => {
301
- if(text.split(':').map((dd)=>{
302
- return Number.isFinite(Number(dd))
303
- }).length===2){
304
- vm.data.prdouct_card_layout=text
299
+ callback: text => {
300
+ if (
301
+ text.split(':').map(dd => {
302
+ return Number.isFinite(Number(dd));
303
+ }).length === 2
304
+ ) {
305
+ vm.data.prdouct_card_layout = text;
305
306
  }
306
307
  },
307
308
  });
@@ -451,11 +452,10 @@ ${BgWidget.customButton({
451
452
  },
452
453
  };
453
454
 
454
- return BgWidget.container(html`
455
- <div class="title-container">${BgWidget.title('全站設定')}</div>
456
- ${BgWidget.tab(
455
+ return [
456
+ html`<div class="title-container">${BgWidget.title('全站設定')}</div>`,
457
+ BgWidget.tab(
457
458
  [
458
- // { title: '商店訊息', key: 'basic' },
459
459
  { title: '功能管理', key: 'function' },
460
460
  { title: '金流設定', key: 'finance' },
461
461
  ],
@@ -463,25 +463,28 @@ ${BgWidget.customButton({
463
463
  vm.type,
464
464
  text => {
465
465
  vm.type = text as any;
466
- }
467
- )}
468
- ${typeMap[vm.type] ? typeMap[vm.type]() : ''}
469
- <div style="margin-top: 300px;"></div>
470
- <div class="update-bar-container">
471
- ${BgWidget.save(
472
- gvc.event(async () => {
473
- dialog.dataLoading({ visible: true });
474
- await vm.save_info();
475
- await Promise.all(PosConfigSetting.saveArray.map(dd => dd()));
476
- PosConfigSetting.saveArray = [];
477
- dialog.dataLoading({ visible: false });
478
- dialog.successMessage({ text: '儲存成功' });
479
- }),
480
- '儲存',
481
- 'guide3-5'
482
- )}
483
- </div>
484
- `);
466
+ },
467
+ vm.type === 'finance' ? 'margin-bottom: 0 !important;' : ''
468
+ ),
469
+ typeMap[vm.type] ? typeMap[vm.type]() : '',
470
+ BgWidget.mbContainer(300),
471
+ vm.type === 'finance'
472
+ ? ''
473
+ : html`<div class="update-bar-container">
474
+ ${BgWidget.save(
475
+ gvc.event(async () => {
476
+ dialog.dataLoading({ visible: true });
477
+ await vm.save_info();
478
+ await Promise.all(PosConfigSetting.saveArray.map(dd => dd()));
479
+ PosConfigSetting.saveArray = [];
480
+ dialog.dataLoading({ visible: false });
481
+ dialog.successMessage({ text: '儲存成功' });
482
+ }),
483
+ '儲存',
484
+ 'guide3-5'
485
+ )}
486
+ </div>`,
487
+ ].join('');
485
488
  },
486
489
  divCreate: {
487
490
  style: 'color: #393939; font-size: 14px;',
@@ -15,83 +15,91 @@ const html = String.raw;
15
15
  export class PaymentFunction {
16
16
  static cashFinish(gvc, total, callback) {
17
17
  gvc.addStyle(`
18
- .dialog-box {
19
- width: 100vw;
20
- height: 100vh;
21
- display: flex;
22
- align-items: center;
23
- justify-content: center;
24
- background-color: rgba(0, 0, 0, 0.5);
25
- z-index: 10000;
26
- }
18
+ .dialog-box {
19
+ width: 100vw;
20
+ height: 100vh;
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ background-color: rgba(0, 0, 0, 0.5);
25
+ z-index: 10000;
26
+ }
27
27
 
28
- .dialog-absolute {
29
- width: 100%;
30
- border-top: 1px solid #e2e5f1;
31
- position: absolute;
32
- left: 0px;
33
- bottom: 0px;
34
- height: 40px;
35
- display: flex;
36
- align-items: center;
37
- justify-content: center;
38
- cursor: pointer;
39
- }
28
+ .dialog-absolute {
29
+ width: 100%;
30
+ border-top: 1px solid #e2e5f1;
31
+ position: absolute;
32
+ left: 0px;
33
+ bottom: 0px;
34
+ height: 40px;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ cursor: pointer;
39
+ }
40
40
 
41
- .hover-cancel {
42
- background-color: #fff;
43
- border-radius: 0 0 0 0.5rem;
44
- }
41
+ .hover-cancel {
42
+ background-color: #fff;
43
+ border-radius: 0 0 0 0.5rem;
44
+ }
45
45
 
46
- .hover-cancel:hover {
47
- background-color: #e6e6e6;
48
- }
46
+ .hover-cancel:hover {
47
+ background-color: #e6e6e6;
48
+ }
49
49
 
50
- .hover-save {
51
- background-color: #393939;
52
- border-radius: 0 0 0.5rem;
53
- }
50
+ .hover-save {
51
+ background-color: #393939;
52
+ border-radius: 0 0 0.5rem;
53
+ }
54
54
 
55
- .hover-save:hover {
56
- background-color: #646464;
57
- }
58
- `);
55
+ .hover-save:hover {
56
+ background-color: #646464;
57
+ }
58
+ `);
59
59
  const dialog = new ShareDialog(gvc.glitter);
60
60
  gvc.glitter.innerDialog((gvc) => {
61
61
  return html `
62
- <div class="dialog-box">
63
- <div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
64
- <div
65
- class="my-3 fs-6 fw-500 text-center"
66
- style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
67
- >
68
- 請先收取現金後進行結帳
69
- </div>
70
- <div style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;">
71
- 本次結帳金額為 <span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;">$${total.toLocaleString()}</span>
72
- </div>
73
- <div class="d-flex align-items-center justify-content-center" style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
74
- <div
75
- style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
76
- onclick="${gvc.event(() => {
62
+ <div class="dialog-box">
63
+ <div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
64
+ <div
65
+ class="my-3 fs-6 fw-500 text-center"
66
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
67
+ >
68
+ 請先收取現金後進行結帳
69
+ </div>
70
+ <div
71
+ style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
72
+ >
73
+ 本次結帳金額為
74
+ <span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;"
75
+ >$${total.toLocaleString()}</span
76
+ >
77
+ </div>
78
+ <div
79
+ class="d-flex align-items-center justify-content-center"
80
+ style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
81
+ >
82
+ <div
83
+ style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
84
+ onclick="${gvc.event(() => {
77
85
  gvc.glitter.closeDiaLog();
78
86
  })}"
79
- >
80
- 取消
81
- </div>
82
- <div
83
- style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
84
- onclick="${gvc.event(() => {
87
+ >
88
+ 取消
89
+ </div>
90
+ <div
91
+ style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
92
+ onclick="${gvc.event(() => {
85
93
  gvc.closeDialog();
86
94
  callback(true);
87
95
  })}"
88
- >
89
- 確認
90
- </div>
91
- </div>
92
- </div>
93
- </div>
94
- `;
96
+ >
97
+ 確認
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ `;
95
103
  }, 'orderFinish', {
96
104
  dismiss: () => {
97
105
  },
@@ -112,7 +120,7 @@ export class PaymentFunction {
112
120
  }, (res) => {
113
121
  var _a;
114
122
  const response = JSON.parse(res.result.data);
115
- if (response.code === "250") {
123
+ if (response.code === '250') {
116
124
  gvc.closeDialog();
117
125
  callback(true);
118
126
  }
@@ -126,7 +134,7 @@ export class PaymentFunction {
126
134
  gvc.glitter.share.credit_card_callback = (res) => {
127
135
  var _a;
128
136
  const response = JSON.parse(res.result.data);
129
- if (response.code === "250") {
137
+ if (response.code === '250') {
130
138
  gvc.closeDialog();
131
139
  callback(true);
132
140
  }
@@ -150,27 +158,36 @@ export class PaymentFunction {
150
158
  }, 100);
151
159
  }
152
160
  return html `
153
- <div class="dialog-box">
154
- <div class="dialog-content position-relative "
155
- style="width: 370px;max-width: calc(100% - 20px);">
156
- <div class="my-3 fw-500 text-center"
157
- style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;">
158
- 請感應或插入信用卡進行付款
159
- </div>
160
- <div style="font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;">
161
- 若逾時將重新選擇付款方式
162
- </div>
163
- <img class="mt-3" style="max-width:70%;"
164
- src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scsds7s8sbsfs3s8_b00f1f368f2a9b9fb067a844f940ca2a.gif"></img>
165
- <div class="fw-500 w-100 mt-3"
166
- style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
167
- onclick="${gvc.event(() => {
161
+ <div class="dialog-box">
162
+ <div class="dialog-content position-relative " style="width: 370px;max-width: calc(100% - 20px);">
163
+ <div
164
+ class="my-3 fw-500 text-center"
165
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
166
+ >
167
+ 請感應或插入信用卡進行付款
168
+ </div>
169
+ <div
170
+ style="font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
171
+ >
172
+ 若逾時將重新選擇付款方式
173
+ </div>
174
+ <img
175
+ class="mt-3"
176
+ style="max-width:70%;"
177
+ src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_scsds7s8sbsfs3s8_b00f1f368f2a9b9fb067a844f940ca2a.gif"
178
+ />
179
+ <div
180
+ class="fw-500 w-100 mt-3"
181
+ style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
182
+ onclick="${gvc.event(() => {
168
183
  gvc.glitter.closeDiaLog();
169
- })}">取消付款
170
- </div>
171
- </div>
172
- </div>
173
- `;
184
+ })}"
185
+ >
186
+ 取消付款
187
+ </div>
188
+ </div>
189
+ </div>
190
+ `;
174
191
  }, 'orderFinish', {
175
192
  dismiss: () => {
176
193
  },
@@ -180,7 +197,7 @@ export class PaymentFunction {
180
197
  const dialog = new ShareDialog(gvc.glitter);
181
198
  gvc.glitter.innerDialog((gvc) => {
182
199
  let block = false;
183
- PayConfig.onPayment = (scanText) => {
200
+ PayConfig.onPayment = scanText => {
184
201
  if (block) {
185
202
  return;
186
203
  }
@@ -195,7 +212,7 @@ export class PaymentFunction {
195
212
  })
196
213
  .join(','),
197
214
  oneTimeKey: scanText,
198
- }).then((res) => {
215
+ }).then(res => {
199
216
  dialog.dataLoading({ visible: false });
200
217
  if (!res.result || !res.response.result) {
201
218
  dialog.errorMessage({ text: '交易失敗' });
@@ -210,62 +227,67 @@ export class PaymentFunction {
210
227
  };
211
228
  let m_text = '';
212
229
  return html `
213
- <div class="dialog-box">
214
- <div class="dialog-content position-relative "
215
- style="width: 370px;max-width: calc(100% - 20px);">
216
- <div class="my-3 fw-500 text-center"
217
- style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;">
218
- 請掃描LINE Pay付款條碼
219
- </div>
220
- <img class="mt-3" style="max-width:70%;"
221
- src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_s6sfs4scs5s3s0sa_Screenshot2024-09-06at12.28.00 PM.jpg"></img>
222
- <div class="d-flex w-100 align-items-center mt-3"
223
- style="border:1px solid grey;height: 50px;">
224
- <input
225
- class="form-control h-100"
226
- style="border: none;"
227
- placeholder="請輸入或掃描付款代碼"
228
- onchange="${gvc.event((e, event) => {
230
+ <div class="dialog-box">
231
+ <div class="dialog-content position-relative " style="width: 370px;max-width: calc(100% - 20px);">
232
+ <div
233
+ class="my-3 fw-500 text-center"
234
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 20px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
235
+ >
236
+ 請掃描LINE Pay付款條碼
237
+ </div>
238
+ <img
239
+ class="mt-3"
240
+ style="max-width:70%;"
241
+ src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_s6sfs4scs5s3s0sa_Screenshot2024-09-06at12.28.00 PM.jpg"
242
+ />
243
+ <div class="d-flex w-100 align-items-center mt-3" style="border:1px solid grey;height: 50px;">
244
+ <input
245
+ class="form-control h-100"
246
+ style="border: none;"
247
+ placeholder="請輸入或掃描付款代碼"
248
+ onchange="${gvc.event((e, event) => {
229
249
  m_text = e.value;
230
250
  })}"
231
- value="${m_text || ''}"
232
- onfocus="${gvc.event(() => {
251
+ value="${m_text || ''}"
252
+ onfocus="${gvc.event(() => {
233
253
  block = true;
234
254
  })}"
235
- onblur="${gvc.event(() => {
255
+ onblur="${gvc.event(() => {
236
256
  block = false;
237
257
  })}"
238
- />
239
- <div class="flex-fill"></div>
240
- <div
241
- style="background: grey;width: 50px;"
242
- class="d-flex align-items-center justify-content-center text-white h-100"
243
- onclick="${gvc.event(() => {
244
- gvc.glitter.runJsInterFace('start_scan', {}, (res) => {
258
+ />
259
+ <div class="flex-fill"></div>
260
+ <div
261
+ style="background: grey;width: 50px;"
262
+ class="d-flex align-items-center justify-content-center text-white h-100"
263
+ onclick="${gvc.event(() => {
264
+ gvc.glitter.runJsInterFace('start_scan', {}, res => {
245
265
  PayConfig.onPayment(res.text);
246
266
  });
247
267
  })}"
248
- >
249
- <i class="fa-regular fa-barcode-read"></i>
250
- </div>
251
- </div>
252
- <div class="d-flex align-items-center justify-content-center w-100"
253
- style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;">
254
- <div
255
- class="flex-fill"
256
- style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
257
- onclick="${gvc.event(() => {
268
+ >
269
+ <i class="fa-regular fa-barcode-read"></i>
270
+ </div>
271
+ </div>
272
+ <div
273
+ class="d-flex align-items-center justify-content-center w-100"
274
+ style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
275
+ >
276
+ <div
277
+ class="flex-fill"
278
+ style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;text-align:center;"
279
+ onclick="${gvc.event(() => {
258
280
  PayConfig.onPayment = undefined;
259
281
  gvc.glitter.closeDiaLog();
260
282
  })}"
261
- >
262
- 取消
263
- </div>
264
- <div class="mx-2"></div>
265
- <div
266
- class="flex-fill"
267
- style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
268
- onclick="${gvc.event(() => __awaiter(this, void 0, void 0, function* () {
283
+ >
284
+ 取消
285
+ </div>
286
+ <div class="mx-2"></div>
287
+ <div
288
+ class="flex-fill"
289
+ style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;text-align:center;"
290
+ onclick="${gvc.event(() => __awaiter(this, void 0, void 0, function* () {
269
291
  if (!m_text) {
270
292
  dialog.errorMessage({ text: '請輸入交易條碼' });
271
293
  return;
@@ -273,17 +295,109 @@ export class PaymentFunction {
273
295
  block = false;
274
296
  PayConfig.onPayment(m_text);
275
297
  }))}"
276
- >
277
- 確定
278
- </div>
279
- </div>
280
- </div>
281
- </div>
282
- `;
298
+ >
299
+ 確定
300
+ </div>
301
+ </div>
302
+ </div>
303
+ </div>
304
+ `;
283
305
  }, 'orderFinish', {
284
306
  dismiss: () => {
285
307
  gvc.glitter.share.scan_back = () => { };
286
308
  },
287
309
  });
288
310
  }
311
+ static customFinish(gvc, total, callback) {
312
+ gvc.addStyle(`
313
+ .dialog-box {
314
+ width: 100vw;
315
+ height: 100vh;
316
+ display: flex;
317
+ align-items: center;
318
+ justify-content: center;
319
+ background-color: rgba(0, 0, 0, 0.5);
320
+ z-index: 10000;
321
+ }
322
+
323
+ .dialog-absolute {
324
+ width: 100%;
325
+ border-top: 1px solid #e2e5f1;
326
+ position: absolute;
327
+ left: 0px;
328
+ bottom: 0px;
329
+ height: 40px;
330
+ display: flex;
331
+ align-items: center;
332
+ justify-content: center;
333
+ cursor: pointer;
334
+ }
335
+
336
+ .hover-cancel {
337
+ background-color: #fff;
338
+ border-radius: 0 0 0 0.5rem;
339
+ }
340
+
341
+ .hover-cancel:hover {
342
+ background-color: #e6e6e6;
343
+ }
344
+
345
+ .hover-save {
346
+ background-color: #393939;
347
+ border-radius: 0 0 0.5rem;
348
+ }
349
+
350
+ .hover-save:hover {
351
+ background-color: #646464;
352
+ }
353
+ `);
354
+ const dialog = new ShareDialog(gvc.glitter);
355
+ gvc.glitter.innerDialog((gvc) => {
356
+ return html `
357
+ <div class="dialog-box">
358
+ <div class="dialog-content position-relative pb-5" style="width: 452px;max-width: calc(100% - 20px);">
359
+ <div
360
+ class="my-3 fs-6 fw-500 text-center"
361
+ style="white-space: normal; overflow-wrap: anywhere;font-size: 28px;font-style: normal;font-weight: 700;line-height: normal;letter-spacing: 2.8px;"
362
+ >
363
+ 請先收取款項後進行結帳
364
+ </div>
365
+ <div
366
+ style="font-size: 18px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.72px;"
367
+ >
368
+ 本次結帳金額為
369
+ <span style="font-size: 28px;font-style: normal;font-weight: 700;line-height: 160%;"
370
+ >$${total.toLocaleString()}</span
371
+ >
372
+ </div>
373
+ <div
374
+ class="d-flex align-items-center justify-content-center"
375
+ style="margin-top: 24px;font-size: 16px;font-weight: 700;letter-spacing: 0.64px;"
376
+ >
377
+ <div
378
+ style="border-radius: 10px;border: 1px solid #DDD;background: #FFF;padding: 12px 24px;color: #393939;width:120px;text-align:center;"
379
+ onclick="${gvc.event(() => {
380
+ gvc.glitter.closeDiaLog();
381
+ })}"
382
+ >
383
+ 取消
384
+ </div>
385
+ <div
386
+ style="border-radius: 10px;background: #393939;padding: 12px 24px;color: #FFF;margin-left: 24px;width:120px;text-align:center;"
387
+ onclick="${gvc.event(() => {
388
+ gvc.closeDialog();
389
+ callback(true);
390
+ })}"
391
+ >
392
+ 確認
393
+ </div>
394
+ </div>
395
+ </div>
396
+ </div>
397
+ `;
398
+ }, 'orderFinish', {
399
+ dismiss: () => {
400
+ },
401
+ });
402
+ }
289
403
  }