ts-glitter 21.6.2 → 21.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-blog.js +186 -8
  4. package/lowcode/backend-manager/bg-blog.ts +206 -11
  5. package/lowcode/backend-manager/bg-widget.js +20 -17
  6. package/lowcode/backend-manager/bg-widget.ts +23 -19
  7. package/lowcode/cms-plugin/permission-setting.js +2 -3
  8. package/lowcode/cms-plugin/permission-setting.ts +2 -3
  9. package/lowcode/cms-plugin/shopping-discount-setting.js +1711 -341
  10. package/lowcode/cms-plugin/shopping-discount-setting.ts +1938 -327
  11. package/lowcode/editor-components/global-widget/bridge.js +30 -0
  12. package/lowcode/editor-components/global-widget/bridge.ts +131 -2
  13. package/lowcode/form-view/e-commerce/product-select.js +6 -16
  14. package/lowcode/form-view/e-commerce/product-select.ts +16 -18
  15. package/lowcode/glitter-base/global/language.js +2 -0
  16. package/lowcode/glitter-base/global/language.ts +2 -0
  17. package/lowcode/glitterBundle/html-component/global-widget.js +0 -74
  18. package/lowcode/glitterBundle/html-component/global-widget.ts +1 -81
  19. package/lowcode/official_view_component/official/component.ts +0 -2
  20. package/lowcode/public-components/checkout/index.js +1 -1
  21. package/lowcode/public-components/checkout/index.ts +1 -1
  22. package/lowcode/public-components/user-manager/um-info.js +4 -0
  23. package/lowcode/public-components/user-manager/um-info.ts +4 -1
  24. package/lowcode/public-components/user-manager/um-login.js +3 -3
  25. package/lowcode/public-components/user-manager/um-login.ts +3 -6
  26. package/lowcode/public-components/user-manager/um-rebate.js +6 -2
  27. package/lowcode/public-components/user-manager/um-rebate.ts +28 -2
  28. package/package.json +1 -1
  29. package/src/api-public/controllers/shop.js +1 -0
  30. package/src/api-public/controllers/shop.js.map +1 -1
  31. package/src/api-public/controllers/shop.ts +1 -0
  32. package/src/api-public/services/data-analyze.d.ts +1 -1
  33. package/src/api-public/services/rebate.d.ts +14 -2
  34. package/src/api-public/services/rebate.js +66 -24
  35. package/src/api-public/services/rebate.js.map +1 -1
  36. package/src/api-public/services/rebate.ts +91 -24
  37. package/src/api-public/services/schedule.js +1 -3
  38. package/src/api-public/services/schedule.js.map +1 -1
  39. package/src/api-public/services/schedule.ts +1 -1
  40. package/src/api-public/services/shopping.js +35 -6
  41. package/src/api-public/services/shopping.js.map +1 -1
  42. package/src/api-public/services/shopping.ts +45 -12
  43. package/src/index.js +17 -7
  44. package/src/index.js.map +1 -1
  45. package/src/modules/database.js +1 -1
  46. package/src/modules/database.js.map +1 -1
  47. package/src/modules/database.ts +1 -1
  48. package/src/run.js +1 -1
  49. package/src/run.js.map +1 -1
  50. package/src/run.ts +1 -1
  51. package/src/services/system-schedule.js +1 -1
  52. package/src/services/system-schedule.js.map +1 -1
  53. package/src/services/system-schedule.ts +3 -2
@@ -1,6 +1,36 @@
1
1
  import { ToolSetting } from '../../jspage/function-page/tool-setting.js';
2
+ const html = String.raw;
2
3
  export class Bridge {
4
+ static grayButton(text, event, obj) {
5
+ var _a;
6
+ return html ` <button class="btn btn-gray ${(obj === null || obj === void 0 ? void 0 : obj.class) || ''}" type="button" onclick="${event}">
7
+ <i class="${obj && obj.icon && obj.icon.length > 0 ? obj.icon : 'd-none'}" style="color: #393939"></i>
8
+ ${text.length > 0 ? html `<span class="tx_700" style="${(_a = obj === null || obj === void 0 ? void 0 : obj.textStyle) !== null && _a !== void 0 ? _a : ''}">${text}</span>` : ''}
9
+ </button>`;
10
+ }
11
+ static select(obj) {
12
+ var _a;
13
+ return html ` ${obj.title ? html ` <div class="tx_normal fw-normal mb-2">${obj.title}</div>` : ``}
14
+ <select
15
+ class="c_select c_select_w_100"
16
+ style="${(_a = obj.style) !== null && _a !== void 0 ? _a : ''}; ${obj.readonly ? 'background: #f7f7f7;' : ''}"
17
+ onchange="${obj.gvc.event(e => {
18
+ obj.callback(e.value);
19
+ })}"
20
+ ${obj.readonly ? 'disabled' : ''}
21
+ >
22
+ ${obj.gvc.map(obj.options.map(opt => html ` <option class="c_select_option" value="${opt.key}" ${obj.default === opt.key ? 'selected' : ''}>
23
+ ${opt.value}
24
+ </option>`))}
25
+ ${obj.options.find((opt) => {
26
+ return obj.default === opt.key;
27
+ })
28
+ ? ``
29
+ : `<option class="d-none" selected>${obj.place_holder || `請選擇項目`}</option>`}
30
+ </select>`;
31
+ }
3
32
  static main(obj) {
33
+ console.log(`refer_form_data=>`, obj.widget);
4
34
  const gvc = obj.gvc;
5
35
  const glitter = gvc.glitter;
6
36
  const is_sub_page = ['pages/', 'hidden/', 'shop/'].find((dd) => {
@@ -1,9 +1,54 @@
1
1
  import { GVC } from '../../glitterBundle/GVController.js';
2
2
  import { ToolSetting } from '../../jspage/function-page/tool-setting.js';
3
3
  import { BgWidget } from '../../backend-manager/bg-widget.js';
4
-
4
+ import { ApiUser } from '../../glitter-base/route/user.js';
5
+ import { OptionsItem } from '../../glitterBundle/html-component/global-widget.js';
6
+ const html=String.raw;
5
7
  export class Bridge {
8
+
9
+ static grayButton(text: string, event: string, obj?: { icon?: string; textStyle?: string; class?: string }) {
10
+ return html` <button class="btn btn-gray ${obj?.class || ''}" type="button" onclick="${event}">
11
+ <i class="${obj && obj.icon && obj.icon.length > 0 ? obj.icon : 'd-none'}" style="color: #393939"></i>
12
+ ${text.length > 0 ? html`<span class="tx_700" style="${obj?.textStyle ?? ''}">${text}</span>` : ''}
13
+ </button>`;
14
+ }
15
+
16
+ static select(obj: {
17
+ gvc: GVC;
18
+ callback: (value: any) => void;
19
+ default: string;
20
+ options: OptionsItem[];
21
+ style?: string;
22
+ title?: string;
23
+ readonly?: boolean;
24
+ place_holder?: string;
25
+ }) {
26
+ return html` ${obj.title ? html` <div class="tx_normal fw-normal mb-2">${obj.title}</div>` : ``}
27
+ <select
28
+ class="c_select c_select_w_100"
29
+ style="${obj.style ?? ''}; ${obj.readonly ? 'background: #f7f7f7;' : ''}"
30
+ onchange="${obj.gvc.event(e => {
31
+ obj.callback(e.value);
32
+ })}"
33
+ ${obj.readonly ? 'disabled' : ''}
34
+ >
35
+ ${obj.gvc.map(
36
+ obj.options.map(
37
+ opt =>
38
+ html` <option class="c_select_option" value="${opt.key}" ${obj.default === opt.key ? 'selected' : ''}>
39
+ ${opt.value}
40
+ </option>`
41
+ )
42
+ )}
43
+ ${(obj.options as any).find((opt: any) => {
44
+ return obj.default === opt.key;
45
+ })
46
+ ? ``
47
+ : `<option class="d-none" selected>${obj.place_holder || `請選擇項目`}</option>`}
48
+ </select>`;
49
+ }
6
50
  public static main(obj: any) {
51
+ console.log(`refer_form_data=>`,obj.widget)
7
52
  const gvc: GVC = obj.gvc;
8
53
  const glitter = gvc.glitter;
9
54
  const is_sub_page = ['pages/','hidden/','shop/'].find((dd)=>{
@@ -45,7 +90,91 @@ export class Bridge {
45
90
  }
46
91
  })(),
47
92
  }))
48
-
93
+ // c_view.push(
94
+ // [
95
+ // `<div class="fs-6 mb-2" style="color: black;">選單參照內容</div>`,
96
+ // gvc.bindView(()=>{
97
+ // const bi=gvc.glitter.getUUID()
98
+ // return {
99
+ // bind:bi,
100
+ // view:async ()=>{
101
+ // try {
102
+ // const vm:any={
103
+ // tab:'menu',
104
+ // dataList:[]
105
+ // }
106
+ // const tag=vm.tab==='menu' ? 'menu-setting':'footer-setting';
107
+ // let menu_all= (await ApiUser.getPublicConfig('menu-setting-list','manager')).response.value;
108
+ // menu_all.list = menu_all.list ?? [];
109
+ // vm.dataList = [
110
+ // { tag: tag, title: `系統預設
111
+ // ` },
112
+ // ...menu_all.list.filter((d1:any)=>{
113
+ // return d1.tab===tag
114
+ // })
115
+ // ];
116
+ // return [
117
+ // this.select({
118
+ // gvc: gvc,
119
+ // callback: (text: any) => {
120
+ // glitter.share.refer_form['menu_refer']=text
121
+ // glitter.share.refresh_global();
122
+ // },
123
+ // default: glitter.share.refer_form['menu_refer'] ?? tag,
124
+ // options: vm.dataList.map((dd:any)=>{
125
+ // return {
126
+ // key:dd.tag,
127
+ // value:dd.title
128
+ // }
129
+ // })
130
+ // }),
131
+ // this.grayButton(
132
+ // '設定',
133
+ // gvc.event(() => {
134
+ // gvc.glitter.getModule(`${gvc.glitter.root_path}cms-plugin/menus-setting.js`, menu => {
135
+ // gvc.glitter.innerDialog((gvc)=>{
136
+ // return html`
137
+ // <div class="vw-100 vh-100 bg-white">
138
+ // <div class="d-flex align-items-center" style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
139
+ // <div class="d-flex" style="padding:19px 32px;gap:8px;cursor: pointer;border-right: solid 1px #DDD;" onclick="${gvc.event(()=>{
140
+ // gvc.closeDialog()
141
+ // })}">
142
+ // <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
143
+ // <path d="M13.7859 4.96406L8.02969 10.7203C7.69219 11.0578 7.5 11.5219 7.5 12C7.5 12.4781 7.69219 12.9422 8.02969 13.2797L13.7859 19.0359C14.0859 19.3359 14.4891 19.5 14.9109 19.5C15.7875 19.5 16.5 18.7875 16.5 17.9109V15H22.5C23.3297 15 24 14.3297 24 13.5V10.5C24 9.67031 23.3297 9 22.5 9H16.5V6.08906C16.5 5.2125 15.7875 4.5 14.9109 4.5C14.4891 4.5 14.0859 4.66875 13.7859 4.96406ZM7.5 19.5H4.5C3.67031 19.5 3 18.8297 3 18V6C3 5.17031 3.67031 4.5 4.5 4.5H7.5C8.32969 4.5 9 3.82969 9 3C9 2.17031 8.32969 1.5 7.5 1.5H4.5C2.01562 1.5 0 3.51562 0 6V18C0 20.4844 2.01562 22.5 4.5 22.5H7.5C8.32969 22.5 9 21.8297 9 21C9 20.1703 8.32969 19.5 7.5 19.5Z" fill="#393939"></path>
144
+ // </svg>
145
+ // 返回
146
+ // </div>
147
+ // <div class="flex-fill" style="padding: 19px 32px;">編輯選單內容</div>
148
+ // </div>
149
+ // <div class="w-100">${
150
+ // menu.main(gvc, obj.widget)
151
+ // }</div>
152
+ // </div>
153
+ // `
154
+ // }, 'menus-setting',{
155
+ // dismiss:()=>{
156
+ // glitter.share.refresh_global();
157
+ // }
158
+ // });
159
+ // });
160
+ // }),
161
+ // {
162
+ // }
163
+ // )
164
+ // ].join('')
165
+ // }catch (e) {
166
+ // console.log(e)
167
+ // return ``
168
+ // }
169
+ // },
170
+ // divCreate:{
171
+ // class:`d-flex align-items-center`,style:`gap:5px;`
172
+ // }
173
+ // }
174
+ // })
175
+ // ].join('')
176
+ // );
177
+ // civ.push(`<div class="mx-n2 border-top mb-2 mt-3"></div>`);
49
178
  c_view.push( `<div style="height:1px;" class="border-top mx-n3"></div>`)
50
179
  return c_view.join(`<div style="height:10px;"></div>`);
51
180
  }
@@ -93,14 +93,6 @@ export class ProductSelect {
93
93
  containerId: Tool.randomString(6),
94
94
  loading: true,
95
95
  };
96
- const is_page = window.parent.glitter.getUrlParameter('page').startsWith('shop') ||
97
- window.parent.glitter.getUrlParameter('page').startsWith('hidden');
98
- if (is_page) {
99
- if (bundle.formData[bundle.key].select !== 'product') {
100
- bundle.formData[bundle.key].select = 'product';
101
- bundle.formData[bundle.key].value = [];
102
- }
103
- }
104
96
  return gvc.bindView(() => {
105
97
  return {
106
98
  bind: subVM.id,
@@ -135,13 +127,11 @@ export class ProductSelect {
135
127
  title: bundle.title,
136
128
  gvc: gvc,
137
129
  def: bundle.formData[bundle.key].select,
138
- array: is_page
139
- ? [{ value: 'product', title: '特定商品' }]
140
- : [
141
- { value: 'collection', title: '商品系列' },
142
- { value: 'product', title: '特定商品' },
143
- { value: 'all', title: '所有商品' },
144
- ],
130
+ array: [
131
+ { value: 'collection', title: '商品系列' },
132
+ { value: 'product', title: '特定商品' },
133
+ { value: 'all', title: '所有商品' },
134
+ ],
145
135
  callback: text => {
146
136
  bundle.formData[bundle.key].select = text;
147
137
  bundle.formData[bundle.key].value = [];
@@ -233,7 +223,7 @@ export class ProductSelect {
233
223
  }
234
224
  }))}
235
225
  </div>
236
- <div class="mx-n3 border-top" ></div>
226
+ <div class="mx-n3 border-top mt-2" ></div>
237
227
  </div>`);
238
228
  }));
239
229
  },
@@ -94,16 +94,16 @@ export class ProductSelect {
94
94
  containerId: Tool.randomString(6),
95
95
  loading: true,
96
96
  };
97
- const is_page =
98
- (window.parent as any).glitter.getUrlParameter('page').startsWith('shop') ||
99
- (window.parent as any).glitter.getUrlParameter('page').startsWith('hidden');
100
- //隱形賣場和一頁商店僅能單選
101
- if (is_page) {
102
- if (bundle.formData[bundle.key].select !== 'product') {
103
- bundle.formData[bundle.key].select = 'product';
104
- bundle.formData[bundle.key].value = [];
105
- }
106
- }
97
+ // const is_page =
98
+ // (window.parent as any).glitter.getUrlParameter('page').startsWith('shop') ||
99
+ // (window.parent as any).glitter.getUrlParameter('page').startsWith('hidden');
100
+ // //隱形賣場和一頁商店僅能單選
101
+ // if (is_page) {
102
+ // if (bundle.formData[bundle.key].select !== 'product') {
103
+ // bundle.formData[bundle.key].select = 'product';
104
+ // bundle.formData[bundle.key].value = [];
105
+ // }
106
+ // }
107
107
  return gvc.bindView(() => {
108
108
  return {
109
109
  bind: subVM.id,
@@ -138,13 +138,11 @@ export class ProductSelect {
138
138
  title: bundle.title,
139
139
  gvc: gvc,
140
140
  def: bundle.formData[bundle.key].select,
141
- array: is_page
142
- ? [{ value: 'product', title: '特定商品' }]
143
- : [
144
- { value: 'collection', title: '商品系列' },
145
- { value: 'product', title: '特定商品' },
146
- { value: 'all', title: '所有商品' },
147
- ],
141
+ array: [
142
+ { value: 'collection', title: '商品系列' },
143
+ { value: 'product', title: '特定商品' },
144
+ { value: 'all', title: '所有商品' },
145
+ ],
148
146
  callback: text => {
149
147
  bundle.formData[bundle.key].select = text;
150
148
  bundle.formData[bundle.key].value = [];
@@ -242,7 +240,7 @@ export class ProductSelect {
242
240
  })
243
241
  )}
244
242
  </div>
245
- <div class="mx-n3 border-top" ></div>
243
+ <div class="mx-n3 border-top mt-2" ></div>
246
244
  </div>`
247
245
  );
248
246
  });
@@ -220,6 +220,7 @@ export class Language {
220
220
  { key: 'comment', tw: '評語', cn: '评语', en: 'Comment' },
221
221
  { key: 'write_comment', tw: '撰寫評論', cn: '撰写评论', en: 'Write Comment' },
222
222
  { key: 'rating', tw: '評分', cn: '评分', en: 'Rating' },
223
+ { key: 'cancel_reback', tw: '取消退回', cn: '取消退回', en: 'Cancel Return' },
223
224
  { key: 'switch_language', tw: '切換語言', cn: '切换语言', en: 'Switch language' },
224
225
  { key: 'shopping_details', tw: '購物明細', cn: '购物明细', en: 'Shopping details' },
225
226
  { key: 'your_shopping_cart', tw: '您的購物車', cn: '您的购物车', en: 'Your shopping cart' },
@@ -839,6 +840,7 @@ export class Language {
839
840
  { key: 'shipping_notes', tw: '配送備註', cn: '配送备注', en: 'Shipping Notes' },
840
841
  { key: 'return_to_order_list', tw: '返回訂單列表', cn: '返回订单列表', en: 'Return to OrderEvent List' },
841
842
  { key: 'order_not_found', tw: '查無此訂單', cn: '查无此订单', en: 'OrderEvent not found' },
843
+ { key: 'no_account', tw: '查無此帳號', cn: '查無此帳號', en: 'Cant find account' },
842
844
  { key: 'expired', tw: '已過期', cn: '已过期', en: 'Expired' },
843
845
  { key: 'not_yet_shipped', tw: '尚未出貨', cn: '尚未出货', en: 'Not yet shipped' },
844
846
  { key: 'get_verification_code', tw: '取得驗證碼', cn: '获取验证码', en: 'Get Verification Code' },
@@ -229,6 +229,7 @@ export class Language {
229
229
  { key: 'comment', tw: '評語', cn: '评语', en: 'Comment' },
230
230
  { key: 'write_comment', tw: '撰寫評論', cn: '撰写评论', en: 'Write Comment' },
231
231
  { key: 'rating', tw: '評分', cn: '评分', en: 'Rating' },
232
+ { key: 'cancel_reback', tw: '取消退回', cn: '取消退回', en: 'Cancel Return' },
232
233
  { key: 'switch_language', tw: '切換語言', cn: '切换语言', en: 'Switch language' },
233
234
  { key: 'shopping_details', tw: '購物明細', cn: '购物明细', en: 'Shopping details' },
234
235
  { key: 'your_shopping_cart', tw: '您的購物車', cn: '您的购物车', en: 'Your shopping cart' },
@@ -849,6 +850,7 @@ export class Language {
849
850
  { key: 'shipping_notes', tw: '配送備註', cn: '配送备注', en: 'Shipping Notes' },
850
851
  { key: 'return_to_order_list', tw: '返回訂單列表', cn: '返回订单列表', en: 'Return to OrderEvent List' },
851
852
  { key: 'order_not_found', tw: '查無此訂單', cn: '查无此订单', en: 'OrderEvent not found' },
853
+ { key: 'no_account', tw: '查無此帳號', cn: '查無此帳號', en: 'Cant find account' },
852
854
  { key: 'expired', tw: '已過期', cn: '已过期', en: 'Expired' },
853
855
  { key: 'not_yet_shipped', tw: '尚未出貨', cn: '尚未出货', en: 'Not yet shipped' },
854
856
  { key: 'get_verification_code', tw: '取得驗證碼', cn: '获取验证码', en: 'Get Verification Code' },
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Storage } from '../helper/storage.js';
11
11
  import { ApiPageConfig } from '../../api/pageConfig.js';
12
- import { ApiUser } from '../../glitter-base/route/user.js';
13
12
  var ViewType;
14
13
  (function (ViewType) {
15
14
  ViewType["mobile"] = "mobile";
@@ -269,79 +268,6 @@ export class GlobalWidget {
269
268
  window.parent.document.querySelector('.' + outer_id).outerHTML = civ.join('');
270
269
  return;
271
270
  }
272
- civ.push(`<div class="my-2"></div>`);
273
- civ.push([
274
- `<div class="fs-6 mb-2" style="color: black;">選單參照內容</div>`,
275
- gvc.bindView(() => {
276
- const bi = gvc.glitter.getUUID();
277
- return {
278
- bind: bi,
279
- view: () => __awaiter(this, void 0, void 0, function* () {
280
- var _a, _b;
281
- const vm = {
282
- tab: 'menu',
283
- dataList: []
284
- };
285
- const tag = vm.tab === 'menu' ? 'menu-setting' : 'footer-setting';
286
- let menu_all = (yield ApiUser.getPublicConfig('menu-setting-list', 'manager')).response.value;
287
- menu_all.list = (_a = menu_all.list) !== null && _a !== void 0 ? _a : [];
288
- vm.dataList = [
289
- { tag: tag, title: `系統預設
290
- ` },
291
- ...menu_all.list.filter((d1) => {
292
- return d1.tab === tag;
293
- })
294
- ];
295
- return [
296
- this.select({
297
- gvc: gvc,
298
- callback: (text) => {
299
- obj.widget.data.refer_form_data['menu_refer'] = text;
300
- glitter.share.refresh_global();
301
- },
302
- default: (_b = obj.widget.data.refer_form_data['menu_refer']) !== null && _b !== void 0 ? _b : tag,
303
- options: vm.dataList.map((dd) => {
304
- return {
305
- key: dd.tag,
306
- value: dd.title
307
- };
308
- })
309
- }),
310
- this.grayButton('設定', gvc.event(() => {
311
- gvc.glitter.getModule(`${gvc.glitter.root_path}cms-plugin/menus-setting.js`, menu => {
312
- gvc.glitter.innerDialog((gvc) => {
313
- return html `
314
- <div class="vw-100 vh-100 bg-white">
315
- <div class="d-flex align-items-center" style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
316
- <div class="d-flex" style="padding:19px 32px;gap:8px;cursor: pointer;border-right: solid 1px #DDD;" onclick="${gvc.event(() => {
317
- gvc.closeDialog();
318
- })}">
319
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
320
- <path d="M13.7859 4.96406L8.02969 10.7203C7.69219 11.0578 7.5 11.5219 7.5 12C7.5 12.4781 7.69219 12.9422 8.02969 13.2797L13.7859 19.0359C14.0859 19.3359 14.4891 19.5 14.9109 19.5C15.7875 19.5 16.5 18.7875 16.5 17.9109V15H22.5C23.3297 15 24 14.3297 24 13.5V10.5C24 9.67031 23.3297 9 22.5 9H16.5V6.08906C16.5 5.2125 15.7875 4.5 14.9109 4.5C14.4891 4.5 14.0859 4.66875 13.7859 4.96406ZM7.5 19.5H4.5C3.67031 19.5 3 18.8297 3 18V6C3 5.17031 3.67031 4.5 4.5 4.5H7.5C8.32969 4.5 9 3.82969 9 3C9 2.17031 8.32969 1.5 7.5 1.5H4.5C2.01562 1.5 0 3.51562 0 6V18C0 20.4844 2.01562 22.5 4.5 22.5H7.5C8.32969 22.5 9 21.8297 9 21C9 20.1703 8.32969 19.5 7.5 19.5Z" fill="#393939"></path>
321
- </svg>
322
- 返回
323
- </div>
324
- <div class="flex-fill" style="padding: 19px 32px;">編輯選單內容</div>
325
- </div>
326
- <div class="w-100">${menu.main(gvc, obj.widget)}</div>
327
- </div>
328
- `;
329
- }, 'menus-setting', {
330
- dismiss: () => {
331
- glitter.share.refresh_global();
332
- }
333
- });
334
- });
335
- }), {})
336
- ].join('');
337
- }),
338
- divCreate: {
339
- class: `d-flex align-items-center`, style: `gap:5px;`
340
- }
341
- };
342
- })
343
- ].join(''));
344
- civ.push(`<div class="mx-n2 border-top mb-2 mt-3"></div>`);
345
271
  }
346
272
  civ.push((() => {
347
273
  GlobalWidget.glitter_view_type = ViewType.desktop;
@@ -305,87 +305,7 @@ export class GlobalWidget {
305
305
  (window.parent as any).document.querySelector('.' + outer_id).outerHTML = civ.join('');
306
306
  return;
307
307
  }
308
- civ.push(`<div class="my-2"></div>`);
309
- civ.push(
310
- [
311
- `<div class="fs-6 mb-2" style="color: black;">選單參照內容</div>`,
312
- gvc.bindView(()=>{
313
- const bi=gvc.glitter.getUUID()
314
- return {
315
- bind:bi,
316
- view:async ()=>{
317
- const vm:any={
318
- tab:'menu',
319
- dataList:[]
320
- }
321
- const tag=vm.tab==='menu' ? 'menu-setting':'footer-setting';
322
- let menu_all= (await ApiUser.getPublicConfig('menu-setting-list','manager')).response.value;
323
- menu_all.list = menu_all.list ?? [];
324
- vm.dataList = [
325
- { tag: tag, title: `系統預設
326
- ` },
327
- ...menu_all.list.filter((d1:any)=>{
328
- return d1.tab===tag
329
- })
330
- ];
331
- return [
332
- this.select({
333
- gvc: gvc,
334
- callback: (text: any) => {
335
- obj.widget.data.refer_form_data['menu_refer']=text
336
- glitter.share.refresh_global();
337
- },
338
- default: obj.widget.data.refer_form_data['menu_refer'] ?? tag,
339
- options: vm.dataList.map((dd:any)=>{
340
- return {
341
- key:dd.tag,
342
- value:dd.title
343
- }
344
- })
345
- }),
346
- this.grayButton(
347
- '設定',
348
- gvc.event(() => {
349
- gvc.glitter.getModule(`${gvc.glitter.root_path}cms-plugin/menus-setting.js`, menu => {
350
- gvc.glitter.innerDialog((gvc)=>{
351
- return html`
352
- <div class="vw-100 vh-100 bg-white">
353
- <div class="d-flex align-items-center" style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
354
- <div class="d-flex" style="padding:19px 32px;gap:8px;cursor: pointer;border-right: solid 1px #DDD;" onclick="${gvc.event(()=>{
355
- gvc.closeDialog()
356
- })}">
357
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
358
- <path d="M13.7859 4.96406L8.02969 10.7203C7.69219 11.0578 7.5 11.5219 7.5 12C7.5 12.4781 7.69219 12.9422 8.02969 13.2797L13.7859 19.0359C14.0859 19.3359 14.4891 19.5 14.9109 19.5C15.7875 19.5 16.5 18.7875 16.5 17.9109V15H22.5C23.3297 15 24 14.3297 24 13.5V10.5C24 9.67031 23.3297 9 22.5 9H16.5V6.08906C16.5 5.2125 15.7875 4.5 14.9109 4.5C14.4891 4.5 14.0859 4.66875 13.7859 4.96406ZM7.5 19.5H4.5C3.67031 19.5 3 18.8297 3 18V6C3 5.17031 3.67031 4.5 4.5 4.5H7.5C8.32969 4.5 9 3.82969 9 3C9 2.17031 8.32969 1.5 7.5 1.5H4.5C2.01562 1.5 0 3.51562 0 6V18C0 20.4844 2.01562 22.5 4.5 22.5H7.5C8.32969 22.5 9 21.8297 9 21C9 20.1703 8.32969 19.5 7.5 19.5Z" fill="#393939"></path>
359
- </svg>
360
- 返回
361
- </div>
362
- <div class="flex-fill" style="padding: 19px 32px;">編輯選單內容</div>
363
- </div>
364
- <div class="w-100">${
365
- menu.main(gvc, obj.widget)
366
- }</div>
367
- </div>
368
- `
369
- }, 'menus-setting',{
370
- dismiss:()=>{
371
- glitter.share.refresh_global();
372
- }
373
- });
374
- });
375
- }),
376
- {
377
- }
378
- )
379
- ].join('')
380
- },
381
- divCreate:{
382
- class:`d-flex align-items-center`,style:`gap:5px;`
383
- }
384
- }
385
- })
386
- ].join('')
387
- );
388
- civ.push(`<div class="mx-n2 border-top mb-2 mt-3"></div>`);
308
+
389
309
  }
390
310
  civ.push(
391
311
  (() => {
@@ -8,8 +8,6 @@ import { GlobalWidget } from '../../glitterBundle/html-component/global-widget.j
8
8
  import { NormalPageEditor } from '../../editor/normal-page-editor.js';
9
9
  import { RenderValue } from '../../glitterBundle/html-component/render-value.js';
10
10
  import { ApplicationConfig } from '../../application-config.js';
11
- import { ApiPageConfig } from '../../api/pageConfig.js';
12
- import { GlobalEditor } from '../../editor-components/global-editor.js';
13
11
 
14
12
  export const component = Plugin.createComponent(import.meta.url, (glitter: Glitter, editMode: boolean) => {
15
13
  return {
@@ -2282,7 +2282,7 @@ export class CheckoutIndex {
2282
2282
  gvc.notifyDataChange(id);
2283
2283
  });
2284
2284
  }
2285
- const checkbox = this.getCheckedClass(gvc, '#393939');
2285
+ const checkbox = this.getCheckedClass(gvc);
2286
2286
  return {
2287
2287
  bind: id,
2288
2288
  view: () => __awaiter(this, void 0, void 0, function* () {
@@ -2508,7 +2508,7 @@ export class CheckoutIndex {
2508
2508
  gvc.notifyDataChange(id);
2509
2509
  });
2510
2510
  }
2511
- const checkbox = this.getCheckedClass(gvc, '#393939');
2511
+ const checkbox = this.getCheckedClass(gvc);
2512
2512
  return {
2513
2513
  bind: id,
2514
2514
  view: async () => {
@@ -804,6 +804,7 @@ export class UMInfo {
804
804
  userData: update_userData,
805
805
  }).then(res => {
806
806
  dialog.dataLoading({ visible: false });
807
+ console.log(res);
807
808
  if (!res.result && res.response.data.msg === 'email-verify-false') {
808
809
  dialog.errorMessage({ text: Language.text('email_verification_code_incorrect') });
809
810
  }
@@ -816,6 +817,9 @@ export class UMInfo {
816
817
  else if (!res.result && res.response.data.msg === 'email-exists') {
817
818
  dialog.errorMessage({ text: Language.text('email_already_exists') });
818
819
  }
820
+ else if (!res.result && res.response.message === 'User phone already exists.') {
821
+ dialog.errorMessage({ text: Language.text('phone_number_already_exists') });
822
+ }
819
823
  else if (!res.result) {
820
824
  dialog.errorMessage({ text: Language.text('update_exception') });
821
825
  }
@@ -939,6 +939,7 @@ export class UMInfo {
939
939
  userData: update_userData,
940
940
  }).then(res => {
941
941
  dialog.dataLoading({ visible: false });
942
+ console.log(res)
942
943
  if (!res.result && res.response.data.msg === 'email-verify-false') {
943
944
  dialog.errorMessage({ text: Language.text('email_verification_code_incorrect') });
944
945
  } else if (!res.result && res.response.data.msg === 'phone-verify-false') {
@@ -947,7 +948,9 @@ export class UMInfo {
947
948
  dialog.errorMessage({ text: Language.text('phone_number_already_exists') });
948
949
  } else if (!res.result && res.response.data.msg === 'email-exists') {
949
950
  dialog.errorMessage({ text: Language.text('email_already_exists') });
950
- } else if (!res.result) {
951
+ }else if(!res.result && res.response.message==='User phone already exists.'){
952
+ dialog.errorMessage({ text: Language.text('phone_number_already_exists') });
953
+ }else if (!res.result) {
951
954
  dialog.errorMessage({ text: Language.text('update_exception') });
952
955
  } else {
953
956
  dialog.successMessage({ text: Language.text('change_success') });
@@ -960,13 +960,13 @@ export class UMLogin {
960
960
  });
961
961
  }
962
962
  static sendResetEmail(widget, vm) {
963
+ const email = this.checkValue('vm-email');
964
+ vm.resetEmail = email;
963
965
  if (!vm.resetEmail) {
964
- const email = this.checkValue('vm-email');
965
966
  if (!email) {
966
967
  widget.event('error', { title: Language.text('email_placeholder') });
967
968
  return;
968
969
  }
969
- vm.resetEmail = email;
970
970
  }
971
971
  widget.event('loading', { visible: true });
972
972
  ApiUser.forgetPwd(vm.resetEmail).then(r => {
@@ -980,7 +980,7 @@ export class UMLogin {
980
980
  }
981
981
  }
982
982
  else {
983
- widget.event('error', { title: Language.text('system_error') });
983
+ widget.event('error', { title: Language.text('no_account') });
984
984
  }
985
985
  });
986
986
  }
@@ -1011,17 +1011,14 @@ export class UMLogin {
1011
1011
  }
1012
1012
 
1013
1013
  static sendResetEmail(widget: any, vm: VM) {
1014
+ const email = this.checkValue('vm-email');
1015
+ vm.resetEmail = email as any;
1014
1016
  if (!vm.resetEmail) {
1015
- const email = this.checkValue('vm-email');
1016
-
1017
1017
  if (!email) {
1018
1018
  widget.event('error', { title: Language.text('email_placeholder') });
1019
1019
  return;
1020
1020
  }
1021
-
1022
- vm.resetEmail = email;
1023
1021
  }
1024
-
1025
1022
  widget.event('loading', { visible: true });
1026
1023
  ApiUser.forgetPwd(vm.resetEmail).then(r => {
1027
1024
  widget.event('loading', { visible: false });
@@ -1033,7 +1030,7 @@ export class UMLogin {
1033
1030
  }, 1000);
1034
1031
  }
1035
1032
  } else {
1036
- widget.event('error', { title: Language.text('system_error') });
1033
+ widget.event('error', { title: Language.text('no_account') });
1037
1034
  }
1038
1035
  });
1039
1036
  }