ts-glitter 16.7.9 → 16.8.3

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.
package/lowcode/Entry.js CHANGED
@@ -88,7 +88,7 @@ export class Entry {
88
88
  }
89
89
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
90
90
  console.log(`Entry-time:`, window.renderClock.stop());
91
- glitter.share.editerVersion = 'V_16.7.9';
91
+ glitter.share.editerVersion = 'V_16.8.3';
92
92
  glitter.share.start = new Date();
93
93
  const vm = {
94
94
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -88,7 +88,7 @@ export class Entry {
88
88
  }
89
89
  (window as any).renderClock = (window as any).renderClock ?? clockF();
90
90
  console.log(`Entry-time:`, (window as any).renderClock.stop());
91
- glitter.share.editerVersion = 'V_16.7.9';
91
+ glitter.share.editerVersion = 'V_16.8.3';
92
92
  glitter.share.start = new Date();
93
93
  const vm: {
94
94
  appConfig: any;
@@ -2325,6 +2325,7 @@ export class CheckoutIndex {
2325
2325
  <button
2326
2326
  class="${gClass('button-bgr')}"
2327
2327
  onclick="${gvc.event(() => {
2328
+ var _a;
2328
2329
  const dialog = new ShareDialog(gvc.glitter);
2329
2330
  if (!this.checkFormData(gvc, vm.cartData, widget)) {
2330
2331
  return;
@@ -2381,7 +2382,7 @@ export class CheckoutIndex {
2381
2382
  custom_form_format: vm.cartData.custom_form_format,
2382
2383
  custom_form_data: vm.cartData.custom_form_data,
2383
2384
  custom_receipt_form: vm.cartData.receipt_form,
2384
- distribution_code: apiCart.cart.distribution_code,
2385
+ distribution_code: (_a = localStorage.getItem('distributionCode')) !== null && _a !== void 0 ? _a : '',
2385
2386
  give_away: apiCart.cart.give_away,
2386
2387
  }).then((res) => {
2387
2388
  dialog.dataLoading({ visible: false });
@@ -2514,7 +2514,7 @@ export class CheckoutIndex {
2514
2514
  custom_form_format: vm.cartData.custom_form_format,
2515
2515
  custom_form_data: vm.cartData.custom_form_data,
2516
2516
  custom_receipt_form: vm.cartData.receipt_form,
2517
- distribution_code: apiCart.cart.distribution_code,
2517
+ distribution_code: localStorage.getItem('distributionCode') ?? '',
2518
2518
  give_away: apiCart.cart.give_away,
2519
2519
  }).then((res) => {
2520
2520
  dialog.dataLoading({ visible: false });
@@ -209,7 +209,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
209
209
  ${widget.formData.logo.value}
210
210
  </div>
211
211
  `
212
- : html ` <div class="d-flex align-items-center justify-content-center h-100 py-2"><img src="${widget.formData.logo.value}" style="max-height: 100%;max-width:200px;" /></div> `}
212
+ : html ` <div class="d-flex align-items-center justify-content-center h-100 py-2" style="max-width:calc(100vw - 200px);"><img src="${widget.formData.logo.value}" style="max-height: 100%;max-width:calc(100vw - 200px);" /></div> `}
213
213
  </div>
214
214
  </div>
215
215
  <div class="">
@@ -255,7 +255,7 @@ background: ${(_a = colors.bgr) !== null && _a !== void 0 ? _a : '#000'};overflo
255
255
  },
256
256
  divCreate: {
257
257
  class: `navbar-nav ms-3 me-auto `,
258
- style: `flex-direction: row; gap: 15px;`,
258
+ style: `flex-direction: row; gap: 0px;`,
259
259
  elem: `ul`,
260
260
  },
261
261
  };
@@ -212,7 +212,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
212
212
  ${widget.formData.logo.value}
213
213
  </div>
214
214
  `
215
- : html` <div class="d-flex align-items-center justify-content-center h-100 py-2"><img src="${widget.formData.logo.value}" style="max-height: 100%;max-width:200px;" /></div> `}
215
+ : html` <div class="d-flex align-items-center justify-content-center h-100 py-2" style="max-width:calc(100vw - 200px);"><img src="${widget.formData.logo.value}" style="max-height: 100%;max-width:calc(100vw - 200px);" /></div> `}
216
216
  </div>
217
217
  </div>
218
218
  <div class="">
@@ -258,7 +258,7 @@ background: ${colors.bgr ?? '#000'};overflow-x: hidden;`,
258
258
  },
259
259
  divCreate: {
260
260
  class: `navbar-nav ms-3 me-auto `,
261
- style: `flex-direction: row; gap: 15px;`,
261
+ style: `flex-direction: row; gap: 0px;`,
262
262
  elem: `ul`,
263
263
  },
264
264
  };
@@ -654,6 +654,7 @@ export class ProductList {
654
654
  vm.pageIndex = p;
655
655
  loadings.product = true;
656
656
  gvc.notifyDataChange(ids.product);
657
+ document.querySelector('html').scrollTo(0, 0);
657
658
  })}
658
659
  <div style="margin-top: 240px;"></div>`;
659
660
  }
@@ -831,6 +831,7 @@ export class ProductList {
831
831
  vm.pageIndex = p;
832
832
  loadings.product = true;
833
833
  gvc.notifyDataChange(ids.product);
834
+ (document.querySelector('html') as any).scrollTo(0,0);
834
835
  })}
835
836
  <div style="margin-top: 240px;"></div>`;
836
837
  }
@@ -20,14 +20,24 @@ export class TermsRelated {
20
20
  return {
21
21
  bind: glitter.getUUID(),
22
22
  view: () => __awaiter(this, void 0, void 0, function* () {
23
- let lan_d = (yield ApiUser.getPublicConfig(`terms-related-${page}-${Language.getLanguage()}`, 'manager')).response.value.text;
24
- if (!lan_d) {
25
- lan_d = (yield ApiUser.getPublicConfig(`terms-related-${page}-${window.store_info.language_setting.def}`, 'manager')).response.value.text;
23
+ if ((`${glitter.getUrlParameter('page')}`.startsWith(`collections`)) ||
24
+ (`${glitter.getUrlParameter('page')}`.startsWith(`all-product`))) {
25
+ return yield new Promise((resolve, reject) => {
26
+ glitter.getModule(new URL('./public-components/product/product-list.js', gvc.glitter.root_path).href, (res) => {
27
+ resolve(res.main(gvc));
28
+ });
29
+ });
30
+ }
31
+ else {
32
+ let lan_d = (yield ApiUser.getPublicConfig(`terms-related-${page}-${Language.getLanguage()}`, 'manager')).response.value.text;
33
+ if (!lan_d) {
34
+ lan_d = (yield ApiUser.getPublicConfig(`terms-related-${page}-${window.store_info.language_setting.def}`, 'manager')).response.value.text;
35
+ }
36
+ return html `<h1 class="my-sm-5 my-4 fs-1" style="color:${title_color};">服務條款</h1>
37
+ <div class="mb-5" style="min-height: calc(100vh - 200px);">
38
+ ${lan_d || ''}
39
+ </div>`;
26
40
  }
27
- return html `<h1 class="my-sm-5 my-4 fs-1" style="color:${title_color};">服務條款</h1>
28
- <div class="mb-5" style="min-height: calc(100vh - 200px);">
29
- ${lan_d || ''}
30
- </div>`;
31
41
  }),
32
42
  divCreate: {
33
43
  class: `container text-center`
@@ -18,14 +18,27 @@ export class TermsRelated {
18
18
  return {
19
19
  bind: glitter.getUUID(),
20
20
  view: async () => {
21
- let lan_d = (await ApiUser.getPublicConfig(`terms-related-${page}-${Language.getLanguage()}`, 'manager')).response.value.text
22
- if (!lan_d) {
23
- lan_d = (await ApiUser.getPublicConfig(`terms-related-${page}-${(window as any).store_info.language_setting.def}`, 'manager')).response.value.text
21
+ //分類頁面
22
+ if ((`${glitter.getUrlParameter('page')}`.startsWith(`collections`)) ||
23
+ (`${glitter.getUrlParameter('page')}`.startsWith(`all-product`))
24
+ ) {
25
+ return await new Promise((resolve, reject) => {
26
+ glitter.getModule(new URL('./public-components/product/product-list.js', gvc.glitter.root_path).href, (res) => {
27
+ resolve(res.main(gvc));
28
+ });
29
+ })
30
+ } else {
31
+ //條款頁面
32
+ let lan_d = (await ApiUser.getPublicConfig(`terms-related-${page}-${Language.getLanguage()}`, 'manager')).response.value.text
33
+ if (!lan_d) {
34
+ lan_d = (await ApiUser.getPublicConfig(`terms-related-${page}-${(window as any).store_info.language_setting.def}`, 'manager')).response.value.text
35
+ }
36
+ return html`<h1 class="my-sm-5 my-4 fs-1" style="color:${title_color};">服務條款</h1>
37
+ <div class="mb-5" style="min-height: calc(100vh - 200px);">
38
+ ${lan_d || ''}
39
+ </div>`
24
40
  }
25
- return html`<h1 class="my-sm-5 my-4 fs-1" style="color:${title_color};">服務條款</h1>
26
- <div class="mb-5" style="min-height: calc(100vh - 200px);">
27
- ${lan_d || ''}
28
- </div>`
41
+
29
42
  },
30
43
  divCreate: {
31
44
  class: `container text-center`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "16.7.9",
3
+ "version": "16.8.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -942,8 +942,10 @@ class Shopping {
942
942
  status: true,
943
943
  no_detail: true,
944
944
  });
945
+ console.log(`linkList.data.length=>`, linkList.data.length);
945
946
  if (linkList.data.length > 0) {
946
947
  const content = linkList.data[0].content;
948
+ console.log(`linkList.data.content=>`, content);
947
949
  if (this.checkDuring(content)) {
948
950
  carData.distribution_info = content;
949
951
  }
@@ -4587,12 +4589,12 @@ OR JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) NOT IN (-99)) `);
4587
4589
  }
4588
4590
  checkDuring(jsonData) {
4589
4591
  const now = new Date().getTime();
4590
- const startDateTime = new Date(`${jsonData.startDate}T${jsonData.startTime}`).getTime();
4592
+ const startDateTime = new Date(moment_1.default.tz(`${jsonData.startDate} ${jsonData.startTime}:00`, "YYYY-MM-DD HH:mm:ss", "Asia/Taipei").toISOString()).getTime();
4591
4593
  if (isNaN(startDateTime))
4592
4594
  return false;
4593
4595
  if (!jsonData.endDate || !jsonData.endTime)
4594
4596
  return true;
4595
- const endDateTime = new Date(`${jsonData.endDate}T${jsonData.endTime}`).getTime();
4597
+ const endDateTime = new Date(moment_1.default.tz(`${jsonData.endDate} ${jsonData.endTime}:00`, "YYYY-MM-DD HH:mm:ss", "Asia/Taipei").toISOString()).getTime();
4596
4598
  if (isNaN(endDateTime))
4597
4599
  return false;
4598
4600
  return now >= startDateTime && now <= endDateTime;