ts-glitter 18.1.1 → 18.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lowcode/Entry.js CHANGED
@@ -90,7 +90,7 @@ export class Entry {
90
90
  }
91
91
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
92
92
  console.log(`Entry-time:`, window.renderClock.stop());
93
- glitter.share.editerVersion = 'V_18.1.1';
93
+ glitter.share.editerVersion = 'V_18.1.2';
94
94
  glitter.share.start = new Date();
95
95
  const vm = {
96
96
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -91,7 +91,7 @@ export class Entry {
91
91
  }
92
92
  (window as any).renderClock = (window as any).renderClock ?? clockF();
93
93
  console.log(`Entry-time:`, (window as any).renderClock.stop());
94
- glitter.share.editerVersion = 'V_18.1.1';
94
+ glitter.share.editerVersion = 'V_18.1.2';
95
95
  glitter.share.start = new Date();
96
96
  const vm: {
97
97
  appConfig: any;
@@ -69,6 +69,42 @@ export class UserList {
69
69
  key: '上次登入時間',
70
70
  value: `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.online_time), 'yyyy-MM-dd hh:mm')}</span>`,
71
71
  },
72
+ {
73
+ key: '社群綁定',
74
+ value: (() => {
75
+ return `<div class="d-flex align-items-center px-2" style="gap:5px;">
76
+ ${[
77
+ {
78
+ type: 'fb',
79
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722847285395-img_facebook.svg',
80
+ value: dd.userData['fb-id']
81
+ },
82
+ {
83
+ type: 'line',
84
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/LINE_Brand_icon.png',
85
+ value: dd.userData.lineID
86
+ },
87
+ {
88
+ type: 'google',
89
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/Google__G__logo.svg.webp',
90
+ value: dd.userData['google-id']
91
+ },
92
+ {
93
+ type: 'apple',
94
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/14776639.png',
95
+ value: dd.userData['apple-id']
96
+ }
97
+ ].map(((dd) => {
98
+ if (!dd.value) {
99
+ return ``;
100
+ }
101
+ return `<div class="d-flex align-items-center" style="gap:5px;">
102
+ <img src="${dd.src}" style="width:25px;height: 25px;background: whitesmoke;" class="rounded-circle" >
103
+ </div>`;
104
+ })).filter((dd) => { return dd; }).join('')}
105
+ </div>`;
106
+ })(),
107
+ },
72
108
  {
73
109
  key: '用戶狀態',
74
110
  value: (() => {
@@ -1048,7 +1084,7 @@ export class UserList {
1048
1084
  data_from: 'manager',
1049
1085
  email: vm.data.userData.email,
1050
1086
  phone: vm.data.userData.phone,
1051
- status: 1,
1087
+ valid: true
1052
1088
  }).then((data) => {
1053
1089
  vm.dataList = data.response.data;
1054
1090
  vd.pageSize = Math.ceil(data.response.total / limit);
@@ -1255,30 +1291,54 @@ ${(dd.value) ? `<div class="fw-500 " style="font-size: 14px; font-weight: 400; c
1255
1291
  data_from: 'manager',
1256
1292
  email: vm.data.userData.email,
1257
1293
  phone: vm.data.userData.phone,
1258
- status: 1,
1294
+ valid: true
1259
1295
  }).then((data) => {
1260
1296
  let total_price = 0;
1297
+ let firstData = undefined;
1261
1298
  data.response.data.map((item) => {
1299
+ if (!firstData) {
1300
+ firstData = item;
1301
+ }
1262
1302
  total_price += item.orderData.total;
1263
1303
  });
1264
1304
  const formatNum = (n) => parseInt(`${n}`, 10).toLocaleString();
1265
- resolve(html ` <div class="gray-bottom-line-18">
1266
- <div class="tx_700">消費總金額</div>
1305
+ resolve(html ` <div class="">
1306
+ ${[`<div class="tx_700">累積消費金額</div>
1267
1307
  ${total_price === 0
1268
- ? html ` <div
1269
- style="font-size: 14px; font-weight: 400; color: #393939; margin-top: 12px;"
1308
+ ? html ` <div
1309
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1270
1310
  >
1271
1311
  此顧客還沒有任何消費紀錄
1272
1312
  </div>`
1273
- : html ` <div
1274
- style="font-size: 32px; font-weight: 400; color: #393939; margin-top: 12px;"
1313
+ : html ` <div
1314
+ style="font-size: 32px; font-weight: 400; color: #393939; "
1275
1315
  >
1276
1316
  ${formatNum(total_price)}
1277
- </div>`}
1278
- <div class="tx_700" style="margin-top: 18px">消費次數</div>
1279
- <div style="font-size: 32px; font-weight: 400; color: #393939; margin-top: 12px;">
1317
+ </div>`}`,
1318
+ ` <div class="tx_700" style="">累計消費次數</div>
1319
+ <div style="font-size: 32px; font-weight: 400; color: #393939; ">
1280
1320
  ${formatNum(data.response.total)}
1321
+ </div>`, `
1322
+ <div class="tx_700" style="">最後消費金額</div>
1323
+ <div class=""
1324
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1325
+ >
1326
+ ${!firstData ? `此顧客還沒有任何消費紀錄` : `<div
1327
+ style="font-size: 32px; font-weight: 400; color: #393939; "
1328
+ >
1329
+ ${formatNum(firstData.orderData.total)}
1330
+ </div>`}
1331
+ </div>
1332
+ `, `
1333
+ <div class="tx_700" style="">最後購買日期</div>
1334
+ <div class=""
1335
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1336
+ >
1337
+ ${!firstData ? `此顧客還沒有任何消費紀錄` : `<div class="fw-500">${gvc.glitter.ut.dateFormat(new Date(firstData.created_time), 'yyyy-MM-dd hh:mm')}</div>`}
1281
1338
  </div>
1339
+ `].join(`<div class="my-3 w-100 border-top"></div>`)}
1340
+
1341
+
1282
1342
  </div>`);
1283
1343
  });
1284
1344
  });
@@ -92,6 +92,42 @@ export class UserList {
92
92
  key: '上次登入時間',
93
93
  value: `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.online_time), 'yyyy-MM-dd hh:mm')}</span>`,
94
94
  },
95
+ {
96
+ key: '社群綁定',
97
+ value: (() => {
98
+ return `<div class="d-flex align-items-center px-2" style="gap:5px;">
99
+ ${[
100
+ {
101
+ type:'fb',
102
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/1722847285395-img_facebook.svg',
103
+ value:dd.userData['fb-id']
104
+ },
105
+ {
106
+ type:'line',
107
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/LINE_Brand_icon.png',
108
+ value:dd.userData.lineID
109
+ },
110
+ {
111
+ type:'google',
112
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/Google__G__logo.svg.webp',
113
+ value:dd.userData['google-id']
114
+ },
115
+ {
116
+ type:'apple',
117
+ src: 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/14776639.png',
118
+ value:dd.userData['apple-id']
119
+ }
120
+ ].map(((dd)=>{
121
+ if(!dd.value){
122
+ return ``
123
+ }
124
+ return `<div class="d-flex align-items-center" style="gap:5px;">
125
+ <img src="${dd.src}" style="width:25px;height: 25px;background: whitesmoke;" class="rounded-circle" >
126
+ </div>`
127
+ })).filter((dd)=>{return dd}).join('')}
128
+ </div>`
129
+ })(),
130
+ },
95
131
  {
96
132
  key: '用戶狀態',
97
133
  value: (() => {
@@ -398,6 +434,7 @@ export class UserList {
398
434
  key: '上次登入時間',
399
435
  value: `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.online_time), 'yyyy-MM-dd hh:mm')}</span>`,
400
436
  },
437
+
401
438
  {
402
439
  key: '用戶狀態',
403
440
  value: (() => {
@@ -1153,7 +1190,7 @@ export class UserList {
1153
1190
  data_from: 'manager',
1154
1191
  email: vm.data.userData.email,
1155
1192
  phone: vm.data.userData.phone,
1156
- status: 1,
1193
+ valid:true
1157
1194
  }).then((data) => {
1158
1195
  vm.dataList = data.response.data;
1159
1196
  vd.pageSize = Math.ceil(data.response.total / limit);
@@ -1366,32 +1403,58 @@ ${(dd.value) ? `<div class="fw-500 " style="font-size: 14px; font-weight: 400; c
1366
1403
  data_from: 'manager',
1367
1404
  email: vm.data.userData.email,
1368
1405
  phone: vm.data.userData.phone,
1369
- status: 1,
1406
+ valid:true
1370
1407
  }).then((data) => {
1371
1408
  let total_price = 0;
1409
+ let firstData:any=undefined
1372
1410
  data.response.data.map((item: any) => {
1411
+ if(!firstData){
1412
+ firstData=item
1413
+ }
1373
1414
  total_price += item.orderData.total;
1374
1415
  });
1375
1416
  const formatNum = (n: string | number) => parseInt(`${n}`, 10).toLocaleString();
1376
1417
 
1377
1418
  resolve(
1378
- html` <div class="gray-bottom-line-18">
1379
- <div class="tx_700">消費總金額</div>
1419
+ html` <div class="">
1420
+ ${
1421
+ [`<div class="tx_700">累積消費金額</div>
1380
1422
  ${total_price === 0
1381
- ? html` <div
1382
- style="font-size: 14px; font-weight: 400; color: #393939; margin-top: 12px;"
1423
+ ? html` <div
1424
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1383
1425
  >
1384
1426
  此顧客還沒有任何消費紀錄
1385
1427
  </div>`
1386
- : html` <div
1387
- style="font-size: 32px; font-weight: 400; color: #393939; margin-top: 12px;"
1428
+ : html` <div
1429
+ style="font-size: 32px; font-weight: 400; color: #393939; "
1388
1430
  >
1389
1431
  ${formatNum(total_price)}
1390
- </div>`}
1391
- <div class="tx_700" style="margin-top: 18px">消費次數</div>
1392
- <div style="font-size: 32px; font-weight: 400; color: #393939; margin-top: 12px;">
1432
+ </div>`}`,
1433
+ ` <div class="tx_700" style="">累計消費次數</div>
1434
+ <div style="font-size: 32px; font-weight: 400; color: #393939; ">
1393
1435
  ${formatNum(data.response.total)}
1436
+ </div>`,`
1437
+ <div class="tx_700" style="">最後消費金額</div>
1438
+ <div class=""
1439
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1440
+ >
1441
+ ${!firstData ? `此顧客還沒有任何消費紀錄`:`<div
1442
+ style="font-size: 32px; font-weight: 400; color: #393939; "
1443
+ >
1444
+ ${formatNum(firstData.orderData.total)}
1445
+ </div>`}
1446
+ </div>
1447
+ `,`
1448
+ <div class="tx_700" style="">最後購買日期</div>
1449
+ <div class=""
1450
+ style="font-size: 14px; font-weight: 400; color: #393939; "
1451
+ >
1452
+ ${!firstData ? `此顧客還沒有任何消費紀錄`:`<div class="fw-500">${gvc.glitter.ut.dateFormat(new Date(firstData.created_time), 'yyyy-MM-dd hh:mm')}</div>`}
1394
1453
  </div>
1454
+ `].join(`<div class="my-3 w-100 border-top"></div>`)
1455
+ }
1456
+
1457
+
1395
1458
  </div>`
1396
1459
  );
1397
1460
  });
@@ -484,6 +484,7 @@ export class ApiShop {
484
484
  json.email && par.push(`email=${json.email}`);
485
485
  json.phone && par.push(`phone=${json.phone}`);
486
486
  json.status && par.push(`status=${json.status}`);
487
+ json.valid && par.push(`valid=${json.valid}`);
487
488
  json.searchType && par.push(`searchType=${json.searchType}`);
488
489
  json.orderString && par.push(`orderString=${json.orderString}`);
489
490
  json.archived && par.push(`archived=${json.archived}`);
@@ -532,6 +532,7 @@ export class ApiShop {
532
532
  archived?: string;
533
533
  distribution_code?: string;
534
534
  returnSearch?: 'true';
535
+ valid?:boolean
535
536
  }) {
536
537
  const filterString = this.orderListFilterString(json.filter);
537
538
  return BaseApi.create({
@@ -544,6 +545,7 @@ export class ApiShop {
544
545
  json.email && par.push(`email=${json.email}`);
545
546
  json.phone && par.push(`phone=${json.phone}`);
546
547
  json.status && par.push(`status=${json.status}`);
548
+ json.valid && par.push(`valid=${json.valid}`);
547
549
  json.searchType && par.push(`searchType=${json.searchType}`);
548
550
  json.orderString && par.push(`orderString=${json.orderString}`);
549
551
  json.archived && par.push(`archived=${json.archived}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "18.1.1",
3
+ "version": "18.1.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -326,6 +326,7 @@ router.get('/order', async (req: express.Request, resp: express.Response) => {
326
326
  archived: req.query.archived as string,
327
327
  distribution_code: req.query.distribution_code as string,
328
328
  returnSearch: req.query.returnSearch as string,
329
+ valid:req.query.valid === 'true'
329
330
  })
330
331
  );
331
332
  } else if (await UtPermission.isAppUser(req)) {
@@ -3256,6 +3256,7 @@ export class Shopping {
3256
3256
  archived?: string;
3257
3257
  returnSearch?: string;
3258
3258
  distribution_code?: string;
3259
+ valid?:boolean;
3259
3260
  }) {
3260
3261
  try {
3261
3262
  let querySql = ['1=1'];
@@ -3288,6 +3289,9 @@ export class Shopping {
3288
3289
  temp += `JSON_UNQUOTE(JSON_EXTRACT(orderData, '$.orderStatus')) IN (${query.orderStatus})`;
3289
3290
  querySql.push(`(${temp})`);
3290
3291
  }
3292
+ if(query.valid){
3293
+ querySql.push(`(orderData->>'$.orderStatus' is null or orderData->>'$.orderStatus' != '-1')`)
3294
+ }
3291
3295
 
3292
3296
  if (query.progress) {
3293
3297
  let newArray = query.progress.split(',');