ts-glitter 14.3.0 → 14.3.2

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 (36) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/shopping-finance-setting.js +377 -298
  4. package/lowcode/cms-plugin/shopping-finance-setting.ts +1060 -951
  5. package/lowcode/public-components/checkout/index.js +22 -14
  6. package/lowcode/public-components/checkout/index.ts +24 -15
  7. package/package.json +1 -1
  8. package/src/api-public/controllers/ai-chat.js.map +1 -1
  9. package/src/api-public/controllers/app-release.js.map +1 -1
  10. package/src/api-public/controllers/article.js.map +1 -1
  11. package/src/api-public/controllers/post.js.map +1 -1
  12. package/src/api-public/controllers/shop.js +9 -12
  13. package/src/api-public/controllers/shop.js.map +1 -1
  14. package/src/api-public/controllers/shop.ts +9 -14
  15. package/src/api-public/controllers/user.js.map +1 -1
  16. package/src/api-public/models/glitter-finance.d.ts +51 -0
  17. package/src/api-public/models/glitter-finance.js +9 -0
  18. package/src/api-public/models/glitter-finance.js.map +1 -0
  19. package/src/api-public/models/glitter-finance.ts +54 -0
  20. package/src/api-public/services/EcInvoice.js.map +1 -5
  21. package/src/api-public/services/ai-robot.js.map +1 -1
  22. package/src/api-public/services/financial-service.d.ts +14 -11
  23. package/src/api-public/services/financial-service.js +3 -38
  24. package/src/api-public/services/financial-service.js.map +1 -1
  25. package/src/api-public/services/financial-service.ts +17 -54
  26. package/src/api-public/services/post.js.map +1 -1
  27. package/src/api-public/services/shopping.d.ts +12 -9
  28. package/src/api-public/services/shopping.js +96 -57
  29. package/src/api-public/services/shopping.js.map +1 -1
  30. package/src/api-public/services/shopping.ts +148 -147
  31. package/src/index.js +3 -3
  32. package/src/index.js.map +1 -5
  33. package/src/services/private_config.d.ts +1 -0
  34. package/src/services/private_config.js +62 -4
  35. package/src/services/private_config.js.map +1 -1
  36. package/src/services/private_config.ts +65 -4
@@ -17,14 +17,7 @@ export class ShoppingFinanceSetting {
17
17
  static main(gvc) {
18
18
  const dialog = new ShareDialog(gvc.glitter);
19
19
  const saasConfig = window.parent.saasConfig;
20
- let keyData = {
21
- MERCHANT_ID: 'MS350015371',
22
- HASH_KEY: 'yP9K0sXy1P2WcWfcbhcZDfHASdREcCz1',
23
- HASH_IV: 'C4AlT6GjEEr1Z9VP',
24
- ActionURL: 'https://core.newebpay.com/MPG/mpg_gateway',
25
- TYPE: 'newWebPay',
26
- payment_info_text: '',
27
- };
20
+ let keyData = {};
28
21
  const vm = {
29
22
  id: gvc.glitter.getUUID(),
30
23
  onBoxId: gvc.glitter.getUUID(),
@@ -34,6 +27,7 @@ export class ShoppingFinanceSetting {
34
27
  const onlinePayArray = [
35
28
  { key: 'newWebPay', name: '藍新金流' },
36
29
  { key: 'ecPay', name: '綠界金流' },
30
+ { key: 'paypal', name: 'PayPal' },
37
31
  ];
38
32
  const offlinePayArray = [
39
33
  { key: 'atm', name: 'ATM銀行轉帳', customerClass: 'guide2-3' },
@@ -43,10 +37,11 @@ export class ShoppingFinanceSetting {
43
37
  const redDot = html ` <span class="red-dot">*</span>`;
44
38
  return BgWidget.container(html `
45
39
  ${[
46
- html ` <div class="title-container">
47
- ${BgWidget.title(`金流設定`)}
48
- <div class="flex-fill"></div>
49
- </div>`,
40
+ html `
41
+ <div class="title-container">
42
+ ${BgWidget.title(`金流設定`)}
43
+ <div class="flex-fill"></div>
44
+ </div>`,
50
45
  gvc.bindView({
51
46
  bind: vm.id,
52
47
  view: () => {
@@ -61,147 +56,201 @@ export class ShoppingFinanceSetting {
61
56
  cash_on_delivery: false,
62
57
  };
63
58
  return [
64
- BgWidget.mainCard(html ` <div class="tx_700">線上金流</div>
65
- ${BgWidget.grayNote('透過藍新或綠界服務商串接線上付款功能')} ${BgWidget.mbContainer(12)}
66
- ${BgWidget.multiCheckboxContainer(gvc, onlinePayArray, keyData.TYPE ? [keyData.TYPE] : [], (data) => {
67
- switch (data[0]) {
68
- case 'newWebPay':
69
- keyData.TYPE = data[0];
70
- keyData.ActionURL = 'https://ccore.newebpay.com/MPG/mpg_gateway';
71
- break;
72
- case 'ecPay':
73
- keyData.TYPE = data[0];
74
- keyData.ActionURL = 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5';
75
- break;
76
- case undefined:
77
- keyData.TYPE = undefined;
78
- keyData.ActionURL = '';
79
- break;
80
- }
59
+ BgWidget.mainCard(html `
60
+ <div class="tx_700">線上金流</div>
61
+ ${BgWidget.grayNote('透過藍新或綠界服務商串接線上付款功能')} ${BgWidget.mbContainer(12)}
62
+ ${BgWidget.multiCheckboxContainer(gvc, onlinePayArray, (() => {
63
+ let array = [];
64
+ keyData.newWebPay.toggle && array.push('newWebPay');
65
+ keyData.ecPay.toggle && array.push('ecPay');
66
+ keyData.paypal.toggle && array.push('paypal');
67
+ return array;
68
+ })(), (data) => {
69
+ onlinePayArray.map((dd) => {
70
+ keyData[dd.key].toggle = data.includes(dd.key);
71
+ });
81
72
  gvc.notifyDataChange(vm.onBoxId);
82
- }, { single: true, zeroOption: true })}
83
- ${gvc.bindView({
73
+ }, { single: false, zeroOption: true })}
74
+ ${gvc.bindView({
84
75
  bind: vm.onBoxId,
85
76
  view: () => {
86
- const payData = onlinePayArray.find((item) => item.key === keyData.TYPE);
87
- if (payData === undefined) {
77
+ const payData_List = onlinePayArray.filter(item => {
78
+ return keyData[item.key] && keyData[item.key].toggle;
79
+ });
80
+ if (!payData_List.length) {
88
81
  return '';
89
82
  }
90
- return html ` ${BgWidget.mbContainer(12)}
91
- <div class="tx_700">設定</div>
92
- ${BgWidget.mbContainer(12)}
93
- ${BgWidget.openBoxContainer({
94
- gvc,
95
- tag: 'detail',
96
- title: payData.name + redDot,
97
- openOnInit: false,
98
- insideHTML: [
99
- BgWidget.inlineCheckBox({
100
- title: '串接路徑',
101
- gvc: gvc,
102
- def: keyData.ActionURL,
103
- array: (() => {
104
- if (keyData.TYPE === 'newWebPay') {
105
- return [
106
- {
107
- title: '正式站',
108
- value: 'https://core.newebpay.com/MPG/mpg_gateway',
109
- },
110
- {
111
- title: '測試站',
112
- value: 'https://ccore.newebpay.com/MPG/mpg_gateway',
113
- },
114
- ];
115
- }
116
- else {
117
- return [
118
- {
119
- title: '正式站',
120
- value: 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
121
- },
122
- {
123
- title: '測試站',
124
- value: 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
125
- },
126
- ];
127
- }
128
- })(),
129
- callback: (text) => {
130
- keyData.ActionURL = text;
131
- },
132
- }),
133
- BgWidget.inlineCheckBox({
134
- title: '開通付款方式',
135
- gvc: gvc,
136
- def: ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].filter((dd) => {
137
- return keyData[dd];
138
- }),
139
- array: [
140
- {
141
- title: '信用卡',
142
- value: 'credit',
143
- },
144
- {
145
- title: '一般 ATM',
146
- value: 'atm',
147
- },
148
- {
149
- title: '網路 ATM',
150
- value: 'web_atm',
151
- },
152
- {
153
- title: '超商代碼',
154
- value: 'c_code',
155
- },
156
- {
157
- title: '超商條碼',
158
- value: 'c_bar_code',
159
- },
160
- ],
161
- callback: (array) => {
162
- ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map((dd) => {
163
- keyData[dd] = !!array.find((d1) => {
164
- return d1 === dd;
165
- });
166
- });
167
- },
168
- type: 'multiple',
169
- }),
170
- BgWidget.editeInput({
171
- gvc: gvc,
172
- title: '特店編號',
173
- default: keyData.MERCHANT_ID,
174
- callback: (text) => {
175
- keyData.MERCHANT_ID = text;
176
- },
177
- placeHolder: '請輸入特店編號',
178
- }),
179
- BgWidget.editeInput({
180
- gvc: gvc,
181
- title: 'HASH_KEY',
182
- default: keyData.HASH_KEY,
183
- callback: (text) => {
184
- keyData.HASH_KEY = text;
185
- },
186
- placeHolder: '請輸入HASH_KEY',
187
- }),
188
- BgWidget.editeInput({
189
- gvc: gvc,
190
- title: 'HASH_IV',
191
- default: keyData.HASH_IV,
192
- callback: (text) => {
193
- keyData.HASH_IV = text;
194
- },
195
- placeHolder: '請輸入HASH_IV',
196
- }),
197
- ].join(''),
198
- })}`;
83
+ return [
84
+ html `${BgWidget.mbContainer(12)}
85
+ <div class="tx_700">設定</div>
86
+ ${BgWidget.mbContainer(12)}`,
87
+ payData_List.map((payData) => {
88
+ const key_d = keyData[payData.key];
89
+ switch (payData.key) {
90
+ case 'newWebPay':
91
+ case 'ecPay':
92
+ return html `
93
+ ${BgWidget.openBoxContainer({
94
+ gvc,
95
+ tag: 'detail',
96
+ title: payData.name + redDot,
97
+ openOnInit: false,
98
+ insideHTML: [
99
+ BgWidget.inlineCheckBox({
100
+ title: '串接路徑',
101
+ gvc: gvc,
102
+ def: key_d.ActionURL,
103
+ array: (() => {
104
+ if (payData.key === 'newWebPay') {
105
+ return [
106
+ {
107
+ title: '正式站',
108
+ value: 'https://core.newebpay.com/MPG/mpg_gateway',
109
+ },
110
+ {
111
+ title: '測試站',
112
+ value: 'https://ccore.newebpay.com/MPG/mpg_gateway',
113
+ },
114
+ ];
115
+ }
116
+ else {
117
+ return [
118
+ {
119
+ title: '正式站',
120
+ value: 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
121
+ },
122
+ {
123
+ title: '測試站',
124
+ value: 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
125
+ },
126
+ ];
127
+ }
128
+ })(),
129
+ callback: (text) => {
130
+ key_d.ActionURL = text;
131
+ },
132
+ }),
133
+ BgWidget.inlineCheckBox({
134
+ title: '開通付款方式',
135
+ gvc: gvc,
136
+ def: ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].filter((dd) => {
137
+ return key_d[dd];
138
+ }),
139
+ array: [
140
+ {
141
+ title: '信用卡',
142
+ value: 'credit',
143
+ },
144
+ {
145
+ title: '一般 ATM',
146
+ value: 'atm',
147
+ },
148
+ {
149
+ title: '網路 ATM',
150
+ value: 'web_atm',
151
+ },
152
+ {
153
+ title: '超商代碼',
154
+ value: 'c_code',
155
+ },
156
+ {
157
+ title: '超商條碼',
158
+ value: 'c_bar_code',
159
+ },
160
+ ],
161
+ callback: (array) => {
162
+ ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map((dd) => {
163
+ key_d[dd] = !!array.find((d1) => {
164
+ return d1 === dd;
165
+ });
166
+ });
167
+ },
168
+ type: 'multiple',
169
+ }),
170
+ BgWidget.editeInput({
171
+ gvc: gvc,
172
+ title: '特店編號',
173
+ default: key_d.MERCHANT_ID,
174
+ callback: (text) => {
175
+ key_d.MERCHANT_ID = text;
176
+ },
177
+ placeHolder: '請輸入特店編號',
178
+ }),
179
+ BgWidget.editeInput({
180
+ gvc: gvc,
181
+ title: 'HASH_KEY',
182
+ default: key_d.HASH_KEY,
183
+ callback: (text) => {
184
+ key_d.HASH_KEY = text;
185
+ },
186
+ placeHolder: '請輸入HASH_KEY',
187
+ }),
188
+ BgWidget.editeInput({
189
+ gvc: gvc,
190
+ title: 'HASH_IV',
191
+ default: key_d.HASH_IV,
192
+ callback: (text) => {
193
+ key_d.HASH_IV = text;
194
+ },
195
+ placeHolder: '請輸入HASH_IV',
196
+ }),
197
+ ].join(''),
198
+ })}`;
199
+ case 'paypal':
200
+ return html `
201
+ ${BgWidget.openBoxContainer({
202
+ gvc,
203
+ tag: 'detail',
204
+ title: payData.name + redDot,
205
+ openOnInit: false,
206
+ insideHTML: [
207
+ BgWidget.inlineCheckBox({
208
+ title: '串接路徑',
209
+ gvc: gvc,
210
+ def: `${keyData.paypal.BETA}`,
211
+ array: [
212
+ {
213
+ title: '正式站',
214
+ value: `true`,
215
+ },
216
+ {
217
+ title: '測試站',
218
+ value: `false`,
219
+ },
220
+ ],
221
+ callback: (text) => {
222
+ keyData.paypal.BETA = text;
223
+ },
224
+ }),
225
+ BgWidget.editeInput({
226
+ gvc: gvc,
227
+ title: 'CLIENT_ID',
228
+ default: keyData.paypal.PAYPAL_CLIENT_ID,
229
+ callback: (text) => {
230
+ keyData.paypal.PAYPAL_CLIENT_ID = text;
231
+ },
232
+ placeHolder: '請輸入CLIENT_ID',
233
+ }),
234
+ BgWidget.editeInput({
235
+ gvc: gvc,
236
+ title: 'SECRET',
237
+ default: keyData.paypal.PAYPAL_SECRET,
238
+ callback: (text) => {
239
+ keyData.paypal.PAYPAL_SECRET = text;
240
+ },
241
+ placeHolder: '請輸入SECRET',
242
+ }),
243
+ ].join(''),
244
+ })}`;
245
+ }
246
+ }).join('<div class="my-2"></div>')
247
+ ].join('');
199
248
  },
200
249
  })}`),
201
250
  BgWidget.mainCard(html `
202
- <div class="tx_700">線下金流</div>
203
- ${BgWidget.grayNote('不執行線上付款,由店家自行與消費者商議付款方式')} ${BgWidget.mbContainer(12)}
204
- ${BgWidget.multiCheckboxContainer(gvc, offlinePayArray, offlinePayArray
251
+ <div class="tx_700">線下金流</div>
252
+ ${BgWidget.grayNote('不執行線上付款,由店家自行與消費者商議付款方式')} ${BgWidget.mbContainer(12)}
253
+ ${BgWidget.multiCheckboxContainer(gvc, offlinePayArray, offlinePayArray
205
254
  .slice()
206
255
  .filter((item) => {
207
256
  return keyData.off_line_support[item.key];
@@ -216,7 +265,7 @@ export class ShoppingFinanceSetting {
216
265
  });
217
266
  gvc.notifyDataChange(vm.offBoxId);
218
267
  }, { single: false })}
219
- ${gvc.bindView({
268
+ ${gvc.bindView({
220
269
  bind: vm.offBoxId,
221
270
  view: () => {
222
271
  const payData = ['atm', 'line'].filter((key) => {
@@ -226,10 +275,10 @@ export class ShoppingFinanceSetting {
226
275
  return '';
227
276
  }
228
277
  return html `
229
- ${BgWidget.mbContainer(12)}
230
- <div class="tx_700">付款資訊</div>
231
- ${BgWidget.grayNote('於訂單確認頁面及通知郵件中顯示,告知顧客付款的銀行帳戶或其他付款說明')} ${BgWidget.mbContainer(12)}
232
- ${payData
278
+ ${BgWidget.mbContainer(12)}
279
+ <div class="tx_700">付款資訊</div>
280
+ ${BgWidget.grayNote('於訂單確認頁面及通知郵件中顯示,告知顧客付款的銀行帳戶或其他付款說明')} ${BgWidget.mbContainer(12)}
281
+ ${payData
233
282
  .map((key) => {
234
283
  if (key === 'atm') {
235
284
  return BgWidget.openBoxContainer({
@@ -253,10 +302,10 @@ export class ShoppingFinanceSetting {
253
302
  })
254
303
  .filter((str) => str.length > 0)
255
304
  .join(BgWidget.mbContainer(12))}
256
- `;
305
+ `;
257
306
  },
258
307
  })}
259
- `),
308
+ `),
260
309
  ].join(BgWidget.mbContainer(24));
261
310
  }
262
311
  catch (e) {
@@ -290,16 +339,6 @@ export class ShoppingFinanceSetting {
290
339
  ${BgWidget.mbContainer(240)}
291
340
  <div class="update-bar-container">
292
341
  ${BgWidget.save(gvc.event(() => {
293
- var _a;
294
- if (['newWebPay', 'ecPay'].includes((_a = keyData.TYPE) !== null && _a !== void 0 ? _a : '') &&
295
- !['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].some((dd) => {
296
- return keyData[dd];
297
- })) {
298
- dialog.infoMessage({
299
- text: html ` <div class="text-center">線上金流需至少選取<br />一種開通付款方式</div>`,
300
- });
301
- return;
302
- }
303
342
  dialog.dataLoading({ visible: true });
304
343
  saasConfig.api.setPrivateConfig(saasConfig.config.appName, 'glitter_finance', keyData).then((r) => {
305
344
  setTimeout(() => {
@@ -319,16 +358,17 @@ export class ShoppingFinanceSetting {
319
358
  static line_pay(gvc, keyData) {
320
359
  var _a;
321
360
  const defText = html `<p>您選擇了線下Line Pay付款。請完成付款後,提供證明截圖(圖一),或是照著(圖二)的流程擷取『付款詳細資訊』並上傳,以便我們核款。&nbsp;</p>
322
- <p>
323
- <br /><img src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722924978722-Frame%205078.png" class="fr-fic fr-dii" style="width: 215px;" />&nbsp;<img
324
- src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722924973580-Frame%205058.png"
325
- class="fr-fic fr-dii"
326
- style="width: 545px;"
327
- />
328
- </p>
329
- <p>
330
- <br />
331
- </p> `;
361
+ <p>
362
+ <br/><img src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722924978722-Frame%205078.png"
363
+ class="fr-fic fr-dii" style="width: 215px;"/>&nbsp;<img
364
+ src="https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722924973580-Frame%205058.png"
365
+ class="fr-fic fr-dii"
366
+ style="width: 545px;"
367
+ />
368
+ </p>
369
+ <p>
370
+ <br/>
371
+ </p> `;
332
372
  keyData.payment_info_line_pay = (_a = keyData.payment_info_line_pay) !== null && _a !== void 0 ? _a : {
333
373
  text: '',
334
374
  };
@@ -339,13 +379,14 @@ export class ShoppingFinanceSetting {
339
379
  view: () => {
340
380
  var _a, _b;
341
381
  return [
342
- html ` <div class="d-flex justify-content-between mb-3">
343
- <div class="tx_normal">付款說明</div>
344
- ${BgWidget.blueNote('返回預設', gvc.event(() => {
382
+ html `
383
+ <div class="d-flex justify-content-between mb-3">
384
+ <div class="tx_normal">付款說明</div>
385
+ ${BgWidget.blueNote('返回預設', gvc.event(() => {
345
386
  keyData.payment_info_line_pay.text = defText;
346
387
  gvc.notifyDataChange(id);
347
388
  }))}
348
- </div>`,
389
+ </div>`,
349
390
  EditorElem.richText({
350
391
  gvc: gvc,
351
392
  def: (_b = (_a = keyData.payment_info_line_pay) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '',
@@ -361,9 +402,9 @@ export class ShoppingFinanceSetting {
361
402
  static atm(gvc, keyData) {
362
403
  var _a;
363
404
  const defText = html `<p>當日下單匯款,隔日出貨,後天到貨。</p>
364
- <p>若有需要統一編號 請提早告知</p>
365
- <p>------------------------------------------------------------------</p>
366
- <p>*採臨櫃匯款者,電匯單上匯款人姓名與聯絡電話請務必填寫。</p> `;
405
+ <p>若有需要統一編號 請提早告知</p>
406
+ <p>------------------------------------------------------------------</p>
407
+ <p>*採臨櫃匯款者,電匯單上匯款人姓名與聯絡電話請務必填寫。</p> `;
367
408
  keyData.payment_info_atm =
368
409
  (_a = keyData.payment_info_atm) !== null && _a !== void 0 ? _a : {
369
410
  bank_account: '',
@@ -378,8 +419,9 @@ export class ShoppingFinanceSetting {
378
419
  view: () => {
379
420
  var _a, _b;
380
421
  return [
381
- html ` <div class="row w-100">
382
- ${[
422
+ html `
423
+ <div class="row w-100">
424
+ ${[
383
425
  {
384
426
  key: 'bank_code',
385
427
  title: '銀行代號',
@@ -398,30 +440,32 @@ export class ShoppingFinanceSetting {
398
440
  },
399
441
  ]
400
442
  .map((dd) => {
401
- return html ` <div class="col-12 col-md-6 mb-2 pe-0 pe-md-2">
402
- <div class="w-100 mb-1">
403
- <span style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">${dd.title}</span>
404
- <span style="color: #E80000; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">*</span>
405
- </div>
406
- <input
407
- class="form-control w-100"
408
- placeholder="請輸入${dd.title}"
409
- value="${keyData.payment_info_atm[dd.key]}"
410
- onchange="${gvc.event((e, event) => {
443
+ return html `
444
+ <div class="col-12 col-md-6 mb-2 pe-0 pe-md-2">
445
+ <div class="w-100 mb-1">
446
+ <span style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">${dd.title}</span>
447
+ <span style="color: #E80000; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">*</span>
448
+ </div>
449
+ <input
450
+ class="form-control w-100"
451
+ placeholder="請輸入${dd.title}"
452
+ value="${keyData.payment_info_atm[dd.key]}"
453
+ onchange="${gvc.event((e, event) => {
411
454
  keyData.payment_info_atm[dd.key] = e.value;
412
455
  })}"
413
- />
414
- </div>`;
456
+ />
457
+ </div>`;
415
458
  })
416
459
  .join('')}
417
- </div>`,
418
- html ` <div class="my-2 px-1" style="display:flex;justify-content: space-between;">
419
- <div class="tx_normal">付款說明</div>
420
- ${BgWidget.blueNote('返回預設', gvc.event(() => {
460
+ </div>`,
461
+ html `
462
+ <div class="my-2 px-1" style="display:flex;justify-content: space-between;">
463
+ <div class="tx_normal">付款說明</div>
464
+ ${BgWidget.blueNote('返回預設', gvc.event(() => {
421
465
  keyData.payment_info_atm.text = defText;
422
466
  gvc.notifyDataChange(id);
423
467
  }))}
424
- </div>`,
468
+ </div>`,
425
469
  ``,
426
470
  EditorElem.richText({
427
471
  gvc: gvc,
@@ -496,15 +540,17 @@ export class ShoppingFinanceSetting {
496
540
  gvc,
497
541
  tag: 'delivery_alert_info',
498
542
  title: '注意事項',
499
- insideHTML: html ` <div class="mt-2" style="white-space: normal;">
500
- ${BgWidget.alertInfo('', [
543
+ insideHTML: html `
544
+ <div class="mt-2"
545
+ style="white-space: normal;">
546
+ ${BgWidget.alertInfo('', [
501
547
  '1. 僅提供<b>「綠界C2C物流」</b>建立與追蹤',
502
548
  '2. 可追蹤四大超商(7-ELEVEN、全家、萊爾富、OK超商)',
503
549
  '3. 若無填寫物流追蹤設定,此功能將在結帳時忽略執行',
504
550
  '4. 寄件人名稱請設定最多10字元(中文5個字, 英文10個字, 不得含指定特殊符號)',
505
551
  '5. 寄件人手機應為09開頭的格式',
506
552
  ])}
507
- </div>`,
553
+ </div>`,
508
554
  height: document.body.clientWidth > 768 ? 300 : 385,
509
555
  }),
510
556
  ...(() => {
@@ -639,7 +685,10 @@ export class ShoppingFinanceSetting {
639
685
  }
640
686
  if (CheckInput.isEmpty(vm.delivery.SenderName) || !checkSenderPattern(vm.delivery.SenderName)) {
641
687
  dialog.infoMessage({
642
- text: html ` <div class="text-center">寄件人名稱請設定最多10字元<br />(中文5個字, 英文10個字,<br />不得含指定特殊符號)</div>`,
688
+ text: html `
689
+ <div class="text-center">寄件人名稱請設定最多10字元<br/>(中文5個字,
690
+ 英文10個字,<br/>不得含指定特殊符號)
691
+ </div>`,
643
692
  });
644
693
  resolve(false);
645
694
  return;
@@ -687,10 +736,12 @@ export class ShoppingFinanceSetting {
687
736
  innerHTML: (gvc) => {
688
737
  form = BgWidget.customForm(gvc, [
689
738
  {
690
- title: html ` <div class="tx_normal fw-bolder mt-2 d-flex flex-column" style="margin-bottom: 12px;">
691
- 自訂物流表單
692
- <span class="" style="color:#8D8D8D;font-size: 12px;">當客戶選擇此物流時所需填寫的額外資料</span>
693
- </div>`,
739
+ title: html `
740
+ <div class="tx_normal fw-bolder mt-2 d-flex flex-column"
741
+ style="margin-bottom: 12px;">
742
+ 自訂物流表單
743
+ <span class="" style="color:#8D8D8D;font-size: 12px;">當客戶選擇此物流時所需填寫的額外資料</span>
744
+ </div>`,
694
745
  key: `form_delivery_${custom_delivery.id}`,
695
746
  no_padding: true,
696
747
  },
@@ -714,7 +765,8 @@ export class ShoppingFinanceSetting {
714
765
  ].join(BgWidget.mbContainer(12));
715
766
  },
716
767
  divCreate: {},
717
- onCreate: () => { },
768
+ onCreate: () => {
769
+ },
718
770
  };
719
771
  })());
720
772
  },
@@ -821,17 +873,17 @@ export class ShoppingFinanceSetting {
821
873
  }))
822
874
  .map((dd) => {
823
875
  return html `
824
- <div class="col-12 col-md-4 p-0 p-md-2">
825
- <div
826
- class="w-100 position-relative main-card"
827
- style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
828
- >
829
- ${(() => {
876
+ <div class="col-12 col-md-4 p-0 p-md-2">
877
+ <div
878
+ class="w-100 position-relative main-card"
879
+ style="padding: 24px 32px; background: white; overflow: hidden; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: inline-flex;"
880
+ >
881
+ ${(() => {
830
882
  if (dd.custom) {
831
883
  return html `<i
832
- class="fa-solid fa-pencil position-absolute"
833
- style="cursor:pointer;right:15px;top:15px;"
834
- onclick="${gvc.event(() => {
884
+ class="fa-solid fa-pencil position-absolute"
885
+ style="cursor:pointer;right:15px;top:15px;"
886
+ onclick="${gvc.event(() => {
835
887
  updateCustomShipment({
836
888
  function: 'replace',
837
889
  data: vm.data.custom_delivery.find((d1) => {
@@ -839,29 +891,34 @@ export class ShoppingFinanceSetting {
839
891
  }),
840
892
  });
841
893
  })}"
842
- ></i>`;
894
+ ></i>`;
843
895
  }
844
896
  else {
845
897
  return ``;
846
898
  }
847
899
  })()}
848
- <div style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex">
849
- <div style="min-width: 46px;max-width: 46px;">${dd.type === 'font_awesome' ? dd.src : html ` <img src="${dd.src}" />`}</div>
850
- <div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex">
851
- <div class="tx_normal">${dd.title}</div>
852
- <div class="d-flex align-items-center" style="gap:4px;">
853
- <div class="tx_normal">
854
- ${vm.data.support.find((d1) => {
900
+ <div style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex">
901
+ <div style="min-width: 46px;max-width: 46px;">
902
+ ${dd.type === 'font_awesome' ? dd.src : html `
903
+ <img src="${dd.src}"/>`}
904
+ </div>
905
+ <div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex">
906
+ <div class="tx_normal">${dd.title}</div>
907
+ <div class="d-flex align-items-center"
908
+ style="gap:4px;">
909
+ <div class="tx_normal">
910
+ ${vm.data.support.find((d1) => {
855
911
  return dd.value === d1;
856
912
  })
857
913
  ? `開啟`
858
914
  : `關閉`}
859
- </div>
860
- <div class="cursor_pointer form-check form-switch" style="margin-top: 10px;">
861
- <input
862
- class="form-check-input"
863
- type="checkbox"
864
- onchange="${gvc.event((e, event) => {
915
+ </div>
916
+ <div class="cursor_pointer form-check form-switch"
917
+ style="margin-top: 10px;">
918
+ <input
919
+ class="form-check-input"
920
+ type="checkbox"
921
+ onchange="${gvc.event((e, event) => {
865
922
  if (vm.data.support.find((d1) => {
866
923
  return dd.value === d1;
867
924
  })) {
@@ -874,39 +931,41 @@ export class ShoppingFinanceSetting {
874
931
  }
875
932
  gvc.notifyDataChange(id);
876
933
  })}"
877
- ${vm.data.support.find((d1) => {
934
+ ${vm.data.support.find((d1) => {
878
935
  return dd.value === d1;
879
936
  })
880
937
  ? `checked`
881
938
  : ``}
882
- />
939
+ />
940
+ </div>
883
941
  </div>
884
942
  </div>
885
943
  </div>
886
944
  </div>
887
945
  </div>
888
- </div>
889
- ${document.body.clientWidth > 768 ? '' : BgWidget.mbContainer(8)}
890
- `;
946
+ ${document.body.clientWidth > 768 ? '' : BgWidget.mbContainer(8)}
947
+ `;
891
948
  })
892
949
  .concat([
893
- html ` <div
894
- class="col-12 col-md-4 p-0 p-md-2"
895
- style="cursor: pointer;"
896
- onclick="${gvc.event(() => {
950
+ html `
951
+ <div
952
+ class="col-12 col-md-4 p-0 p-md-2"
953
+ style="cursor: pointer;"
954
+ onclick="${gvc.event(() => {
897
955
  updateCustomShipment({ function: 'plus' });
898
956
  })}"
899
- >
900
- <div
901
- class="w-100 main-card"
902
- style="min-height:121px;padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: center; align-items: center; gap: 18px; display: inline-flex"
903
- >
904
- <div class="fw-bold" style="align-self: stretch; justify-content: center; align-items: center; gap: 14px; display: inline-flex;color:#4D86DB;">
905
- <i class="fa-regular fa-circle-plus fs-5"></i>
906
- <div class="fs-5">新增自訂物流</div>
907
- </div>
908
- </div>
909
- </div>`,
957
+ >
958
+ <div
959
+ class="w-100 main-card"
960
+ style="min-height:121px;padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: center; align-items: center; gap: 18px; display: inline-flex"
961
+ >
962
+ <div class="fw-bold"
963
+ style="align-self: stretch; justify-content: center; align-items: center; gap: 14px; display: inline-flex;color:#4D86DB;">
964
+ <i class="fa-regular fa-circle-plus fs-5"></i>
965
+ <div class="fs-5">新增自訂物流</div>
966
+ </div>
967
+ </div>
968
+ </div>`,
910
969
  ])
911
970
  .join('');
912
971
  },
@@ -917,10 +976,11 @@ export class ShoppingFinanceSetting {
917
976
  })}
918
977
  ${BgWidget.mbContainer(12)}
919
978
  ${BgWidget.mainCard([
920
- html `<div class="title-container px-0">
921
- <div class="d-flex d-md-block gap-2 align-items-center">
922
- <div class="tx_700">配送說明</div>
923
- ${document.body.clientWidth > 768
979
+ html `
980
+ <div class="title-container px-0">
981
+ <div class="d-flex d-md-block gap-2 align-items-center">
982
+ <div class="tx_700">配送說明</div>
983
+ ${document.body.clientWidth > 768
924
984
  ? BgWidget.grayNote('於結帳頁面中顯示,告知顧客配送所需要注意的事項')
925
985
  : BgWidget.iconButton({
926
986
  icon: 'info',
@@ -934,17 +994,18 @@ export class ShoppingFinanceSetting {
934
994
  });
935
995
  }),
936
996
  })}
937
- </div>
938
- <div class="flex-fill"></div>
939
- ${BgWidget.aiChatButton({
997
+ </div>
998
+ <div class="flex-fill"></div>
999
+ ${BgWidget.aiChatButton({
940
1000
  gvc,
941
1001
  select: 'writer',
942
1002
  })}
943
- </div>`,
1003
+ </div>`,
944
1004
  ,
945
1005
  BgWidget.mbContainer(18),
946
- html `<div class="guide3-4">
947
- ${EditorElem.richText({
1006
+ html `
1007
+ <div class="guide3-4">
1008
+ ${EditorElem.richText({
948
1009
  gvc: gvc,
949
1010
  def: vm.data.info,
950
1011
  callback: (text) => {
@@ -952,7 +1013,7 @@ export class ShoppingFinanceSetting {
952
1013
  save();
953
1014
  },
954
1015
  })}
955
- </div>`,
1016
+ </div>`,
956
1017
  ].join(''))}
957
1018
  <div style="width: 100%;padding: 14px 16px;background: #FFF; display: flex;justify-content: end;position: fixed;bottom: 0;right: 0;z-index:1;gap:14px;">
958
1019
  ${BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
@@ -1026,51 +1087,68 @@ export class ShoppingFinanceSetting {
1026
1087
  bind: id,
1027
1088
  view: () => {
1028
1089
  return html `
1029
- <div class="d-flex flex-column" style="gap:18px;">
1030
- <div class="tx_normal fw-bold">服務商選擇</div>
1031
- ${[
1090
+ <div class="d-flex flex-column"
1091
+ style="gap:18px;">
1092
+ <div class="tx_normal fw-bold">
1093
+ 服務商選擇
1094
+ </div>
1095
+ ${[
1032
1096
  {
1033
- title: html ` <div class="d-flex flex-column">
1034
- 綠界發票
1035
- <span class="" style="color:#8D8D8D;font-size: 12px;">透過綠界服務商串接,於商品購買時,自動開立電子發票</span>
1036
- </div>`,
1097
+ title: html `
1098
+ <div class="d-flex flex-column">
1099
+ 綠界發票
1100
+ <span class=""
1101
+ style="color:#8D8D8D;font-size: 12px;">透過綠界服務商串接,於商品購買時,自動開立電子發票</span>
1102
+ </div>`,
1037
1103
  value: 'ecpay',
1038
1104
  },
1039
1105
  {
1040
- title: html ` <div class="d-flex flex-column">
1041
- 線下開立
1042
- <span class="" style="color:#8D8D8D;font-size: 12px;">顧客需填寫發票資訊,由店家自行開立發票</span>
1043
- </div>`,
1106
+ title: html `
1107
+ <div class="d-flex flex-column">
1108
+ 線下開立
1109
+ <span class=""
1110
+ style="color:#8D8D8D;font-size: 12px;">顧客需填寫發票資訊,由店家自行開立發票</span>
1111
+ </div>`,
1044
1112
  value: 'off_line',
1045
1113
  },
1046
1114
  {
1047
- title: html ` <div class="d-flex flex-column">
1048
- 不開立電子發票
1049
- <span class="" style="color:#8D8D8D;font-size: 12px;">顧客不需填寫發票資訊,不需開立電子發票</span>
1050
- </div>`,
1115
+ title: html `
1116
+ <div class="d-flex flex-column">
1117
+ 不開立電子發票
1118
+ <span class=""
1119
+ style="color:#8D8D8D;font-size: 12px;">顧客不需填寫發票資訊,不需開立電子發票</span>
1120
+ </div>`,
1051
1121
  value: 'nouse',
1052
1122
  },
1053
1123
  ]
1054
1124
  .map((dd) => {
1055
- return html ` <div>
1056
- ${[
1057
- html ` <div
1058
- class="d-flex align-items-center cursor_pointer"
1059
- style="gap:8px;"
1060
- onclick="${gvc.event(() => {
1125
+ return html `
1126
+ <div>
1127
+ ${[
1128
+ html `
1129
+ <div
1130
+ class="d-flex align-items-center cursor_pointer"
1131
+ style="gap:8px;"
1132
+ onclick="${gvc.event(() => {
1061
1133
  vm.data.fincial = dd.value;
1062
1134
  gvc.notifyDataChange(id);
1063
1135
  })}"
1064
- >
1065
- ${vm.data.fincial === dd.value
1136
+ >
1137
+ ${vm.data.fincial === dd.value
1066
1138
  ? `<i class="fa-sharp fa-solid fa-circle-dot color39"></i>`
1067
1139
  : ` <div class="c_39_checkbox"></div>`}
1068
- <div class="tx_normal fw-normal">${dd.title}</div>
1069
- </div>`,
1070
- html ` <div class="d-flex position-relative mt-2" style="">
1071
- <div class="ms-2 border-end position-absolute h-100" style="left: 0px;"></div>
1072
- <div class="flex-fill " style="margin-left:30px;max-width: 518px;">
1073
- ${(() => {
1140
+ <div class="tx_normal fw-normal">
1141
+ ${dd.title}
1142
+ </div>
1143
+ </div>`,
1144
+ html `
1145
+ <div class="d-flex position-relative mt-2"
1146
+ style="">
1147
+ <div class="ms-2 border-end position-absolute h-100"
1148
+ style="left: 0px;"></div>
1149
+ <div class="flex-fill "
1150
+ style="margin-left:30px;max-width: 518px;">
1151
+ ${(() => {
1074
1152
  var _a, _b, _c;
1075
1153
  if (vm.data.fincial === 'nouse' ||
1076
1154
  vm.data.fincial === 'off_line' ||
@@ -1151,14 +1229,14 @@ export class ShoppingFinanceSetting {
1151
1229
  ].join(BgWidget.mbContainer(12));
1152
1230
  }
1153
1231
  })()}
1154
- </div>
1155
- </div>`,
1232
+ </div>
1233
+ </div>`,
1156
1234
  ].join('')}
1157
- </div>`;
1235
+ </div>`;
1158
1236
  })
1159
1237
  .join('')}
1160
- </div>
1161
- `;
1238
+ </div>
1239
+ `;
1162
1240
  },
1163
1241
  divCreate: {
1164
1242
  style: ``,
@@ -1175,14 +1253,15 @@ export class ShoppingFinanceSetting {
1175
1253
  };
1176
1254
  })),
1177
1255
  BgWidget.mbContainer(240),
1178
- html ` <div class="update-bar-container">
1179
- ${BgWidget.save(gvc.event(() => {
1256
+ html `
1257
+ <div class="update-bar-container">
1258
+ ${BgWidget.save(gvc.event(() => {
1180
1259
  save(() => {
1181
1260
  const dialog = new ShareDialog(gvc.glitter);
1182
1261
  dialog.successMessage({ text: '設定成功' });
1183
1262
  });
1184
1263
  }))}
1185
- </div>`,
1264
+ </div>`,
1186
1265
  ].join(''))}
1187
1266
  `);
1188
1267
  },