ts-glitter 19.2.9 → 19.3.0

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 (77) hide show
  1. package/lowcode/Entry.js +11 -3
  2. package/lowcode/Entry.ts +10 -3
  3. package/lowcode/app-component/footer.js +117 -15
  4. package/lowcode/app-component/footer.ts +162 -61
  5. package/lowcode/backend-manager/bg-widget.js +1 -1
  6. package/lowcode/backend-manager/bg-widget.ts +1 -1
  7. package/lowcode/cms-plugin/app-design.js +150 -0
  8. package/lowcode/cms-plugin/app-design.ts +159 -0
  9. package/lowcode/cms-plugin/cms-router.js +5 -0
  10. package/lowcode/cms-plugin/cms-router.ts +5 -0
  11. package/lowcode/cms-plugin/customer-message-user.js +389 -356
  12. package/lowcode/cms-plugin/customer-message-user.ts +457 -421
  13. package/lowcode/cms-plugin/data-analyze-orders.js +1 -1
  14. package/lowcode/cms-plugin/data-analyze-orders.ts +1 -1
  15. package/lowcode/cms-plugin/reconciliation-area.js +1 -1
  16. package/lowcode/cms-plugin/reconciliation-area.ts +1 -1
  17. package/lowcode/cms-plugin/shopping-order-manager.js +1 -1
  18. package/lowcode/cms-plugin/shopping-order-manager.ts +1 -1
  19. package/lowcode/css/editor.css +7 -1
  20. package/lowcode/glitter-base/route/api-cart.js +3 -0
  21. package/lowcode/glitter-base/route/api-cart.ts +3 -0
  22. package/lowcode/glitterBundle/html-component/global-widget.js +1 -1
  23. package/lowcode/glitterBundle/html-component/global-widget.ts +1 -1
  24. package/lowcode/glitterBundle/plugins/html-render.js +1 -1
  25. package/lowcode/glitterBundle/plugins/html-render.ts +1 -1
  26. package/lowcode/jspage/editor.js +22 -23
  27. package/lowcode/jspage/editor.ts +31 -22
  28. package/lowcode/jspage/function-page/setting_editor.js +2 -8
  29. package/lowcode/jspage/function-page/setting_editor.ts +8 -8
  30. package/lowcode/jspage/function-page/tool-setting.js +0 -12
  31. package/lowcode/jspage/function-page/tool-setting.ts +0 -12
  32. package/lowcode/official_view_component/official/component.js +3 -13
  33. package/lowcode/official_view_component/official/component.ts +3 -13
  34. package/lowcode/public-components/checkout/index.js +4 -1
  35. package/lowcode/public-components/checkout/index.ts +4 -2
  36. package/lowcode/public-components/footer/footer-01.js +107 -95
  37. package/lowcode/public-components/footer/footer-01.ts +107 -94
  38. package/lowcode/public-components/footer/footer-02.js +175 -162
  39. package/lowcode/public-components/footer/footer-02.ts +175 -162
  40. package/lowcode/public-components/footer/footer-03.js +166 -156
  41. package/lowcode/public-components/footer/footer-03.ts +167 -157
  42. package/lowcode/public-components/footer/footer-initial.js +26 -0
  43. package/lowcode/public-components/footer/footer-initial.ts +25 -0
  44. package/lowcode/public-components/footer/footer-mobile.js +2 -0
  45. package/lowcode/public-components/footer/footer-mobile.ts +4 -0
  46. package/lowcode/public-components/headers/head-initial.js +26 -0
  47. package/lowcode/public-components/headers/head-initial.ts +25 -0
  48. package/lowcode/public-components/headers/header-mobile.js +29 -0
  49. package/lowcode/public-components/headers/header-mobile.ts +32 -0
  50. package/lowcode/public-components/headers/sy-02.js +251 -238
  51. package/lowcode/public-components/headers/sy-02.ts +248 -235
  52. package/lowcode/public-components/headers/sy-03.js +330 -318
  53. package/lowcode/public-components/headers/sy-03.ts +323 -310
  54. package/lowcode/public-components/headers/sy-04.js +298 -286
  55. package/lowcode/public-components/headers/sy-04.ts +292 -279
  56. package/lowcode/public-components/headers/sy-05.js +229 -217
  57. package/lowcode/public-components/headers/sy-05.ts +232 -216
  58. package/lowcode/public-components/terms-related/index.js +1 -1
  59. package/lowcode/public-components/terms-related/index.ts +1 -1
  60. package/package.json +1 -1
  61. package/src/index.js +2 -0
  62. package/src/index.js.map +1 -1
  63. package/src/index.ts +1 -1
  64. package/src/services/app.js +3 -1
  65. package/src/services/app.js.map +1 -1
  66. package/src/services/app.ts +6 -4
  67. package/src/services/ios-project.js +1 -1
  68. package/src/services/ios-project.js.map +1 -1
  69. package/src/services/ios-project.ts +1 -1
  70. package/src/services/template.js +97 -43
  71. package/src/services/template.js.map +1 -1
  72. package/src/services/template.ts +418 -339
  73. package/src/update-script.js +14 -628
  74. package/src/update-script.js.map +1 -1
  75. package/src/update-script.ts +616 -629
  76. package/lowcode/public-components/footer/hide-footer.js +0 -9
  77. package/lowcode/public-components/footer/hide-footer.ts +0 -7
package/lowcode/Entry.js CHANGED
@@ -20,6 +20,14 @@ import { ApiCart } from './glitter-base/route/api-cart.js';
20
20
  export class Entry {
21
21
  static onCreate(glitter) {
22
22
  var _a, _b;
23
+ if (window.parent.glitter.getUrlParameter('device') === 'mobile') {
24
+ glitter.share.is_application = true;
25
+ }
26
+ else {
27
+ glitter.runJsInterFace("is_application", {}, (res) => {
28
+ glitter.share.is_application = res.is_application;
29
+ });
30
+ }
23
31
  if (glitter.getUrlParameter('EndCheckout') === '1') {
24
32
  try {
25
33
  const lineItemIds = JSON.parse(localStorage.getItem('clear_cart_items'));
@@ -132,7 +140,7 @@ export class Entry {
132
140
  }
133
141
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
134
142
  console.log(`Entry-time:`, window.renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.2.9';
143
+ glitter.share.editerVersion = 'V_19.3.0';
136
144
  glitter.share.start = new Date();
137
145
  const vm = { appConfig: [] };
138
146
  window.saasConfig = {
@@ -616,14 +624,14 @@ export class Entry {
616
624
  }
617
625
  });
618
626
  glitter.runJsInterFace('getTopInset', {}, (response) => {
619
- glitter.share.top_inset = response.data;
627
+ glitter.share.top_inset = parseInt(response.data, 10);
620
628
  }, {
621
629
  webFunction: () => {
622
630
  return { data: 0 };
623
631
  },
624
632
  });
625
633
  glitter.runJsInterFace('getBottomInset', {}, (response) => {
626
- glitter.share.bottom_inset = response.data;
634
+ glitter.share.bottom_inset = parseInt(response.data, 10);
627
635
  }, {
628
636
  webFunction: () => {
629
637
  return { data: 0 };
package/lowcode/Entry.ts CHANGED
@@ -13,6 +13,13 @@ import { ApiCart } from './glitter-base/route/api-cart.js';
13
13
  export class Entry {
14
14
  // 建立初始函式
15
15
  public static onCreate(glitter: Glitter) {
16
+ if((window.parent as any).glitter.getUrlParameter('device')==='mobile') {
17
+ glitter.share.is_application=true
18
+ }else{
19
+ glitter.runJsInterFace("is_application",{},(res)=>{
20
+ glitter.share.is_application=res.is_application;
21
+ })
22
+ }
16
23
  //判斷結帳成功清空購物車紀錄
17
24
  if (glitter.getUrlParameter('EndCheckout') === '1') {
18
25
  try {
@@ -132,7 +139,7 @@ export class Entry {
132
139
  }
133
140
  (window as any).renderClock = (window as any).renderClock ?? createClock();
134
141
  console.log(`Entry-time:`, (window as any).renderClock.stop());
135
- glitter.share.editerVersion = 'V_19.2.9';
142
+ glitter.share.editerVersion = 'V_19.3.0';
136
143
  glitter.share.start = new Date();
137
144
  const vm = { appConfig: [] };
138
145
  (window as any).saasConfig = {
@@ -696,7 +703,7 @@ export class Entry {
696
703
  'getTopInset',
697
704
  {},
698
705
  (response: any) => {
699
- glitter.share.top_inset = response.data;
706
+ glitter.share.top_inset = parseInt(response.data,10);
700
707
  },
701
708
  {
702
709
  webFunction: () => {
@@ -709,7 +716,7 @@ export class Entry {
709
716
  'getBottomInset',
710
717
  {},
711
718
  (response: any) => {
712
- glitter.share.bottom_inset = response.data;
719
+ glitter.share.bottom_inset = parseInt(response.data,10);
713
720
  },
714
721
  {
715
722
  webFunction: () => {
@@ -1,16 +1,30 @@
1
+ import { GlobalUser } from '../glitter-base/global/global-user.js';
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';
1
6
  const html = String.raw;
2
7
  export class Footer {
3
8
  static main(cf) {
4
- return [
9
+ const gvc = cf.gvc;
10
+ return html `
11
+ <div style="height: ${gvc.glitter.share.bottom_inset / 2}px;"></div>
12
+ <div
13
+ class="position-fixed bottom-0 d-flex shadow vw-100 start-0"
14
+ style="z-index:10;justify-content: space-around;background: rgba(255,255,255,0.95);
15
+ padding-bottom: ${gvc.glitter.share.bottom_inset / 2}px;;
16
+ "
17
+ >
18
+ ${[
5
19
  {
6
20
  title: '首頁',
7
21
  icon: '<i class="fa-solid fa-house"></i>',
8
22
  event: cf.gvc.event(() => {
9
- cf.gvc.glitter.href = '/index-mobile' + location.search;
23
+ cf.gvc.glitter.href = '/index-app' + location.search;
10
24
  }),
11
25
  select: () => {
12
- return cf.gvc.glitter.getUrlParameter('page') === 'index-mobile';
13
- }
26
+ return cf.gvc.glitter.getUrlParameter('page') === 'index-app';
27
+ },
14
28
  },
15
29
  {
16
30
  title: '分類',
@@ -20,18 +34,94 @@ export class Footer {
20
34
  }),
21
35
  select: () => {
22
36
  return cf.gvc.glitter.getUrlParameter('page') === 'all-product';
23
- }
37
+ },
24
38
  },
25
39
  {
26
40
  title: '購物車',
27
41
  icon: '<i class="fa-regular fa-cart-shopping"></i>',
28
42
  event: cf.gvc.event(() => {
29
- cf.gvc.glitter.href = '/checkout' + location.search;
43
+ ApiCart.checkoutCart = ApiCart.globalCart;
44
+ gvc.glitter.innerDialog((gvc) => {
45
+ return gvc.bindView(() => {
46
+ const id = gvc.glitter.getUUID();
47
+ return {
48
+ bind: id,
49
+ view: () => {
50
+ return [
51
+ html ` <div
52
+ class="w-100 d-flex align-items-center justify-content-center fw-bold position-absolute top-0 start-0"
53
+ style="height: 50px;
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
+ ${Language.text('cart')}
60
+ <div
61
+ class="position-absolute d-flex align-items-center justify-content-center"
62
+ style="top:50%;transform: translateY(-50%);
63
+ width:40px;height: 40px;
64
+ right:0px;
65
+ "
66
+ onclick="${gvc.event(() => {
67
+ gvc.closeDialog();
68
+ })}"
69
+ >
70
+ <i class="fa-solid fa-xmark"></i>
71
+ </div>
72
+ </div>`,
73
+ ` <div style="height:50px;"></div>`,
74
+ CheckoutIndex.main(gvc, cf.widget, {}),
75
+ ].join('');
76
+ },
77
+ divCreate: {
78
+ class: `h-100 w-100`,
79
+ style: `overflow-y: auto;background:#f0f0f0;`,
80
+ },
81
+ };
82
+ });
83
+ }, 'checkout', {
84
+ animation: Animation.popup,
85
+ });
30
86
  }),
31
87
  select: () => {
32
88
  return cf.gvc.glitter.getUrlParameter('page') === 'checkout';
33
- }
89
+ },
34
90
  },
91
+ ...(() => {
92
+ if (window.store_info.chat_toggle) {
93
+ return [
94
+ {
95
+ title: '訊息',
96
+ icon: '<i class="fa-sharp fa-solid fa-headset"></i>',
97
+ event: cf.gvc.event(() => {
98
+ const userID = (() => {
99
+ if (GlobalUser.token) {
100
+ return GlobalUser.parseJWT(GlobalUser.token).payload.userID;
101
+ }
102
+ else {
103
+ return gvc.glitter.macAddress;
104
+ }
105
+ })();
106
+ gvc.glitter.getModule(new URL('./cms-plugin/customer-message-user.js', gvc.glitter.root_path).href, cl => {
107
+ cl.mobileChat({
108
+ gvc: gvc,
109
+ chat: {
110
+ chat_id: [`${userID}`, 'manager'].sort().join('-'),
111
+ type: 'user',
112
+ },
113
+ user_id: `${userID}`,
114
+ });
115
+ });
116
+ }),
117
+ select: () => { },
118
+ },
119
+ ];
120
+ }
121
+ else {
122
+ return [];
123
+ }
124
+ })(),
35
125
  {
36
126
  title: '我的',
37
127
  icon: '<i class="fa-regular fa-user"></i>',
@@ -40,15 +130,27 @@ export class Footer {
40
130
  }),
41
131
  select: () => {
42
132
  return cf.gvc.glitter.getUrlParameter('page') === 'account_userinfo';
43
- }
44
- }
45
- ].map((dd) => {
46
- const color = (dd.select()) ? cf.widget.formData.select_color : cf.widget.formData.un_select_color;
47
- return html `<div class="d-flex flex-column align-items-center justify-content-center" style="height:63px;gap: 2px;cursor: pointer;" onclick="${dd.event}">
48
- <div class="d-flex align-items-center justify-content-center fs-5" style="width:25px;height: 25px;color:${color};">${dd.icon}</div>
49
- <div class="fw-500" style="font-size: 12px; color:${color};" >${dd.title}</div>
133
+ },
134
+ },
135
+ ]
136
+ .map((dd) => {
137
+ const color = dd.select() ? cf.gvc.glitter.share.globalValue['theme_color.0.border-button-text'] : '#8D8D8D';
138
+ return html ` <div
139
+ class="d-flex flex-column align-items-center justify-content-center"
140
+ style="height:63px;gap: 2px;cursor: pointer;"
141
+ onclick="${dd.event}"
142
+ >
143
+ <div
144
+ class="d-flex align-items-center justify-content-center fs-5"
145
+ style="width:25px;height: 25px;color:${color};"
146
+ >
147
+ ${dd.icon}
148
+ </div>
149
+ <div class="fw-bold" style="font-size: 12px; color:${color};">${dd.title}</div>
150
+ </div>`;
151
+ })
152
+ .join('')}
50
153
  </div>`;
51
- }).join('');
52
154
  }
53
155
  }
54
156
  window.glitter.setModule(import.meta.url, Footer);
@@ -1,65 +1,166 @@
1
- import {GVC} from "../glitterBundle/GVController.js";
2
- const html=String.raw
3
- export class Footer{
1
+ import { GVC } from '../glitterBundle/GVController.js';
2
+ import { GlobalUser } from '../glitter-base/global/global-user.js';
3
+ import { ApiCart } from '../glitter-base/route/api-cart.js';
4
+ import { Animation } from '../glitterBundle/module/Animation.js';
5
+ import { Language } from '../glitter-base/global/language.js';
6
+ import { CheckoutIndex } from '../public-components/checkout/index.js';
4
7
 
5
- public static main(cf: { gvc: GVC; formData: any; widget: any; key: string; callback: (data: any) => void }){
6
- return [
7
- {
8
- title:'首頁',
9
- icon:'<i class="fa-solid fa-house"></i>',
10
- event:cf.gvc.event(()=>{
11
- cf.gvc.glitter.href='/index-mobile'+location.search
12
- }),
13
- select:()=>{
14
- return cf.gvc.glitter.getUrlParameter('page')==='index-mobile'
15
- }
16
- },
17
- {
18
- title:'分類',
19
- icon:'<i class="fa-duotone fa-solid fa-grid-2"></i>',
20
- event:cf.gvc.event(()=>{
21
- cf.gvc.glitter.href='/all-product'+location.search
22
- }),
23
- select:()=>{
24
- return cf.gvc.glitter.getUrlParameter('page')==='all-product'
25
- }
26
- },
27
- {
28
- title:'購物車',
29
- icon:'<i class="fa-regular fa-cart-shopping"></i>',
30
- event:cf.gvc.event(()=>{
31
- cf.gvc.glitter.href='/checkout'+location.search
32
- }),
33
- select:()=>{
34
- return cf.gvc.glitter.getUrlParameter('page')==='checkout'
35
- }
36
- },
37
- // {
38
- // title:'訊息',
39
- // icon:'<i class="fa-sharp fa-solid fa-headset"></i>',
40
- // event:cf.gvc.event(()=>{}),
41
- // select:()=>{
42
- //
43
- // }
44
- // },
45
- {
46
- title:'我的',
47
- icon:'<i class="fa-regular fa-user"></i>',
48
- event:cf.gvc.event(()=>{
49
- cf.gvc.glitter.href='/account_userinfo'+location.search
50
- }),
51
- select:()=>{
52
- return cf.gvc.glitter.getUrlParameter('page')==='account_userinfo'
53
- }
54
- }
55
- ].map((dd:any)=>{
56
- const color=(dd.select()) ? cf.widget.formData.select_color:cf.widget.formData.un_select_color
57
- return html`<div class="d-flex flex-column align-items-center justify-content-center" style="height:63px;gap: 2px;cursor: pointer;" onclick="${dd.event}">
58
- <div class="d-flex align-items-center justify-content-center fs-5" style="width:25px;height: 25px;color:${color};">${dd.icon}</div>
59
- <div class="fw-500" style="font-size: 12px; color:${color};" >${dd.title}</div>
60
- </div>`
61
- }).join('')
62
- }
8
+ const html = String.raw;
9
+
10
+ export class Footer {
11
+ public static main(cf: { gvc: GVC; formData: any; widget: any; key: string; callback: (data: any) => void }) {
12
+ const gvc = cf.gvc;
13
+ return html`
14
+ <div style="height: ${gvc.glitter.share.bottom_inset / 2 }px;"></div>
15
+ <div
16
+ class="position-fixed bottom-0 d-flex shadow vw-100 start-0"
17
+ style="z-index:10;justify-content: space-around;background: rgba(255,255,255,0.95);
18
+ padding-bottom: ${gvc.glitter.share.bottom_inset / 2 }px;;
19
+ "
20
+ >
21
+ ${[
22
+ {
23
+ title: '首頁',
24
+ icon: '<i class="fa-solid fa-house"></i>',
25
+ event: cf.gvc.event(() => {
26
+ cf.gvc.glitter.href = '/index-app' + location.search;
27
+ }),
28
+ select: () => {
29
+ return cf.gvc.glitter.getUrlParameter('page') === 'index-app';
30
+ },
31
+ },
32
+ {
33
+ title: '分類',
34
+ icon: '<i class="fa-duotone fa-solid fa-grid-2"></i>',
35
+ event: cf.gvc.event(() => {
36
+ cf.gvc.glitter.href = '/all-product' + location.search;
37
+ }),
38
+ select: () => {
39
+ return cf.gvc.glitter.getUrlParameter('page') === 'all-product';
40
+ },
41
+ },
42
+ {
43
+ title: '購物車',
44
+ icon: '<i class="fa-regular fa-cart-shopping"></i>',
45
+ event: cf.gvc.event(() => {
46
+ 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-absolute top-0 start-0"
57
+ style="height: 50px;
58
+ background: ${gvc.glitter.share.globalValue['theme_color.0.solid-button-bg']};
59
+ color:${gvc.glitter.share.globalValue['theme_color.0.solid-button-text']};
60
+ z-index: 999;
61
+ "
62
+ >
63
+ ${Language.text('cart')}
64
+ <div
65
+ class="position-absolute d-flex align-items-center justify-content-center"
66
+ style="top:50%;transform: translateY(-50%);
67
+ width:40px;height: 40px;
68
+ right:0px;
69
+ "
70
+ onclick="${gvc.event(() => {
71
+ gvc.closeDialog();
72
+ })}"
73
+ >
74
+ <i class="fa-solid fa-xmark"></i>
75
+ </div>
76
+ </div>`,
77
+ ` <div style="height:50px;"></div>`,
78
+ CheckoutIndex.main(gvc, cf.widget, {}),
79
+ ].join('');
80
+ },
81
+ divCreate: {
82
+ class: `h-100 w-100`,
83
+ style: `overflow-y: auto;background:#f0f0f0;`,
84
+ },
85
+ };
86
+ });
87
+ },
88
+ 'checkout',
89
+ {
90
+ animation: Animation.popup,
91
+ }
92
+ );
93
+ // ApiCart.toCheckOutPage(ApiCart.globalCart);
94
+ }),
95
+ select: () => {
96
+ return cf.gvc.glitter.getUrlParameter('page') === 'checkout';
97
+ },
98
+ },
99
+ ...(() => {
100
+ if ((window as any).store_info.chat_toggle) {
101
+ return [
102
+ {
103
+ title: '訊息',
104
+ icon: '<i class="fa-sharp fa-solid fa-headset"></i>',
105
+ event: cf.gvc.event(() => {
106
+ const userID = (() => {
107
+ if (GlobalUser.token) {
108
+ return GlobalUser.parseJWT(GlobalUser.token).payload.userID;
109
+ } else {
110
+ return gvc.glitter.macAddress;
111
+ }
112
+ })();
113
+ gvc.glitter.getModule(
114
+ new URL('./cms-plugin/customer-message-user.js', gvc.glitter.root_path).href,
115
+ cl => {
116
+ cl.mobileChat({
117
+ gvc: gvc,
118
+ chat: {
119
+ chat_id: [`${userID}`, 'manager'].sort().join('-'),
120
+ type: 'user',
121
+ },
122
+ user_id: `${userID}`,
123
+ });
124
+ }
125
+ );
126
+ }),
127
+ select: () => {},
128
+ },
129
+ ];
130
+ } else {
131
+ return [];
132
+ }
133
+ })(),
134
+ {
135
+ title: '我的',
136
+ icon: '<i class="fa-regular fa-user"></i>',
137
+ event: cf.gvc.event(() => {
138
+ cf.gvc.glitter.href = '/account_userinfo' + location.search;
139
+ }),
140
+ select: () => {
141
+ return cf.gvc.glitter.getUrlParameter('page') === 'account_userinfo';
142
+ },
143
+ },
144
+ ]
145
+ .map((dd: any) => {
146
+ const color = dd.select() ? cf.gvc.glitter.share.globalValue['theme_color.0.border-button-text'] : '#8D8D8D';
147
+ return html` <div
148
+ class="d-flex flex-column align-items-center justify-content-center"
149
+ style="height:63px;gap: 2px;cursor: pointer;"
150
+ onclick="${dd.event}"
151
+ >
152
+ <div
153
+ class="d-flex align-items-center justify-content-center fs-5"
154
+ style="width:25px;height: 25px;color:${color};"
155
+ >
156
+ ${dd.icon}
157
+ </div>
158
+ <div class="fw-bold" style="font-size: 12px; color:${color};">${dd.title}</div>
159
+ </div>`;
160
+ })
161
+ .join('')}
162
+ </div>`;
163
+ }
63
164
  }
64
165
 
65
166
  (window as any).glitter.setModule(import.meta.url, Footer);
@@ -1919,7 +1919,7 @@ ${(_c = obj.default) !== null && _c !== void 0 ? _c : ''}</textarea
1919
1919
  static container(htmlString, obj) {
1920
1920
  var _a;
1921
1921
  return html ` <div
1922
- class=" mb-0 ${document.body.clientWidth > 768 ? 'mx-auto mt-4' : 'w-100 mx-0 mt-2'}"
1922
+ class=" mb-0 ${document.body.clientWidth > 768 ? 'mx-auto mt-4' : 'w-100 mx-0'}"
1923
1923
  style="max-width: 100%; width: ${this.getContainerWidth()}px; ${(_a = obj === null || obj === void 0 ? void 0 : obj.style) !== null && _a !== void 0 ? _a : ''}"
1924
1924
  >
1925
1925
  ${htmlString}
@@ -2314,7 +2314,7 @@ ${obj.default ?? ''}</textarea
2314
2314
  }
2315
2315
  ) {
2316
2316
  return html` <div
2317
- class=" mb-0 ${document.body.clientWidth > 768 ? 'mx-auto mt-4' : 'w-100 mx-0 mt-2'}"
2317
+ class=" mb-0 ${document.body.clientWidth > 768 ? 'mx-auto mt-4' : 'w-100 mx-0'}"
2318
2318
  style="max-width: 100%; width: ${this.getContainerWidth()}px; ${obj?.style ?? ''}"
2319
2319
  >
2320
2320
  ${htmlString}
@@ -0,0 +1,150 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { BgWidget } from '../backend-manager/bg-widget.js';
11
+ import { ApiPageConfig } from '../api/pageConfig.js';
12
+ export class AppDesign {
13
+ static main(gvc) {
14
+ const html = String.raw;
15
+ return BgWidget.container([
16
+ html ` <div class="title-container">${BgWidget.title('APP佈景主題')}</div>`,
17
+ BgWidget.card(gvc.bindView(() => {
18
+ const id = gvc.glitter.getUUID();
19
+ return {
20
+ bind: id,
21
+ view: () => {
22
+ return html `
23
+ <div class="d-flex flex-column" style="gap:5px;">
24
+ ${[
25
+ `<div class="tx_normal fs-5 fw-500">2414-居家生活</div>`,
26
+ `<div class="tx_normal fs-sm fw-500 text-body" style="">上次儲存時間: 03-21 14:27</div>`,
27
+ ``,
28
+ ].join('')}
29
+ </div>
30
+ <div class="flex-fill"></div>
31
+ <div class="d-flex" style="gap:10px;">
32
+ ${[
33
+ BgWidget.grayButton('主題資訊', gvc.event(() => { })),
34
+ BgWidget.save(gvc.event(() => {
35
+ window.parent.glitter.setUrlParameter('function', 'user-editor');
36
+ window.parent.glitter.setUrlParameter('device', 'mobile');
37
+ window.parent.glitter.setUrlParameter('page', 'index-app');
38
+ window.parent.location.reload();
39
+ }), '主題設計'),
40
+ ].join('')}
41
+ </div>
42
+ `;
43
+ },
44
+ divCreate: {
45
+ class: `w-100 d-flex align-items-center`,
46
+ style: `gap:10px;`,
47
+ },
48
+ };
49
+ })),
50
+ BgWidget.card(html `
51
+ <div class="d-flex flex-column" style="gap:5px;">
52
+ ${[
53
+ `<div class="tx_normal fs-6 fw-bold">佈景主題庫</div>`,
54
+ `<div class="tx_normal fs-sm fw-500 text-body" style="">從佈景主題庫中,更換佈景主題樣式。</div>`,
55
+ ``,
56
+ ].join('')}
57
+ </div>
58
+ `),
59
+ BgWidget.card(html `
60
+ <div class="d-flex flex-column" style="gap:5px;">
61
+ ${[
62
+ `<div class="tx_normal fs-6 fw-bold">熱門免費佈景主題</div>`,
63
+ `<div class="tx_normal fs-sm fw-500 text-body" style="">佈景主題涵蓋核心功能,無需編寫程式碼即可讓您輕鬆自訂。</div>`,
64
+ `<div class="w-100 border-top my-2"></div>`,
65
+ gvc.bindView(() => {
66
+ return {
67
+ bind: gvc.glitter.getUUID(),
68
+ view: () => __awaiter(this, void 0, void 0, function* () {
69
+ const templateList = (yield ApiPageConfig.getTemplateList()).response.result.reverse();
70
+ return templateList
71
+ .map((dd) => {
72
+ return html ` <div class="w-100 h-100 parent mx-auto" style="cursor:pointer;">
73
+ <div class="hoverBlock shadow rounded-3" style="position: relative;">
74
+ <div
75
+ class=" "
76
+ style="width: 100%;
77
+ position: relative;
78
+ border-top-left-radius: 12.24px;
79
+ border-top-right-radius: 12.24px;
80
+ top:0px;
81
+
82
+ background-image: url('${dd.template_config.image[0]}');
83
+ /* 设置背景图片的URL */
84
+ background-size: cover;
85
+ /* 将背景图片放大以覆盖整个容器 */
86
+ background-position: center;
87
+ /* 将背景图片水平和垂直居中对齐 */
88
+ background-repeat: no-repeat;
89
+ /* 防止背景图片重复 */
90
+ padding-bottom: 133%;"
91
+ ></div>
92
+ <div
93
+ class="hoverPlace"
94
+ style="position: absolute;width: 100%;height: 100%;background:rgba(255, 255, 255, 0.5);top: 0px;left: 0px;align-items: center;justify-content: center;gap:0px;opacity: 0;z-index: 2;"
95
+ >
96
+ <div
97
+ class="btn btn-sm bgf6 text-black border"
98
+ style="color: black !important;width: 60px;height: 28px;"
99
+ >
100
+ 預覽
101
+ </div>
102
+ <div
103
+ class="btn btn-primary-c addTheme"
104
+ style="color: black;width: 40px;margin-left: 10px;color: white;height: 28px;background:#393939;"
105
+ >
106
+ 新增
107
+ </div>
108
+ </div>
109
+ </div>
110
+ <div
111
+ class="flex-fill py-3"
112
+ style="display: flex;flex-direction: column;gap: 10px;"
113
+ >
114
+ <div
115
+ class="fs-5"
116
+ style="color: black;text-align: start;font-size: 24px;font-style: normal;font-weight: 600;line-height: 100%;"
117
+ >
118
+ ${dd.template_config.name}
119
+ </div>
120
+ <div class="d-flex flex-wrap" style="gap: 5px;" >
121
+ ${dd.template_config.tag.map((dd) => {
122
+ return ` <div
123
+ class="badge bg-primary text-white"
124
+ style="color: rgb(218, 187, 131);text-align: start;font-size: 14px;font-style: normal;font-weight: 600;line-height: 100%;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);;"
125
+ >
126
+ ${dd}
127
+ </div>`;
128
+ }).join('')}
129
+ </div>
130
+ </div>
131
+ </div>`;
132
+ }).map((dd) => {
133
+ return `<div class="col-6 col-lg-4">${dd}</div>`;
134
+ })
135
+ .join('');
136
+ }),
137
+ divCreate: {
138
+ class: `row`
139
+ }
140
+ };
141
+ }),
142
+ ].join('')}
143
+ </div>
144
+ `),
145
+ ].join(`<div class="my-3"></div>`), {
146
+ style: 'max-width:950px;',
147
+ });
148
+ }
149
+ }
150
+ window.glitter.setModule(import.meta.url, AppDesign);