ts-glitter 20.0.4 → 20.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.
package/lowcode/Entry.js CHANGED
@@ -141,7 +141,7 @@ export class Entry {
141
141
  }
142
142
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
143
143
  console.log(`Entry-time:`, window.renderClock.stop());
144
- glitter.share.editerVersion = 'V_20.0.4';
144
+ glitter.share.editerVersion = 'V_20.0.5';
145
145
  glitter.share.start = new Date();
146
146
  const vm = { appConfig: [] };
147
147
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -140,7 +140,7 @@ export class Entry {
140
140
  }
141
141
  (window as any).renderClock = (window as any).renderClock ?? createClock();
142
142
  console.log(`Entry-time:`, (window as any).renderClock.stop());
143
- glitter.share.editerVersion = 'V_20.0.4';
143
+ glitter.share.editerVersion = 'V_20.0.5';
144
144
  glitter.share.start = new Date();
145
145
  const vm = { appConfig: [] };
146
146
  (window as any).saasConfig = {
@@ -1,12 +1,12 @@
1
1
  import { GlobalUser } from '../glitter-base/global/global-user.js';
2
2
  import { ApiCart } from '../glitter-base/route/api-cart.js';
3
- import { Animation } from '../glitterBundle/module/Animation.js';
4
- import { Language } from '../glitter-base/global/language.js';
5
- import { CheckoutIndex } from '../public-components/checkout/index.js';
6
3
  const html = String.raw;
7
4
  export class Footer {
8
5
  static main(cf) {
9
6
  const gvc = cf.gvc;
7
+ if (cf.gvc.glitter.getUrlParameter('page') === 'checkout') {
8
+ return ``;
9
+ }
10
10
  return html ` <div style="height: ${gvc.glitter.share.bottom_inset / 2}px;"></div>
11
11
  <div
12
12
  class="position-fixed bottom-0 d-flex shadow vw-100 start-0"
@@ -22,7 +22,7 @@ padding-bottom: ${gvc.glitter.share.bottom_inset / 2}px;;
22
22
  cf.gvc.glitter.href = '/index-app' + location.search;
23
23
  }),
24
24
  select: () => {
25
- return cf.gvc.glitter.getUrlParameter('page') === 'index-app';
25
+ return ['index-app', 'index'].includes(cf.gvc.glitter.getUrlParameter('page'));
26
26
  },
27
27
  },
28
28
  {
@@ -40,51 +40,7 @@ padding-bottom: ${gvc.glitter.share.bottom_inset / 2}px;;
40
40
  icon: '<i class="fa-regular fa-cart-shopping"></i>',
41
41
  event: cf.gvc.event(() => {
42
42
  ApiCart.checkoutCart = ApiCart.globalCart;
43
- gvc.glitter.innerDialog((gvc) => {
44
- return gvc.bindView(() => {
45
- const id = gvc.glitter.getUUID();
46
- return {
47
- bind: id,
48
- view: () => {
49
- return [
50
- html ` <div
51
- class="w-100 d-flex align-items-center justify-content-center fw-bold position-fixed top-0 start-0"
52
- style="height: calc(50px + ${gvc.glitter.share.top_inset}px);
53
- padding-top: ${gvc.glitter.share.top_inset}px;
54
- background: ${gvc.glitter.share.globalValue['theme_color.0.solid-button-bg']};
55
- color:${gvc.glitter.share.globalValue['theme_color.0.solid-button-text']};
56
- z-index: 999;
57
- "
58
- >
59
- <div class="d-flex position-relative align-items-center justify-content-center w-100 py-3">
60
- ${Language.text('cart')}
61
- <div
62
- class="position-absolute d-flex align-items-center justify-content-center"
63
- style="top:50%;transform: translateY(-50%);
64
- width:50px;height: 50px;
65
- right:0px;
66
- "
67
- onclick="${gvc.event(() => {
68
- gvc.closeDialog();
69
- })}"
70
- >
71
- <i class="fa-solid fa-xmark"></i>
72
- </div>
73
- </div>
74
- </div>`,
75
- ` <div style="height: calc(50px + ${gvc.glitter.share.top_inset}px);"></div>`,
76
- CheckoutIndex.main(gvc, cf.widget, {}),
77
- ].join('');
78
- },
79
- divCreate: {
80
- class: `h-100 w-100`,
81
- style: `overflow-y: auto;background:#f0f0f0;`,
82
- },
83
- };
84
- });
85
- }, 'checkout', {
86
- animation: Animation.popup,
87
- });
43
+ gvc.glitter.href = '/checkout';
88
44
  }),
89
45
  select: () => {
90
46
  return cf.gvc.glitter.getUrlParameter('page') === 'checkout';
@@ -8,9 +8,13 @@ import { Storage } from '../glitterBundle/helper/storage.js';
8
8
 
9
9
  const html = String.raw;
10
10
 
11
+
11
12
  export class Footer {
12
13
  public static main(cf: { gvc: GVC; formData: any; widget: any; key: string; callback: (data: any) => void }) {
13
14
  const gvc = cf.gvc;
15
+ if (cf.gvc.glitter.getUrlParameter('page') === 'checkout'){
16
+ return ``
17
+ }
14
18
  return html` <div style="height: ${gvc.glitter.share.bottom_inset / 2}px;"></div>
15
19
  <div
16
20
  class="position-fixed bottom-0 d-flex shadow vw-100 start-0"
@@ -26,7 +30,7 @@ padding-bottom: ${gvc.glitter.share.bottom_inset / 2}px;;
26
30
  cf.gvc.glitter.href = '/index-app' + location.search;
27
31
  }),
28
32
  select: () => {
29
- return cf.gvc.glitter.getUrlParameter('page') === 'index-app';
33
+ return ['index-app','index'].includes(cf.gvc.glitter.getUrlParameter('page')) ;
30
34
  },
31
35
  },
32
36
  {
@@ -44,56 +48,57 @@ padding-bottom: ${gvc.glitter.share.bottom_inset / 2}px;;
44
48
  icon: '<i class="fa-regular fa-cart-shopping"></i>',
45
49
  event: cf.gvc.event(() => {
46
50
  ApiCart.checkoutCart = ApiCart.globalCart;
47
- gvc.glitter.innerDialog(
48
- (gvc: GVC) => {
49
- return gvc.bindView(() => {
50
- const id = gvc.glitter.getUUID();
51
- return {
52
- bind: id,
53
- view: () => {
54
- return [
55
- html` <div
56
- class="w-100 d-flex align-items-center justify-content-center fw-bold position-fixed top-0 start-0"
57
- style="height: calc(50px + ${gvc.glitter.share.top_inset}px);
58
- padding-top: ${gvc.glitter.share.top_inset}px;
59
- background: ${gvc.glitter.share.globalValue['theme_color.0.solid-button-bg']};
60
- color:${gvc.glitter.share.globalValue['theme_color.0.solid-button-text']};
61
- z-index: 999;
62
- "
63
- >
64
- <div class="d-flex position-relative align-items-center justify-content-center w-100 py-3">
65
- ${Language.text('cart')}
66
- <div
67
- class="position-absolute d-flex align-items-center justify-content-center"
68
- style="top:50%;transform: translateY(-50%);
69
- width:50px;height: 50px;
70
- right:0px;
71
- "
72
- onclick="${gvc.event(() => {
73
- gvc.closeDialog();
74
- })}"
75
- >
76
- <i class="fa-solid fa-xmark"></i>
77
- </div>
78
- </div>
79
- </div>`,
80
- ` <div style="height: calc(50px + ${gvc.glitter.share.top_inset}px);"></div>`,
81
- CheckoutIndex.main(gvc, cf.widget, {}),
82
- ].join('');
83
- },
84
- divCreate: {
85
- class: `h-100 w-100`,
86
- style: `overflow-y: auto;background:#f0f0f0;`,
87
- },
88
- };
89
- });
90
- },
91
- 'checkout',
92
- {
93
- animation: Animation.popup,
94
- }
95
- );
51
+ // gvc.glitter.innerDialog(
52
+ // (gvc: GVC) => {
53
+ // return gvc.bindView(() => {
54
+ // const id = gvc.glitter.getUUID();
55
+ // return {
56
+ // bind: id,
57
+ // view: () => {
58
+ // return [
59
+ // html` <div
60
+ // class="w-100 d-flex align-items-center justify-content-center fw-bold position-fixed top-0 start-0"
61
+ // style="height: calc(50px + ${gvc.glitter.share.top_inset}px);
62
+ // padding-top: ${gvc.glitter.share.top_inset}px;
63
+ // background: ${gvc.glitter.share.globalValue['theme_color.0.solid-button-bg']};
64
+ // color:${gvc.glitter.share.globalValue['theme_color.0.solid-button-text']};
65
+ // z-index: 999;
66
+ // "
67
+ // >
68
+ // <div class="d-flex position-relative align-items-center justify-content-center w-100 py-3">
69
+ // ${Language.text('cart')}
70
+ // <div
71
+ // class="position-absolute d-flex align-items-center justify-content-center"
72
+ // style="top:50%;transform: translateY(-50%);
73
+ // width:50px;height: 50px;
74
+ // right:0px;
75
+ // "
76
+ // onclick="${gvc.event(() => {
77
+ // gvc.closeDialog();
78
+ // })}"
79
+ // >
80
+ // <i class="fa-solid fa-xmark"></i>
81
+ // </div>
82
+ // </div>
83
+ // </div>`,
84
+ // ` <div style="height: calc(50px + ${gvc.glitter.share.top_inset}px);"></div>`,
85
+ // CheckoutIndex.main(gvc, cf.widget, {}),
86
+ // ].join('');
87
+ // },
88
+ // divCreate: {
89
+ // class: `h-100 w-100`,
90
+ // style: `overflow-y: auto;background:#f0f0f0;`,
91
+ // },
92
+ // };
93
+ // });
94
+ // },
95
+ // 'checkout',
96
+ // {
97
+ // animation: Animation.popup,
98
+ // }
99
+ // );
96
100
  // ApiCart.toCheckOutPage(ApiCart.globalCart);
101
+ gvc.glitter.href='/checkout'
97
102
  }),
98
103
  select: () => {
99
104
  return cf.gvc.glitter.getUrlParameter('page') === 'checkout';
@@ -4163,7 +4163,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
4163
4163
  >
4164
4164
  <div
4165
4165
  class=" w-100"
4166
- style="height: 191px; padding-top: 59px; padding-bottom: 58px; background: white; border-top-left-radius: 10px; border-top-right-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: flex;position: relative; "
4166
+ style="height: 191px; padding-top: 59px; padding-bottom: 58px; background: whitesmoke; border-top-left-radius: 10px; border-top-right-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: flex;position: relative; "
4167
4167
  >
4168
4168
  <img style="position: absolute;max-width: 100%;height: calc(100% - 10px); " src="${image}" />
4169
4169
  </div>
@@ -4911,7 +4911,7 @@ ${obj.default ?? ''}</textarea
4911
4911
  >
4912
4912
  <div
4913
4913
  class=" w-100"
4914
- style="height: 191px; padding-top: 59px; padding-bottom: 58px; background: white; border-top-left-radius: 10px; border-top-right-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: flex;position: relative; "
4914
+ style="height: 191px; padding-top: 59px; padding-bottom: 58px; background: whitesmoke; border-top-left-radius: 10px; border-top-right-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: flex;position: relative; "
4915
4915
  >
4916
4916
  <img style="position: absolute;max-width: 100%;height: calc(100% - 10px); " src="${image}" />
4917
4917
  </div>
@@ -1015,7 +1015,7 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset}px !i
1015
1015
  },
1016
1016
  divCreate: {
1017
1017
  class: `chatContainer p-3 d-flex flex-column `,
1018
- style: `overflow-y: auto;height: calc(100% - 150px);background: white;padding-bottom:${cf.hideBar ? `80` : `0`}px !important;`,
1018
+ style: `overflow-y: auto;height: calc(100% - ${150 + parseInt(`${gvc.glitter.share.top_inset / 2}`, 10)}px);background: white;padding-bottom:${cf.hideBar ? `80` : `0`}px !important;`,
1019
1019
  },
1020
1020
  onCreate: () => {
1021
1021
  vm.close = false;
@@ -1313,8 +1313,8 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset}px !i
1313
1313
  <div class="text-white fw-bold d-flex align-items-center" style=" font-size: 20px;">
1314
1314
  ${(_a = CustomerMessageUser.config.title) !== null && _a !== void 0 ? _a : ''}
1315
1315
  <div class="flex-fill"></div>
1316
- <i class="fa-sharp fa-regular fa-xmark d-md-none"
1317
- style=" color: white;font-size: 24px;" onclick="${gvc.event(() => {
1316
+ <i class="fa-regular fa-circle-xmark text-white d-md-none " onclick="${gvc.event(() => {
1317
+ document.body.style.removeProperty('overflow-y');
1318
1318
  gvc.closeDialog();
1319
1319
  })}"></i>
1320
1320
  </div>
@@ -1327,6 +1327,7 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset}px !i
1327
1327
  onclick="${gvc.event(() => {
1328
1328
  if (!GlobalUser.token) {
1329
1329
  GlobalUser.loginRedirect = location.href;
1330
+ gvc.closeDialog();
1330
1331
  gvc.glitter.href = '/login';
1331
1332
  }
1332
1333
  else {
@@ -1140,7 +1140,7 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset }px !
1140
1140
  },
1141
1141
  divCreate: {
1142
1142
  class: `chatContainer p-3 d-flex flex-column `,
1143
- style: `overflow-y: auto;height: calc(100% - 150px);background: white;padding-bottom:${cf.hideBar ? `80` : `0`}px !important;`,
1143
+ style: `overflow-y: auto;height: calc(100% - ${150 + parseInt(`${gvc.glitter.share.top_inset / 2}`,10)}px);background: white;padding-bottom:${cf.hideBar ? `80` : `0`}px !important;`,
1144
1144
  },
1145
1145
  onCreate: () => {
1146
1146
  vm.close = false;
@@ -1450,9 +1450,9 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset }px !
1450
1450
  <div class="text-white fw-bold d-flex align-items-center" style=" font-size: 20px;">
1451
1451
  ${CustomerMessageUser.config.title ?? ''}
1452
1452
  <div class="flex-fill"></div>
1453
- <i class="fa-sharp fa-regular fa-xmark d-md-none"
1454
- style=" color: white;font-size: 24px;" onclick="${gvc.event(()=>{
1455
- gvc.closeDialog()
1453
+ <i class="fa-regular fa-circle-xmark text-white d-md-none " onclick="${gvc.event(() => {
1454
+ document.body.style.removeProperty('overflow-y');
1455
+ gvc.closeDialog();
1456
1456
  })}"></i>
1457
1457
  </div>
1458
1458
  <p class=" text-white mt-2 mb-4"
@@ -1464,6 +1464,7 @@ ${gvc.glitter.share.top_inset ? `padding-top:${gvc.glitter.share.top_inset }px !
1464
1464
  onclick="${gvc.event(() => {
1465
1465
  if(!GlobalUser.token){
1466
1466
  GlobalUser.loginRedirect = location.href;
1467
+ gvc.closeDialog();
1467
1468
  gvc.glitter.href='/login';
1468
1469
  }else{
1469
1470
  goToChat('');
@@ -3063,7 +3063,12 @@ export class CheckoutIndex {
3063
3063
  if (res.response.returnCode == '0000' &&
3064
3064
  vm.cartData.customer_info.payment_select == 'line_pay') {
3065
3065
  console.log('res.response.form.info.paymentUrl.web -- ', res.response.info.paymentUrl.web);
3066
- location.href = res.response.info.paymentUrl.web;
3066
+ if (glitter.share.is_application) {
3067
+ location.href = res.response.form.info.paymentUrl.app;
3068
+ }
3069
+ else {
3070
+ location.href = res.response.info.paymentUrl.web;
3071
+ }
3067
3072
  }
3068
3073
  else if (res.response.approveLink) {
3069
3074
  location.href = res.response.approveLink;
@@ -3345,7 +3345,12 @@ export class CheckoutIndex {
3345
3345
  'res.response.form.info.paymentUrl.web -- ',
3346
3346
  res.response.info.paymentUrl.web
3347
3347
  );
3348
- location.href = res.response.info.paymentUrl.web;
3348
+
3349
+ if(glitter.share.is_application){
3350
+ location.href = res.response.form.info.paymentUrl.app;
3351
+ }else{
3352
+ location.href = res.response.info.paymentUrl.web;
3353
+ }
3349
3354
  // todo 手機跳轉用這個
3350
3355
  // location.href = res.response.form.info.paymentUrl.app;
3351
3356
  } else if (res.response.approveLink) {