ts-glitter 21.0.3 → 21.0.5

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 (161) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-blog.js +22 -37
  4. package/lowcode/backend-manager/bg-blog.ts +45 -34
  5. package/lowcode/backend-manager/bg-list-component.js +2 -2
  6. package/lowcode/backend-manager/bg-list-component.ts +2 -2
  7. package/lowcode/backend-manager/bg-widget.js +21 -0
  8. package/lowcode/backend-manager/bg-widget.ts +21 -0
  9. package/lowcode/cms-plugin/filter-options.js +3 -3
  10. package/lowcode/cms-plugin/filter-options.ts +1 -1
  11. package/lowcode/cms-plugin/shopping-finance-setting.js +251 -6
  12. package/lowcode/cms-plugin/shopping-finance-setting.ts +291 -6
  13. package/lowcode/cms-plugin/shopping-order-manager.js +56 -46
  14. package/lowcode/cms-plugin/shopping-order-manager.ts +59 -47
  15. package/lowcode/cms-plugin/shopping-product-setting.js +10 -5
  16. package/lowcode/cms-plugin/shopping-product-setting.ts +14 -6
  17. package/lowcode/cms-plugin/shopping-setting-advance.js +21 -72
  18. package/lowcode/cms-plugin/shopping-setting-advance.ts +31 -98
  19. package/lowcode/css/editor.css +48 -16
  20. package/lowcode/css/front-end.css +16 -17
  21. package/lowcode/glitter-base/global/language.js +2 -0
  22. package/lowcode/glitter-base/global/language.ts +3 -0
  23. package/lowcode/glitter-base/global/shipment-config.js +4 -4
  24. package/lowcode/glitter-base/global/shipment-config.ts +1 -1
  25. package/lowcode/glitter-base/route/shopping.js +11 -0
  26. package/lowcode/glitter-base/route/shopping.ts +12 -0
  27. package/lowcode/official_view_component/form-widget/input-custom.js +0 -1
  28. package/lowcode/official_view_component/form-widget/input-custom.ts +0 -1
  29. package/lowcode/public-components/checkout/index.js +578 -780
  30. package/lowcode/public-components/checkout/index.ts +2457 -2652
  31. package/lowcode/public-components/headers/header-class.js +252 -324
  32. package/lowcode/public-components/headers/header-class.ts +389 -480
  33. package/lowcode/public-components/modules/cart-module.js +433 -0
  34. package/lowcode/public-components/modules/cart-module.ts +491 -0
  35. package/lowcode/public-components/modules/product-module.js +45 -0
  36. package/lowcode/public-components/modules/product-module.ts +58 -0
  37. package/lowcode/public-components/product/product-detail.js +178 -184
  38. package/lowcode/public-components/product/product-detail.ts +564 -579
  39. package/lowcode/public-components/user-manager/um-order.js +162 -32
  40. package/lowcode/public-components/user-manager/um-order.ts +181 -46
  41. package/lowcode/public-models/product.ts +1 -0
  42. package/lowcode/view-model/saas-view-model.js +1 -1
  43. package/lowcode/view-model/saas-view-model.ts +1 -1
  44. package/package.json +1 -1
  45. package/src/Language.js +1 -0
  46. package/src/Language.js.map +1 -1
  47. package/src/Language.ts +3 -0
  48. package/src/api-public/controllers/article.js +33 -29
  49. package/src/api-public/controllers/article.js.map +1 -1
  50. package/src/api-public/controllers/article.ts +152 -146
  51. package/src/api-public/controllers/index.js +2 -0
  52. package/src/api-public/controllers/index.js.map +1 -1
  53. package/src/api-public/controllers/index.ts +2 -0
  54. package/src/api-public/controllers/shop.js +125 -47
  55. package/src/api-public/controllers/shop.js.map +1 -1
  56. package/src/api-public/controllers/shop.ts +148 -61
  57. package/src/api-public/controllers/user.js +51 -52
  58. package/src/api-public/controllers/user.js.map +1 -1
  59. package/src/api-public/controllers/user.ts +63 -52
  60. package/src/api-public/models/glitter-finance.js +2 -1
  61. package/src/api-public/models/glitter-finance.js.map +5 -1
  62. package/src/api-public/services/checkout-event.d.ts +1 -0
  63. package/src/api-public/services/checkout-event.js +18 -10
  64. package/src/api-public/services/checkout-event.js.map +1 -1
  65. package/src/api-public/services/checkout-event.ts +18 -7
  66. package/src/api-public/services/factories/payment-strategy-factory.d.ts +6 -0
  67. package/src/api-public/services/factories/payment-strategy-factory.js +49 -0
  68. package/src/api-public/services/factories/payment-strategy-factory.js.map +1 -0
  69. package/src/api-public/services/factories/payment-strategy-factory.ts +71 -0
  70. package/src/api-public/services/fb-service.js +4 -4
  71. package/src/api-public/services/fb-service.js.map +1 -1
  72. package/src/api-public/services/financial-service.d.ts +2 -1
  73. package/src/api-public/services/financial-service.js +48 -53
  74. package/src/api-public/services/financial-service.js.map +1 -1
  75. package/src/api-public/services/financial-service.ts +29 -38
  76. package/src/api-public/services/financial-serviceV2.d.ts +298 -0
  77. package/src/api-public/services/financial-serviceV2.js +1158 -0
  78. package/src/api-public/services/financial-serviceV2.js.map +1 -0
  79. package/src/api-public/services/financial-serviceV2.ts +1518 -0
  80. package/src/api-public/services/interface/payment-keys-interface.d.ts +37 -0
  81. package/src/api-public/services/interface/payment-keys-interface.js +3 -0
  82. package/src/api-public/services/interface/payment-keys-interface.js.map +1 -0
  83. package/src/api-public/services/interface/payment-keys-interface.ts +46 -0
  84. package/src/api-public/services/interface/payment-strategy-interface.d.ts +17 -0
  85. package/src/api-public/services/interface/payment-strategy-interface.js +3 -0
  86. package/src/api-public/services/interface/payment-strategy-interface.js.map +1 -0
  87. package/src/api-public/services/interface/payment-strategy-interface.ts +48 -0
  88. package/src/api-public/services/migrate-event/public-user-config.d.ts +5 -0
  89. package/src/api-public/services/migrate-event/public-user-config.js +81 -0
  90. package/src/api-public/services/migrate-event/public-user-config.js.map +1 -0
  91. package/src/api-public/services/migrate-event/public-user-config.ts +106 -0
  92. package/src/api-public/services/model/handlePaymentTransaction.js +0 -68
  93. package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
  94. package/src/api-public/services/model/handlePaymentTransaction.ts +62 -54
  95. package/src/api-public/services/monitor.d.ts +1 -0
  96. package/src/api-public/services/payment-service.d.ts +12 -0
  97. package/src/api-public/services/payment-service.js +83 -0
  98. package/src/api-public/services/payment-service.js.map +1 -0
  99. package/src/api-public/services/payment-service.ts +112 -0
  100. package/src/api-public/services/shopping.d.ts +2 -1
  101. package/src/api-public/services/shopping.js +60 -23
  102. package/src/api-public/services/shopping.js.map +1 -1
  103. package/src/api-public/services/shopping.ts +88 -16
  104. package/src/api-public/services/strategies/ecpay-strategy.d.ts +8 -0
  105. package/src/api-public/services/strategies/ecpay-strategy.js +26 -0
  106. package/src/api-public/services/strategies/ecpay-strategy.js.map +1 -0
  107. package/src/api-public/services/strategies/ecpay-strategy.ts +30 -0
  108. package/src/api-public/services/strategies/ezpay-strategy.d.ts +8 -0
  109. package/src/api-public/services/strategies/ezpay-strategy.js +26 -0
  110. package/src/api-public/services/strategies/ezpay-strategy.js.map +1 -0
  111. package/src/api-public/services/strategies/ezpay-strategy.ts +31 -0
  112. package/src/api-public/services/strategies/jkopay-strategy.d.ts +8 -0
  113. package/src/api-public/services/strategies/jkopay-strategy.js +32 -0
  114. package/src/api-public/services/strategies/jkopay-strategy.js.map +1 -0
  115. package/src/api-public/services/strategies/jkopay-strategy.ts +36 -0
  116. package/src/api-public/services/strategies/linepay-strategy.d.ts +8 -0
  117. package/src/api-public/services/strategies/linepay-strategy.js +32 -0
  118. package/src/api-public/services/strategies/linepay-strategy.js.map +1 -0
  119. package/src/api-public/services/strategies/linepay-strategy.ts +35 -0
  120. package/src/api-public/services/strategies/paynow-strategy.d.ts +8 -0
  121. package/src/api-public/services/strategies/paynow-strategy.js +26 -0
  122. package/src/api-public/services/strategies/paynow-strategy.js.map +1 -0
  123. package/src/api-public/services/strategies/paynow-strategy.ts +29 -0
  124. package/src/api-public/services/strategies/paypal-strategy.d.ts +8 -0
  125. package/src/api-public/services/strategies/paypal-strategy.js +28 -0
  126. package/src/api-public/services/strategies/paypal-strategy.js.map +1 -0
  127. package/src/api-public/services/strategies/paypal-strategy.ts +31 -0
  128. package/src/api-public/services/updated-table-checked.d.ts +1 -0
  129. package/src/api-public/services/updated-table-checked.js +37 -15
  130. package/src/api-public/services/updated-table-checked.js.map +1 -1
  131. package/src/api-public/services/updated-table-checked.ts +56 -36
  132. package/src/api-public/utils/ut-permission.d.ts +1 -0
  133. package/src/app-project/serverless/src/index.js +17 -7
  134. package/src/app-project/serverless/src/index.js.map +1 -1
  135. package/src/app-project/serverless/src/modules/CryptoJS.js +17 -7
  136. package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
  137. package/src/app-project/serverless/src/modules/ssh.js +17 -7
  138. package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
  139. package/src/config.d.ts +1 -1
  140. package/src/modules/AWSLib.js +3 -2
  141. package/src/modules/AWSLib.js.map +1 -1
  142. package/src/modules/CryptoJS.js +17 -7
  143. package/src/modules/CryptoJS.js.map +1 -1
  144. package/src/modules/database.d.ts +1 -1
  145. package/src/modules/redis.d.ts +1 -1
  146. package/src/modules/ssh.js +17 -7
  147. package/src/modules/ssh.js.map +1 -1
  148. package/src/modules/tool.d.ts +4 -4
  149. package/src/modules/tool.js +2 -1
  150. package/src/modules/tool.js.map +1 -1
  151. package/src/run.js +2 -1
  152. package/src/run.js.map +1 -1
  153. package/src/services/create-instance.js +4 -3
  154. package/src/services/create-instance.js.map +1 -1
  155. package/src/services/saas-table-check.js +2 -2
  156. package/src/services/saas-table-check.js.map +5 -1
  157. package/src/services/tool.js +3 -2
  158. package/src/services/tool.js.map +1 -1
  159. package/vp00rqhw1r.json +1 -0
  160. package/src/api-public/services/product-migrate.d.ts +0 -8
  161. package/src/api-public/services/product-migrate.js.map +0 -1
@@ -0,0 +1,491 @@
1
+ import { GVC } from '../../glitterBundle/GVController.js';
2
+ import { ApiShop } from '../../glitter-base/route/shopping.js';
3
+ import { ApiCart } from '../../glitter-base/route/api-cart.js';
4
+ import { ApiUser } from '../../glitter-base/route/user.js';
5
+ import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
6
+ import { PdClass } from '../product/pd-class.js';
7
+
8
+ export type CartShippings = {
9
+ title: string;
10
+ value: string;
11
+ cartLength: number;
12
+ };
13
+
14
+ export type CartDataList = {
15
+ logistic: string;
16
+ group: string[];
17
+ cart: {
18
+ id: number;
19
+ title: string;
20
+ count: number;
21
+ spec: string[];
22
+ price: number;
23
+ image: string;
24
+ specs: string[];
25
+ }[];
26
+ };
27
+
28
+ export type CartLogiGroup = {
29
+ key: string;
30
+ list: string[];
31
+ name: string;
32
+ };
33
+
34
+ type ViewModel = {
35
+ shippings: CartShippings[];
36
+ dataList: CartDataList[];
37
+ logisticsGroup: CartLogiGroup[];
38
+ hasFullLengthCart: boolean;
39
+ };
40
+
41
+ export class CartModule {
42
+ static async getLineItemAndShipmentCart() {
43
+ const vm: ViewModel = {
44
+ shippings: [],
45
+ dataList: [],
46
+ logisticsGroup: [],
47
+ hasFullLengthCart: false,
48
+ };
49
+
50
+ const cart = new ApiCart(ApiCart.checkoutCart).cart;
51
+
52
+ await Promise.all([
53
+ // 取得所有物流方式
54
+ ShipmentConfig.list,
55
+
56
+ // 取得購物車商品資訊
57
+ new Promise(resolve => {
58
+ ApiShop.getProduct({
59
+ page: 0,
60
+ limit: 10000,
61
+ status: 'inRange',
62
+ show_hidden: true,
63
+ id_list: [...new Set(cart.line_items.map(item => item.id))].join(','),
64
+ }).then(d => {
65
+ resolve(d);
66
+ });
67
+ }),
68
+
69
+ // 取得物流群組配置檔
70
+ ApiUser.getPublicConfig('logistics_group', 'manager').then(r => r.response.value),
71
+ ]).then(async (dataArray: any) => {
72
+ vm.shippings = [...dataArray[0]].map(item => {
73
+ item.cartLength = 0;
74
+ return item;
75
+ });
76
+ vm.logisticsGroup = dataArray[2];
77
+
78
+ // 建立物流群組購物車
79
+ vm.dataList = [
80
+ ...vm.shippings.map(item => {
81
+ return {
82
+ logistic: item.value,
83
+ group: vm.logisticsGroup
84
+ .filter(group => {
85
+ return group.list.includes(item.value);
86
+ })
87
+ .map(item => {
88
+ return item.key;
89
+ }),
90
+ cart: [],
91
+ };
92
+ }),
93
+ ];
94
+
95
+ if (!dataArray[1].result || !dataArray[1].response) {
96
+ return vm;
97
+ }
98
+
99
+ // 購物車所有商品資訊
100
+ const products = dataArray[1].response.data;
101
+
102
+ // 判斷是否有單一物流,可滿足所有購物車商品的配送方式
103
+ for (const item of cart.line_items) {
104
+ const product = products.find((p: { id: number }) => `${p.id}` === `${item.id}`);
105
+ if (product) {
106
+ const productLogi = product.content.designated_logistics;
107
+
108
+ for (const data of vm.dataList) {
109
+ const findShip = vm.shippings.find(ship => ship.value === data.logistic);
110
+
111
+ if (findShip) {
112
+ if (productLogi === undefined || productLogi.type === 'all') {
113
+ findShip.cartLength++;
114
+ continue;
115
+ }
116
+
117
+ const findGroup = vm.logisticsGroup.find(group => productLogi.group.includes(group.key));
118
+ if (findGroup && findGroup.list.includes(data.logistic)) {
119
+ findShip.cartLength++;
120
+ continue;
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ // 是否有單一物流結果
128
+ const hasFullCart = vm.shippings.some(ship => ship.cartLength === cart.line_items.length);
129
+
130
+ // 遍歷購物車商品,並加入所有物流群組
131
+ for (const item of cart.line_items) {
132
+ const product = products.find((p: { id: number }) => `${p.id}` === `${item.id}`);
133
+ if (product) {
134
+ const variant = PdClass.getVariant(product.content, { specs: item.spec });
135
+
136
+ const lineItem = {
137
+ id: item.id,
138
+ title: product.content.title,
139
+ count: item.count,
140
+ spec: item.spec,
141
+ specs: product.content.specs,
142
+ price: variant ? variant.sale_price : 0,
143
+ image: await (async () => {
144
+ if (!variant) {
145
+ if (product.content && product.content.preview_image) {
146
+ return product.content.preview_image[0];
147
+ }
148
+ return this.noImageURL;
149
+ }
150
+ const img = await this.isImageUrlValid(variant.preview_image).then(isValid => {
151
+ return isValid ? variant.preview_image : product.content.preview_image[0] || this.noImageURL;
152
+ });
153
+ return img;
154
+ })(),
155
+ };
156
+
157
+ const productLogi = product.content.designated_logistics;
158
+
159
+ for (const data of vm.dataList) {
160
+ if (productLogi === undefined || productLogi.type === 'all') {
161
+ data.cart.push(lineItem);
162
+ continue;
163
+ }
164
+
165
+ if (hasFullCart) {
166
+ const filterGroup = vm.logisticsGroup.filter(group => productLogi.group.includes(group.key));
167
+
168
+ for (const group of filterGroup) {
169
+ if (group && group.list.includes(data.logistic)) {
170
+ data.cart.push(lineItem);
171
+ }
172
+ }
173
+ } else {
174
+ const findGroup = vm.logisticsGroup.find(group => productLogi.group.includes(group.key));
175
+ if (findGroup && findGroup.list.includes(data.logistic)) {
176
+ data.cart.push(lineItem);
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ // 清除無商品之物流群組
184
+ vm.dataList = vm.dataList.filter(item => item.cart.length > 0);
185
+
186
+ // 若有滿足所有商品配送的物流群組,則取代原本的 vm.dataList
187
+ const filterFullShipping = vm.dataList.filter(item => item.cart.length === cart.line_items.length);
188
+
189
+ if (filterFullShipping.length > 0) {
190
+ vm.dataList = filterFullShipping;
191
+ vm.hasFullLengthCart = true;
192
+ }
193
+ });
194
+
195
+ return vm;
196
+ }
197
+
198
+ static isImageUrlValid(url: string): Promise<boolean> {
199
+ return new Promise(resolve => {
200
+ const img = new Image();
201
+ img.onload = () => resolve(true);
202
+ img.onerror = () => resolve(false);
203
+ img.src = url;
204
+ });
205
+ }
206
+
207
+ static addStyle(gvc: GVC, classPrefix: string) {
208
+ gvc.addStyle(`
209
+ .${classPrefix}-container {
210
+ max-width: 1200px !important;
211
+ margin: 2.5rem auto !important;
212
+ }
213
+
214
+ .${classPrefix}-null-container {
215
+ display: flex;
216
+ flex-direction: column;
217
+ align-items: center;
218
+ height: 100vh !important;
219
+ }
220
+
221
+ .${classPrefix}-header {
222
+ color: #393939;
223
+ font-size: 24px;
224
+ font-weight: 700;
225
+ letter-spacing: 12px;
226
+ text-align: center;
227
+ margin-bottom: 24px;
228
+ }
229
+
230
+ .${classPrefix}-banner-bgr {
231
+ padding: 1rem;
232
+ border-radius: 10px;
233
+ background: #f6f6f6;
234
+ }
235
+
236
+ .${classPrefix}-banner-text {
237
+ color: #393939;
238
+ font-size: 18px;
239
+ font-weight: 700;
240
+ letter-spacing: 2px;
241
+ }
242
+
243
+ .${classPrefix}-text-1 {
244
+ color: #393939;
245
+ font-size: 20px;
246
+ }
247
+
248
+ .${classPrefix}-text-2 {
249
+ color: #393939;
250
+ font-size: 16px;
251
+ }
252
+
253
+ .${classPrefix}-text-3 {
254
+ color: #393939;
255
+ font-size: 14px;
256
+ }
257
+
258
+ .${classPrefix}-label {
259
+ color: #393939;
260
+ font-size: 16px;
261
+ margin-bottom: 8px;
262
+ }
263
+
264
+ .${classPrefix}-bold {
265
+ font-weight: 700;
266
+ }
267
+
268
+ .${classPrefix}-button-bgr {
269
+ width: 100%;
270
+ border: 0;
271
+ border-radius: 0.375rem;
272
+ height: 40px;
273
+ background: #393939;
274
+ padding: 0 24px;
275
+ margin: 18px 0;
276
+ }
277
+
278
+ .${classPrefix}-button-bgr-disable {
279
+ width: 100%;
280
+ border: 0;
281
+ border-radius: 0.375rem;
282
+ height: 40px;
283
+ background: #dddddd;
284
+ padding: 0 24px;
285
+ margin: 18px 0;
286
+ cursor: not-allowed !important;
287
+ }
288
+
289
+ .${classPrefix}-button-text {
290
+ color: #fff;
291
+ font-size: 16px;
292
+ }
293
+
294
+ .${classPrefix}-input {
295
+ width: 100%;
296
+ border-radius: 10px;
297
+ border: 1px solid #ddd;
298
+ height: 40px;
299
+ padding: 0px 18px;
300
+ }
301
+
302
+ .${classPrefix}-select {
303
+ display: flex;
304
+ padding: 7px 30px 7px 18px;
305
+ max-height: 40px;
306
+ align-items: center;
307
+ gap: 6px;
308
+ border-radius: 10px;
309
+ border: 1px solid #ddd;
310
+ background: transparent url('https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1718100926212-Vector 89.png')
311
+ no-repeat;
312
+ background-position-x: calc(100% - 12px);
313
+ background-position-y: 16px;
314
+ appearance: none;
315
+ -webkit-appearance: none;
316
+ -moz-appearance: none;
317
+ color: #393939;
318
+ background-color: white;
319
+ }
320
+
321
+ .${classPrefix}-select:focus {
322
+ outline: 0;
323
+ }
324
+
325
+ .${classPrefix}-group-input {
326
+ border: none;
327
+ background: none;
328
+ text-align: start;
329
+ color: #393939;
330
+ font-size: 16px;
331
+ font-weight: 400;
332
+ word-wrap: break-word;
333
+ padding-left: 12px;
334
+ }
335
+
336
+ .${classPrefix}-first-td {
337
+ display: flex;
338
+ align-items: center;
339
+ justify-content: center;
340
+ width: 30%;
341
+ }
342
+
343
+ .${classPrefix}-group-input:focus {
344
+ outline: 0;
345
+ }
346
+
347
+ .${classPrefix}-group-button {
348
+ padding: 9px 18px;
349
+ background: #393939;
350
+ align-items: center;
351
+ gap: 5px;
352
+ display: flex;
353
+ font-size: 16px;
354
+ justify-content: center;
355
+ cursor: pointer;
356
+ }
357
+
358
+ .${classPrefix}-td {
359
+ display: flex;
360
+ align-items: center;
361
+ justify-content: start;
362
+ width: 15%;
363
+ }
364
+
365
+ .${classPrefix}-first-td {
366
+ display: flex;
367
+ align-items: center;
368
+ justify-content: center;
369
+ width: 40%;
370
+ }
371
+
372
+ .${classPrefix}-price-container {
373
+ display: flex;
374
+ flex-direction: column;
375
+ width: 400px;
376
+ align-items: center;
377
+ padding: 0;
378
+ gap: 12px;
379
+ margin: 24px 0;
380
+ }
381
+
382
+ .${classPrefix}-price-row {
383
+ display: flex;
384
+ width: 100%;
385
+ align-items: center;
386
+ justify-content: space-between;
387
+ }
388
+
389
+ .${classPrefix}-origin-price {
390
+ text-align: end;
391
+ font-weight: 400;
392
+ word-wrap: break-word;
393
+ text-decoration: line-through;
394
+ color: #636363;
395
+ font-style: italic;
396
+ margin-top: auto;
397
+ }
398
+
399
+ .${classPrefix}-add-item-badge {
400
+ height: 22px;
401
+ padding-left: 6px;
402
+ padding-right: 6px;
403
+ padding-top: 4px;
404
+ padding-bottom: 4px;
405
+ background: #ffe9b2;
406
+ border-radius: 7px;
407
+ justify-content: center;
408
+ align-items: center;
409
+ gap: 10px;
410
+ display: inline-flex;
411
+ }
412
+
413
+ .${classPrefix}-add-item-text {
414
+ color: #393939;
415
+ font-size: 14px;
416
+ font-weight: 400;
417
+ word-wrap: break-word;
418
+ }
419
+
420
+ .${classPrefix}-shipping-hint {
421
+ white-space: normal;
422
+ word-break: break-all;
423
+ color: #8d8d8d;
424
+ font-size: 14px;
425
+ font-weight: 400;
426
+ margin: 4px 0;
427
+ }
428
+
429
+ .${classPrefix}-price-text {
430
+ color: #ff5353ff;
431
+ }
432
+
433
+ .img-106px {
434
+ width: 106px;
435
+ min-width: 106px;
436
+ height: 106px;
437
+ border-radius: 3px;
438
+ background-position: center;
439
+ background-size: cover;
440
+ background-repeat: no-repeat;
441
+ }
442
+
443
+ .banner-font-15 {
444
+ font-size: 15px;
445
+ font-style: normal;
446
+ font-weight: 400;
447
+ white-space: nowrap;
448
+ overflow: hidden;
449
+ max-width: 130px;
450
+ text-overflow: ellipsis;
451
+ }
452
+
453
+ .ntd-font-14 {
454
+ font-size: 14px;
455
+ font-style: normal;
456
+ font-weight: 700;
457
+ line-height: 140%;
458
+ }
459
+
460
+ @media (max-width: 768px) {
461
+ .${classPrefix}-container {
462
+ max-width: 100% !important;
463
+ margin: 2.5rem auto !important;
464
+ }
465
+
466
+ .${classPrefix}-td {
467
+ display: flex;
468
+ align-items: center;
469
+ justify-content: start;
470
+ width: 100%;
471
+ }
472
+
473
+ .${classPrefix}-66text {
474
+ color: #666666;
475
+ }
476
+
477
+ .${classPrefix}-price-container {
478
+ display: flex;
479
+ flex-direction: column;
480
+ width: 100% !important;
481
+ align-items: center;
482
+ padding: 0;
483
+ gap: 12px;
484
+ margin: 24px 0;
485
+ }
486
+ }
487
+ `);
488
+ }
489
+
490
+ static noImageURL = 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722936949034-default_image.jpg';
491
+ }
@@ -0,0 +1,45 @@
1
+ const html = String.raw;
2
+ export class ProductModule {
3
+ static tab(data, gvc, select, callback, style) {
4
+ return html ` <div
5
+ style="width: 100%; justify-content: center; align-items: flex-start; gap: 22px; display: inline-flex;cursor: pointer;margin-top: 24px;margin-bottom: 24px;font-size: 18px; ${style !== null && style !== void 0 ? style : ''};"
6
+ >
7
+ ${data
8
+ .map(dd => {
9
+ if (select === dd.key) {
10
+ return html ` <div
11
+ style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
12
+ >
13
+ <div
14
+ style="align-self: stretch; text-align: center; color: ${this
15
+ .titleFontColor}; font-family: Noto Sans; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
16
+ onclick="${gvc.event(() => {
17
+ callback(dd.key);
18
+ })}"
19
+ >
20
+ ${dd.title}
21
+ </div>
22
+ <div style="align-self: stretch; height: 0px; border: 1px ${this.titleFontColor} solid"></div>
23
+ </div>`;
24
+ }
25
+ else {
26
+ return html ` <div
27
+ style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
28
+ onclick="${gvc.event(() => {
29
+ callback(dd.key);
30
+ })}"
31
+ >
32
+ <div
33
+ style="align-self: stretch; text-align: center; color: #8D8D8D; font-family: Noto Sans; font-weight: 400; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
34
+ >
35
+ ${dd.title}
36
+ </div>
37
+ <div style="align-self: stretch; height: 0px"></div>
38
+ </div>`;
39
+ }
40
+ })
41
+ .join('')}
42
+ </div>`;
43
+ }
44
+ }
45
+ ProductModule.titleFontColor = '';
@@ -0,0 +1,58 @@
1
+ import { GVC } from '../../glitterBundle/GVController.js';
2
+
3
+ const html = String.raw;
4
+
5
+ export class ProductModule {
6
+ static titleFontColor: string = '';
7
+
8
+ static tab(
9
+ data: {
10
+ title: string;
11
+ key: string;
12
+ }[],
13
+ gvc: GVC,
14
+ select: string,
15
+ callback: (key: string) => void,
16
+ style?: string
17
+ ) {
18
+ return html` <div
19
+ style="width: 100%; justify-content: center; align-items: flex-start; gap: 22px; display: inline-flex;cursor: pointer;margin-top: 24px;margin-bottom: 24px;font-size: 18px; ${style ??
20
+ ''};"
21
+ >
22
+ ${data
23
+ .map(dd => {
24
+ if (select === dd.key) {
25
+ return html` <div
26
+ style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
27
+ >
28
+ <div
29
+ style="align-self: stretch; text-align: center; color: ${this
30
+ .titleFontColor}; font-family: Noto Sans; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
31
+ onclick="${gvc.event(() => {
32
+ callback(dd.key);
33
+ })}"
34
+ >
35
+ ${dd.title}
36
+ </div>
37
+ <div style="align-self: stretch; height: 0px; border: 1px ${this.titleFontColor} solid"></div>
38
+ </div>`;
39
+ } else {
40
+ return html` <div
41
+ style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
42
+ onclick="${gvc.event(() => {
43
+ callback(dd.key);
44
+ })}"
45
+ >
46
+ <div
47
+ style="align-self: stretch; text-align: center; color: #8D8D8D; font-family: Noto Sans; font-weight: 400; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
48
+ >
49
+ ${dd.title}
50
+ </div>
51
+ <div style="align-self: stretch; height: 0px"></div>
52
+ </div>`;
53
+ }
54
+ })
55
+ .join('')}
56
+ </div>`;
57
+ }
58
+ }