ts-glitter 21.1.5 → 21.1.6
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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/module/order-excel.js +256 -132
- package/lowcode/cms-plugin/module/order-excel.ts +228 -81
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -1
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -1
- package/lowcode/cms-plugin/shopping-order-manager.js +33 -29
- package/lowcode/cms-plugin/shopping-order-manager.ts +36 -30
- package/lowcode/editor-components/global-widget/global-widget.js +254 -0
- package/lowcode/editor-components/global-widget/global-widget.ts +269 -0
- package/lowcode/editor-components/global-widget/src/banner.jpg +0 -0
- package/lowcode/editor-components/global-widget/src/footer.jpg +0 -0
- package/lowcode/editor-components/global-widget/src/header.png +0 -0
- package/lowcode/editor-components/global-widget/src/product.jpg +0 -0
- package/lowcode/jspage/function-page/tool-setting.js +18 -94
- package/lowcode/jspage/function-page/tool-setting.ts +21 -93
- package/lowcode/public-components/checkout/index.js +32 -1
- package/lowcode/public-components/checkout/index.ts +32 -1
- package/lowcode/public-components/product/pd-card-01.js +0 -58
- package/lowcode/public-components/product/pd-card-01.ts +0 -45
- package/lowcode/public-components/product/pd-card-02.js +1 -59
- package/lowcode/public-components/product/pd-card-02.ts +1 -45
- package/lowcode/public-components/product/pd-card-03.js +2 -59
- package/lowcode/public-components/product/pd-card-03.ts +2 -46
- package/package.json +1 -1
- package/src/api-public/services/financial-serviceV2.js +17 -7
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/post.js +17 -7
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/shopee.js +17 -7
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
|
@@ -44,46 +44,51 @@ export class OrderExcel {
|
|
|
44
44
|
];
|
|
45
45
|
|
|
46
46
|
// 匯出可選欄位
|
|
47
|
-
static headerColumn = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
47
|
+
static headerColumn = async () => {
|
|
48
|
+
const customizeMap = await this.getCustomizeMap();
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
訂單: [
|
|
52
|
+
'訂單編號',
|
|
53
|
+
'訂單來源',
|
|
54
|
+
'訂單建立時間',
|
|
55
|
+
'會員信箱',
|
|
56
|
+
'訂單處理狀態',
|
|
57
|
+
'付款狀態',
|
|
58
|
+
'出貨狀態',
|
|
59
|
+
'訂單小計',
|
|
60
|
+
'訂單運費',
|
|
61
|
+
'訂單使用優惠券',
|
|
62
|
+
'訂單折扣',
|
|
63
|
+
'訂單使用購物金',
|
|
64
|
+
'分銷連結代碼',
|
|
65
|
+
'分銷連結名稱',
|
|
66
|
+
],
|
|
67
|
+
商品: ['商品名稱', '商品規格', '商品SKU', '商品購買數量', '商品價格', '商品折扣'],
|
|
68
|
+
顧客: [
|
|
69
|
+
'顧客姓名',
|
|
70
|
+
'顧客手機',
|
|
71
|
+
'顧客信箱',
|
|
72
|
+
'收件人姓名',
|
|
73
|
+
'收件人手機',
|
|
74
|
+
'收件人信箱',
|
|
75
|
+
'付款方式',
|
|
76
|
+
'配送方式',
|
|
77
|
+
'收貨地址',
|
|
78
|
+
'代收金額',
|
|
79
|
+
'出貨單號碼',
|
|
80
|
+
'出貨單日期',
|
|
81
|
+
'發票號碼',
|
|
82
|
+
'會員等級',
|
|
83
|
+
'備註',
|
|
84
|
+
],
|
|
85
|
+
對帳資訊: ['對帳狀態', '入帳金額', '入帳日期', '應沖金額', '沖帳原因'],
|
|
86
|
+
客製化資訊: [...customizeMap.keys()],
|
|
87
|
+
};
|
|
83
88
|
};
|
|
84
89
|
|
|
85
90
|
// 選項元素
|
|
86
|
-
static optionsView(gvc: GVC, callback: (dataArray: string[]) => void) {
|
|
91
|
+
static async optionsView(gvc: GVC, callback: (dataArray: string[]) => void) {
|
|
87
92
|
let columnList = new Set<string>();
|
|
88
93
|
const randomString = BgWidget.getCheckedClass(gvc);
|
|
89
94
|
|
|
@@ -144,14 +149,27 @@ export class OrderExcel {
|
|
|
144
149
|
</div>
|
|
145
150
|
`;
|
|
146
151
|
},
|
|
147
|
-
divCreate: {
|
|
152
|
+
divCreate: {
|
|
153
|
+
class: (() => {
|
|
154
|
+
let maxLength = Math.max(...fields.map(field => field.length));
|
|
155
|
+
switch (true) {
|
|
156
|
+
case maxLength < 12:
|
|
157
|
+
return 'col-12 col-md-4 mb-3';
|
|
158
|
+
case maxLength >= 12 && maxLength < 20:
|
|
159
|
+
return 'col-12 col-md-6 mb-3';
|
|
160
|
+
case maxLength > 20:
|
|
161
|
+
return 'col-12 col-md-12 mb-3';
|
|
162
|
+
}
|
|
163
|
+
})(),
|
|
164
|
+
},
|
|
148
165
|
});
|
|
149
166
|
})
|
|
150
167
|
.join('')}
|
|
151
168
|
</div>
|
|
152
169
|
`;
|
|
153
170
|
|
|
154
|
-
|
|
171
|
+
const getColumn = await this.headerColumn();
|
|
172
|
+
return checkboxContainer(getColumn);
|
|
155
173
|
}
|
|
156
174
|
|
|
157
175
|
// 匯出方法
|
|
@@ -168,13 +186,14 @@ export class OrderExcel {
|
|
|
168
186
|
// 取得琣送與付款方式設定檔
|
|
169
187
|
const [shipment_methods, payment_methods] = await Promise.all([
|
|
170
188
|
ShipmentConfig.shipmentMethod({
|
|
171
|
-
type:'all'
|
|
189
|
+
type: 'all',
|
|
172
190
|
}),
|
|
173
191
|
PaymentConfig.getSupportPayment(true),
|
|
174
192
|
]);
|
|
175
193
|
|
|
176
194
|
// 是否將訂單拆分商品欄位
|
|
177
|
-
const
|
|
195
|
+
const getColumn = await this.headerColumn();
|
|
196
|
+
const showLineItems = getColumn['商品'].some(a => column.includes(a));
|
|
178
197
|
|
|
179
198
|
// 格式化資料時間
|
|
180
199
|
const formatDate = (date?: string | number) =>
|
|
@@ -303,32 +322,52 @@ export class OrderExcel {
|
|
|
303
322
|
沖帳原因: order.offset_reason ?? '-',
|
|
304
323
|
});
|
|
305
324
|
};
|
|
325
|
+
|
|
326
|
+
// 客製化資訊
|
|
327
|
+
const getCustomizeJSON = async (order: any) => {
|
|
328
|
+
const customizeMap = await this.getCustomizeMap(order);
|
|
329
|
+
const json = Object.fromEntries(customizeMap);
|
|
330
|
+
|
|
331
|
+
return formatJSON(json);
|
|
332
|
+
};
|
|
333
|
+
|
|
306
334
|
// 匯出訂單 Excel
|
|
307
|
-
function exportOrdersToExcel(dataArray: any[]) {
|
|
335
|
+
async function exportOrdersToExcel(dataArray: any[]) {
|
|
308
336
|
if (!dataArray.length) {
|
|
309
337
|
dialog.errorMessage({ text: '無訂單資料可以匯出' });
|
|
310
338
|
return;
|
|
311
339
|
}
|
|
312
340
|
|
|
313
|
-
const printArray =
|
|
341
|
+
const printArray = [];
|
|
342
|
+
|
|
343
|
+
for (const order of dataArray) {
|
|
314
344
|
const orderData = order.orderData;
|
|
315
|
-
|
|
316
|
-
|
|
345
|
+
const customizeJSON = await getCustomizeJSON(order);
|
|
346
|
+
|
|
347
|
+
if (showLineItems) {
|
|
348
|
+
printArray.push(
|
|
349
|
+
orderData.lineItems.map((item: any) => ({
|
|
317
350
|
...getOrderJSON(order, orderData),
|
|
318
351
|
...getProductJSON(item),
|
|
319
352
|
...getUserJSON(order, orderData),
|
|
320
353
|
...getReconciliationJSON(order),
|
|
354
|
+
...customizeJSON,
|
|
321
355
|
}))
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
356
|
+
);
|
|
357
|
+
} else {
|
|
358
|
+
printArray.push([
|
|
359
|
+
{
|
|
360
|
+
...getOrderJSON(order, orderData),
|
|
361
|
+
...getUserJSON(order, orderData),
|
|
362
|
+
...getReconciliationJSON(order),
|
|
363
|
+
...customizeJSON,
|
|
364
|
+
},
|
|
365
|
+
]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
330
368
|
|
|
331
|
-
const
|
|
369
|
+
const printArrayFlat = printArray.flat();
|
|
370
|
+
const worksheet = XLSX.utils.json_to_sheet(printArrayFlat);
|
|
332
371
|
const workbook = XLSX.utils.book_new();
|
|
333
372
|
XLSX.utils.book_append_sheet(workbook, worksheet, '訂單列表');
|
|
334
373
|
|
|
@@ -338,21 +377,25 @@ export class OrderExcel {
|
|
|
338
377
|
|
|
339
378
|
// 透過 API, 取得訂單資料
|
|
340
379
|
async function fetchOrders(limit: number) {
|
|
341
|
-
dialog.dataLoading({ visible: true });
|
|
380
|
+
dialog.dataLoading({ visible: true, text: '匯出資料中,請稍後...' });
|
|
342
381
|
try {
|
|
343
382
|
const response = await ApiShop.getOrder({
|
|
344
383
|
...apiJSON,
|
|
345
384
|
page: 0,
|
|
346
385
|
limit: limit,
|
|
347
386
|
});
|
|
348
|
-
dialog.dataLoading({ visible: false });
|
|
349
387
|
|
|
350
388
|
if (response?.response?.total > 0) {
|
|
351
|
-
|
|
389
|
+
const orders = response.response.data;
|
|
390
|
+
await exportOrdersToExcel(orders).then(() => {
|
|
391
|
+
dialog.dataLoading({ visible: false });
|
|
392
|
+
});
|
|
352
393
|
} else {
|
|
394
|
+
dialog.dataLoading({ visible: false });
|
|
353
395
|
dialog.errorMessage({ text: '匯出檔案發生錯誤' });
|
|
354
396
|
}
|
|
355
397
|
} catch (error) {
|
|
398
|
+
console.error(error);
|
|
356
399
|
dialog.dataLoading({ visible: false });
|
|
357
400
|
dialog.errorMessage({ text: '無法取得訂單資料' });
|
|
358
401
|
}
|
|
@@ -365,6 +408,57 @@ export class OrderExcel {
|
|
|
365
408
|
});
|
|
366
409
|
}
|
|
367
410
|
|
|
411
|
+
// 取得客製化資訊
|
|
412
|
+
static getCustomizeMap = async (order?: any) => {
|
|
413
|
+
const [cashflowConfigObj, shipmentConfigObj, registerConfig, memberConfig] = await OrderExcel.customizePromise();
|
|
414
|
+
|
|
415
|
+
const customizeMap = new Map();
|
|
416
|
+
|
|
417
|
+
const getUserValue = (key: string) => {
|
|
418
|
+
try {
|
|
419
|
+
return order.user_data.userData[key] || '-';
|
|
420
|
+
} catch (error) {
|
|
421
|
+
return '-';
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
const getCashflowValue = (key: string) => {
|
|
426
|
+
try {
|
|
427
|
+
return order.orderData.user_info.custom_form_payment[key] || '-';
|
|
428
|
+
} catch (error) {
|
|
429
|
+
return '-';
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
const getShipmentValue = (key: string) => {
|
|
434
|
+
try {
|
|
435
|
+
return order.orderData.user_info.custom_form_delivery[key] || '-';
|
|
436
|
+
} catch (error) {
|
|
437
|
+
return '-';
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
(registerConfig || []).map((item: any) => {
|
|
442
|
+
customizeMap.set(`註冊自訂值 - ${item.title}`, order ? getUserValue(item.key) : '-');
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
(memberConfig || []).map((item: any) => {
|
|
446
|
+
customizeMap.set(`會員自訂值 - ${item.title}`, order ? getUserValue(item.key) : '-');
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
const cashflowConfig = order ? cashflowConfigObj[order.payment_method] : Object.values(cashflowConfigObj).flat();
|
|
450
|
+
(cashflowConfig || []).map((item: any) => {
|
|
451
|
+
customizeMap.set(`金流自訂值 - ${item.title}`, order ? getCashflowValue(item.key) : '-');
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
const shipmentConfig = order ? shipmentConfigObj[order.shipment_method] : Object.values(shipmentConfigObj).flat();
|
|
455
|
+
(shipmentConfig || []).map((item: any) => {
|
|
456
|
+
customizeMap.set(`物流自訂值 - ${item.title}`, order ? getShipmentValue(item.key) : '-');
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
return customizeMap;
|
|
460
|
+
};
|
|
461
|
+
|
|
368
462
|
// 匯出檔案彈出視窗
|
|
369
463
|
static exportDialog(gvc: GVC, apiJSON: any, dataArray: any[]) {
|
|
370
464
|
const vm = {
|
|
@@ -391,28 +485,38 @@ export class OrderExcel {
|
|
|
391
485
|
title: '匯出' + pageType,
|
|
392
486
|
width: 700,
|
|
393
487
|
innerHTML: gvc2 => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
488
|
+
const id = gvc2.glitter.getUUID();
|
|
489
|
+
|
|
490
|
+
return gvc2.bindView({
|
|
491
|
+
bind: id,
|
|
492
|
+
view: async () => {
|
|
493
|
+
const view = await this.optionsView(gvc2, cols => {
|
|
494
|
+
vm.column = cols;
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
return html`<div class="d-flex flex-column align-items-start gap-2">
|
|
498
|
+
<div class="tx_700 mb-2">匯出範圍</div>
|
|
499
|
+
${BgWidget.multiCheckboxContainer(
|
|
500
|
+
gvc2,
|
|
501
|
+
[
|
|
502
|
+
{ key: 'all', name: `全部${pageType}` },
|
|
503
|
+
{ key: 'search', name: '目前搜尋與篩選的結果' },
|
|
504
|
+
{ key: 'checked', name: `勾選的 ${dataArray.length} 個訂單` },
|
|
505
|
+
],
|
|
506
|
+
[vm.select],
|
|
507
|
+
(res: any) => {
|
|
508
|
+
vm.select = res[0];
|
|
509
|
+
},
|
|
510
|
+
{ single: true }
|
|
511
|
+
)}
|
|
512
|
+
<div class="tx_700 mb-2">
|
|
513
|
+
匯出欄位
|
|
514
|
+
${BgWidget.grayNote('*若勾選商品系列的欄位,將會以訂單商品作為資料列匯出 Excel', 'margin: 4px;')}
|
|
515
|
+
</div>
|
|
516
|
+
${view}
|
|
517
|
+
</div>`;
|
|
518
|
+
},
|
|
519
|
+
});
|
|
416
520
|
},
|
|
417
521
|
footer_html: gvc2 => {
|
|
418
522
|
return [
|
|
@@ -429,13 +533,12 @@ export class OrderExcel {
|
|
|
429
533
|
return;
|
|
430
534
|
}
|
|
431
535
|
|
|
432
|
-
|
|
433
536
|
const dataMap: Record<Range, any> = {
|
|
434
537
|
search: apiJSON,
|
|
435
538
|
checked: {
|
|
436
539
|
...apiJSON,
|
|
437
540
|
id_list: dataArray.map(data => data.id).join(','),
|
|
438
|
-
searchType:'id'
|
|
541
|
+
searchType: 'id',
|
|
439
542
|
},
|
|
440
543
|
all: {
|
|
441
544
|
is_reconciliation: apiJSON.is_reconciliation,
|
|
@@ -584,6 +687,7 @@ export class OrderExcel {
|
|
|
584
687
|
dialog.dataLoading({ visible: false });
|
|
585
688
|
dialog.errorMessage({ text: text });
|
|
586
689
|
}
|
|
690
|
+
|
|
587
691
|
if (target.files?.length) {
|
|
588
692
|
try {
|
|
589
693
|
dialog.dataLoading({ visible: true, text: '上傳檔案中' });
|
|
@@ -867,4 +971,47 @@ export class OrderExcel {
|
|
|
867
971
|
});
|
|
868
972
|
}, vm.id);
|
|
869
973
|
}
|
|
974
|
+
|
|
975
|
+
static async customizePromise() {
|
|
976
|
+
const saasConfig: { config: any; api: any } = (window.parent as any).saasConfig;
|
|
977
|
+
|
|
978
|
+
const dataArray = await Promise.all([
|
|
979
|
+
// 自訂金流
|
|
980
|
+
await saasConfig.api.getPrivateConfig(saasConfig.config.appName, 'glitter_finance').then((data: any) => {
|
|
981
|
+
const cashflowObject: any = {};
|
|
982
|
+
|
|
983
|
+
data.response.result[0].value.payment_info_custom.map((item: any) => {
|
|
984
|
+
ApiUser.getPublicConfig(`form_finance_${item.id}`, 'manager').then(r => {
|
|
985
|
+
cashflowObject[item.id] = r.response.value.list;
|
|
986
|
+
});
|
|
987
|
+
});
|
|
988
|
+
|
|
989
|
+
return cashflowObject;
|
|
990
|
+
}),
|
|
991
|
+
// 自訂物流
|
|
992
|
+
await saasConfig.api.getPrivateConfig(saasConfig.config.appName, 'logistics_setting').then((data: any) => {
|
|
993
|
+
const shipmentObject: any = {};
|
|
994
|
+
|
|
995
|
+
data.response.result[0].value.custom_delivery.map((item: any) => {
|
|
996
|
+
ApiUser.getPublicConfig(`form_delivery_${item.id}`, 'manager').then(r => {
|
|
997
|
+
if (r.response.value.list.length > 0) {
|
|
998
|
+
shipmentObject[item.id] = r.response.value.list;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
return shipmentObject;
|
|
1004
|
+
}),
|
|
1005
|
+
// 註冊資料
|
|
1006
|
+
await ApiUser.getPublicConfig('custom_form_register', 'manager').then(r => {
|
|
1007
|
+
return Array.isArray(r.response.value.list) ? r.response.value.list : [];
|
|
1008
|
+
}),
|
|
1009
|
+
// 會員資料
|
|
1010
|
+
await ApiUser.getPublicConfig('customer_form_user_setting', 'manager').then(r => {
|
|
1011
|
+
return Array.isArray(r.response.value.list) ? r.response.value.list : [];
|
|
1012
|
+
}),
|
|
1013
|
+
]);
|
|
1014
|
+
|
|
1015
|
+
return dataArray;
|
|
1016
|
+
}
|
|
870
1017
|
}
|
|
@@ -1538,51 +1538,55 @@ export class ShoppingOrderManager {
|
|
|
1538
1538
|
return {
|
|
1539
1539
|
bind: gvc.glitter.getUUID(),
|
|
1540
1540
|
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
1541
|
-
|
|
1541
|
+
const needAddress = [
|
|
1542
|
+
'normal',
|
|
1543
|
+
'black_cat',
|
|
1544
|
+
'black_cat_freezing',
|
|
1545
|
+
'black_cat_ice',
|
|
1546
|
+
'global_express',
|
|
1547
|
+
].includes(orderData.orderData.user_info.shipment);
|
|
1548
|
+
const viewModel = [
|
|
1542
1549
|
['姓名', 'name'],
|
|
1543
1550
|
['電話', 'phone'],
|
|
1544
1551
|
['信箱', 'email'],
|
|
1545
1552
|
['縣市', 'city'],
|
|
1546
1553
|
['鄉鎮', 'area'],
|
|
1547
1554
|
['地址', 'address'],
|
|
1548
|
-
]
|
|
1555
|
+
].filter(item => {
|
|
1556
|
+
return needAddress || !['city', 'area', 'address'].includes(item[1]);
|
|
1557
|
+
});
|
|
1549
1558
|
const receipt = (yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value;
|
|
1550
1559
|
receipt.list.map((d1) => {
|
|
1551
1560
|
if (!viewModel.find(dd => dd[1] === d1.key)) {
|
|
1552
1561
|
viewModel.push([d1.title, d1.key]);
|
|
1553
1562
|
}
|
|
1554
1563
|
});
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
<input
|
|
1572
|
-
style="display: flex;padding: 9px 18px;align-items: flex-start;gap: 10px;flex: 1 0 0;border-radius: 10px;border: 1px solid #DDD;"
|
|
1573
|
-
value="${orderData.orderData.user_info[item[1]]}"
|
|
1574
|
-
onchange="${gvc.event(e => {
|
|
1564
|
+
return viewModel
|
|
1565
|
+
.map(item => {
|
|
1566
|
+
return vm.mode == 'read'
|
|
1567
|
+
? html ` <div>
|
|
1568
|
+
${item[0]} : ${orderData.orderData.user_info[item[1]] || '未填寫'}
|
|
1569
|
+
</div>
|
|
1570
|
+
${BgWidget.mbContainer(4)}`
|
|
1571
|
+
: html `
|
|
1572
|
+
<div class="d-flex flex-column w-100" style="gap: 8px;">
|
|
1573
|
+
<div style="${item[0] == '姓名' ? '' : 'margin-top: 12px;'}">
|
|
1574
|
+
${item[0]}
|
|
1575
|
+
</div>
|
|
1576
|
+
<input
|
|
1577
|
+
style="display: flex;padding: 9px 18px;align-items: flex-start;gap: 10px;flex: 1 0 0;border-radius: 10px;border: 1px solid #DDD;"
|
|
1578
|
+
value="${orderData.orderData.user_info[item[1]]}"
|
|
1579
|
+
onchange="${gvc.event(e => {
|
|
1575
1580
|
orderData.orderData.user_info[item[1]] = e.value;
|
|
1576
1581
|
})}"
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
}
|
|
1582
|
+
/>
|
|
1583
|
+
</div>
|
|
1584
|
+
`;
|
|
1585
|
+
})
|
|
1586
|
+
.join('');
|
|
1583
1587
|
}),
|
|
1584
1588
|
divCreate: {
|
|
1585
|
-
class:
|
|
1589
|
+
class: 'tx_normal',
|
|
1586
1590
|
},
|
|
1587
1591
|
};
|
|
1588
1592
|
})}
|
|
@@ -1736,14 +1736,24 @@ export class ShoppingOrderManager {
|
|
|
1736
1736
|
return {
|
|
1737
1737
|
bind: gvc.glitter.getUUID(),
|
|
1738
1738
|
view: async () => {
|
|
1739
|
-
|
|
1739
|
+
const needAddress = [
|
|
1740
|
+
'normal',
|
|
1741
|
+
'black_cat',
|
|
1742
|
+
'black_cat_freezing',
|
|
1743
|
+
'black_cat_ice',
|
|
1744
|
+
'global_express',
|
|
1745
|
+
].includes(orderData.orderData.user_info.shipment);
|
|
1746
|
+
|
|
1747
|
+
const viewModel = [
|
|
1740
1748
|
['姓名', 'name'],
|
|
1741
1749
|
['電話', 'phone'],
|
|
1742
1750
|
['信箱', 'email'],
|
|
1743
1751
|
['縣市', 'city'],
|
|
1744
1752
|
['鄉鎮', 'area'],
|
|
1745
1753
|
['地址', 'address'],
|
|
1746
|
-
]
|
|
1754
|
+
].filter(item => {
|
|
1755
|
+
return needAddress || !['city', 'area', 'address'].includes(item[1]);
|
|
1756
|
+
});
|
|
1747
1757
|
|
|
1748
1758
|
const receipt = (
|
|
1749
1759
|
await ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')
|
|
@@ -1755,36 +1765,32 @@ export class ShoppingOrderManager {
|
|
|
1755
1765
|
}
|
|
1756
1766
|
});
|
|
1757
1767
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
.
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
`;
|
|
1782
|
-
})
|
|
1783
|
-
.join('');
|
|
1784
|
-
}
|
|
1768
|
+
return viewModel
|
|
1769
|
+
.map(item => {
|
|
1770
|
+
return vm.mode == 'read'
|
|
1771
|
+
? html` <div>
|
|
1772
|
+
${item[0]} : ${(orderData.orderData.user_info as any)[item[1]] || '未填寫'}
|
|
1773
|
+
</div>
|
|
1774
|
+
${BgWidget.mbContainer(4)}`
|
|
1775
|
+
: html`
|
|
1776
|
+
<div class="d-flex flex-column w-100" style="gap: 8px;">
|
|
1777
|
+
<div style="${item[0] == '姓名' ? '' : 'margin-top: 12px;'}">
|
|
1778
|
+
${item[0]}
|
|
1779
|
+
</div>
|
|
1780
|
+
<input
|
|
1781
|
+
style="display: flex;padding: 9px 18px;align-items: flex-start;gap: 10px;flex: 1 0 0;border-radius: 10px;border: 1px solid #DDD;"
|
|
1782
|
+
value="${(orderData.orderData.user_info as any)[item[1]]}"
|
|
1783
|
+
onchange="${gvc.event(e => {
|
|
1784
|
+
(orderData.orderData.user_info as any)[item[1]] = e.value;
|
|
1785
|
+
})}"
|
|
1786
|
+
/>
|
|
1787
|
+
</div>
|
|
1788
|
+
`;
|
|
1789
|
+
})
|
|
1790
|
+
.join('');
|
|
1785
1791
|
},
|
|
1786
1792
|
divCreate: {
|
|
1787
|
-
class:
|
|
1793
|
+
class: 'tx_normal',
|
|
1788
1794
|
},
|
|
1789
1795
|
};
|
|
1790
1796
|
})}
|