ts-glitter 13.4.7 → 13.5.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 (198) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -2
  3. package/lowcode/backend-manager/bg-blog.js +573 -590
  4. package/lowcode/backend-manager/bg-blog.ts +884 -915
  5. package/lowcode/backend-manager/bg-graph-api.js +3 -3
  6. package/lowcode/backend-manager/bg-graph-api.ts +3 -5
  7. package/lowcode/backend-manager/bg-guide.js +69 -24
  8. package/lowcode/backend-manager/bg-guide.ts +82 -27
  9. package/lowcode/backend-manager/bg-line.js +18 -18
  10. package/lowcode/backend-manager/bg-line.ts +18 -35
  11. package/lowcode/backend-manager/bg-notify.js +18 -18
  12. package/lowcode/backend-manager/bg-notify.ts +18 -34
  13. package/lowcode/backend-manager/bg-project.js +11 -11
  14. package/lowcode/backend-manager/bg-project.ts +11 -20
  15. package/lowcode/backend-manager/bg-recommend.js +656 -652
  16. package/lowcode/backend-manager/bg-recommend.ts +31 -40
  17. package/lowcode/backend-manager/bg-seo.js +25 -20
  18. package/lowcode/backend-manager/bg-seo.ts +121 -105
  19. package/lowcode/backend-manager/bg-shopping.js +14 -14
  20. package/lowcode/backend-manager/bg-shopping.ts +14 -25
  21. package/lowcode/backend-manager/bg-sns.js +18 -18
  22. package/lowcode/backend-manager/bg-sns.ts +18 -34
  23. package/lowcode/backend-manager/bg-wallet.js +5 -5
  24. package/lowcode/backend-manager/bg-wallet.ts +5 -7
  25. package/lowcode/backend-manager/bg-widget.js +25 -14
  26. package/lowcode/backend-manager/bg-widget.ts +43 -17
  27. package/lowcode/cms-plugin/ai-points-list.js +54 -57
  28. package/lowcode/cms-plugin/ai-points-list.ts +55 -63
  29. package/lowcode/cms-plugin/ai-points.js +2 -2
  30. package/lowcode/cms-plugin/ai-points.ts +2 -4
  31. package/lowcode/cms-plugin/app-release.js +45 -46
  32. package/lowcode/cms-plugin/app-release.ts +221 -209
  33. package/lowcode/cms-plugin/auto-reply.js +3 -3
  34. package/lowcode/cms-plugin/auto-reply.ts +3 -5
  35. package/lowcode/cms-plugin/form-setting.js +6 -6
  36. package/lowcode/cms-plugin/form-setting.ts +6 -10
  37. package/lowcode/cms-plugin/line-auto-reply.js +3 -3
  38. package/lowcode/cms-plugin/line-auto-reply.ts +3 -5
  39. package/lowcode/cms-plugin/member-group-list.js +2 -2
  40. package/lowcode/cms-plugin/member-group-list.ts +2 -3
  41. package/lowcode/cms-plugin/member-setting.js +75 -88
  42. package/lowcode/cms-plugin/member-setting.ts +143 -157
  43. package/lowcode/cms-plugin/member-type-list.js +243 -240
  44. package/lowcode/cms-plugin/member-type-list.ts +14 -19
  45. package/lowcode/cms-plugin/menus-setting.js +2 -2
  46. package/lowcode/cms-plugin/menus-setting.ts +2 -4
  47. package/lowcode/cms-plugin/permission-setting.js +17 -18
  48. package/lowcode/cms-plugin/permission-setting.ts +145 -147
  49. package/lowcode/cms-plugin/pos-checkout-setting.js +7 -10
  50. package/lowcode/cms-plugin/pos-checkout-setting.ts +174 -179
  51. package/lowcode/cms-plugin/shopping-collections.js +224 -218
  52. package/lowcode/cms-plugin/shopping-collections.ts +152 -153
  53. package/lowcode/cms-plugin/shopping-discount-setting.js +855 -852
  54. package/lowcode/cms-plugin/shopping-discount-setting.ts +14 -18
  55. package/lowcode/cms-plugin/shopping-finance-setting.js +259 -265
  56. package/lowcode/cms-plugin/shopping-finance-setting.ts +273 -284
  57. package/lowcode/cms-plugin/shopping-order-manager.js +520 -497
  58. package/lowcode/cms-plugin/shopping-order-manager.ts +347 -325
  59. package/lowcode/cms-plugin/shopping-order-return.js +10 -9
  60. package/lowcode/cms-plugin/shopping-order-return.ts +23 -27
  61. package/lowcode/cms-plugin/shopping-product-setting.js +1079 -1055
  62. package/lowcode/cms-plugin/shopping-product-setting.ts +348 -337
  63. package/lowcode/cms-plugin/shopping-product-stock.js +2 -2
  64. package/lowcode/cms-plugin/shopping-product-stock.ts +2 -3
  65. package/lowcode/cms-plugin/shopping-product-text.js +32 -36
  66. package/lowcode/cms-plugin/shopping-product-text.ts +78 -81
  67. package/lowcode/cms-plugin/shopping-rebate-setting.js +321 -316
  68. package/lowcode/cms-plugin/shopping-rebate-setting.ts +15 -17
  69. package/lowcode/cms-plugin/shopping-rebate.js +102 -59
  70. package/lowcode/cms-plugin/shopping-rebate.ts +110 -71
  71. package/lowcode/cms-plugin/shopping-shipment-setting.js +382 -426
  72. package/lowcode/cms-plugin/shopping-shipment-setting.ts +489 -531
  73. package/lowcode/cms-plugin/sms-points.js +2 -2
  74. package/lowcode/cms-plugin/sms-points.ts +2 -4
  75. package/lowcode/cms-plugin/sns-auto-reply.js +3 -3
  76. package/lowcode/cms-plugin/sns-auto-reply.ts +3 -5
  77. package/lowcode/cms-plugin/third-party-apple.js +22 -28
  78. package/lowcode/cms-plugin/third-party-apple.ts +189 -191
  79. package/lowcode/cms-plugin/third-party-facebook.js +31 -32
  80. package/lowcode/cms-plugin/third-party-facebook.ts +240 -234
  81. package/lowcode/cms-plugin/third-party-google.js +33 -29
  82. package/lowcode/cms-plugin/third-party-google.ts +216 -202
  83. package/lowcode/cms-plugin/third-party-line.js +19 -22
  84. package/lowcode/cms-plugin/third-party-line.ts +166 -162
  85. package/lowcode/cms-plugin/user-list.js +449 -441
  86. package/lowcode/cms-plugin/user-list.ts +63 -65
  87. package/lowcode/cms-plugin/user-login-setting.js +2 -2
  88. package/lowcode/cms-plugin/user-login-setting.ts +2 -5
  89. package/lowcode/cms-plugin/wallet-list.js +5 -5
  90. package/lowcode/cms-plugin/wallet-list.ts +5 -7
  91. package/lowcode/cms-plugin/web-config-setting.js +5 -5
  92. package/lowcode/cms-plugin/web-config-setting.ts +5 -8
  93. package/lowcode/cms-plugin/widget-manager.js +1 -1
  94. package/lowcode/cms-plugin/widget-manager.ts +1 -2
  95. package/lowcode/css/editor.css +12 -1
  96. package/lowcode/form-view/editor/array-items.js +1 -1
  97. package/lowcode/form-view/editor/array-items.ts +1 -1
  98. package/lowcode/form-view/editor/color-selector.ts +1 -1
  99. package/lowcode/glitter-base/route/shopping.js +17 -0
  100. package/lowcode/glitter-base/route/shopping.ts +17 -0
  101. package/lowcode/glitter-base/route/user.js +2 -2
  102. package/lowcode/glitter-base/route/user.ts +26 -27
  103. package/lowcode/glitterBundle/Glitter.js +10 -3
  104. package/lowcode/glitterBundle/Glitter.ts +10 -3
  105. package/lowcode/jspage/editor.js +16 -10
  106. package/lowcode/jspage/editor.ts +17 -11
  107. package/lowcode/jspage/function-page/server-editor/router/api-manager.js +4 -4
  108. package/lowcode/jspage/function-page/server-editor/router/api-manager.ts +4 -6
  109. package/lowcode/jspage/function-page/server-editor/router/database.js +8 -8
  110. package/lowcode/jspage/function-page/server-editor/router/database.ts +53 -48
  111. package/lowcode/jspage/function-page/server-editor/router/domain-manager.js +2 -2
  112. package/lowcode/jspage/function-page/server-editor/router/domain-manager.ts +2 -3
  113. package/lowcode/jspage/function-page/server-editor/router/server-status.js +50 -38
  114. package/lowcode/jspage/function-page/server-editor/router/server-status.ts +93 -76
  115. package/lowcode/jspage/main.js +61 -29
  116. package/lowcode/jspage/main.ts +99 -56
  117. package/lowcode/official_view_component/official/form.js +110 -78
  118. package/lowcode/official_view_component/official/form.ts +238 -192
  119. package/lowcode/view-model/saas-view-model.js +454 -285
  120. package/lowcode/view-model/saas-view-model.ts +917 -722
  121. package/package.json +1 -1
  122. package/src/api-public/controllers/ai-points.js.map +1 -1
  123. package/src/api-public/controllers/article.js +3 -0
  124. package/src/api-public/controllers/article.js.map +1 -1
  125. package/src/api-public/controllers/article.ts +3 -0
  126. package/src/api-public/controllers/chat.js.map +1 -1
  127. package/src/api-public/controllers/delivery.js.map +1 -1
  128. package/src/api-public/controllers/fb-message.js.map +1 -1
  129. package/src/api-public/controllers/index.js.map +1 -1
  130. package/src/api-public/controllers/invoice.js.map +1 -1
  131. package/src/api-public/controllers/line-message.js.map +1 -1
  132. package/src/api-public/controllers/oauth.js.map +1 -1
  133. package/src/api-public/controllers/rebate.js.map +1 -1
  134. package/src/api-public/controllers/recommend.js.map +1 -1
  135. package/src/api-public/controllers/sms-points.js.map +1 -1
  136. package/src/api-public/controllers/wallet.js.map +1 -1
  137. package/src/api-public/services/EcInvoice.js.map +1 -1
  138. package/src/api-public/services/ai-pointes.js.map +1 -1
  139. package/src/api-public/services/article.js.map +1 -1
  140. package/src/api-public/services/auto-send-email.js.map +1 -1
  141. package/src/api-public/services/delivery.js.map +1 -1
  142. package/src/api-public/services/ezpay/tool.d.ts +0 -1
  143. package/src/api-public/services/ezpay/tool.js.map +1 -1
  144. package/src/api-public/services/fake-data-model/fake-product.js.map +1 -1
  145. package/src/api-public/services/fb-message.js.map +1 -5
  146. package/src/api-public/services/filter-protect-data.js.map +1 -1
  147. package/src/api-public/services/financial-service.js.map +1 -1
  148. package/src/api-public/services/graph-api.js.map +1 -1
  149. package/src/api-public/services/invoice.js.map +1 -1
  150. package/src/api-public/services/monitor.d.ts +0 -1
  151. package/src/api-public/services/monitor.js.map +1 -1
  152. package/src/api-public/services/public-table-check.js.map +1 -1
  153. package/src/api-public/services/rebate.js.map +1 -1
  154. package/src/api-public/services/recommend.js.map +1 -1
  155. package/src/api-public/services/share-permission.js.map +1 -1
  156. package/src/api-public/services/shopping.d.ts +1 -1
  157. package/src/api-public/services/shopping.js +44 -36
  158. package/src/api-public/services/shopping.js.map +1 -1
  159. package/src/api-public/services/shopping.ts +184 -183
  160. package/src/api-public/services/sms-pointes.js.map +1 -1
  161. package/src/api-public/services/sms.js.map +1 -1
  162. package/src/api-public/services/wallet.js.map +1 -1
  163. package/src/api-public/services/workers.d.ts +1 -1
  164. package/src/api-public/utils/ut-database.js.map +1 -1
  165. package/src/app-project/serverless/src/controllers/index.js.map +1 -1
  166. package/src/app-project/serverless/src/controllers/sample.js.map +1 -1
  167. package/src/app-project/serverless/src/modules/database.d.ts +1 -2
  168. package/src/app-project/serverless/src/modules/database.js.map +1 -1
  169. package/src/app-project/serverless/src/modules/exception.js.map +1 -1
  170. package/src/app-project/serverless/src/modules/hooks.js.map +1 -1
  171. package/src/app-project/serverless/src/modules/logger.js.map +1 -1
  172. package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
  173. package/src/app-project/serverless/src/modules/redis.js.map +1 -1
  174. package/src/app-project/serverless/src/modules/response.js.map +1 -1
  175. package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
  176. package/src/config.js.map +1 -5
  177. package/src/controllers/ai.js.map +1 -1
  178. package/src/controllers/global-event.js.map +1 -1
  179. package/src/controllers/page.js.map +1 -1
  180. package/src/controllers/private_config.js.map +1 -1
  181. package/src/export/export-test.js.map +1 -1
  182. package/src/firebase/message.js +1 -2
  183. package/src/firebase/message.js.map +1 -1
  184. package/src/helper/app_creater.js +1 -2
  185. package/src/helper/app_creater.js.map +1 -1
  186. package/src/helper/glitter-util.d.ts +0 -1
  187. package/src/helper/glitter-util.js.map +1 -1
  188. package/src/lambda/interface.d.ts +1 -1
  189. package/src/lambda/interface.js +2 -2
  190. package/src/lambda/interface.js.map +1 -1
  191. package/src/modules/exception.js.map +1 -1
  192. package/src/modules/hooks.js.map +1 -1
  193. package/src/modules/response.js.map +1 -1
  194. package/src/modules/ssh.js.map +1 -1
  195. package/src/services/ses.js +1 -2
  196. package/src/services/ses.js.map +1 -1
  197. package/src/services/system-schedule.js.map +1 -1
  198. package/g1b90plcfb.csv +0 -1289
@@ -122,7 +122,7 @@ export class BgGraphApi {
122
122
  ],
123
123
  }),
124
124
  ].join('')))}
125
- `, BgWidget.getContainerWidth());
125
+ `);
126
126
  case 'replace':
127
127
  return BgGraphApi.editor({
128
128
  gvc: gvc,
@@ -155,7 +155,7 @@ export class BgGraphApi {
155
155
  bind: id,
156
156
  view: () => {
157
157
  return BgWidget.container(html `
158
- <div class="d-flex align-items-center">
158
+ <div class="title-container">
159
159
  ${BgWidget.goBack(obj.gvc.event(() => {
160
160
  obj.vm.status = 'list';
161
161
  }))}
@@ -236,7 +236,7 @@ export class BgGraphApi {
236
236
  }),
237
237
  ].join(`<div class="my-2"></div>`)}`))}
238
238
  ${BgWidget.mbContainer(120)}
239
- `, BgWidget.getContainerWidth({ rate: { web: 0.6 } }));
239
+ `);
240
240
  },
241
241
  };
242
242
  });
@@ -141,8 +141,7 @@ export class BgGraphApi {
141
141
  ].join('')
142
142
  )
143
143
  )}
144
- `,
145
- BgWidget.getContainerWidth()
144
+ `
146
145
  );
147
146
  case 'replace':
148
147
  return BgGraphApi.editor({
@@ -193,7 +192,7 @@ export class BgGraphApi {
193
192
  view: () => {
194
193
  return BgWidget.container(
195
194
  html`
196
- <div class="d-flex align-items-center">
195
+ <div class="title-container">
197
196
  ${BgWidget.goBack(
198
197
  obj.gvc.event(() => {
199
198
  obj.vm.status = 'list';
@@ -281,8 +280,7 @@ export class BgGraphApi {
281
280
  )
282
281
  )}
283
282
  ${BgWidget.mbContainer(120)}
284
- `,
285
- BgWidget.getContainerWidth({ rate: { web: 0.6 } })
283
+ `
286
284
  );
287
285
  },
288
286
  };
@@ -1,7 +1,8 @@
1
1
  import { ApiShop } from '../glitter-base/route/shopping.js';
2
+ import { ShareDialog } from "../dialog/ShareDialog.js";
2
3
  const html = String.raw;
3
4
  export class BgGuide {
4
- constructor(gvc, guide, type = 'backend-manger') {
5
+ constructor(gvc, guide, type = 'backend-manger', step = 0) {
5
6
  this.uiGuidePage = [
6
7
  {
7
8
  value: 'init',
@@ -94,7 +95,7 @@ export class BgGuide {
94
95
  this.guide = guide;
95
96
  this.gvc = gvc;
96
97
  this.type = type;
97
- this.step = 0;
98
+ this.step = step;
98
99
  }
99
100
  detectClickThrough(target, clickEvent) {
100
101
  target.classList.add('guideClickListen');
@@ -177,7 +178,8 @@ export class BgGuide {
177
178
  return data.value === key;
178
179
  });
179
180
  target.finished = true;
180
- ApiShop.setGuide(dataList);
181
+ ApiShop.setGuide(dataList).then(r => {
182
+ });
181
183
  });
182
184
  }
183
185
  drawMainRowBG(BG, vm, targetSelector, viewID, step, title) {
@@ -237,9 +239,12 @@ export class BgGuide {
237
239
  drawSecondRowBG(BG, vm, targetSelector, viewID, title, step) {
238
240
  BG.style.clipPath = ``;
239
241
  const gvc = this.gvc;
240
- const target = document.querySelector(targetSelector);
241
- const rect = target ? target.getBoundingClientRect() : '';
242
+ let target = document.querySelector(targetSelector);
243
+ let rect = target ? target.getBoundingClientRect() : '';
242
244
  if (rect) {
245
+ target.scrollIntoView();
246
+ target = document.querySelector(targetSelector);
247
+ rect = target.getBoundingClientRect();
243
248
  BG.style.clipPath = `polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 ${rect.bottom}px, ${rect.right}px ${rect.bottom}px, ${rect.right}px ${rect.top}px, 0 ${rect.top}px)`;
244
249
  this.detectClickThrough(target, () => {
245
250
  vm.step = 3;
@@ -762,8 +767,8 @@ export class BgGuide {
762
767
  `);
763
768
  this.detectClickThrough(target, () => {
764
769
  close();
765
- this.leaveGuide(vm, 1);
766
770
  this.finGuide(key);
771
+ this.leaveGuide(vm, 0);
767
772
  });
768
773
  return html `
769
774
  <div class="d-flex flex-column"
@@ -1024,6 +1029,8 @@ export class BgGuide {
1024
1029
  };
1025
1030
  const that = this;
1026
1031
  let totalStep = 8;
1032
+ let layer2Delay = true;
1033
+ let themeNumbers = 0;
1027
1034
  return gvc.bindView({
1028
1035
  bind: 'layoutInit',
1029
1036
  dataList: [],
@@ -1065,6 +1072,16 @@ export class BgGuide {
1065
1072
  `);
1066
1073
  switch (vm.step) {
1067
1074
  case 2: {
1075
+ let target = document.querySelector('.guide7-2');
1076
+ if (layer2Delay) {
1077
+ const timer = setInterval(() => {
1078
+ layer2Delay = false;
1079
+ clearInterval(timer);
1080
+ target.scrollIntoView();
1081
+ gvc.notifyDataChange(viewID);
1082
+ }, 300);
1083
+ return ``;
1084
+ }
1068
1085
  return this.drawSecondRowBG(BG, vm, `.guide7-2`, viewID, '佈景主題', totalStep);
1069
1086
  }
1070
1087
  case 3: {
@@ -1097,7 +1114,7 @@ export class BgGuide {
1097
1114
  clearInterval(timer);
1098
1115
  gvc.notifyDataChange(viewID);
1099
1116
  }
1100
- }, 400);
1117
+ }, 600);
1101
1118
  }
1102
1119
  let content = html `
1103
1120
  <div class="d-flex flex-wrap"
@@ -1166,10 +1183,15 @@ export class BgGuide {
1166
1183
  height: 261,
1167
1184
  title: '選擇主題',
1168
1185
  content: content,
1186
+ next: true
1169
1187
  });
1170
1188
  }
1171
1189
  case 7: {
1172
1190
  let target = this.findIframeDom(`.guide8-5`);
1191
+ let themeRow = this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow');
1192
+ if (themeNumbers == 0) {
1193
+ themeNumbers = themeRow.length;
1194
+ }
1173
1195
  if (!target) {
1174
1196
  const timer = setInterval(() => {
1175
1197
  if (this.findIframeDom(`.guide8-5`)) {
@@ -1178,6 +1200,14 @@ export class BgGuide {
1178
1200
  }
1179
1201
  }, 400);
1180
1202
  }
1203
+ if (themeNumbers == this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow').length) {
1204
+ const timer = setInterval(() => {
1205
+ if (themeNumbers != this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow').length) {
1206
+ clearInterval(timer);
1207
+ gvc.notifyDataChange(viewID);
1208
+ }
1209
+ }, 400);
1210
+ }
1181
1211
  target.scrollIntoView();
1182
1212
  let content = html `
1183
1213
  <div class=""
@@ -1798,9 +1828,9 @@ export class BgGuide {
1798
1828
  </div>
1799
1829
  <div
1800
1830
  class="d-flex flex-column w-100"
1801
- style="background: #FFF;width:100%;padding: 18px 24px;border-radius: 0 0 10px 10px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.64px;"
1831
+ style="white-space: normal;background: #FFF;width:100%;padding: 18px 24px;border-radius: 0 0 10px 10px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.64px;"
1802
1832
  >
1803
- 開啟您要使用的配送方式
1833
+ 根據商品的特性決定運費要依照「材積」還是「重量」計算,靈活選擇每個商品的運費計算方式。
1804
1834
  <div class="d-flex align-items-center justify-content-between"
1805
1835
  style="margin-top: 24px;height:52px;">
1806
1836
  <div
@@ -1840,25 +1870,26 @@ export class BgGuide {
1840
1870
  });
1841
1871
  }
1842
1872
  case 5: {
1873
+ this.detectClickThrough(this.findIframeDom('.guide4-5'), () => {
1874
+ vm.step++;
1875
+ setTimeout(() => {
1876
+ gvc.notifyDataChange('logisticsInit');
1877
+ }, 200);
1878
+ });
1843
1879
  return this.drawBGwithBelowWindow(BG, vm, '.guide4-5', 'logisticsInit', 5, 8, {
1844
1880
  width: 332,
1845
1881
  height: 209,
1846
1882
  title: '新增計算區間',
1883
+ next: true,
1847
1884
  content: '點擊藍字即可新增一個計算區間',
1848
1885
  });
1849
1886
  }
1850
1887
  case 6: {
1851
- let target = this.findIframeDom('.guide4-6');
1852
- const handleClick = (event) => {
1853
- this.eventSet = this.eventSet.filter((d) => {
1854
- return d !== handleClick;
1855
- });
1856
- target.removeEventListener('click', handleClick);
1857
- return;
1858
- };
1859
- target.addEventListener('click', handleClick);
1860
- this.eventSet.push(() => {
1861
- target.removeEventListener('click', handleClick);
1888
+ let target = this.findPageIframe().contentWindow.document.querySelectorAll('.guide4-6');
1889
+ target = target[target.length - 1];
1890
+ this.detectClickThrough(target, () => {
1891
+ vm.step++;
1892
+ gvc.notifyDataChange('logisticsInit');
1862
1893
  });
1863
1894
  let content = html `
1864
1895
  <div class="d-flex align-items-center" style="">
@@ -1993,6 +2024,7 @@ export class BgGuide {
1993
2024
  }
1994
2025
  }, 500);
1995
2026
  }
2027
+ target.scrollIntoView();
1996
2028
  let rect = target.getBoundingClientRect();
1997
2029
  let left = rect.left + iframeRect.left;
1998
2030
  let top = rect.top + iframeRect.top;
@@ -2312,9 +2344,17 @@ export class BgGuide {
2312
2344
  }
2313
2345
  }, 400);
2314
2346
  }
2347
+ if (target.querySelector('.open-box')) {
2348
+ target.click();
2349
+ let timer2 = setInterval(() => {
2350
+ clearInterval(timer2);
2351
+ gvc.notifyDataChange(viewID);
2352
+ }, 500);
2353
+ return ``;
2354
+ }
2315
2355
  this.detectClickThrough(target, () => {
2316
2356
  BG.classList.remove('guide2-4');
2317
- vm.step++;
2357
+ vm.step = 5;
2318
2358
  gvc.notifyDataChange(`financeInit`);
2319
2359
  });
2320
2360
  target.parentElement.parentElement.scrollIntoView();
@@ -2474,9 +2514,9 @@ export class BgGuide {
2474
2514
  close();
2475
2515
  setTimeout(() => {
2476
2516
  this.findIframeDom('.guide2-4').scrollIntoView({});
2477
- vm.step--;
2517
+ vm.step = 4;
2478
2518
  gvc.notifyDataChange('financeInit');
2479
- }, 400);
2519
+ }, 600);
2480
2520
  })}"
2481
2521
  >
2482
2522
  上一步
@@ -2542,6 +2582,7 @@ export class BgGuide {
2542
2582
  bind: 'init',
2543
2583
  dataList: [{ key: 'step', obj: vm }],
2544
2584
  view: () => {
2585
+ console.log(" vm.progress -- ", vm.progress);
2545
2586
  if (vm.progress.length == 0) {
2546
2587
  ApiShop.getGuide().then((r) => {
2547
2588
  vm.progress = r.response.value;
@@ -2720,6 +2761,9 @@ export class BgGuide {
2720
2761
  `;
2721
2762
  }
2722
2763
  case 0: {
2764
+ if (vm.progress.length == 0) {
2765
+ let dialog = new ShareDialog(gvc.glitter);
2766
+ }
2723
2767
  return html `
2724
2768
  <div class="d-flex flex-column"
2725
2769
  style="width:588px;border-radius: 10px;background-color: white;">
@@ -3828,6 +3872,7 @@ export class BgGuide {
3828
3872
  ApiShop.getEditorGuide().then(r => {
3829
3873
  r.response.value.find((element) => element.title == "頁面編輯").finish = true;
3830
3874
  ApiShop.setEditorGuide(r.response.value);
3875
+ this.leaveGuide(vm, 1);
3831
3876
  });
3832
3877
  }
3833
3878
  });
@@ -3863,8 +3908,8 @@ export class BgGuide {
3863
3908
  case 1: {
3864
3909
  const className = 'guide-user-editor-11';
3865
3910
  let clickTarget = document.querySelector(`.${className}-icon`);
3866
- clickTarget.click();
3867
3911
  if (!document.querySelector(`.${className}`)) {
3912
+ clickTarget.click();
3868
3913
  const timer = setInterval(() => {
3869
3914
  if (document.querySelector(`.${className}`)) {
3870
3915
  clearInterval(timer);
@@ -1,6 +1,7 @@
1
1
  import {GVC} from '../glitterBundle/GVController.js';
2
2
  import {ApiShop} from '../glitter-base/route/shopping.js';
3
3
  import {all} from 'underscore/index.js';
4
+ import {ShareDialog} from "../dialog/ShareDialog.js";
4
5
 
5
6
  const html = String.raw;
6
7
 
@@ -99,11 +100,11 @@ export class BgGuide {
99
100
  ];
100
101
  private eventSet: any = [];
101
102
 
102
- constructor(gvc: GVC, guide: number, type: string = 'backend-manger') {
103
+ constructor(gvc: GVC, guide: number, type: string = 'backend-manger' , step: number = 0) {
103
104
  this.guide = guide;
104
105
  this.gvc = gvc;
105
106
  this.type = type;
106
- this.step = 0;
107
+ this.step = step;
107
108
  }
108
109
 
109
110
  public detectClickThrough(target: any, clickEvent: () => void) {
@@ -214,7 +215,10 @@ export class BgGuide {
214
215
  return data.value === key;
215
216
  });
216
217
  target.finished = true;
217
- ApiShop.setGuide(dataList);
218
+
219
+ ApiShop.setGuide(dataList).then(r => {
220
+
221
+ });
218
222
  });
219
223
  }
220
224
 
@@ -278,9 +282,12 @@ export class BgGuide {
278
282
  private drawSecondRowBG(BG: HTMLElement, vm: any, targetSelector: string, viewID: string, title: string, step: number) {
279
283
  BG.style.clipPath = ``;
280
284
  const gvc = this.gvc;
281
- const target = document.querySelector(targetSelector) as HTMLElement;
282
- const rect = target ? target!.getBoundingClientRect() : '';
285
+ let target = document.querySelector(targetSelector) as HTMLElement;
286
+ let rect = target ? target!.getBoundingClientRect() : '';
283
287
  if (rect) {
288
+ target.scrollIntoView();
289
+ target = document.querySelector(targetSelector) as HTMLElement;
290
+ rect = target!.getBoundingClientRect();
284
291
  BG.style.clipPath = `polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 ${rect.bottom}px, ${rect.right}px ${rect.bottom}px, ${rect.right}px ${rect.top}px, 0 ${rect.top}px)`;
285
292
  this.detectClickThrough(target, () => {
286
293
  vm.step = 3;
@@ -895,8 +902,8 @@ export class BgGuide {
895
902
  `);
896
903
  this.detectClickThrough(target, () => {
897
904
  close();
898
- this.leaveGuide(vm, 1);
899
905
  this.finGuide(key);
906
+ this.leaveGuide(vm, 0);
900
907
  });
901
908
  return html`
902
909
  <div class="d-flex flex-column"
@@ -1188,6 +1195,8 @@ export class BgGuide {
1188
1195
  };
1189
1196
  const that = this;
1190
1197
  let totalStep = 8;
1198
+ let layer2Delay = true;
1199
+ let themeNumbers = 0;
1191
1200
  return gvc.bindView({
1192
1201
  bind: 'layoutInit',
1193
1202
  dataList: [],
@@ -1195,6 +1204,7 @@ export class BgGuide {
1195
1204
  let viewID = 'layoutInit';
1196
1205
  let iframe = this.findPageIframe();
1197
1206
 
1207
+
1198
1208
  const BG = document.querySelector(`.guide-BG`) as HTMLElement;
1199
1209
  gvc.addStyle(`
1200
1210
  .breathing-light {
@@ -1230,6 +1240,18 @@ export class BgGuide {
1230
1240
  `);
1231
1241
  switch (vm.step) {
1232
1242
  case 2: {
1243
+ let target = document.querySelector('.guide7-2');
1244
+
1245
+ if (layer2Delay) {
1246
+ const timer = setInterval(() => {
1247
+ layer2Delay = false;
1248
+ clearInterval(timer);
1249
+ (target as any).scrollIntoView();
1250
+ gvc.notifyDataChange(viewID);
1251
+
1252
+ }, 300);
1253
+ return ``
1254
+ }
1233
1255
  return this.drawSecondRowBG(BG, vm, `.guide7-2`, viewID, '佈景主題', totalStep);
1234
1256
  }
1235
1257
  case 3: {
@@ -1273,7 +1295,7 @@ export class BgGuide {
1273
1295
  clearInterval(timer);
1274
1296
  gvc.notifyDataChange(viewID);
1275
1297
  }
1276
- }, 400);
1298
+ }, 600);
1277
1299
  }
1278
1300
  let content = html`
1279
1301
  <div class="d-flex flex-wrap"
@@ -1343,10 +1365,16 @@ export class BgGuide {
1343
1365
  height: 261,
1344
1366
  title: '選擇主題',
1345
1367
  content: content,
1368
+ next:true
1346
1369
  });
1347
1370
  }
1348
1371
  case 7: {
1349
1372
  let target = this.findIframeDom(`.guide8-5`);
1373
+ let themeRow = this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow');
1374
+ if (themeNumbers == 0){
1375
+ themeNumbers = themeRow.length;
1376
+ }
1377
+
1350
1378
  if (!target) {
1351
1379
  const timer = setInterval(() => {
1352
1380
  if (this.findIframeDom(`.guide8-5`)) {
@@ -1355,6 +1383,15 @@ export class BgGuide {
1355
1383
  }
1356
1384
  }, 400);
1357
1385
  }
1386
+ if (themeNumbers == this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow').length){
1387
+
1388
+ const timer = setInterval(() => {
1389
+ if (themeNumbers != this.findPageIframe().contentWindow.document.querySelectorAll('.themeRow').length) {
1390
+ clearInterval(timer);
1391
+ gvc.notifyDataChange(viewID);
1392
+ }
1393
+ }, 400);
1394
+ }
1358
1395
  target.scrollIntoView();
1359
1396
  let content = html`
1360
1397
  <div class=""
@@ -2038,9 +2075,9 @@ export class BgGuide {
2038
2075
  </div>
2039
2076
  <div
2040
2077
  class="d-flex flex-column w-100"
2041
- style="background: #FFF;width:100%;padding: 18px 24px;border-radius: 0 0 10px 10px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.64px;"
2078
+ style="white-space: normal;background: #FFF;width:100%;padding: 18px 24px;border-radius: 0 0 10px 10px;font-size: 16px;font-style: normal;font-weight: 400;line-height: 160%;letter-spacing: 0.64px;"
2042
2079
  >
2043
- 開啟您要使用的配送方式
2080
+ 根據商品的特性決定運費要依照「材積」還是「重量」計算,靈活選擇每個商品的運費計算方式。
2044
2081
  <div class="d-flex align-items-center justify-content-between"
2045
2082
  style="margin-top: 24px;height:52px;">
2046
2083
  <div
@@ -2080,26 +2117,27 @@ export class BgGuide {
2080
2117
  });
2081
2118
  }
2082
2119
  case 5: {
2120
+ this.detectClickThrough(this.findIframeDom('.guide4-5'), () => {
2121
+ vm.step++;
2122
+ setTimeout(()=>{
2123
+ gvc.notifyDataChange('logisticsInit');
2124
+ },200)
2125
+
2126
+ });
2083
2127
  return this.drawBGwithBelowWindow(BG, vm, '.guide4-5', 'logisticsInit', 5, 8, {
2084
2128
  width: 332,
2085
2129
  height: 209,
2086
2130
  title: '新增計算區間',
2131
+ next: true,
2087
2132
  content: '點擊藍字即可新增一個計算區間',
2088
2133
  });
2089
2134
  }
2090
2135
  case 6: {
2091
- let target = this.findIframeDom('.guide4-6');
2092
- const handleClick = (event: any) => {
2093
- this.eventSet = this.eventSet.filter((d: any) => {
2094
- return d !== handleClick;
2095
- });
2096
- target!.removeEventListener('click', handleClick);
2097
- // (event as any).preventDefault()
2098
- return;
2099
- };
2100
- target!.addEventListener('click', handleClick);
2101
- this.eventSet.push(() => {
2102
- target!.removeEventListener('click', handleClick);
2136
+ let target = this.findPageIframe().contentWindow.document.querySelectorAll('.guide4-6');
2137
+ target = target[target.length - 1];
2138
+ this.detectClickThrough(target, () => {
2139
+ vm.step++;
2140
+ gvc.notifyDataChange('logisticsInit');
2103
2141
  });
2104
2142
  let content = html`
2105
2143
  <div class="d-flex align-items-center" style="">
@@ -2248,6 +2286,7 @@ export class BgGuide {
2248
2286
  }
2249
2287
  }, 500);
2250
2288
  }
2289
+ target.scrollIntoView();
2251
2290
  let rect = target.getBoundingClientRect();
2252
2291
  let left = rect.left + iframeRect.left;
2253
2292
  let top = rect.top + iframeRect.top;
@@ -2579,15 +2618,27 @@ export class BgGuide {
2579
2618
  let target = this.findIframeDom(targetSelector);
2580
2619
  if (!target) {
2581
2620
  const timer = setInterval(() => {
2621
+
2582
2622
  if (this.findIframeDom(targetSelector)) {
2583
2623
  clearInterval(timer);
2624
+
2584
2625
  gvc.notifyDataChange(viewID);
2585
2626
  }
2586
2627
  }, 400);
2587
2628
  }
2629
+ if (target.querySelector('.open-box')){
2630
+ target.click();
2631
+
2632
+ let timer2 = setInterval(()=>{
2633
+ clearInterval(timer2)
2634
+ gvc.notifyDataChange(viewID);
2635
+
2636
+ },500)
2637
+ return ``
2638
+ }
2588
2639
  this.detectClickThrough(target, () => {
2589
2640
  BG.classList.remove('guide2-4');
2590
- vm.step++;
2641
+ vm.step = 5;
2591
2642
  gvc.notifyDataChange(`financeInit`);
2592
2643
  });
2593
2644
  target.parentElement.parentElement.scrollIntoView();
@@ -2752,10 +2803,10 @@ export class BgGuide {
2752
2803
  close();
2753
2804
  setTimeout(() => {
2754
2805
  this.findIframeDom('.guide2-4').scrollIntoView({});
2755
- vm.step--;
2806
+ vm.step = 4;
2756
2807
 
2757
2808
  gvc.notifyDataChange('financeInit');
2758
- }, 400);
2809
+ }, 600);
2759
2810
  })}"
2760
2811
  >
2761
2812
  上一步
@@ -2824,6 +2875,7 @@ export class BgGuide {
2824
2875
  bind: 'init',
2825
2876
  dataList: [{key: 'step', obj: vm}],
2826
2877
  view: () => {
2878
+ console.log(" vm.progress -- " , vm.progress)
2827
2879
  if (vm.progress.length == 0) {
2828
2880
  ApiShop.getGuide().then((r) => {
2829
2881
  // if (!r.response.value.guideList){
@@ -3005,6 +3057,10 @@ export class BgGuide {
3005
3057
  `;
3006
3058
  }
3007
3059
  case 0: {
3060
+ if(vm.progress.length == 0){
3061
+ let dialog = new ShareDialog(gvc.glitter);
3062
+
3063
+ }
3008
3064
  return html`
3009
3065
  <div class="d-flex flex-column"
3010
3066
  style="width:588px;border-radius: 10px;background-color: white;">
@@ -4230,6 +4286,7 @@ export class BgGuide {
4230
4286
  ApiShop.getEditorGuide().then(r => {
4231
4287
  r.response.value.find((element: any) => element.title == "頁面編輯").finish = true;
4232
4288
  ApiShop.setEditorGuide(r.response.value)
4289
+ this.leaveGuide(vm,1)
4233
4290
  })
4234
4291
  }
4235
4292
  });
@@ -4266,9 +4323,8 @@ export class BgGuide {
4266
4323
  case 1: {
4267
4324
  const className: string = 'guide-user-editor-11';
4268
4325
  let clickTarget = document.querySelector(`.${className}-icon`) as HTMLElement;
4269
- clickTarget!.click();
4270
4326
  if (!document.querySelector(`.${className}`)) {
4271
-
4327
+ clickTarget!.click();
4272
4328
  const timer = setInterval(() => {
4273
4329
  if (document.querySelector(`.${className}`)) {
4274
4330
  clearInterval(timer);
@@ -4277,7 +4333,6 @@ export class BgGuide {
4277
4333
  }, 500)
4278
4334
  }
4279
4335
  let target = document.querySelector(`.${className}`);
4280
-
4281
4336
  if (target) {
4282
4337
  //點擊完的icon會變色 也會是不同的dom元素
4283
4338
  let clickTarget = document.querySelector(`.${className}-icon`) as HTMLElement;