ts-glitter 21.0.4 → 21.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 (164) 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/pos-pages/models.ts +1 -0
  12. package/lowcode/cms-plugin/pos-pages/payment-page.js +74 -8
  13. package/lowcode/cms-plugin/pos-pages/payment-page.ts +98 -19
  14. package/lowcode/cms-plugin/product-service.js +2 -1
  15. package/lowcode/cms-plugin/product-service.ts +3 -2
  16. package/lowcode/cms-plugin/shopping-finance-setting.js +251 -6
  17. package/lowcode/cms-plugin/shopping-finance-setting.ts +291 -6
  18. package/lowcode/cms-plugin/shopping-order-manager.js +56 -46
  19. package/lowcode/cms-plugin/shopping-order-manager.ts +59 -47
  20. package/lowcode/cms-plugin/shopping-product-setting.js +10 -5
  21. package/lowcode/cms-plugin/shopping-product-setting.ts +14 -6
  22. package/lowcode/cms-plugin/shopping-setting-advance.js +21 -72
  23. package/lowcode/cms-plugin/shopping-setting-advance.ts +31 -98
  24. package/lowcode/css/editor.css +48 -16
  25. package/lowcode/css/front-end.css +16 -17
  26. package/lowcode/glitter-base/global/language.js +2 -0
  27. package/lowcode/glitter-base/global/language.ts +3 -0
  28. package/lowcode/glitter-base/global/shipment-config.js +4 -4
  29. package/lowcode/glitter-base/global/shipment-config.ts +1 -1
  30. package/lowcode/glitter-base/route/shopping.js +11 -0
  31. package/lowcode/glitter-base/route/shopping.ts +12 -0
  32. package/lowcode/official_view_component/form-widget/input-custom.js +0 -1
  33. package/lowcode/official_view_component/form-widget/input-custom.ts +0 -1
  34. package/lowcode/public-components/checkout/index.js +578 -780
  35. package/lowcode/public-components/checkout/index.ts +2457 -2652
  36. package/lowcode/public-components/headers/header-class.js +252 -324
  37. package/lowcode/public-components/headers/header-class.ts +389 -480
  38. package/lowcode/public-components/modules/cart-module.js +433 -0
  39. package/lowcode/public-components/modules/cart-module.ts +491 -0
  40. package/lowcode/public-components/modules/product-module.js +45 -0
  41. package/lowcode/public-components/modules/product-module.ts +58 -0
  42. package/lowcode/public-components/product/product-detail.js +178 -184
  43. package/lowcode/public-components/product/product-detail.ts +564 -579
  44. package/lowcode/public-components/user-manager/um-order.js +162 -32
  45. package/lowcode/public-components/user-manager/um-order.ts +181 -46
  46. package/lowcode/public-models/product.ts +1 -0
  47. package/package.json +1 -1
  48. package/src/Language.js +1 -0
  49. package/src/Language.js.map +1 -1
  50. package/src/Language.ts +3 -0
  51. package/src/api-public/controllers/article.js +33 -29
  52. package/src/api-public/controllers/article.js.map +1 -1
  53. package/src/api-public/controllers/article.ts +152 -146
  54. package/src/api-public/controllers/index.js +2 -0
  55. package/src/api-public/controllers/index.js.map +1 -1
  56. package/src/api-public/controllers/index.ts +2 -0
  57. package/src/api-public/controllers/shop.js +125 -47
  58. package/src/api-public/controllers/shop.js.map +1 -1
  59. package/src/api-public/controllers/shop.ts +148 -61
  60. package/src/api-public/controllers/user.js +51 -52
  61. package/src/api-public/controllers/user.js.map +1 -1
  62. package/src/api-public/controllers/user.ts +63 -52
  63. package/src/api-public/models/glitter-finance.js +2 -1
  64. package/src/api-public/models/glitter-finance.js.map +5 -1
  65. package/src/api-public/services/checkout-event.d.ts +1 -0
  66. package/src/api-public/services/checkout-event.js +38 -13
  67. package/src/api-public/services/checkout-event.js.map +1 -1
  68. package/src/api-public/services/checkout-event.ts +38 -10
  69. package/src/api-public/services/factories/payment-strategy-factory.d.ts +6 -0
  70. package/src/api-public/services/factories/payment-strategy-factory.js +49 -0
  71. package/src/api-public/services/factories/payment-strategy-factory.js.map +1 -0
  72. package/src/api-public/services/factories/payment-strategy-factory.ts +71 -0
  73. package/src/api-public/services/fb-service.js +4 -4
  74. package/src/api-public/services/fb-service.js.map +1 -1
  75. package/src/api-public/services/financial-service.d.ts +2 -1
  76. package/src/api-public/services/financial-service.js +48 -53
  77. package/src/api-public/services/financial-service.js.map +1 -1
  78. package/src/api-public/services/financial-service.ts +29 -38
  79. package/src/api-public/services/financial-serviceV2.d.ts +298 -0
  80. package/src/api-public/services/financial-serviceV2.js +1158 -0
  81. package/src/api-public/services/financial-serviceV2.js.map +1 -0
  82. package/src/api-public/services/financial-serviceV2.ts +1518 -0
  83. package/src/api-public/services/interface/payment-keys-interface.d.ts +37 -0
  84. package/src/api-public/services/interface/payment-keys-interface.js +3 -0
  85. package/src/api-public/services/interface/payment-keys-interface.js.map +1 -0
  86. package/src/api-public/services/interface/payment-keys-interface.ts +46 -0
  87. package/src/api-public/services/interface/payment-strategy-interface.d.ts +17 -0
  88. package/src/api-public/services/interface/payment-strategy-interface.js +3 -0
  89. package/src/api-public/services/interface/payment-strategy-interface.js.map +1 -0
  90. package/src/api-public/services/interface/payment-strategy-interface.ts +48 -0
  91. package/src/api-public/services/migrate-event/public-user-config.d.ts +5 -0
  92. package/src/api-public/services/migrate-event/public-user-config.js +81 -0
  93. package/src/api-public/services/migrate-event/public-user-config.js.map +1 -0
  94. package/src/api-public/services/migrate-event/public-user-config.ts +106 -0
  95. package/src/api-public/services/model/handlePaymentTransaction.js +0 -68
  96. package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
  97. package/src/api-public/services/model/handlePaymentTransaction.ts +62 -54
  98. package/src/api-public/services/monitor.d.ts +1 -0
  99. package/src/api-public/services/payment-service.d.ts +12 -0
  100. package/src/api-public/services/payment-service.js +83 -0
  101. package/src/api-public/services/payment-service.js.map +1 -0
  102. package/src/api-public/services/payment-service.ts +112 -0
  103. package/src/api-public/services/shopping.d.ts +2 -1
  104. package/src/api-public/services/shopping.js +60 -23
  105. package/src/api-public/services/shopping.js.map +1 -1
  106. package/src/api-public/services/shopping.ts +88 -16
  107. package/src/api-public/services/strategies/ecpay-strategy.d.ts +8 -0
  108. package/src/api-public/services/strategies/ecpay-strategy.js +26 -0
  109. package/src/api-public/services/strategies/ecpay-strategy.js.map +1 -0
  110. package/src/api-public/services/strategies/ecpay-strategy.ts +30 -0
  111. package/src/api-public/services/strategies/ezpay-strategy.d.ts +8 -0
  112. package/src/api-public/services/strategies/ezpay-strategy.js +26 -0
  113. package/src/api-public/services/strategies/ezpay-strategy.js.map +1 -0
  114. package/src/api-public/services/strategies/ezpay-strategy.ts +31 -0
  115. package/src/api-public/services/strategies/jkopay-strategy.d.ts +8 -0
  116. package/src/api-public/services/strategies/jkopay-strategy.js +32 -0
  117. package/src/api-public/services/strategies/jkopay-strategy.js.map +1 -0
  118. package/src/api-public/services/strategies/jkopay-strategy.ts +36 -0
  119. package/src/api-public/services/strategies/linepay-strategy.d.ts +8 -0
  120. package/src/api-public/services/strategies/linepay-strategy.js +32 -0
  121. package/src/api-public/services/strategies/linepay-strategy.js.map +1 -0
  122. package/src/api-public/services/strategies/linepay-strategy.ts +35 -0
  123. package/src/api-public/services/strategies/paynow-strategy.d.ts +8 -0
  124. package/src/api-public/services/strategies/paynow-strategy.js +26 -0
  125. package/src/api-public/services/strategies/paynow-strategy.js.map +1 -0
  126. package/src/api-public/services/strategies/paynow-strategy.ts +29 -0
  127. package/src/api-public/services/strategies/paypal-strategy.d.ts +8 -0
  128. package/src/api-public/services/strategies/paypal-strategy.js +28 -0
  129. package/src/api-public/services/strategies/paypal-strategy.js.map +1 -0
  130. package/src/api-public/services/strategies/paypal-strategy.ts +31 -0
  131. package/src/api-public/services/updated-table-checked.d.ts +1 -0
  132. package/src/api-public/services/updated-table-checked.js +37 -15
  133. package/src/api-public/services/updated-table-checked.js.map +1 -1
  134. package/src/api-public/services/updated-table-checked.ts +56 -36
  135. package/src/api-public/utils/ut-permission.d.ts +1 -0
  136. package/src/app-project/serverless/src/index.js +17 -7
  137. package/src/app-project/serverless/src/index.js.map +1 -1
  138. package/src/app-project/serverless/src/modules/CryptoJS.js +17 -7
  139. package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
  140. package/src/app-project/serverless/src/modules/ssh.js +17 -7
  141. package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
  142. package/src/config.d.ts +1 -1
  143. package/src/modules/AWSLib.js +3 -2
  144. package/src/modules/AWSLib.js.map +1 -1
  145. package/src/modules/CryptoJS.js +17 -7
  146. package/src/modules/CryptoJS.js.map +1 -1
  147. package/src/modules/database.d.ts +1 -1
  148. package/src/modules/redis.d.ts +1 -1
  149. package/src/modules/ssh.js +17 -7
  150. package/src/modules/ssh.js.map +1 -1
  151. package/src/modules/tool.d.ts +4 -4
  152. package/src/modules/tool.js +2 -1
  153. package/src/modules/tool.js.map +1 -1
  154. package/src/run.js +2 -1
  155. package/src/run.js.map +1 -1
  156. package/src/services/create-instance.js +4 -3
  157. package/src/services/create-instance.js.map +1 -1
  158. package/src/services/saas-table-check.js +2 -2
  159. package/src/services/saas-table-check.js.map +5 -1
  160. package/src/services/tool.js +3 -2
  161. package/src/services/tool.js.map +1 -1
  162. package/vp00rqhw1r.json +1 -0
  163. package/src/api-public/services/product-migrate.d.ts +0 -8
  164. package/src/api-public/services/product-migrate.js.map +0 -1
@@ -13,49 +13,12 @@ import { PdClass } from './pd-class.js';
13
13
  import { Language } from '../../glitter-base/global/language.js';
14
14
  import { UmClass } from '../user-manager/um-class.js';
15
15
  import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
16
+ import { ProductModule } from '../modules/product-module.js';
16
17
  const html = String.raw;
17
18
  export class ProductDetail {
18
- static tab(data, gvc, select, callback, style) {
19
- return html ` <div
20
- 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 : ''};"
21
- >
22
- ${data
23
- .map((dd) => {
24
- if (select === dd.key) {
25
- return html ` <div style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
26
- <div
27
- style="align-self: stretch; text-align: center; color: ${ProductDetail.titleFontColor}; font-family: Noto Sans; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
28
- onclick="${gvc.event(() => {
29
- callback(dd.key);
30
- })}"
31
- >
32
- ${dd.title}
33
- </div>
34
- <div style="align-self: stretch; height: 0px; border: 1px ${ProductDetail.titleFontColor} solid"></div>
35
- </div>`;
36
- }
37
- else {
38
- return html ` <div
39
- style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
40
- onclick="${gvc.event(() => {
41
- callback(dd.key);
42
- })}"
43
- >
44
- <div
45
- 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;"
46
- >
47
- ${dd.title}
48
- </div>
49
- <div style="align-self: stretch; height: 0px"></div>
50
- </div>`;
51
- }
52
- })
53
- .join('')}
54
- </div>`;
55
- }
56
19
  static main(gvc, widget, subData) {
57
20
  var _a;
58
- ProductDetail.titleFontColor = (_a = gvc.glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
21
+ ProductModule.titleFontColor = (_a = gvc.glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
59
22
  const css = String.raw;
60
23
  const product_id = gvc.glitter.getUrlParameter('product_id');
61
24
  const url = new URL(location.href);
@@ -86,9 +49,9 @@ export class ProductDetail {
86
49
  };
87
50
  function spinner() {
88
51
  return html ` <div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto mt-5">
89
- <div class="spinner-border" role="status"></div>
90
- <span class="mt-3">${Language.text('loading')}</span>
91
- </div>`;
52
+ <div class="spinner-border" role="status"></div>
53
+ <span class="mt-3">${Language.text('loading')}</span>
54
+ </div>`;
92
55
  }
93
56
  return gvc.bindView({
94
57
  bind: ids.page,
@@ -99,22 +62,22 @@ export class ProductDetail {
99
62
  }
100
63
  if (Object.keys(vm.data).length === 0) {
101
64
  return html ` <div class="d-flex align-items-center justify-content-center flex-column w-100 mx-auto">
102
- <lottie-player
103
- style="max-width: 100%;width: 300px;"
104
- src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
105
- speed="1"
106
- loop="true"
107
- background="transparent"
108
- ></lottie-player>
109
- <span class="mb-5 fs-5">這個商品目前尚未上架喔!</span>
110
- </div>`;
65
+ <lottie-player
66
+ style="max-width: 100%;width: 300px;"
67
+ src="https://assets10.lottiefiles.com/packages/lf20_rc6CDU.json"
68
+ speed="1"
69
+ loop="true"
70
+ background="transparent"
71
+ ></lottie-player>
72
+ <span class="mb-5 fs-5">這個商品目前尚未上架喔!</span>
73
+ </div>`;
111
74
  }
112
75
  const prod = vm.data.content;
113
76
  PdClass.addSpecStyle(gvc);
114
77
  vm.specs =
115
78
  vm.specs.length > 0
116
79
  ? vm.specs
117
- : prod.specs.map((spec) => {
80
+ : prod.specs.map(spec => {
118
81
  return spec.option[0].title;
119
82
  });
120
83
  const book_mark = [
@@ -135,8 +98,16 @@ export class ProductDetail {
135
98
  function loop(array) {
136
99
  for (const b of array) {
137
100
  if (b.title === title) {
138
- domain = (b.language_data && b.language_data[Language.getLanguage()] && b.language_data[Language.getLanguage()].seo.domain) || b.code;
139
- title = (b.language_data && b.language_data[Language.getLanguage()] && b.language_data[Language.getLanguage()].title) || title;
101
+ domain =
102
+ (b.language_data &&
103
+ b.language_data[Language.getLanguage()] &&
104
+ b.language_data[Language.getLanguage()].seo.domain) ||
105
+ b.code;
106
+ title =
107
+ (b.language_data &&
108
+ b.language_data[Language.getLanguage()] &&
109
+ b.language_data[Language.getLanguage()].title) ||
110
+ title;
140
111
  break;
141
112
  }
142
113
  else if (b.array) {
@@ -160,30 +131,30 @@ export class ProductDetail {
160
131
  });
161
132
  }
162
133
  return html ` <div class="mx-auto pb-5" style="max-width:1100px;word-break: break-all;white-space: normal;">
163
- <div class="breadcrumb mb-0 d-flex align-items-center py-3" style="cursor:pointer; gap:10px;">
164
- ${book_mark
165
- .map((dd) => {
134
+ <div class="breadcrumb mb-0 d-flex align-items-center py-3" style="cursor:pointer; gap:10px;">
135
+ ${book_mark
136
+ .map(dd => {
166
137
  return html ` <li
167
- class="breadcrumb-item "
168
- style="margin-top: 0px;color:${ProductDetail.titleFontColor};"
169
- onclick="${gvc.event(() => {
138
+ class="breadcrumb-item "
139
+ style="margin-top: 0px;color:${ProductModule.titleFontColor};"
140
+ onclick="${gvc.event(() => {
170
141
  dd.event();
171
142
  })}"
172
- >
173
- ${dd.title}
174
- </li>`;
143
+ >
144
+ ${dd.title}
145
+ </li>`;
175
146
  })
176
147
  .join('<i class="fa-solid fa-angle-right"></i>')}
177
- </div>
178
- ${PdClass.selectSpec({
148
+ </div>
149
+ ${PdClass.selectSpec({
179
150
  gvc,
180
- titleFontColor: ProductDetail.titleFontColor,
151
+ titleFontColor: ProductModule.titleFontColor,
181
152
  prod,
182
153
  vm,
183
154
  preview: true,
184
155
  })}
185
- <div class="d-flex flex-column align-items-center mt-2" style="width:100%;">
186
- ${gvc.bindView((() => {
156
+ <div class="d-flex flex-column align-items-center mt-2" style="width:100%;">
157
+ ${gvc.bindView((() => {
187
158
  var _a, _b;
188
159
  const id = glitter.getUUID();
189
160
  const commentCount = (_b = (_a = vm.data.content.comments) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
@@ -191,27 +162,29 @@ export class ProductDetail {
191
162
  return {
192
163
  bind: id,
193
164
  view: () => {
194
- return this.tab([
165
+ return ProductModule.tab([
195
166
  {
196
167
  title: Language.text('product_description'),
197
168
  key: 'default',
198
169
  },
199
- ...(window.store_info.customer_comment) ? [
200
- {
201
- title: `${Language.text('customer_reviews')} (${maxDisplayCount})`,
202
- key: 'comment',
203
- }
204
- ] : []
170
+ ...(window.store_info.customer_comment
171
+ ? [
172
+ {
173
+ title: `${Language.text('customer_reviews')} (${maxDisplayCount})`,
174
+ key: 'comment',
175
+ },
176
+ ]
177
+ : []),
205
178
  ].concat(vm.content_manager
206
- .filter((cont) => {
179
+ .filter(cont => {
207
180
  return prod.content_array.includes(cont.id);
208
181
  })
209
- .map((cont) => {
182
+ .map(cont => {
210
183
  return {
211
184
  title: cont.title,
212
185
  key: cont.id,
213
186
  };
214
- })), gvc, vm.content_tag, (text) => {
187
+ })), gvc, vm.content_tag, text => {
215
188
  vm.content_tag = text;
216
189
  gvc.notifyDataChange(id);
217
190
  gvc.notifyDataChange(ids.content);
@@ -222,7 +195,7 @@ export class ProductDetail {
222
195
  },
223
196
  };
224
197
  })())}
225
- ${gvc.bindView({
198
+ ${gvc.bindView({
226
199
  bind: ids.content,
227
200
  view: () => {
228
201
  if (vm.content_tag === 'default') {
@@ -245,7 +218,7 @@ export class ProductDetail {
245
218
  gvc,
246
219
  tag: '',
247
220
  title: '撰寫評論',
248
- innerHTML: (gvcd) => {
221
+ innerHTML: gvcd => {
249
222
  const postData = {
250
223
  product_id: vm.data.id,
251
224
  rate: 5,
@@ -253,9 +226,9 @@ export class ProductDetail {
253
226
  comment: '',
254
227
  };
255
228
  return html `
256
- <div class="mt-1">
257
- <div class="tx_normal fw-normal mb-1">${Language.text('rating')}</div>
258
- ${gvcd.bindView((() => {
229
+ <div class="mt-1">
230
+ <div class="tx_normal fw-normal mb-1">${Language.text('rating')}</div>
231
+ ${gvcd.bindView((() => {
259
232
  const id = glitter.getUUID();
260
233
  function setRate(rate) {
261
234
  postData.rate = rate;
@@ -268,22 +241,22 @@ export class ProductDetail {
268
241
  .fill('')
269
242
  .map((_, index) => {
270
243
  return html ` <div class="rating-item">
271
- ${postData.rate > index
244
+ ${postData.rate > index
272
245
  ? html `<i
273
- class="fa-solid fa-star fs-4"
274
- style="cursor: pointer"
275
- onclick="${gvcd.event(() => {
246
+ class="fa-solid fa-star fs-4"
247
+ style="cursor: pointer"
248
+ onclick="${gvcd.event(() => {
276
249
  setRate(index + 1);
277
250
  })}"
278
- ></i>`
251
+ ></i>`
279
252
  : html `<i
280
- class="fa-regular fa-star fs-4"
281
- style="cursor: pointer"
282
- onclick="${gvcd.event(() => {
253
+ class="fa-regular fa-star fs-4"
254
+ style="cursor: pointer"
255
+ onclick="${gvcd.event(() => {
283
256
  setRate(index + 1);
284
257
  })}"
285
- ></i>`}
286
- </div>`;
258
+ ></i>`}
259
+ </div>`;
287
260
  })
288
261
  .join('');
289
262
  },
@@ -292,31 +265,31 @@ export class ProductDetail {
292
265
  },
293
266
  };
294
267
  })())}
295
- </div>
296
- <div class="mt-2">
297
- <div class="tx_normal fw-normal mb-1">${Language.text('title')}</div>
298
- <input
299
- class="bgw-input"
300
- type="text"
301
- oninput="${gvcd.event((e) => {
268
+ </div>
269
+ <div class="mt-2">
270
+ <div class="tx_normal fw-normal mb-1">${Language.text('title')}</div>
271
+ <input
272
+ class="bgw-input"
273
+ type="text"
274
+ oninput="${gvcd.event(e => {
302
275
  postData.title = e.value;
303
276
  })}"
304
- />
305
- </div>
306
- <div class="mt-2">
307
- <div class="tx_normal fw-normal mb-1">${Language.text('comment')}</div>
308
- <textarea
309
- class="bgw-input"
310
- rows="3"
311
- oninput="${gvcd.event((e) => {
277
+ />
278
+ </div>
279
+ <div class="mt-2">
280
+ <div class="tx_normal fw-normal mb-1">${Language.text('comment')}</div>
281
+ <textarea
282
+ class="bgw-input"
283
+ rows="3"
284
+ oninput="${gvcd.event(e => {
312
285
  postData.comment = e.value;
313
286
  })}"
314
- ></textarea>
315
- </div>
316
- <div class="d-flex justify-content-end mt-2 mb-1">
317
- <div
318
- class="um-solid-btn"
319
- onclick="${gvcd.event(() => {
287
+ ></textarea>
288
+ </div>
289
+ <div class="d-flex justify-content-end mt-2 mb-1">
290
+ <div
291
+ class="um-solid-btn"
292
+ onclick="${gvcd.event(() => {
320
293
  if (postData.title === '' || postData.comment === '') {
321
294
  PdClass.jumpAlert({
322
295
  gvc,
@@ -336,11 +309,11 @@ export class ProductDetail {
336
309
  gvc.notifyDataChange(ids.page);
337
310
  });
338
311
  })}"
339
- >
340
- ${Language.text('submit')}
341
- </div>
342
- </div>
343
- `;
312
+ >
313
+ ${Language.text('submit')}
314
+ </div>
315
+ </div>
316
+ `;
344
317
  },
345
318
  });
346
319
  };
@@ -353,66 +326,74 @@ export class ProductDetail {
353
326
  return a.date > b.date ? -1 : 1;
354
327
  })
355
328
  .slice(0, 15)
356
- .map((item) => {
357
- return html `<div style="padding: 20px; min-width: ${document.body.clientWidth > 768 ? '780px' : `calc(${document.body.clientWidth}px - 1.5rem)`};">
358
- <div class="row">
359
- <div class="col-12 col-md">
360
- <div class="row mb-6">
361
- <div class="col-12">
362
- <!-- Rating -->
363
- <div class="rating fs-sm text-dark d-flex">
364
- ${[...new Array(5)]
329
+ .map(item => {
330
+ return html `<div
331
+ style="padding: 20px; min-width: ${document.body.clientWidth > 768
332
+ ? '780px'
333
+ : `calc(${document.body.clientWidth}px - 1.5rem)`};"
334
+ >
335
+ <div class="row">
336
+ <div class="col-12 col-md">
337
+ <div class="row mb-6">
338
+ <div class="col-12">
339
+ <!-- Rating -->
340
+ <div class="rating fs-sm text-dark d-flex">
341
+ ${[...new Array(5)]
365
342
  .fill('')
366
343
  .map((_, index) => {
367
344
  return html ` <div class="rating-item">
368
- ${item.rate > index ? html `<i class="fa-solid fa-star"></i>` : html `<i class="fa-regular fa-star"></i>`}
369
- </div>`;
345
+ ${item.rate > index
346
+ ? html `<i class="fa-solid fa-star"></i>`
347
+ : html `<i class="fa-regular fa-star"></i>`}
348
+ </div>`;
370
349
  })
371
350
  .join('')}
372
- </div>
373
- </div>
374
- <div class="col-12">
375
- <!-- Time -->
376
- <span class="fs-xs text-muted"> ${item.userName}, <time datetime="${item.date}">${item.date}</time> </span>
377
- </div>
378
- </div>
379
- <!-- Title -->
380
- <p class="mb-2 fs-lg fw-bold">${item.title}</p>
381
- <!-- Text -->
382
- <p class="text-gray-500">${item.comment.replace(/\n/g, '<br/>')}</p>
383
- </div>
384
- </div>
385
- </div>`;
351
+ </div>
352
+ </div>
353
+ <div class="col-12">
354
+ <!-- Time -->
355
+ <span class="fs-xs text-muted">
356
+ ${item.userName}, <time datetime="${item.date}">${item.date}</time>
357
+ </span>
358
+ </div>
359
+ </div>
360
+ <!-- Title -->
361
+ <p class="mb-2 fs-lg fw-bold">${item.title}</p>
362
+ <!-- Text -->
363
+ <p class="text-gray-500">${item.comment.replace(/\n/g, '<br/>')}</p>
364
+ </div>
365
+ </div>
366
+ </div>`;
386
367
  })
387
368
  .join('');
388
369
  };
389
370
  return html ` <div class="d-flex justify-content-center">
390
- <div
391
- class="um-solid-btn"
392
- onclick="${gvc.event(() => {
371
+ <div
372
+ class="um-solid-btn"
373
+ onclick="${gvc.event(() => {
393
374
  addCommentDialog();
394
375
  })}"
395
- >
396
- ${Language.text('write_comment')}
397
- </div>
398
- </div>
399
- <div class="d-flex flex-column gap-2">${commentList()}</div>`;
376
+ >
377
+ ${Language.text('write_comment')}
378
+ </div>
379
+ </div>
380
+ <div class="d-flex flex-column gap-2">${commentList()}</div>`;
400
381
  }
401
- const template = vm.content_manager.find((cont) => cont.id === vm.content_tag);
402
- const jsonData = prod.content_json.find((data) => data.id === vm.content_tag);
382
+ const template = vm.content_manager.find(cont => cont.id === vm.content_tag);
383
+ const jsonData = prod.content_json.find(data => data.id === vm.content_tag);
403
384
  if (!template) {
404
385
  return '';
405
386
  }
406
387
  let htmlString = template.data.content;
407
388
  if (jsonData) {
408
- jsonData.list.map((data) => {
389
+ jsonData.list.map(data => {
409
390
  var _a, _b, _c;
410
- const cssStyle = template.data.tags.find((item) => item.key === data.key);
391
+ const cssStyle = template.data.tags.find(item => item.key === data.key);
411
392
  const regex = new RegExp(`@{{${data.key}}}`, 'g');
412
393
  htmlString = htmlString.replace(regex, html `<span
413
- style="font-size: ${(_a = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_size) !== null && _a !== void 0 ? _a : 16}px; color: ${(_b = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_color) !== null && _b !== void 0 ? _b : '${titleFontColor}'}; background: ${(_c = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_bgr) !== null && _c !== void 0 ? _c : '#fff'};"
414
- >${data.value}</span
415
- >`);
394
+ style="font-size: ${(_a = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_size) !== null && _a !== void 0 ? _a : 16}px; color: ${(_b = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_color) !== null && _b !== void 0 ? _b : '${titleFontColor}'}; background: ${(_c = cssStyle === null || cssStyle === void 0 ? void 0 : cssStyle.font_bgr) !== null && _c !== void 0 ? _c : '#fff'};"
395
+ >${data.value}</span
396
+ >`);
416
397
  });
417
398
  }
418
399
  return htmlString.replace(/@{{[^}]+}}/g, '');
@@ -430,9 +411,9 @@ export class ProductDetail {
430
411
  class: `pd_detail_content fr-view`,
431
412
  },
432
413
  })}
433
- </div>
434
- <div style="margin-top: 150px;"></div>
435
- ${((_c = prod.relative_product) !== null && _c !== void 0 ? _c : []).length
414
+ </div>
415
+ <div style="margin-top: 150px;"></div>
416
+ ${((_c = prod.relative_product) !== null && _c !== void 0 ? _c : []).length
436
417
  ? gvc.bindView(() => {
437
418
  const swipID = gvc.glitter.getUUID();
438
419
  return {
@@ -460,31 +441,36 @@ export class ProductDetail {
460
441
  return ``;
461
442
  }
462
443
  resolve(html `
463
- <div class="w-100 d-flex align-items-center justify-content-center ">
464
- <div class="mx-auto" style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
465
- <div
466
- style="font-size:18px;align-self: stretch; text-align: center; color: ${ProductDetail.titleFontColor}; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
467
- >
468
- ${Language.text('related_products')}
469
- </div>
470
- <div style="align-self: stretch; height: 0px; border: 1px ${ProductDetail.titleFontColor} solid"></div>
471
- </div>
472
- </div>
473
- <div class="w-100 row p-0 align-items-center justify-content-center mt-4 mt-lg-4 mx-0">
474
- ${product
444
+ <div class="w-100 d-flex align-items-center justify-content-center ">
445
+ <div
446
+ class="mx-auto"
447
+ style="flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex"
448
+ >
449
+ <div
450
+ style="font-size:18px;align-self: stretch; text-align: center; color: ${ProductModule.titleFontColor}; font-weight: 700; line-height: 18px; word-wrap: break-word;white-space: nowrap;margin: 0 20px;"
451
+ >
452
+ ${Language.text('related_products')}
453
+ </div>
454
+ <div
455
+ style="align-self: stretch; height: 0px; border: 1px ${ProductModule.titleFontColor} solid"
456
+ ></div>
457
+ </div>
458
+ </div>
459
+ <div class="w-100 row p-0 align-items-center justify-content-center mt-4 mt-lg-4 mx-0">
460
+ ${product
475
461
  .map((dd) => {
476
462
  return html `<div class="col-6 col-sm-4 col-lg-3">
477
- ${glitter.htmlGenerate.renderComponent({
463
+ ${glitter.htmlGenerate.renderComponent({
478
464
  appName: window.appName,
479
465
  tag: 'product_widget',
480
466
  gvc: gvc,
481
467
  subData: dd,
482
468
  })}
483
- </div>`;
469
+ </div>`;
484
470
  })
485
471
  .join('')}
486
- </div>
487
- `);
472
+ </div>
473
+ `);
488
474
  }));
489
475
  }),
490
476
  divCreate: {
@@ -494,11 +480,16 @@ export class ProductDetail {
494
480
  };
495
481
  })
496
482
  : ''}
497
- <div style="margin-top: 100px;"></div>
498
- </div>`;
483
+ <div style="margin-top: 100px;"></div>
484
+ </div>`;
499
485
  }),
500
486
  divCreate: {
501
- style: css `min-height: 1000px;word-break: break-all;white-space: normal;`, class: `container`
487
+ style: css `
488
+ min-height: 1000px;
489
+ word-break: break-all;
490
+ white-space: normal;
491
+ `,
492
+ class: `container`,
502
493
  },
503
494
  onCreate: () => {
504
495
  var _a;
@@ -517,7 +508,7 @@ export class ProductDetail {
517
508
  ApiUser.getPublicConfig('text-manager', 'manager', window.appName),
518
509
  ApiShop.getProduct(inputObj),
519
510
  ApiShop.getWishList(),
520
- ]).then((results) => {
511
+ ]).then(results => {
521
512
  var _a, _b;
522
513
  const [publicConfig, productData, wishListData] = results;
523
514
  if (publicConfig.result && publicConfig.response.value) {
@@ -531,7 +522,11 @@ export class ProductDetail {
531
522
  else {
532
523
  vm.data = productData.response.data;
533
524
  }
534
- glitter.setUrlParameter('page', 'products/' + encodeURIComponent(vm.data.content.seo.domain || vm.data.content.title), [(_a = window.home_seo.title_prefix) !== null && _a !== void 0 ? _a : '', vm.data.content.seo.domain || vm.data.content.title, (_b = window.home_seo.title_suffix) !== null && _b !== void 0 ? _b : ''].join(''));
525
+ glitter.setUrlParameter('page', 'products/' + encodeURIComponent(vm.data.content.seo.domain || vm.data.content.title), [
526
+ (_a = window.home_seo.title_prefix) !== null && _a !== void 0 ? _a : '',
527
+ vm.data.content.seo.domain || vm.data.content.title,
528
+ (_b = window.home_seo.title_suffix) !== null && _b !== void 0 ? _b : '',
529
+ ].join(''));
535
530
  }
536
531
  catch (e) {
537
532
  vm.data = {};
@@ -549,5 +544,4 @@ export class ProductDetail {
549
544
  });
550
545
  }
551
546
  }
552
- ProductDetail.titleFontColor = '';
553
547
  window.glitter.setModule(import.meta.url, ProductDetail);