ts-glitter 17.0.2 → 17.0.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_17.0.2';
91
+ glitter.share.editerVersion = 'V_17.0.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_17.0.2';
91
+ glitter.share.editerVersion = 'V_17.0.3';
92
92
  glitter.share.start = new Date();
93
93
  const vm: {
94
94
  appConfig: any;
@@ -11,7 +11,8 @@ import { BaseApi } from '../../glitterBundle/api/base.js';
11
11
  import { GlobalUser } from '../global/global-user.js';
12
12
  import { ApiShop } from './shopping.js';
13
13
  export class ApiUser {
14
- constructor() { }
14
+ constructor() {
15
+ }
15
16
  static register(json) {
16
17
  return BaseApi.create({
17
18
  url: getBaseUrl() + `/api-public/v1/user/register`,
@@ -633,21 +634,16 @@ export class ApiUser {
633
634
  resolve(config[key + user_id]);
634
635
  return;
635
636
  }
636
- BaseApi.create({
637
- url: getBaseUrl() + `/api-public/v1/user/public/config?key=${key}&user_id=${user_id}`,
638
- type: 'GET',
639
- headers: {
640
- 'Content-Type': 'application/json',
641
- 'g-app': appName,
642
- Authorization: getConfig().config.token,
643
- },
644
- }).then((res) => {
637
+ function callback(res) {
645
638
  switch (key) {
646
639
  case 'collection':
647
640
  case 'footer-setting':
648
641
  case 'menu-setting':
649
642
  case 'message_setting':
650
- config[key + user_id] = res;
643
+ case 'promo-label':
644
+ if (window.parent.glitter.getUrlParameter('function') !== 'backend-manger') {
645
+ config[key + user_id] = res;
646
+ }
651
647
  break;
652
648
  case 'image-manager':
653
649
  if (!Array.isArray(res.response.value)) {
@@ -659,7 +655,37 @@ export class ApiUser {
659
655
  config[key + user_id] = res;
660
656
  }
661
657
  resolve(res);
658
+ }
659
+ const find_ = this.getting_config.find((dd) => {
660
+ return dd.key === key;
662
661
  });
662
+ if (find_) {
663
+ find_.array.push(callback);
664
+ }
665
+ else {
666
+ this.getting_config.push({ key: key, array: [callback] });
667
+ BaseApi.create({
668
+ url: getBaseUrl() + `/api-public/v1/user/public/config?key=${key}&user_id=${user_id}`,
669
+ type: 'GET',
670
+ headers: {
671
+ 'Content-Type': 'application/json',
672
+ 'g-app': appName,
673
+ Authorization: getConfig().config.token,
674
+ },
675
+ }).then((res) => {
676
+ this.getting_config = this.getting_config.filter((d1) => {
677
+ if (d1.key === key) {
678
+ d1.array.map((dd) => {
679
+ return dd(res);
680
+ });
681
+ return false;
682
+ }
683
+ else {
684
+ return true;
685
+ }
686
+ });
687
+ });
688
+ }
663
689
  });
664
690
  }
665
691
  static getUserGroupList(type, tag) {
@@ -760,6 +786,7 @@ export class ApiUser {
760
786
  });
761
787
  }
762
788
  }
789
+ ApiUser.getting_config = [];
763
790
  function getConfig() {
764
791
  const saasConfig = window.parent.saasConfig;
765
792
  return saasConfig;
@@ -1,9 +1,10 @@
1
- import { BaseApi } from '../../glitterBundle/api/base.js';
2
- import { GlobalUser } from '../global/global-user.js';
3
- import { ApiShop } from './shopping.js';
1
+ import {BaseApi} from '../../glitterBundle/api/base.js';
2
+ import {GlobalUser} from '../global/global-user.js';
3
+ import {ApiShop} from './shopping.js';
4
4
 
5
5
  export class ApiUser {
6
- constructor() {}
6
+ constructor() {
7
+ }
7
8
 
8
9
  public static register(json: { account: string; pwd: string; userData: any }) {
9
10
  return BaseApi.create({
@@ -112,6 +113,7 @@ export class ApiUser {
112
113
  },
113
114
  });
114
115
  }
116
+
115
117
  public static getPhoneCount(phone: string) {
116
118
  return BaseApi.create({
117
119
  url: getBaseUrl() + `/api-public/v1/user/check/phone/exists?phone=${phone}`,
@@ -174,6 +176,7 @@ export class ApiUser {
174
176
  },
175
177
  });
176
178
  }
179
+
177
180
  public static getUsersDataWithEmailOrPhone(search_s: string) {
178
181
  return BaseApi.create({
179
182
  url: getBaseUrl() + `/api-public/v1/user?search=${search_s}&type=email_or_phone`,
@@ -200,6 +203,7 @@ export class ApiUser {
200
203
  }),
201
204
  });
202
205
  }
206
+
203
207
  public static emailVerify(email: string, app_name?: string) {
204
208
  return BaseApi.create({
205
209
  url: getBaseUrl() + `/api-public/v1/user/email-verify`,
@@ -213,6 +217,7 @@ export class ApiUser {
213
217
  }),
214
218
  });
215
219
  }
220
+
216
221
  public static phoneVerify(phone_number: string) {
217
222
  return BaseApi.create({
218
223
  url: getBaseUrl() + `/api-public/v1/user/phone-verify`,
@@ -324,7 +329,13 @@ export class ApiUser {
324
329
  });
325
330
  }
326
331
 
327
- public static getUserList(json: { limit: number; page: number; search?: string; id?: string; search_type?: string }) {
332
+ public static getUserList(json: {
333
+ limit: number;
334
+ page: number;
335
+ search?: string;
336
+ id?: string;
337
+ search_type?: string
338
+ }) {
328
339
  return BaseApi.create({
329
340
  url:
330
341
  getBaseUrl() +
@@ -425,12 +436,14 @@ export class ApiUser {
425
436
  if (array.length > 0) {
426
437
  await new Promise((resolve, reject) => {
427
438
  let pass = 0;
439
+
428
440
  function checkPass() {
429
441
  pass++;
430
442
  if (pass === array.length) {
431
443
  resolve(true);
432
444
  }
433
445
  }
446
+
434
447
  for (let index = 0; index < array.length; index++) {
435
448
  function execute() {
436
449
  Promise.all([
@@ -471,6 +484,7 @@ export class ApiUser {
471
484
  checkPass();
472
485
  });
473
486
  }
487
+
474
488
  execute();
475
489
  }
476
490
  });
@@ -623,14 +637,14 @@ export class ApiUser {
623
637
  public static login(json: {
624
638
  app_name?: string;
625
639
  account?: string;
626
- user_id?:string;
640
+ user_id?: string;
627
641
  pwd?: string;
628
642
  login_type?: 'fb' | 'normal' | 'line' | 'google' | 'apple' | 'pin';
629
643
  google_token?: string;
630
644
  fb_token?: string;
631
645
  token?: string;
632
646
  line_token?: string;
633
- pin?:string;
647
+ pin?: string;
634
648
  redirect?: string;
635
649
  }) {
636
650
  return BaseApi.create({
@@ -639,7 +653,7 @@ export class ApiUser {
639
653
  headers: {
640
654
  'Content-Type': 'application/json',
641
655
  'g-app': json.app_name || getConfig().config.appName,
642
- Authorization:json.token
656
+ Authorization: json.token
643
657
  },
644
658
  data: JSON.stringify(json),
645
659
  });
@@ -660,7 +674,7 @@ export class ApiUser {
660
674
  public static setPublicConfig(cf: { key: string; value: any; user_id?: string; token?: string }) {
661
675
  (window as any).glitter.share._public_config = (window as any).glitter.share._public_config ?? {};
662
676
  const config = (window as any).glitter.share._public_config;
663
- config[cf.key + cf.user_id]=undefined;
677
+ config[cf.key + cf.user_id] = undefined;
664
678
  return BaseApi.create({
665
679
  url: getBaseUrl() + `/api-public/v1/user/public/config`,
666
680
  type: 'PUT',
@@ -677,6 +691,8 @@ export class ApiUser {
677
691
  });
678
692
  }
679
693
 
694
+ public static getting_config: { key: string, array: ((res: any) => void)[] }[] = []
695
+
680
696
  public static getPublicConfig(key: string, user_id: string, appName: string = getConfig().config.appName) {
681
697
  return new Promise<{ result: boolean; response: any }>((resolve, reject) => {
682
698
  (window as any).glitter.share._public_config = (window as any).glitter.share._public_config ?? {};
@@ -685,33 +701,60 @@ export class ApiUser {
685
701
  resolve(config[key + user_id]);
686
702
  return;
687
703
  }
688
- BaseApi.create({
689
- url: getBaseUrl() + `/api-public/v1/user/public/config?key=${key}&user_id=${user_id}`,
690
- type: 'GET',
691
- headers: {
692
- 'Content-Type': 'application/json',
693
- 'g-app': appName,
694
- Authorization: getConfig().config.token,
695
- },
696
- }).then((res) => {
704
+
705
+ function callback(res: any) {
697
706
  switch (key) {
698
707
  case 'collection':
699
708
  case 'footer-setting':
700
709
  case 'menu-setting':
701
710
  case 'message_setting':
702
- config[key + user_id] = res;
703
- break;
711
+ case 'promo-label':
712
+ //前台才有暫存功能
713
+ if ((window.parent as any).glitter.getUrlParameter('function') !== 'backend-manger') {
714
+ config[key + user_id] = res;
715
+ }
716
+ break
704
717
  case 'image-manager':
705
- if(!Array.isArray(res.response.value)){
706
- res.response.value=[]
718
+ if (!Array.isArray(res.response.value)) {
719
+ res.response.value = []
707
720
  }
708
721
  break
709
722
  }
710
- if(key.indexOf('alt_')===0){
723
+ if (key.indexOf('alt_') === 0) {
711
724
  config[key + user_id] = res;
712
725
  }
713
726
  resolve(res);
714
- });
727
+ }
728
+
729
+ const find_ = this.getting_config.find((dd) => {
730
+ return dd.key === key
731
+ })
732
+ if (find_) {
733
+ find_.array.push(callback)
734
+ } else {
735
+ this.getting_config.push({key: key, array: [callback]})
736
+ BaseApi.create({
737
+ url: getBaseUrl() + `/api-public/v1/user/public/config?key=${key}&user_id=${user_id}`,
738
+ type: 'GET',
739
+ headers: {
740
+ 'Content-Type': 'application/json',
741
+ 'g-app': appName,
742
+ Authorization: getConfig().config.token,
743
+ },
744
+ }).then((res) => {
745
+ this.getting_config = this.getting_config.filter((d1) => {
746
+ if (d1.key === key) {
747
+ d1.array.map((dd) => {
748
+ return dd(res)
749
+ })
750
+ return false
751
+ } else {
752
+ return true
753
+ }
754
+ })
755
+ });
756
+ }
757
+
715
758
  });
716
759
  }
717
760
 
@@ -757,7 +800,15 @@ export class ApiUser {
757
800
  return list;
758
801
  }
759
802
 
760
- public static getPermission(json: { page: number; limit: number; self?: boolean; queryType?: string; query?: string; orderBy?: string; filter?: any }) {
803
+ public static getPermission(json: {
804
+ page: number;
805
+ limit: number;
806
+ self?: boolean;
807
+ queryType?: string;
808
+ query?: string;
809
+ orderBy?: string;
810
+ filter?: any
811
+ }) {
761
812
  return BaseApi.create({
762
813
  url:
763
814
  getBaseUrl() +
@@ -788,10 +839,10 @@ export class ApiUser {
788
839
  title: string;
789
840
  phone: string;
790
841
  auth: any;
791
- member_id:any,
792
- pin:any,
793
- is_manager?:boolean
794
- support_shop?:string[]
842
+ member_id: any,
843
+ pin: any,
844
+ is_manager?: boolean
845
+ support_shop?: string[]
795
846
  };
796
847
  status: number;
797
848
  }) {
@@ -816,7 +867,7 @@ export class ApiUser {
816
867
  'Content-Type': 'application/json',
817
868
  Authorization: getConfig().config.token,
818
869
  },
819
- data: JSON.stringify({ email: email || '' }),
870
+ data: JSON.stringify({email: email || ''}),
820
871
  });
821
872
  }
822
873
 
@@ -829,7 +880,7 @@ export class ApiUser {
829
880
  'Content-Type': 'application/json',
830
881
  Authorization: getConfig().config.token,
831
882
  },
832
- data: JSON.stringify({ email: email }),
883
+ data: JSON.stringify({email: email}),
833
884
  });
834
885
  }
835
886
  }
@@ -1,4 +1,13 @@
1
1
  'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  import { Entry } from '../Entry.js';
3
12
  import { Glitter } from './Glitter.js';
4
13
  import { GVCType } from './module/PageManager.js';
@@ -25,6 +34,9 @@ function listenElementChange(query) {
25
34
  });
26
35
  observer.observe(targetElement, { childList: true, subtree: true });
27
36
  }
37
+ let alt_wait = [];
38
+ let alt_get_ed = [];
39
+ let alt_getter_timer = 0;
28
40
  function traverseHTML(element, document) {
29
41
  var _a, _b;
30
42
  try {
@@ -80,17 +92,40 @@ function traverseHTML(element, document) {
80
92
  if (src) {
81
93
  try {
82
94
  const tag = glitter.generateCheckSum(src, 9);
83
- setTimeout(() => {
84
- if (element) {
85
- ApiUser.getPublicConfig(`alt_` + tag, 'manager').then((res) => {
86
- if (res && res.response.value) {
87
- setTimeout(() => {
88
- element.setAttribute('alt', res.response.value.alt || '');
89
- }, 10);
95
+ alt_wait.push({
96
+ key: `alt_` + tag,
97
+ callback: (v) => {
98
+ try {
99
+ element.setAttribute('alt', v || '');
100
+ }
101
+ catch (e) {
102
+ }
103
+ }
104
+ });
105
+ clearInterval(alt_getter_timer);
106
+ alt_getter_timer = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
107
+ const wait_get_key = alt_wait.map((dd) => {
108
+ return dd.key;
109
+ }).filter((dd) => {
110
+ return !alt_get_ed.find((d1) => { return d1.key === dd; });
111
+ });
112
+ ApiUser.getPublicConfig(wait_get_key.concat('alt_00000').join(','), 'manager').then((res) => {
113
+ alt_get_ed = alt_get_ed.concat(res.response.value);
114
+ alt_wait = alt_wait.filter((d2) => {
115
+ var _a;
116
+ const get = alt_get_ed.find((d3) => {
117
+ return d3.key === d2.key;
118
+ });
119
+ if (get) {
120
+ d2.callback((_a = get.value.alt) !== null && _a !== void 0 ? _a : '');
121
+ return false;
122
+ }
123
+ else {
124
+ return true;
90
125
  }
91
126
  });
92
- }
93
- }, 10);
127
+ });
128
+ }), 10);
94
129
  }
95
130
  catch (e) {
96
131
  }
@@ -36,6 +36,13 @@ function listenElementChange(query: string) {
36
36
  observer.observe(targetElement, {childList: true, subtree: true});
37
37
  }
38
38
 
39
+ //等待取得的ALT
40
+ let alt_wait: { key: string, callback: (_v: string) => void }[] = []
41
+ //已取得的ALT
42
+ let alt_get_ed: {key: string, value: {alt:string}}[] = []
43
+ //ALT取得的Timer
44
+ let alt_getter_timer: any = 0
45
+
39
46
  function traverseHTML(element: any, document: any) {
40
47
  try {
41
48
  if (element.classList.contains('page-box')) {
@@ -91,23 +98,43 @@ function traverseHTML(element: any, document: any) {
91
98
  traverseHTML(children[j], document);
92
99
  }
93
100
  }
94
- if((element.tagName || '').toLowerCase() === 'img' ){
95
- const src=element.getAttribute('src');
96
- if(src){
101
+ if ((element.tagName || '').toLowerCase() === 'img') {
102
+ const src = element.getAttribute('src');
103
+ if (src) {
97
104
  try {
98
- const tag=glitter.generateCheckSum(src,9)
99
- setTimeout(()=>{
100
- if(element){
101
- ApiUser.getPublicConfig(`alt_`+tag,'manager').then((res)=>{
102
- if(res && res.response.value){
103
- setTimeout(()=>{
104
- element.setAttribute('alt', res.response.value.alt || '');
105
- },10)
105
+ const tag = glitter.generateCheckSum(src, 9)
106
+ alt_wait.push({
107
+ key: `alt_` + tag,
108
+ callback: (v) => {
109
+ try {
110
+ element.setAttribute('alt', v || '');
111
+ } catch (e) {
112
+ }
113
+ }
114
+ })
115
+ clearInterval(alt_getter_timer)
116
+ alt_getter_timer = setTimeout(async () => {
117
+ const wait_get_key = alt_wait.map((dd) => {
118
+ return dd.key
119
+ }).filter((dd)=>{
120
+ return !alt_get_ed.find((d1)=>{return d1.key===dd})
121
+ });
122
+ ApiUser.getPublicConfig(wait_get_key.concat('alt_00000').join(','), 'manager').then((res) => {
123
+ alt_get_ed=alt_get_ed.concat(res.response.value)
124
+ alt_wait=alt_wait.filter((d2)=>{
125
+ const get=alt_get_ed.find((d3)=>{
126
+ return d3.key===d2.key
127
+ })
128
+ if(get){
129
+ d2.callback(get.value.alt ?? '')
130
+ return false
131
+ }else{
132
+ return true
106
133
  }
107
134
  })
108
- }
109
- },10)
110
- }catch (e) {
135
+ })
136
+ }, 10)
137
+ } catch (e) {
111
138
 
112
139
  }
113
140
  }
@@ -198,7 +225,7 @@ function traverseHTML(element: any, document: any) {
198
225
  if (document.querySelector(`[gvc-id="${id}"]`) !== null) {
199
226
  document.querySelector(`[gvc-id="${id}"]`).wasRecreate = true;
200
227
  document.querySelector(`[gvc-id="${id}"]`).wasRender = false;
201
- if(!document.querySelector(`[gvc-id="${id}"]`).style.height){
228
+ if (!document.querySelector(`[gvc-id="${id}"]`).style.height) {
202
229
  const height = document.querySelector(`[gvc-id="${id}"]`).offsetHeight;
203
230
  if (height) {
204
231
  document.querySelector(`[gvc-id="${id}"]`).style.height = height + 'px';
@@ -77,7 +77,7 @@ export class ProductList {
77
77
  }
78
78
  }
79
79
  `);
80
- return html ` <div class="box-tag-${obj.tag} box-container-${text}">
80
+ return html ` <div class="box-tag-${obj.tag} box-container-${text} ${obj.openOnInit ? `open-box` : ''}">
81
81
  <div
82
82
  class="box-navbar-${text} ${(_a = obj.guideClass) !== null && _a !== void 0 ? _a : ''}"
83
83
  onclick="${obj.gvc.event((e) => {
@@ -134,7 +134,7 @@ export class ProductList {
134
134
  <button class="box-tag-${obj.tag} arrow-icon-${text}"></button>
135
135
  </div>
136
136
  </div>
137
- <div class="box-inside-${text} ${obj.guideClass ? `box-inside-${obj.guideClass}` : ''}">${obj.insideHTML}</div>
137
+ <div class="box-inside-${text} ${obj.guideClass ? `box-inside-${obj.guideClass}` : ''} " >${obj.insideHTML}</div>
138
138
  </div>`;
139
139
  }
140
140
  static spinner() {
@@ -389,15 +389,14 @@ export class ProductList {
389
389
  if (item.subCollections.length > 0) {
390
390
  for (const col of vm.collections) {
391
391
  if (item.subCollections.includes(col.title) && col.parentTitles[0] === item.title) {
392
- subHTML += html `<ul class="mt-1 pt-2 mx-n4 px-4 mb-n2 pb-2 box-item">
392
+ subHTML += html `<ul class="mt-1 pt-2 mx-n4 px-4 mb-n2 pb-2 box-item" style="${(decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]) === (col.code || col.title)) ? `background:#f5f5f5;` : ``}" onclick="${gvc.event(() => {
393
+ changePage(`collections/${col.code || col.title}`, 'page', {});
394
+ gvc.glitter.closeDrawer();
395
+ })}">
393
396
  <li style="font-weight: 500; line-height: 40px;">
394
397
  <div
395
398
  class="d-flex tx_700"
396
399
  style="color: ${fontColor};"
397
- onclick="${gvc.event(() => {
398
- changePage(`collections/${col.cod || col.title}`, 'page', {});
399
- gvc.glitter.closeDrawer();
400
- })}"
401
400
  >
402
401
  ${col.title}
403
402
  </div>
@@ -406,6 +405,10 @@ export class ProductList {
406
405
  }
407
406
  }
408
407
  }
408
+ console.log(`in--->`, [item.code].concat(vm.collections.filter((col) => {
409
+ return item.subCollections.includes(col.title) && col.parentTitles[0] === item.title;
410
+ })));
411
+ console.log(`in--->cludes->`, decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]));
409
412
  return html ` <li
410
413
  class="${index + 1 === cols.length ? '' : 'border-bottom'}"
411
414
  style="${item.subCollections.length > 0 ? '' : 'padding: 16px;'} cursor: pointer;"
@@ -420,6 +423,11 @@ export class ProductList {
420
423
  length: item.subCollections.length,
421
424
  changePage,
422
425
  fontColor,
426
+ openOnInit: [item.code].concat(vm.collections.filter((col) => {
427
+ return item.subCollections.includes(col.title) && col.parentTitles[0] === item.title;
428
+ }).map((dd) => {
429
+ return dd.code || dd.title;
430
+ })).includes(decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]))
423
431
  })
424
432
  : html `<div
425
433
  class="d-flex tx_700"
@@ -117,7 +117,7 @@ export class ProductList {
117
117
  }
118
118
  }
119
119
  `);
120
- return html` <div class="box-tag-${obj.tag} box-container-${text}">
120
+ return html` <div class="box-tag-${obj.tag} box-container-${text} ${obj.openOnInit ? `open-box`:''}">
121
121
  <div
122
122
  class="box-navbar-${text} ${obj.guideClass ?? ''}"
123
123
  onclick="${obj.gvc.event((e) => {
@@ -134,11 +134,9 @@ export class ProductList {
134
134
  }
135
135
  });
136
136
  }
137
-
138
137
  setTimeout(() => {
139
138
  e.parentElement.classList.toggle('open-box');
140
139
  e.parentElement.querySelector(`.arrow-icon-${text}`).classList.toggle('open-box');
141
-
142
140
  const container = window.document.querySelector(`.box-container-${text}`) as any;
143
141
  if (e.parentElement.classList.contains('open-box')) {
144
142
  const si = setInterval(() => {
@@ -174,7 +172,7 @@ export class ProductList {
174
172
  <button class="box-tag-${obj.tag} arrow-icon-${text}"></button>
175
173
  </div>
176
174
  </div>
177
- <div class="box-inside-${text} ${obj.guideClass ? `box-inside-${obj.guideClass}` : ''}">${obj.insideHTML}</div>
175
+ <div class="box-inside-${text} ${obj.guideClass ? `box-inside-${obj.guideClass}` : ''} " >${obj.insideHTML}</div>
178
176
  </div>`;
179
177
  }
180
178
 
@@ -560,17 +558,17 @@ export class ProductList {
560
558
  .map((item: any, index: number) => {
561
559
  let subHTML = '';
562
560
  if (item.subCollections.length > 0) {
561
+
563
562
  for (const col of vm.collections) {
564
563
  if (item.subCollections.includes(col.title) && col.parentTitles[0] === item.title) {
565
- subHTML += html`<ul class="mt-1 pt-2 mx-n4 px-4 mb-n2 pb-2 box-item">
564
+ subHTML += html`<ul class="mt-1 pt-2 mx-n4 px-4 mb-n2 pb-2 box-item" style="${(decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0])===(col.code || col.title)) ? `background:#f5f5f5;`:``}" onclick="${gvc.event(() => {
565
+ changePage(`collections/${col.code || col.title}` , 'page', {});
566
+ gvc.glitter.closeDrawer();
567
+ })}">
566
568
  <li style="font-weight: 500; line-height: 40px;">
567
569
  <div
568
570
  class="d-flex tx_700"
569
571
  style="color: ${fontColor};"
570
- onclick="${gvc.event(() => {
571
- changePage(`collections/${col.cod || col.title}` , 'page', {});
572
- gvc.glitter.closeDrawer();
573
- })}"
574
572
  >
575
573
  ${col.title}
576
574
  </div>
@@ -579,6 +577,10 @@ export class ProductList {
579
577
  }
580
578
  }
581
579
  }
580
+ console.log(`in--->`,[item.code].concat( vm.collections.filter((col:any)=>{
581
+ return item.subCollections.includes(col.title) && col.parentTitles[0] === item.title
582
+ })))
583
+ console.log(`in--->cludes->`,decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]))
582
584
  return html` <li
583
585
  class="${index + 1 === cols.length ? '' : 'border-bottom'}"
584
586
  style="${item.subCollections.length > 0 ? '' : 'padding: 16px;'} cursor: pointer;"
@@ -593,11 +595,17 @@ export class ProductList {
593
595
  length: item.subCollections.length,
594
596
  changePage,
595
597
  fontColor,
598
+ openOnInit:[item.code].concat( vm.collections.filter((col:any)=>{
599
+ return item.subCollections.includes(col.title) && col.parentTitles[0] === item.title
600
+ }).map((dd:any)=>{
601
+ return dd.code || dd.title
602
+ })).includes(decodeURIComponent((glitter.getUrlParameter('page') || '').split('/').reverse()[0]))
596
603
  })
597
604
  : html`<div
598
605
  class="d-flex tx_700"
599
606
  style="color: ${fontColor};"
600
607
  onclick="${gvc.event(() => {
608
+
601
609
  changePage('collections/' + item.code, 'page', {});
602
610
  gvc.glitter.closeDrawer();
603
611
  })}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "17.0.2",
3
+ "version": "17.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {