ts-glitter 21.0.9 → 21.1.2

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 (43) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/POS-setting.js +10 -6
  4. package/lowcode/cms-plugin/POS-setting.ts +11 -5
  5. package/lowcode/cms-plugin/data-analyze-orders.js +1 -0
  6. package/lowcode/cms-plugin/data-analyze-orders.ts +1 -1
  7. package/lowcode/cms-plugin/data-analyze.js +21 -1
  8. package/lowcode/cms-plugin/data-analyze.ts +24 -25
  9. package/lowcode/cms-plugin/pos-basic-setting.ts +1 -0
  10. package/lowcode/cms-plugin/pos-config-setting.js +56 -8
  11. package/lowcode/cms-plugin/pos-config-setting.ts +81 -28
  12. package/lowcode/cms-plugin/pos-pages/products-page.js +13 -2
  13. package/lowcode/cms-plugin/pos-pages/products-page.ts +14 -2
  14. package/lowcode/editor-components/font-select.js +1 -0
  15. package/lowcode/editor-components/font-select.ts +64 -0
  16. package/lowcode/official_view_component/official/component.js +10 -5
  17. package/lowcode/official_view_component/official/component.ts +22 -13
  18. package/lowcode/setting/fonts-config.js +119 -59
  19. package/lowcode/setting/fonts-config.ts +7075 -6999
  20. package/package.json +1 -1
  21. package/src/api-public/controllers/index.js.map +1 -1
  22. package/src/api-public/controllers/index.ts +1 -0
  23. package/src/api-public/services/checkout-event.js +1 -3
  24. package/src/api-public/services/checkout-event.js.map +1 -1
  25. package/src/api-public/services/data-analyze.d.ts +4 -4
  26. package/src/api-public/services/data-analyze.js +213 -283
  27. package/src/api-public/services/data-analyze.js.map +1 -1
  28. package/src/api-public/services/data-analyze.ts +222 -332
  29. package/src/api-public/services/public-table-check.js +13 -0
  30. package/src/api-public/services/public-table-check.js.map +1 -1
  31. package/src/api-public/services/public-table-check.ts +13 -0
  32. package/src/api-public/services/schedule.d.ts +1 -0
  33. package/src/api-public/services/schedule.js +87 -54
  34. package/src/api-public/services/schedule.js.map +1 -1
  35. package/src/api-public/services/schedule.ts +101 -57
  36. package/src/api-public/services/shopping.js +2 -3
  37. package/src/api-public/services/shopping.js.map +1 -1
  38. package/src/api-public/services/shopping.ts +2 -3
  39. package/src/api-public/utils/ut-permission.d.ts +0 -1
  40. package/src/run.js +2 -3
  41. package/src/run.js.map +1 -1
  42. package/src/run.ts +1 -1
  43. /package/{vp00rqhw1r.json → ye8r333y6g.json} +0 -0
package/lowcode/Entry.js CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
148
148
  console.log(`Entry-time:`, window.renderClock.stop());
149
- glitter.share.editerVersion = 'V_21.0.9';
149
+ glitter.share.editerVersion = 'V_21.1.2';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -149,7 +149,7 @@ export class Entry {
149
149
  }
150
150
  (window as any).renderClock = (window as any).renderClock ?? createClock();
151
151
  console.log(`Entry-time:`, (window as any).renderClock.stop());
152
- glitter.share.editerVersion = 'V_21.0.9';
152
+ glitter.share.editerVersion = 'V_21.1.2';
153
153
  glitter.share.start = new Date();
154
154
  const vm = { appConfig: [] };
155
155
  (window as any).saasConfig = {
@@ -158,7 +158,17 @@ export class POSSetting {
158
158
  });
159
159
  }));
160
160
  }
161
+ static setSaasBrand() {
162
+ if (window.location.href.includes('smartshop')) {
163
+ window.glitterBase = 'hd_saas';
164
+ }
165
+ else {
166
+ window.glitterBase = 'shopnex';
167
+ }
168
+ window.saasConfig.config.token = GlobalUser.saas_token;
169
+ }
161
170
  static main(gvc) {
171
+ this.setSaasBrand();
162
172
  const glitter = gvc.glitter;
163
173
  const dialog = new ShareDialog(glitter);
164
174
  gvc.addStyle(`
@@ -207,12 +217,6 @@ export class POSSetting {
207
217
  POSSetting.initialStyle(gvc);
208
218
  gvc.glitter.share.NormalPageEditor = NormalPageEditor;
209
219
  gvc.glitter.addStyleLink('./css/editor.css');
210
- if (window.location.href.includes('smartshop')) {
211
- window.glitterBase = 'hd_saas';
212
- }
213
- else {
214
- window.glitterBase = 'shopnex';
215
- }
216
220
  window.appName = gvc.glitter.getUrlParameter('app-id');
217
221
  window.saasConfig.config.token = GlobalUser.saas_token;
218
222
  localStorage.setItem('on-pos', 'true');
@@ -172,6 +172,8 @@ export class POSSetting {
172
172
  }
173
173
 
174
174
  static initial(gvc: GVC) {
175
+
176
+
175
177
  gvc.glitter.share.editorViewModel = { app_config_original: {} };
176
178
  gvc.glitter.share.shop_config = { shop_name: '' };
177
179
 
@@ -188,7 +190,16 @@ export class POSSetting {
188
190
  });
189
191
  }
190
192
 
193
+ static setSaasBrand(){
194
+ if (window.location.href.includes('smartshop')) {
195
+ (window as any).glitterBase = 'hd_saas';
196
+ } else {
197
+ (window as any).glitterBase = 'shopnex';
198
+ }
199
+ (window as any).saasConfig.config.token = GlobalUser.saas_token;
200
+ }
191
201
  static main(gvc: GVC) {
202
+ this.setSaasBrand();
192
203
  const glitter = gvc.glitter;
193
204
  const dialog = new ShareDialog(glitter);
194
205
 
@@ -240,11 +251,6 @@ export class POSSetting {
240
251
 
241
252
  gvc.glitter.share.NormalPageEditor = NormalPageEditor; // 提供給編輯器使用
242
253
  gvc.glitter.addStyleLink('./css/editor.css');
243
- if (window.location.href.includes('smartshop')) {
244
- (window as any).glitterBase = 'hd_saas';
245
- } else {
246
- (window as any).glitterBase = 'shopnex';
247
- }
248
254
 
249
255
  (window as any).appName = gvc.glitter.getUrlParameter('app-id');
250
256
  (window as any).saasConfig.config.token = GlobalUser.saas_token;
@@ -35,6 +35,7 @@ export class DataAnalyze {
35
35
  DataAnalyzeModule.salesAmount(gvc, vm),
36
36
  DataAnalyzeModule.orderAmount(gvc, vm),
37
37
  DataAnalyzeModule.orderAverage(gvc, vm),
38
+ DataAnalyzeModule.viewPeople(gvc, vm),
38
39
  DataAnalyzeModule.registerPeople(gvc, vm),
39
40
  DataAnalyzeModule.transferRatio(gvc, vm),
40
41
  ]
@@ -52,7 +52,7 @@ export class DataAnalyze {
52
52
  DataAnalyzeModule.salesAmount(gvc, vm),
53
53
  DataAnalyzeModule.orderAmount(gvc, vm),
54
54
  DataAnalyzeModule.orderAverage(gvc, vm),
55
- // DataAnalyzeModule.viewPeople(gvc, vm),
55
+ DataAnalyzeModule.viewPeople(gvc, vm),
56
56
  DataAnalyzeModule.registerPeople(gvc, vm),
57
57
  DataAnalyzeModule.transferRatio(gvc, vm),
58
58
  ]
@@ -24,7 +24,7 @@ export class DataAnalyze {
24
24
  src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1714105121170-apexcharts.min.js',
25
25
  },
26
26
  ], () => { }, () => { });
27
- ApiShop.ecDataAnalyze('recent_register_today,order_today,sales_per_month_1_month'.split(',')).then((res) => __awaiter(this, void 0, void 0, function* () {
27
+ ApiShop.ecDataAnalyze('recent_register_today,order_today,sales_per_month_1_month,active_recent_year,active_recent_2week'.split(',')).then((res) => __awaiter(this, void 0, void 0, function* () {
28
28
  vm.loading = false;
29
29
  vm.data = res.response;
30
30
  gvc.notifyDataChange(id);
@@ -70,6 +70,22 @@ export class DataAnalyze {
70
70
  </div>
71
71
  <div class="row p-0" style="width: 896px; max-width: 100%; gap:15px 0px; ">
72
72
  ${[
73
+ {
74
+ title: '今日瀏覽人數',
75
+ value: html `${vm.data.active_recent_2week.count_array
76
+ .map((dd) => {
77
+ return dd;
78
+ })
79
+ .reverse()[0]
80
+ .toLocaleString()}
81
+ ${BgWidget.grayNote(`(本月: ${vm.data.active_recent_year.count_array
82
+ .map((dd) => {
83
+ return dd;
84
+ })
85
+ .reverse()[0]
86
+ .toLocaleString()})`, 'font-weight: 500;')}`,
87
+ icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/users-duotone-solid.svg',
88
+ },
73
89
  {
74
90
  title: '今日會員註冊',
75
91
  value: html `${vm.data.recent_register_today['today'].toLocaleString()}
@@ -157,6 +173,10 @@ export class DataAnalyze {
157
173
  class: 'col-12 col-lg-4 col-md-6',
158
174
  event: DataAnalyzeModule.orderAverage(gvc),
159
175
  },
176
+ {
177
+ class: 'col-12 col-lg-4 col-md-6',
178
+ event: DataAnalyzeModule.viewPeople(gvc),
179
+ },
160
180
  {
161
181
  class: 'col-12 col-lg-4 col-md-6',
162
182
  event: DataAnalyzeModule.registerPeople(gvc),
@@ -26,9 +26,8 @@ export class DataAnalyze {
26
26
  () => {},
27
27
  () => {}
28
28
  );
29
- //active_recent_2week,active_recent_year
30
29
  ApiShop.ecDataAnalyze(
31
- 'recent_register_today,order_today,sales_per_month_1_month'.split(',')
30
+ 'recent_register_today,order_today,sales_per_month_1_month,active_recent_year,active_recent_2week'.split(',')
32
31
  ).then(async res => {
33
32
  vm.loading = false;
34
33
  vm.data = res.response;
@@ -76,25 +75,25 @@ export class DataAnalyze {
76
75
  </div>
77
76
  <div class="row p-0" style="width: 896px; max-width: 100%; gap:15px 0px; ">
78
77
  ${[
79
- // {
80
- // title: '今日瀏覽人數',
81
- // value: html`${vm.data.active_recent_2week.count_array
82
- // .map((dd: any) => {
83
- // return dd;
84
- // })
85
- // .reverse()[0]
86
- // .toLocaleString()}
87
- // ${BgWidget.grayNote(
88
- // `(本月: ${vm.data.active_recent_year.count_array
89
- // .map((dd: any) => {
90
- // return dd;
91
- // })
92
- // .reverse()[0]
93
- // .toLocaleString()})`,
94
- // 'font-weight: 500;'
95
- // )}`,
96
- // icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/users-duotone-solid.svg',
97
- // },
78
+ {
79
+ title: '今日瀏覽人數',
80
+ value: html`${vm.data.active_recent_2week.count_array
81
+ .map((dd: any) => {
82
+ return dd;
83
+ })
84
+ .reverse()[0]
85
+ .toLocaleString()}
86
+ ${BgWidget.grayNote(
87
+ `(本月: ${vm.data.active_recent_year.count_array
88
+ .map((dd: any) => {
89
+ return dd;
90
+ })
91
+ .reverse()[0]
92
+ .toLocaleString()})`,
93
+ 'font-weight: 500;'
94
+ )}`,
95
+ icon: 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/users-duotone-solid.svg',
96
+ },
98
97
  {
99
98
  title: '今日會員註冊',
100
99
  value: html`${vm.data.recent_register_today['today'].toLocaleString()}
@@ -188,10 +187,10 @@ export class DataAnalyze {
188
187
  class: 'col-12 col-lg-4 col-md-6',
189
188
  event: DataAnalyzeModule.orderAverage(gvc),
190
189
  },
191
- // {
192
- // class: 'col-12 col-lg-4 col-md-6',
193
- // event: DataAnalyzeModule.viewPeople(gvc),
194
- // },
190
+ {
191
+ class: 'col-12 col-lg-4 col-md-6',
192
+ event: DataAnalyzeModule.viewPeople(gvc),
193
+ },
195
194
  {
196
195
  class: 'col-12 col-lg-4 col-md-6',
197
196
  event: DataAnalyzeModule.registerPeople(gvc),
@@ -30,6 +30,7 @@ const dialog=new ShareDialog(gvc.glitter)
30
30
  ${[
31
31
  BgWidget.editeInput({
32
32
  gvc: gvc,
33
+
33
34
  title: '商店名稱',
34
35
  default: appData.shop_name || '',
35
36
  placeHolder: '請輸入商店名稱',
@@ -227,6 +227,52 @@ ${BgWidget.customButton({
227
227
  }),
228
228
  }));
229
229
  }
230
+ function createProductCardLayout(title, description) {
231
+ var _a;
232
+ vm.data.pos_support_finction = (_a = vm.data.pos_support_finction) !== null && _a !== void 0 ? _a : [];
233
+ return createRow(title, description, BgWidget.customButton({
234
+ button: { color: 'snow', size: 'md' },
235
+ text: { name: '編輯' },
236
+ event: gvc.event(() => {
237
+ var _a;
238
+ vm.data.prdouct_card_layout = (_a = vm.data.prdouct_card_layout) !== null && _a !== void 0 ? _a : '16:9';
239
+ BgWidget.settingDialog({
240
+ gvc,
241
+ title,
242
+ width: 600,
243
+ innerHTML: gvc => {
244
+ return BgWidget.editeInput({
245
+ gvc: gvc,
246
+ title: '卡片比例',
247
+ default: vm.data.prdouct_card_layout,
248
+ placeHolder: '請輸入卡片比例,範例: 16:9',
249
+ callback: (text) => {
250
+ if (text.split(':').map((dd) => {
251
+ return Number.isFinite(Number(dd));
252
+ }).length === 2) {
253
+ vm.data.prdouct_card_layout = text;
254
+ }
255
+ },
256
+ });
257
+ },
258
+ footer_html: gvc => {
259
+ return [
260
+ BgWidget.cancel(gvc.event(() => {
261
+ gvc.closeDialog();
262
+ })),
263
+ BgWidget.save(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
264
+ dialog.dataLoading({ visible: true });
265
+ yield vm.save_info();
266
+ dialog.dataLoading({ visible: false });
267
+ dialog.successMessage({ text: '儲存成功' });
268
+ gvc.closeDialog();
269
+ }))),
270
+ ].join('');
271
+ },
272
+ });
273
+ }),
274
+ }));
275
+ }
230
276
  function createCheckoutModeDialog(title, description) {
231
277
  return createRow(title, description, BgWidget.customButton({
232
278
  button: { color: 'snow', size: 'md' },
@@ -308,10 +354,11 @@ ${BgWidget.customButton({
308
354
  const typeMap = {
309
355
  function: () => {
310
356
  var _a;
311
- return [BgWidget.mainCard(html `
312
- <div class="d-flex flex-column gap-2">
313
- ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
314
- ${BgWidget.inlineCheckBox({
357
+ return [
358
+ BgWidget.mainCard(html `
359
+ <div class="d-flex flex-column gap-2">
360
+ ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
361
+ ${BgWidget.inlineCheckBox({
315
362
  title: '',
316
363
  gvc,
317
364
  def: (_a = vm.data.pos_support_finction) !== null && _a !== void 0 ? _a : [],
@@ -326,14 +373,15 @@ ${BgWidget.customButton({
326
373
  },
327
374
  type: 'multiple',
328
375
  })}
329
- ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
330
- </div>
331
- `)
376
+ ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
377
+ ${createProductCardLayout('商品比例', `設定POS商品卡片顯示比例。`)}
378
+ </div>
379
+ `),
332
380
  ].join('');
333
381
  },
334
382
  finance: () => {
335
383
  return ShoppingFinanceSetting.main(gvc, true);
336
- }
384
+ },
337
385
  };
338
386
  return BgWidget.container(html `
339
387
  <div class="title-container">${BgWidget.title('全站設定')}</div>
@@ -158,7 +158,7 @@ export class PosConfigSetting {
158
158
  }
159
159
 
160
160
  function createPickUpModeDialog(title: string, description: string) {
161
- vm.data.pos_support_finction=vm.data.pos_support_finction??[]
161
+ vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
162
162
  return createRow(
163
163
  title,
164
164
  description,
@@ -276,6 +276,60 @@ ${BgWidget.customButton({
276
276
  );
277
277
  }
278
278
 
279
+ function createProductCardLayout(title: string, description: string) {
280
+ vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
281
+ return createRow(
282
+ title,
283
+ description,
284
+ BgWidget.customButton({
285
+ button: { color: 'snow', size: 'md' },
286
+ text: { name: '編輯' },
287
+ event: gvc.event(() => {
288
+ vm.data.prdouct_card_layout=vm.data.prdouct_card_layout??'16:9'
289
+ BgWidget.settingDialog({
290
+ gvc,
291
+ title,
292
+ width: 600,
293
+ innerHTML: gvc => {
294
+ return BgWidget.editeInput({
295
+ gvc: gvc,
296
+
297
+ title: '卡片比例',
298
+ default: vm.data.prdouct_card_layout,
299
+ placeHolder: '請輸入卡片比例,範例: 16:9',
300
+ callback: (text) => {
301
+ if(text.split(':').map((dd)=>{
302
+ return Number.isFinite(Number(dd))
303
+ }).length===2){
304
+ vm.data.prdouct_card_layout=text
305
+ }
306
+ },
307
+ });
308
+ },
309
+ footer_html: gvc => {
310
+ return [
311
+ BgWidget.cancel(
312
+ gvc.event(() => {
313
+ gvc.closeDialog();
314
+ })
315
+ ),
316
+ BgWidget.save(
317
+ gvc.event(async () => {
318
+ dialog.dataLoading({ visible: true });
319
+ await vm.save_info();
320
+ dialog.dataLoading({ visible: false });
321
+ dialog.successMessage({ text: '儲存成功' });
322
+ gvc.closeDialog();
323
+ })
324
+ ),
325
+ ].join('');
326
+ },
327
+ });
328
+ }),
329
+ })
330
+ );
331
+ }
332
+
279
333
  function createCheckoutModeDialog(title: string, description: string) {
280
334
  return createRow(
281
335
  title,
@@ -367,35 +421,34 @@ ${BgWidget.customButton({
367
421
  vm.data.pos_support_finction = vm.data.pos_support_finction ?? [];
368
422
  const typeMap: Record<string, () => string> = {
369
423
  function: () => {
370
- return [BgWidget.mainCard(html`
371
- <div class="d-flex flex-column gap-2">
372
- ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
373
- ${BgWidget.inlineCheckBox({
374
- title: '',
375
- gvc,
376
- def: vm.data.pos_support_finction ?? [],
377
- array: [
378
- { title: '列印明細', value: 'print_order_detail' },
379
- { title: '列印留存聯', value: 'print_order_receipt' },
380
- { title: '發票開立', value: 'print_invoice' },
381
- { title: '桌號設定', value: 'table_select' },
382
- ],
383
- callback: (array: any) => {
384
- vm.data.pos_support_finction = array;
385
- },
386
- type: 'multiple',
387
- })}
388
- ${createPickUpModeDialog(
389
- '叫號取餐',
390
- `針對特店取餐功能,會自動遞增取餐號碼。`
391
- )}
392
- </div>
393
- `)
424
+ return [
425
+ BgWidget.mainCard(html`
426
+ <div class="d-flex flex-column gap-2">
427
+ ${createSection('POS功能', '系統將根據您勾選的項目,開放相對應的功能')}
428
+ ${BgWidget.inlineCheckBox({
429
+ title: '',
430
+ gvc,
431
+ def: vm.data.pos_support_finction ?? [],
432
+ array: [
433
+ { title: '列印明細', value: 'print_order_detail' },
434
+ { title: '列印留存聯', value: 'print_order_receipt' },
435
+ { title: '發票開立', value: 'print_invoice' },
436
+ { title: '桌號設定', value: 'table_select' },
437
+ ],
438
+ callback: (array: any) => {
439
+ vm.data.pos_support_finction = array;
440
+ },
441
+ type: 'multiple',
442
+ })}
443
+ ${createPickUpModeDialog('叫號取餐', `針對特店取餐功能,會自動遞增取餐號碼。`)}
444
+ ${createProductCardLayout('商品比例', `設定POS商品卡片顯示比例。`)}
445
+ </div>
446
+ `),
394
447
  ].join('');
395
448
  },
396
- finance:()=>{
397
- return ShoppingFinanceSetting.main(gvc,true)
398
- }
449
+ finance: () => {
450
+ return ShoppingFinanceSetting.main(gvc, true);
451
+ },
399
452
  };
400
453
 
401
454
  return BgWidget.container(html`
@@ -12,6 +12,7 @@ import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
12
12
  import { POSSetting } from '../POS-setting.js';
13
13
  import { Swal } from '../../modules/sweetAlert.js';
14
14
  import { PaymentPage } from './payment-page.js';
15
+ import { PayConfig } from './pay-config.js';
15
16
  const html = String.raw;
16
17
  export class ProductsPage {
17
18
  static main(obj) {
@@ -24,7 +25,7 @@ export class ProductsPage {
24
25
  const pVM = {
25
26
  pageSize: 0,
26
27
  pageIndex: 1,
27
- limit: 20,
28
+ limit: 50,
28
29
  };
29
30
  function loadData() {
30
31
  let category = vm.categories.find((category) => category.select == true);
@@ -144,7 +145,17 @@ export class ProductsPage {
144
145
  >
145
146
  <div
146
147
  class="w-100"
147
- style="border-radius: 10px 10px 0 0;;padding-bottom: 116px;background: 50%/cover no-repeat url('${(_b = (_a = data
148
+ style="border-radius: 10px 10px 0 0;;padding-bottom: ${(() => {
149
+ if (PayConfig.pos_config.prdouct_card_layout) {
150
+ const wi = PayConfig.pos_config.prdouct_card_layout.split(':').map((dd) => {
151
+ return parseInt(dd, 10);
152
+ });
153
+ return parseInt(`${wi[0] / wi[1] * 100}`, 10);
154
+ }
155
+ else {
156
+ return `56`;
157
+ }
158
+ })()}%;background: 50%/cover no-repeat url('${(_b = (_a = data
148
159
  .content.preview_image[0]) !== null && _a !== void 0 ? _a : image) !== null && _b !== void 0 ? _b : image}');"
149
160
  ></div>
150
161
  <div class="d-flex flex-column" style="padding: 12px 10px;gap: 4px;">
@@ -5,6 +5,7 @@ import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
5
5
  import { POSSetting } from '../POS-setting.js';
6
6
  import { Swal } from '../../modules/sweetAlert.js';
7
7
  import { PaymentPage } from './payment-page.js';
8
+ import { PayConfig } from './pay-config.js';
8
9
 
9
10
  const html = String.raw;
10
11
 
@@ -102,7 +103,7 @@ export class ProductsPage {
102
103
  const pVM = {
103
104
  pageSize: 0,
104
105
  pageIndex: 1,
105
- limit: 20,
106
+ limit: 50,
106
107
  };
107
108
 
108
109
  function loadData() {
@@ -228,7 +229,18 @@ export class ProductsPage {
228
229
  >
229
230
  <div
230
231
  class="w-100"
231
- style="border-radius: 10px 10px 0 0;;padding-bottom: 116px;background: 50%/cover no-repeat url('${data
232
+ style="border-radius: 10px 10px 0 0;;padding-bottom: ${
233
+ (()=>{
234
+ if(PayConfig.pos_config.prdouct_card_layout){
235
+ const wi=PayConfig.pos_config.prdouct_card_layout.split(':').map((dd:any)=>{
236
+ return parseInt(dd,10)
237
+ })
238
+ return parseInt(`${wi[0] / wi[1] * 100}`,10)
239
+ }else{
240
+ return `56`
241
+ }
242
+ })()
243
+ }%;background: 50%/cover no-repeat url('${data
232
244
  .content.preview_image[0] ??
233
245
  image ??
234
246
  image}');"
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,64 @@
1
+ // import { BgWidget } from '../backend-manager/bg-widget.js';
2
+ // import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
3
+ // import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
4
+ // import { FontsConfig } from '../setting/fonts-config.js';
5
+ //
6
+ // export class FontSelect {
7
+ // public static setFont(obj: { index: number; gvc: any; vm_c: any; globalValue: any; dd: any }) {
8
+ // const { index, gvc, vm_c, globalValue, dd } = obj;
9
+ // return `<div class="col-12 mb-3" style="cursor: pointer;">
10
+ // <div class="rounded border p-2 d-flex w-100 flex-column" style="gap:10px;">
11
+ // ${BgWidget.title(index === 0 ? `預設字型` : dd.value || `字型樣式 ${index}`, 'font-size: 16px;')}
12
+ // <div class="d-flex align-items-center" style="gap:10px;">
13
+ // ${EditorElem.searchInputDynamicV2({
14
+ // title: '',
15
+ // gvc: gvc,
16
+ // // default: dd.value,
17
+ // def: dd.value,
18
+ // array: vm_c.fonts.map((dd: any, index: number) => {
19
+ // return dd.title;
20
+ // }),
21
+ // callback: text => {
22
+ // if (
23
+ // vm_c.fonts.find((dd: any, index: number) => {
24
+ // return dd.title === text;
25
+ // })
26
+ // ) {
27
+ // dd.title = text;
28
+ // dd.value = text;
29
+ // FontsConfig.reInitialFontTheme(globalValue, gvc);
30
+ // }
31
+ // gvc.notifyDataChange(vm_c.id);
32
+ // },
33
+ // placeHolder: '搜尋字體',
34
+ // readonly: 'true',
35
+ // })}
36
+ // ${
37
+ // index !== 0
38
+ // ? BgWidget.cancel(
39
+ // gvc.event(() => {
40
+ // const dialog = new ShareDialog(gvc.glitter);
41
+ // dialog.checkYesOrNot({
42
+ // text: '是否確認刪除此字型?',
43
+ // callback: response => {
44
+ // if (response) {
45
+ // globalValue.font_theme.splice(index, 1);
46
+ // gvc.notifyDataChange(vm_c.id);
47
+ // }
48
+ // },
49
+ // });
50
+ // }),
51
+ // '<i class="fa-solid fa-trash-can"></i>'
52
+ // )
53
+ // : ``
54
+ // }
55
+ // </div>
56
+ // </div>
57
+ // <div class="d-flex p-2 align-items-center" style="gap:10px;">
58
+ // <div class="fs-6">預覽字體:</div>
59
+ // <div class="fs-6 bgf6 p-2" style="font-family: '${dd.value}' !important;">字型</div>
60
+ // <div class="fs-6 bgf6 p-2" style="font-family: '${dd.value}' !important;">fonts</div>
61
+ // </div>
62
+ // </div>`;
63
+ // }
64
+ // }
@@ -33,11 +33,10 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
33
33
  widget[dd].data.refer_app = widget.data.refer_app;
34
34
  });
35
35
  }
36
- const app_editor = (['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application);
36
+ const app_editor = ['index-app'].includes(gvc.glitter.getUrlParameter('page')) || ApplicationConfig.is_application;
37
37
  initialReferData(widget);
38
38
  let viewConfig = undefined;
39
39
  const html = String.raw;
40
- const view_container_id = widget.id;
41
40
  return {
42
41
  view: () => {
43
42
  if (app_editor) {
@@ -128,8 +127,14 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
128
127
  });
129
128
  function getFormData(ref) {
130
129
  var _a, _b;
131
- ref =
132
- window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] || ref;
130
+ ref = (() => {
131
+ if (window.glitter.getUrlParameter('select_widget') === 'true') {
132
+ return ref;
133
+ }
134
+ else {
135
+ return window.parent.glitter.share.updated_form_data[`${page_request_config.appName}_${tag}`] || ref;
136
+ }
137
+ })();
133
138
  let formData = JSON.parse(JSON.stringify(ref || {}));
134
139
  if (widget.data.refer_app) {
135
140
  GlobalWidget.initialShowCaseData({
@@ -1456,7 +1461,7 @@ font-weight: 700;"
1456
1461
  gvc.glitter.getModule(new URL(gvc.glitter.root_path + `public-components/headers/header-mobile.js`).href, res => {
1457
1462
  resolve(res.editor({
1458
1463
  gvc: gvc,
1459
- widget: widget
1464
+ widget: widget,
1460
1465
  }));
1461
1466
  });
1462
1467
  });