ts-glitter 20.5.1 → 20.5.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 (42) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/cms-plugin/member-setting.js +2 -4
  4. package/lowcode/cms-plugin/member-setting.ts +2 -4
  5. package/lowcode/cms-plugin/stock-history.ts +0 -1
  6. package/lowcode/cms-plugin/user-list.js +98 -97
  7. package/lowcode/cms-plugin/user-list.ts +111 -103
  8. package/lowcode/modules/checkInput.js +2 -2
  9. package/lowcode/modules/checkInput.ts +58 -61
  10. package/lowcode/public-components/checkout/index.js +0 -1
  11. package/lowcode/public-components/checkout/index.ts +0 -1
  12. package/lowcode/public-components/user-manager/um-info.js +49 -48
  13. package/lowcode/public-components/user-manager/um-info.ts +219 -204
  14. package/lowcode/public-components/user-manager/um-order.js +25 -22
  15. package/lowcode/public-components/user-manager/um-order.ts +32 -23
  16. package/lowcode/src/glitterBundle/module/Animation.js +7 -13
  17. package/lowcode/src/glitterBundle/module/Enum.js +2 -6
  18. package/lowcode/src/glitterBundle/module/Html_generate.js +50 -42
  19. package/lowcode/src/glitterBundle/module/PageManager.js +23 -30
  20. package/lowcode/src/glitterBundle/plugins/click-event.js +25 -19
  21. package/lowcode/src/glitterBundle/plugins/dialog-style-editor.js +13 -16
  22. package/lowcode/src/glitterBundle/plugins/editor-elem.js +1 -6
  23. package/lowcode/src/glitterBundle/plugins/editor.js +1 -5
  24. package/lowcode/src/glitterBundle/plugins/html-render.js +2 -5
  25. package/lowcode/src/glitterBundle/plugins/plugin-creater.js +28 -22
  26. package/lowcode/src/glitterBundle/plugins/seo-manager.js +1 -5
  27. package/lowcode/src/glitterBundle/plugins/style-attr.js +1 -5
  28. package/lowcode/src/glitterBundle/plugins/style-editor.js +1 -3
  29. package/package.json +1 -1
  30. package/src/api-public/services/financial-service.js +7 -6
  31. package/src/api-public/services/financial-service.js.map +1 -1
  32. package/src/api-public/services/financial-service.ts +11 -8
  33. package/src/api-public/services/model/handlePaymentTransaction.js +29 -2
  34. package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
  35. package/src/api-public/services/model/handlePaymentTransaction.ts +8 -9
  36. package/src/api-public/services/shopping.d.ts +1 -1
  37. package/src/api-public/services/shopping.js +12 -9
  38. package/src/api-public/services/shopping.js.map +1 -1
  39. package/src/api-public/services/shopping.ts +5 -3
  40. package/src/api-public/services/user.js +44 -61
  41. package/src/api-public/services/user.js.map +1 -1
  42. package/src/api-public/services/user.ts +56 -66
package/lowcode/Entry.js CHANGED
@@ -144,7 +144,7 @@ export class Entry {
144
144
  }
145
145
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
146
146
  console.log(`Entry-time:`, window.renderClock.stop());
147
- glitter.share.editerVersion = 'V_20.5.1';
147
+ glitter.share.editerVersion = 'V_20.5.2';
148
148
  glitter.share.start = new Date();
149
149
  const vm = { appConfig: [] };
150
150
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  (window as any).renderClock = (window as any).renderClock ?? createClock();
148
148
  console.log(`Entry-time:`, (window as any).renderClock.stop());
149
- glitter.share.editerVersion = 'V_20.5.1';
149
+ glitter.share.editerVersion = 'V_20.5.2';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  (window as any).saasConfig = {
@@ -132,7 +132,7 @@ export class MemberSetting {
132
132
  style="margin-bottom: 12px;"
133
133
  >
134
134
  註冊頁面表單
135
- <span class="" style="color:#8D8D8D;font-size: 12px;">於註冊頁面中設定顧客必須填寫的資料</span>
135
+ <span style="color:#8D8D8D;font-size: 12px;">於註冊頁面中設定顧客必須填寫的資料</span>
136
136
  </div>`,
137
137
  },
138
138
  {
@@ -142,9 +142,7 @@ export class MemberSetting {
142
142
  style="margin-bottom: 12px;"
143
143
  >
144
144
  設定頁面表單
145
- <span class="" style="color:#8D8D8D;font-size: 12px;"
146
- >於用戶設定頁面中設定顧客可填寫的額外資料</span
147
- >
145
+ <span style="color:#8D8D8D;font-size: 12px;">於用戶設定頁面中設定顧客可填寫的額外資料</span>
148
146
  </div>`,
149
147
  },
150
148
  ]);
@@ -148,7 +148,7 @@ export class MemberSetting {
148
148
  style="margin-bottom: 12px;"
149
149
  >
150
150
  註冊頁面表單
151
- <span class="" style="color:#8D8D8D;font-size: 12px;">於註冊頁面中設定顧客必須填寫的資料</span>
151
+ <span style="color:#8D8D8D;font-size: 12px;">於註冊頁面中設定顧客必須填寫的資料</span>
152
152
  </div>`,
153
153
  },
154
154
  {
@@ -158,9 +158,7 @@ export class MemberSetting {
158
158
  style="margin-bottom: 12px;"
159
159
  >
160
160
  設定頁面表單
161
- <span class="" style="color:#8D8D8D;font-size: 12px;"
162
- >於用戶設定頁面中設定顧客可填寫的額外資料</span
163
- >
161
+ <span style="color:#8D8D8D;font-size: 12px;">於用戶設定頁面中設定顧客可填寫的額外資料</span>
164
162
  </div>`,
165
163
  },
166
164
  ]);
@@ -12,7 +12,6 @@ import { StockVendors, VendorData } from './stock-vendors.js';
12
12
  import { CheckInput } from '../modules/checkInput.js';
13
13
  import { Tool } from '../modules/tool.js';
14
14
  import { BgProduct, OptionsItem } from '../backend-manager/bg-product.js';
15
- import { al } from '@faker-js/faker/dist/airline-CBNP41sR.js';
16
15
 
17
16
  const html = String.raw;
18
17
 
@@ -1181,94 +1181,92 @@ export class UserList {
1181
1181
  </div>`,
1182
1182
  ].join(BgWidget.mbContainer(12)),
1183
1183
  [
1184
- html `<div class="tx_700">升級方式</div>`,
1184
+ html `
1185
+ <div class="d-flex align-items-center gap-2">
1186
+ <div class="tx_700">升級方式</div>
1187
+ ${BgWidget.blueNote('查看會員級數規則', gvc.event(() => {
1188
+ BgWidget.infoDialog({
1189
+ gvc: gvc,
1190
+ title: '會員規則',
1191
+ innerHTML: BgWidget.tableV3({
1192
+ gvc: gvc,
1193
+ getData: vd => {
1194
+ setTimeout(() => {
1195
+ vd.tableData = vm.data.member.map((leadData) => {
1196
+ return [
1197
+ {
1198
+ key: '會員等級',
1199
+ value: leadData.tag_name,
1200
+ },
1201
+ {
1202
+ key: '升級規則',
1203
+ value: (() => {
1204
+ let text = '';
1205
+ const val = parseInt(`${leadData.og.condition.value}`, 10).toLocaleString();
1206
+ const condition_type = leadData.og.condition.type === 'single' ? '單筆' : '累積';
1207
+ if (leadData.og.duration.type === 'noLimit') {
1208
+ text = `${condition_type}消費額達 NT$${val}`;
1209
+ }
1210
+ else {
1211
+ text = `${leadData.og.duration.value}天內${condition_type}消費額達 NT$${val}`;
1212
+ }
1213
+ return text;
1214
+ })(),
1215
+ },
1216
+ {
1217
+ key: '有效期限',
1218
+ value: (() => {
1219
+ const { type, value } = leadData.og.dead_line;
1220
+ let dead_line = '';
1221
+ if (type === 'date') {
1222
+ const deadlines = [
1223
+ {
1224
+ title: '一個月',
1225
+ value: 30,
1226
+ },
1227
+ {
1228
+ title: '三個月',
1229
+ value: 90,
1230
+ },
1231
+ {
1232
+ title: '六個月',
1233
+ value: 180,
1234
+ },
1235
+ {
1236
+ title: '一年',
1237
+ value: 365,
1238
+ },
1239
+ ];
1240
+ const matchedDeadline = deadlines.find(item => item.value === value);
1241
+ dead_line = matchedDeadline
1242
+ ? matchedDeadline.title
1243
+ : `${value}天`;
1244
+ }
1245
+ else if (type === 'noLimit') {
1246
+ dead_line = '沒有期限';
1247
+ }
1248
+ return dead_line;
1249
+ })(),
1250
+ },
1251
+ ];
1252
+ });
1253
+ vd.originalData = vm.data.member;
1254
+ vd.loading = false;
1255
+ vd.callback();
1256
+ }, 200);
1257
+ },
1258
+ filter: [],
1259
+ rowClick: () => { },
1260
+ hiddenPageSplit: true,
1261
+ }),
1262
+ });
1263
+ }))}
1264
+ </div>
1265
+ `,
1185
1266
  BgWidget.multiCheckboxContainer(gvc, [
1186
1267
  {
1187
1268
  key: 'auto',
1188
- name: html `<div>
1189
- 根據本站<span
1190
- style="color: #4D86DB; text-decoration: underline;"
1191
- onclick="${gvc.event((e, ev) => {
1192
- ev.stopPropagation();
1193
- BgWidget.infoDialog({
1194
- gvc: gvc,
1195
- title: '會員規則',
1196
- innerHTML: BgWidget.tableV3({
1197
- gvc: gvc,
1198
- getData: vd => {
1199
- setTimeout(() => {
1200
- vd.tableData = vm.data.member.map((leadData) => {
1201
- return [
1202
- {
1203
- key: '會員等級',
1204
- value: leadData.tag_name,
1205
- },
1206
- {
1207
- key: '升級條件',
1208
- value: (() => {
1209
- let text = '';
1210
- const val = parseInt(`${leadData.og.condition.value}`, 10).toLocaleString();
1211
- const condition_type = leadData.og.condition.type === 'single' ? '單筆' : '累積';
1212
- if (leadData.og.duration.type === 'noLimit') {
1213
- text = `${condition_type}消費額達 NT$${val}`;
1214
- }
1215
- else {
1216
- text = `${leadData.og.duration.value}天內${condition_type}消費額達 NT$${val}`;
1217
- }
1218
- return text;
1219
- })(),
1220
- },
1221
- {
1222
- key: '有效期限',
1223
- value: (() => {
1224
- const { type, value } = leadData.og.dead_line;
1225
- let dead_line = '';
1226
- if (type === 'date') {
1227
- const deadlines = [
1228
- {
1229
- title: '一個月',
1230
- value: 30,
1231
- },
1232
- {
1233
- title: '三個月',
1234
- value: 90,
1235
- },
1236
- {
1237
- title: '六個月',
1238
- value: 180,
1239
- },
1240
- {
1241
- title: '一年',
1242
- value: 365,
1243
- },
1244
- ];
1245
- const matchedDeadline = deadlines.find(item => item.value === value);
1246
- dead_line = matchedDeadline
1247
- ? matchedDeadline.title
1248
- : `${value}天`;
1249
- }
1250
- else if (type === 'noLimit') {
1251
- dead_line = '沒有期限';
1252
- }
1253
- return dead_line;
1254
- })(),
1255
- },
1256
- ];
1257
- });
1258
- vd.originalData = vm.data.member;
1259
- vd.loading = false;
1260
- vd.callback();
1261
- }, 200);
1262
- },
1263
- filter: [],
1264
- rowClick: () => { },
1265
- hiddenPageSplit: true,
1266
- }),
1267
- });
1268
- })}"
1269
- >會員規則</span
1270
- >自動升級
1271
- </div>`,
1269
+ name: '根據本站會員規則自動升級',
1272
1270
  },
1273
1271
  {
1274
1272
  key: 'manual',
@@ -1766,12 +1764,16 @@ export class UserList {
1766
1764
  bind: id,
1767
1765
  view: () => {
1768
1766
  return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
1769
- var _a, _b, _c;
1770
- const response = yield saasConfig.api.getPrivateConfig(saasConfig.config.appName, 'glitterUserForm');
1771
- const result = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.response) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
1772
- const data = Array.isArray(result) ? result : [];
1773
- function loopForm(data, refer_obj) {
1774
- return data
1767
+ var _a, _b, _c, _d, _e;
1768
+ const getDefaultForm = yield saasConfig.api.getPrivateConfig(saasConfig.config.appName, 'glitterUserForm');
1769
+ const defaultForm = (_c = (_b = (_a = getDefaultForm === null || getDefaultForm === void 0 ? void 0 : getDefaultForm.response) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
1770
+ const customerForm = ((_e = (_d = (yield ApiUser.getPublicConfig('customer_form_user_setting', 'manager'))) === null || _d === void 0 ? void 0 : _d.response) === null || _e === void 0 ? void 0 : _e.value) || { list: [] };
1771
+ const formList = [
1772
+ ...(Array.isArray(defaultForm) ? defaultForm : []),
1773
+ ...customerForm.list,
1774
+ ];
1775
+ function loopForm(dataArray, refer_obj) {
1776
+ return dataArray
1775
1777
  .map(item => {
1776
1778
  const { title, key, page } = item;
1777
1779
  const value = refer_obj[key] || '';
@@ -1821,7 +1823,7 @@ export class UserList {
1821
1823
  }
1822
1824
  const form_array_view = [
1823
1825
  html `<div style="display:flex; gap: 12px; flex-direction: column;">
1824
- ${loopForm(data, userData)}
1826
+ ${loopForm(formList, userData)}
1825
1827
  </div>`,
1826
1828
  ];
1827
1829
  resolve(form_array_view.join(html `<div class="my-4 border"></div>`));
@@ -1850,7 +1852,7 @@ export class UserList {
1850
1852
  dialog.infoMessage({ text: '請輸入正確的電子信箱格式' });
1851
1853
  return;
1852
1854
  }
1853
- if (!CheckInput.isEmpty(userData.phone) && !CheckInput.isTaiwanPhone(userData.phone)) {
1855
+ if (!CheckInput.isTaiwanPhone(userData.phone)) {
1854
1856
  dialog.infoMessage({ text: BgWidget.taiwanPhoneAlert() });
1855
1857
  return;
1856
1858
  }
@@ -1877,14 +1879,13 @@ export class UserList {
1877
1879
  pwd: gvc.glitter.getUUID(),
1878
1880
  userData: userData,
1879
1881
  }).then(r => {
1882
+ dialog.dataLoading({ visible: false });
1880
1883
  if (r.result) {
1881
- dialog.dataLoading({ visible: false });
1882
- dialog.infoMessage({ text: '成功新增會員' });
1884
+ dialog.successMessage({ text: '顧客新增成功' });
1883
1885
  vm.type = 'list';
1884
1886
  }
1885
1887
  else {
1886
- dialog.dataLoading({ visible: false });
1887
- dialog.errorMessage({ text: '會員建立失敗' });
1888
+ dialog.errorMessage({ text: '顧客新增失敗' });
1888
1889
  }
1889
1890
  });
1890
1891
  }
@@ -1357,103 +1357,104 @@ export class UserList {
1357
1357
  </div>`,
1358
1358
  ].join(BgWidget.mbContainer(12)),
1359
1359
  [
1360
- html`<div class="tx_700">升級方式</div>`,
1360
+ html`
1361
+ <div class="d-flex align-items-center gap-2">
1362
+ <div class="tx_700">升級方式</div>
1363
+ ${BgWidget.blueNote(
1364
+ '查看會員級數規則',
1365
+ gvc.event(() => {
1366
+ BgWidget.infoDialog({
1367
+ gvc: gvc,
1368
+ title: '會員規則',
1369
+ innerHTML: BgWidget.tableV3({
1370
+ gvc: gvc,
1371
+ getData: vd => {
1372
+ setTimeout(() => {
1373
+ vd.tableData = vm.data.member.map((leadData: any) => {
1374
+ return [
1375
+ {
1376
+ key: '會員等級',
1377
+ value: leadData.tag_name,
1378
+ },
1379
+ {
1380
+ key: '升級規則',
1381
+ value: (() => {
1382
+ let text = '';
1383
+ const val = parseInt(
1384
+ `${leadData.og.condition.value}`,
1385
+ 10
1386
+ ).toLocaleString();
1387
+ const condition_type =
1388
+ leadData.og.condition.type === 'single' ? '單筆' : '累積';
1389
+ if (leadData.og.duration.type === 'noLimit') {
1390
+ text = `${condition_type}消費額達 NT$${val}`;
1391
+ } else {
1392
+ text = `${leadData.og.duration.value}天內${condition_type}消費額達 NT$${val}`;
1393
+ }
1394
+ return text;
1395
+ })(),
1396
+ },
1397
+ {
1398
+ key: '有效期限',
1399
+ value: (() => {
1400
+ const { type, value } = leadData.og.dead_line;
1401
+ let dead_line = '';
1402
+
1403
+ if (type === 'date') {
1404
+ const deadlines = [
1405
+ {
1406
+ title: '一個月',
1407
+ value: 30,
1408
+ },
1409
+ {
1410
+ title: '三個月',
1411
+ value: 90,
1412
+ },
1413
+ {
1414
+ title: '六個月',
1415
+ value: 180,
1416
+ },
1417
+ {
1418
+ title: '一年',
1419
+ value: 365,
1420
+ },
1421
+ ];
1422
+
1423
+ const matchedDeadline = deadlines.find(
1424
+ item => item.value === value
1425
+ );
1426
+ dead_line = matchedDeadline
1427
+ ? matchedDeadline.title
1428
+ : `${value}天`;
1429
+ } else if (type === 'noLimit') {
1430
+ dead_line = '沒有期限';
1431
+ }
1432
+
1433
+ return dead_line;
1434
+ })(),
1435
+ },
1436
+ ];
1437
+ });
1438
+ vd.originalData = vm.data.member;
1439
+ vd.loading = false;
1440
+ vd.callback();
1441
+ }, 200);
1442
+ },
1443
+ filter: [],
1444
+ rowClick: () => {},
1445
+ hiddenPageSplit: true,
1446
+ }),
1447
+ });
1448
+ })
1449
+ )}
1450
+ </div>
1451
+ `,
1361
1452
  BgWidget.multiCheckboxContainer(
1362
1453
  gvc,
1363
1454
  [
1364
1455
  {
1365
1456
  key: 'auto',
1366
- name: html`<div>
1367
- 根據本站<span
1368
- style="color: #4D86DB; text-decoration: underline;"
1369
- onclick="${gvc.event((e, ev) => {
1370
- ev.stopPropagation();
1371
- BgWidget.infoDialog({
1372
- gvc: gvc,
1373
- title: '會員規則',
1374
- innerHTML: BgWidget.tableV3({
1375
- gvc: gvc,
1376
- getData: vd => {
1377
- setTimeout(() => {
1378
- vd.tableData = vm.data.member.map((leadData: any) => {
1379
- return [
1380
- {
1381
- key: '會員等級',
1382
- value: leadData.tag_name,
1383
- },
1384
- {
1385
- key: '升級條件',
1386
- value: (() => {
1387
- let text = '';
1388
- const val = parseInt(
1389
- `${leadData.og.condition.value}`,
1390
- 10
1391
- ).toLocaleString();
1392
- const condition_type =
1393
- leadData.og.condition.type === 'single' ? '單筆' : '累積';
1394
- if (leadData.og.duration.type === 'noLimit') {
1395
- text = `${condition_type}消費額達 NT$${val}`;
1396
- } else {
1397
- text = `${leadData.og.duration.value}天內${condition_type}消費額達 NT$${val}`;
1398
- }
1399
- return text;
1400
- })(),
1401
- },
1402
- {
1403
- key: '有效期限',
1404
- value: (() => {
1405
- const { type, value } = leadData.og.dead_line;
1406
- let dead_line = '';
1407
-
1408
- if (type === 'date') {
1409
- const deadlines = [
1410
- {
1411
- title: '一個月',
1412
- value: 30,
1413
- },
1414
- {
1415
- title: '三個月',
1416
- value: 90,
1417
- },
1418
- {
1419
- title: '六個月',
1420
- value: 180,
1421
- },
1422
- {
1423
- title: '一年',
1424
- value: 365,
1425
- },
1426
- ];
1427
-
1428
- const matchedDeadline = deadlines.find(
1429
- item => item.value === value
1430
- );
1431
- dead_line = matchedDeadline
1432
- ? matchedDeadline.title
1433
- : `${value}天`;
1434
- } else if (type === 'noLimit') {
1435
- dead_line = '沒有期限';
1436
- }
1437
-
1438
- return dead_line;
1439
- })(),
1440
- },
1441
- ];
1442
- });
1443
- vd.originalData = vm.data.member;
1444
- vd.loading = false;
1445
- vd.callback();
1446
- }, 200);
1447
- },
1448
- filter: [],
1449
- rowClick: () => {},
1450
- hiddenPageSplit: true,
1451
- }),
1452
- });
1453
- })}"
1454
- >會員規則</span
1455
- >自動升級
1456
- </div>`,
1457
+ name: '根據本站會員規則自動升級',
1457
1458
  },
1458
1459
  {
1459
1460
  key: 'manual',
@@ -2022,15 +2023,23 @@ export class UserList {
2022
2023
  bind: id,
2023
2024
  view: () => {
2024
2025
  return new Promise(async resolve => {
2025
- const response = await saasConfig.api.getPrivateConfig(
2026
+ const getDefaultForm = await saasConfig.api.getPrivateConfig(
2026
2027
  saasConfig.config.appName,
2027
2028
  'glitterUserForm'
2028
2029
  );
2029
- const result = response?.response?.result?.[0]?.value;
2030
- const data = Array.isArray(result) ? result : [];
2030
+ const defaultForm = getDefaultForm?.response?.result?.[0]?.value;
2031
+
2032
+ const customerForm = (
2033
+ await ApiUser.getPublicConfig('customer_form_user_setting', 'manager')
2034
+ )?.response?.value || { list: [] };
2035
+
2036
+ const formList = [
2037
+ ...(Array.isArray(defaultForm) ? defaultForm : []),
2038
+ ...customerForm.list,
2039
+ ];
2031
2040
 
2032
- function loopForm(data: any[], refer_obj: any): string {
2033
- return data
2041
+ function loopForm(dataArray: any[], refer_obj: any): string {
2042
+ return dataArray
2034
2043
  .map(item => {
2035
2044
  const { title, key, page } = item;
2036
2045
  const value = refer_obj[key] || '';
@@ -2083,7 +2092,7 @@ export class UserList {
2083
2092
  // 預設用戶表單
2084
2093
  const form_array_view: any = [
2085
2094
  html`<div style="display:flex; gap: 12px; flex-direction: column;">
2086
- ${loopForm(data, userData)}
2095
+ ${loopForm(formList, userData)}
2087
2096
  </div>`,
2088
2097
  ];
2089
2098
 
@@ -2121,7 +2130,7 @@ export class UserList {
2121
2130
  return;
2122
2131
  }
2123
2132
 
2124
- if (!CheckInput.isEmpty(userData.phone) && !CheckInput.isTaiwanPhone(userData.phone)) {
2133
+ if (!CheckInput.isTaiwanPhone(userData.phone)) {
2125
2134
  dialog.infoMessage({ text: BgWidget.taiwanPhoneAlert() });
2126
2135
  return;
2127
2136
  }
@@ -2148,13 +2157,12 @@ export class UserList {
2148
2157
  pwd: gvc.glitter.getUUID(),
2149
2158
  userData: userData,
2150
2159
  }).then(r => {
2160
+ dialog.dataLoading({ visible: false });
2151
2161
  if (r.result) {
2152
- dialog.dataLoading({ visible: false });
2153
- dialog.infoMessage({ text: '成功新增會員' });
2162
+ dialog.successMessage({ text: '顧客新增成功' });
2154
2163
  vm.type = 'list';
2155
2164
  } else {
2156
- dialog.dataLoading({ visible: false });
2157
- dialog.errorMessage({ text: '會員建立失敗' });
2165
+ dialog.errorMessage({ text: '顧客新增失敗' });
2158
2166
  }
2159
2167
  });
2160
2168
  }
@@ -28,11 +28,11 @@ export class CheckInput {
28
28
  return regex.test(input);
29
29
  }
30
30
  static isChineseEnglishNumberHyphen(input) {
31
- const regex = /^[A-Za-z0-9\u4e00-\u9fa5\- ]*$/;
31
+ const regex = /^[\u4e00-\u9fa5a-zA-Z0-9-]+$/;
32
32
  return regex.test(input);
33
33
  }
34
34
  static isBirthString(input) {
35
- if (input.length !== 8) {
35
+ if (!input || input.length !== 8) {
36
36
  return false;
37
37
  }
38
38
  const year = parseInt(input.substring(0, 4), 10);