ts-glitter 20.6.8 → 20.6.9
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 +2 -2
- package/lowcode/Entry.ts +2 -2
- package/lowcode/backend-manager/bg-blog.js +617 -621
- package/lowcode/backend-manager/bg-blog.ts +2323 -2325
- package/lowcode/backend-manager/bg-line.js +5 -4
- package/lowcode/backend-manager/bg-line.ts +5 -4
- package/lowcode/backend-manager/bg-list-component.js +9 -0
- package/lowcode/backend-manager/bg-list-component.ts +15 -1
- package/lowcode/backend-manager/bg-notify.js +6 -4
- package/lowcode/backend-manager/bg-notify.ts +6 -4
- package/lowcode/backend-manager/bg-product.js +145 -0
- package/lowcode/backend-manager/bg-product.ts +153 -0
- package/lowcode/backend-manager/bg-sns.js +5 -3
- package/lowcode/backend-manager/bg-sns.ts +5 -3
- package/lowcode/backend-manager/bg-widget.js +92 -4
- package/lowcode/backend-manager/bg-widget.ts +122 -6
- package/lowcode/backend-manager/splitPage.js +0 -39
- package/lowcode/backend-manager/splitPage.ts +0 -40
- package/lowcode/cms-plugin/auto-fcm-advertise.js +17 -5
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +19 -6
- package/lowcode/cms-plugin/auto-fcm-history.js +2732 -0
- package/lowcode/cms-plugin/auto-fcm-history.ts +2995 -0
- package/lowcode/cms-plugin/cms-router.js +5 -0
- package/lowcode/cms-plugin/cms-router.ts +6 -0
- package/lowcode/cms-plugin/filter-options.js +80 -27
- package/lowcode/cms-plugin/filter-options.ts +83 -27
- package/lowcode/cms-plugin/language-backend.js +50 -39
- package/lowcode/cms-plugin/language-backend.ts +109 -95
- package/lowcode/cms-plugin/menus-setting.js +175 -151
- package/lowcode/cms-plugin/menus-setting.ts +620 -591
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/data.js +7 -7
- package/lowcode/cms-plugin/module/data.ts +262 -233
- package/lowcode/cms-plugin/module/delivery-html.js +18 -10
- package/lowcode/cms-plugin/module/delivery-html.ts +26 -10
- package/lowcode/cms-plugin/module/order-setting.js +458 -328
- package/lowcode/cms-plugin/module/order-setting.ts +622 -351
- package/lowcode/cms-plugin/module/product-excel.js +1 -1
- package/lowcode/cms-plugin/module/product-excel.ts +2 -1
- package/lowcode/cms-plugin/order/order-module.js +90 -1
- package/lowcode/cms-plugin/order/order-module.ts +106 -1
- package/lowcode/cms-plugin/pos-pages/payment-page.js +11 -8
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +28 -15
- package/lowcode/cms-plugin/pos-pages/products-page.js +0 -39
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -40
- package/lowcode/cms-plugin/shopping-collections.ts +1 -3
- package/lowcode/cms-plugin/shopping-finance-setting.js +19 -80
- package/lowcode/cms-plugin/shopping-finance-setting.ts +19 -87
- package/lowcode/cms-plugin/shopping-order-manager.js +122 -38
- package/lowcode/cms-plugin/shopping-order-manager.ts +160 -58
- package/lowcode/cms-plugin/shopping-product-setting.js +364 -376
- package/lowcode/cms-plugin/shopping-product-setting.ts +406 -415
- package/lowcode/cms-plugin/shopping-setting-advance.js +57 -16
- package/lowcode/cms-plugin/shopping-setting-advance.ts +69 -18
- package/lowcode/cms-plugin/user/user-module.js +2 -43
- package/lowcode/cms-plugin/user/user-module.ts +2 -46
- package/lowcode/cms-plugin/user-list.js +4 -6
- package/lowcode/cms-plugin/user-list.ts +35 -38
- package/lowcode/css/editor.css +42 -3
- package/lowcode/glitter-base/global/language.js +6 -1
- package/lowcode/glitter-base/global/language.ts +10 -4
- package/lowcode/glitter-base/global/payment-config.js +19 -16
- package/lowcode/glitter-base/global/payment-config.ts +22 -16
- package/lowcode/glitter-base/global/shipment-config.js +6 -5
- package/lowcode/glitter-base/global/shipment-config.ts +12 -10
- package/lowcode/glitter-base/route/fcm.js +21 -1
- package/lowcode/glitter-base/route/fcm.ts +22 -2
- package/lowcode/glitter-base/route/shopping.js +8 -32
- package/lowcode/glitter-base/route/shopping.ts +10 -33
- package/lowcode/glitter-base/route/user.js +11 -2
- package/lowcode/glitter-base/route/user.ts +23 -12
- package/lowcode/jspage/function-page/setting_editor.js +9 -0
- package/lowcode/jspage/function-page/setting_editor.ts +9 -0
- package/lowcode/public-components/blogs/list.js +223 -195
- package/lowcode/public-components/blogs/list.ts +383 -352
- package/lowcode/public-components/product/product-list.js +8 -4
- package/lowcode/public-components/product/product-list.ts +9 -4
- package/lowcode/public-components/terms-related/index.js +1 -1
- package/lowcode/public-components/terms-related/index.ts +1 -1
- package/lowcode/public-components/user-manager/um-login.js +1 -1
- package/lowcode/public-components/user-manager/um-login.ts +2 -2
- package/lowcode/public-components/user-manager/um-order.js +41 -5
- package/lowcode/public-components/user-manager/um-order.ts +58 -20
- package/lowcode/public-components/user-manager/um-voucher.ts +2 -2
- package/nhi4veq3gk.json +1 -0
- package/package.json +1 -1
- package/src/Language.d.ts +2 -0
- package/src/Language.js +66 -65
- package/src/Language.js.map +1 -1
- package/src/Language.ts +719 -715
- package/src/api-public/config/shipment-config.js +3 -2
- package/src/api-public/config/shipment-config.js.map +1 -1
- package/src/api-public/config/shipment-config.ts +3 -2
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +1 -2
- package/src/api-public/controllers/fcm.js +23 -58
- package/src/api-public/controllers/fcm.js.map +1 -1
- package/src/api-public/controllers/fcm.ts +28 -56
- package/src/api-public/controllers/shop.js +7 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +17 -10
- package/src/api-public/controllers/user.js +1 -0
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +2 -0
- package/src/api-public/services/auto-send-email.js +247 -187
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +568 -505
- package/src/api-public/services/delivery.js +1 -1
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/delivery.ts +6 -5
- package/src/api-public/services/financial-service.js +1 -2
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +4 -6
- package/src/api-public/services/manager.d.ts +4 -3
- package/src/api-public/services/manager.js +8 -12
- package/src/api-public/services/manager.js.map +1 -1
- package/src/api-public/services/manager.ts +57 -59
- package/src/api-public/services/model/handlePaymentTransaction.d.ts +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.js +23 -3
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +25 -36
- package/src/api-public/services/schedule.d.ts +1 -0
- package/src/api-public/services/schedule.js +27 -0
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +30 -0
- package/src/api-public/services/shopping.d.ts +22 -2
- package/src/api-public/services/shopping.js +362 -90
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +481 -134
- package/src/api-public/services/user.d.ts +1 -0
- package/src/api-public/services/user.js +32 -12
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +38 -19
- package/src/api-public/services/workers.js +3 -3
- package/src/api-public/services/workers.js.map +1 -1
- package/src/api-public/services/workers.ts +103 -103
- package/src/app-project/serverless/src/modules/database.js +1 -1
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.ts +171 -171
- package/src/controllers/template.d.ts +1 -1
- package/src/controllers/template.js +16 -16
- package/src/controllers/template.js.map +1 -1
- package/src/controllers/template.ts +98 -84
- package/src/modules/database.js +3 -1
- package/src/modules/database.js.map +1 -1
- package/src/modules/database.ts +185 -181
- package/src/modules/firebase.d.ts +17 -0
- package/src/modules/firebase.js +126 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +169 -0
- package/src/public-config-initial/auto-fcm.js +8 -2
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +15 -6
- package/src/services/app.d.ts +2 -1
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +2 -1
- package/src/services/template.d.ts +3 -2
- package/src/services/template.js +2 -1
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +13 -20
|
@@ -10,7 +10,7 @@ export class OrderDetail {
|
|
|
10
10
|
this.customer_info = this.initCustomerInfo();
|
|
11
11
|
this.user_info = this.initUserInfo();
|
|
12
12
|
this.total = 0;
|
|
13
|
-
this.pay_status =
|
|
13
|
+
this.pay_status = '0';
|
|
14
14
|
this.voucher = this.initVoucher();
|
|
15
15
|
}
|
|
16
16
|
initCustomerInfo() {
|
|
@@ -40,13 +40,13 @@ export class OrderDetail {
|
|
|
40
40
|
id: 0,
|
|
41
41
|
discount_total: 0,
|
|
42
42
|
end_ISO_Date: '',
|
|
43
|
-
for:
|
|
43
|
+
for: 'product',
|
|
44
44
|
forKey: [],
|
|
45
|
-
method:
|
|
45
|
+
method: 'fixed',
|
|
46
46
|
overlay: false,
|
|
47
|
-
reBackType:
|
|
47
|
+
reBackType: 'rebate',
|
|
48
48
|
rebate_total: 0,
|
|
49
|
-
rule:
|
|
49
|
+
rule: 'min_count',
|
|
50
50
|
ruleValue: 0,
|
|
51
51
|
startDate: '',
|
|
52
52
|
startTime: '',
|
|
@@ -55,9 +55,9 @@ export class OrderDetail {
|
|
|
55
55
|
target: '',
|
|
56
56
|
targetList: [],
|
|
57
57
|
title: '',
|
|
58
|
-
trigger:
|
|
58
|
+
trigger: 'auto',
|
|
59
59
|
type: 'voucher',
|
|
60
|
-
value:
|
|
60
|
+
value: '0',
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,261 +1,290 @@
|
|
|
1
1
|
export interface OrderData {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
distribution_info?: {
|
|
3
|
+
code: string;
|
|
4
|
+
condition: number;
|
|
5
|
+
link: string;
|
|
6
|
+
recommend_medium: any;
|
|
7
|
+
recommend_status: string;
|
|
8
|
+
recommend_user: any;
|
|
9
|
+
redirect: string;
|
|
10
|
+
relative: string;
|
|
11
|
+
relative_data: any;
|
|
12
|
+
share_type: string;
|
|
13
|
+
share_value: number;
|
|
14
|
+
startDate: string;
|
|
15
|
+
startTime: string;
|
|
16
|
+
status: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
voucher: number;
|
|
19
|
+
voucher_status: string;
|
|
20
|
+
};
|
|
21
|
+
archived: 'true' | 'false';
|
|
22
|
+
customer_info: any;
|
|
23
|
+
editRecord: any;
|
|
24
|
+
method: string;
|
|
25
|
+
shipment_selector: {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
form: any;
|
|
29
|
+
}[];
|
|
30
|
+
orderStatus: string;
|
|
31
|
+
use_wallet: number;
|
|
32
|
+
email: string;
|
|
33
|
+
total: number;
|
|
34
|
+
discount: number;
|
|
35
|
+
expectDate: string;
|
|
36
|
+
shipment_fee: number;
|
|
37
|
+
use_rebate: number;
|
|
38
|
+
lineItems: LineItem[];
|
|
39
|
+
user_info: {
|
|
40
|
+
name: string;
|
|
32
41
|
email: string;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
42
|
+
city?: string;
|
|
43
|
+
area?: string;
|
|
44
|
+
phone: string;
|
|
45
|
+
address: string;
|
|
46
|
+
custom_form_delivery?: any;
|
|
47
|
+
shipment:
|
|
48
|
+
| 'normal'
|
|
49
|
+
| 'black_cat_freezing'
|
|
50
|
+
| 'now'
|
|
51
|
+
| 'shop'
|
|
52
|
+
| 'global_express'
|
|
53
|
+
| 'black_cat'
|
|
54
|
+
| 'UNIMARTC2C'
|
|
55
|
+
| 'FAMIC2C'
|
|
56
|
+
| 'HILIFEC2C'
|
|
57
|
+
| 'OKMARTC2C'
|
|
58
|
+
| 'UNIMARTFREEZE'
|
|
59
|
+
| 'FAMIC2CFREEZE';
|
|
60
|
+
CVSStoreName: string;
|
|
61
|
+
CVSStoreID: string;
|
|
62
|
+
CVSTelephone: string;
|
|
63
|
+
MerchantTradeNo: string;
|
|
64
|
+
CVSAddress: string;
|
|
65
|
+
note?: string;
|
|
66
|
+
code_note?: string;
|
|
67
|
+
};
|
|
68
|
+
custom_receipt_form?: any;
|
|
69
|
+
custom_form_format?: any;
|
|
70
|
+
custom_form_data?: any;
|
|
71
|
+
proof_purchase: any;
|
|
72
|
+
progress: string;
|
|
73
|
+
// progress: 'finish' | 'wait' | 'shipping' | "returns";
|
|
74
|
+
order_note: string;
|
|
75
|
+
voucherList: [
|
|
76
|
+
{
|
|
77
|
+
title: string;
|
|
78
|
+
method: 'percent' | 'fixed';
|
|
79
|
+
trigger: 'auto' | 'code';
|
|
80
|
+
value: string;
|
|
81
|
+
for: 'collection' | 'product';
|
|
82
|
+
rule: 'min_price' | 'min_count';
|
|
83
|
+
forKey: string[];
|
|
84
|
+
ruleValue: number;
|
|
85
|
+
startDate: string;
|
|
86
|
+
startTime: string;
|
|
87
|
+
endDate?: string;
|
|
88
|
+
endTime?: string;
|
|
89
|
+
status: 0 | 1 | -1;
|
|
90
|
+
type: 'voucher';
|
|
91
|
+
code?: string;
|
|
92
|
+
overlay: boolean;
|
|
93
|
+
bind?: {
|
|
94
|
+
id: string;
|
|
95
|
+
spec: string[];
|
|
96
|
+
count: number;
|
|
97
|
+
sale_price: number;
|
|
98
|
+
collection: string[];
|
|
99
|
+
discount_price: number;
|
|
100
|
+
}[];
|
|
101
|
+
start_ISO_Date: string;
|
|
102
|
+
end_ISO_Date: string;
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
orderSource?: string;
|
|
106
|
+
deliveryData: Record<string, string>;
|
|
95
107
|
}
|
|
96
108
|
|
|
97
109
|
export interface CartData {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
id: number;
|
|
111
|
+
cart_token: string;
|
|
112
|
+
status: number;
|
|
113
|
+
email: string;
|
|
114
|
+
orderData: OrderData;
|
|
115
|
+
created_time: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface DeductionLogEntry {
|
|
119
|
+
[key: string]: number; // 物件,鍵是字串,值是數字
|
|
104
120
|
}
|
|
105
121
|
|
|
106
122
|
export interface LineItem {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
id: number;
|
|
124
|
+
spec: string[];
|
|
125
|
+
count: number;
|
|
126
|
+
sale_price: number;
|
|
127
|
+
title?: string;
|
|
128
|
+
sku: string;
|
|
129
|
+
preview_image?: string;
|
|
130
|
+
deduction_log?: any;
|
|
114
131
|
}
|
|
115
132
|
|
|
116
133
|
interface CustomerInfo {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
134
|
+
name: string;
|
|
135
|
+
email: string;
|
|
136
|
+
phone: string;
|
|
137
|
+
payment_select?: string;
|
|
121
138
|
}
|
|
122
139
|
|
|
123
140
|
interface UserInfo {
|
|
141
|
+
name: string;
|
|
142
|
+
email: string;
|
|
143
|
+
phone: string;
|
|
144
|
+
address: string;
|
|
145
|
+
shipment: 'normal' | 'FAMIC2C' | 'UNIMARTC2C' | 'HILIFEC2C' | 'OKMARTC2C';
|
|
146
|
+
CVSStoreName: string;
|
|
147
|
+
CVSStoreID: string;
|
|
148
|
+
CVSTelephone: string;
|
|
149
|
+
MerchantTradeNo: string;
|
|
150
|
+
CVSAddress: string;
|
|
151
|
+
note: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface VoucherData {
|
|
155
|
+
id: number;
|
|
156
|
+
discount_total: number;
|
|
157
|
+
title: string;
|
|
158
|
+
method: 'percent' | 'fixed';
|
|
159
|
+
trigger: 'auto' | 'code';
|
|
160
|
+
value: string;
|
|
161
|
+
for: 'collection' | 'product';
|
|
162
|
+
rule: 'min_price' | 'min_count';
|
|
163
|
+
forKey: string[];
|
|
164
|
+
ruleValue: number;
|
|
165
|
+
startDate: string;
|
|
166
|
+
startTime: string;
|
|
167
|
+
endDate?: string;
|
|
168
|
+
endTime?: string;
|
|
169
|
+
status: 0 | 1 | -1;
|
|
170
|
+
type: 'voucher';
|
|
171
|
+
code?: string;
|
|
172
|
+
overlay: boolean;
|
|
173
|
+
bind?: {
|
|
174
|
+
id: string;
|
|
175
|
+
spec: string[];
|
|
176
|
+
count: number;
|
|
177
|
+
sale_price: number;
|
|
178
|
+
collection: string[];
|
|
179
|
+
discount_price: number;
|
|
180
|
+
}[];
|
|
181
|
+
start_ISO_Date: string;
|
|
182
|
+
end_ISO_Date: string;
|
|
183
|
+
reBackType: string;
|
|
184
|
+
rebate_total: number;
|
|
185
|
+
target: string;
|
|
186
|
+
targetList: string[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export class OrderDetail {
|
|
190
|
+
subtotal: number;
|
|
191
|
+
shipment: number;
|
|
192
|
+
total: number;
|
|
193
|
+
discount: number = 0;
|
|
194
|
+
rebate: number = 0;
|
|
195
|
+
cart_token: string = '';
|
|
196
|
+
tag: 'manual' = 'manual';
|
|
197
|
+
voucher: VoucherData;
|
|
198
|
+
lineItems: LineItem[] = [];
|
|
199
|
+
customer_info: CustomerInfo;
|
|
200
|
+
user_info: {
|
|
124
201
|
name: string;
|
|
125
202
|
email: string;
|
|
203
|
+
city?: string;
|
|
204
|
+
area?: string;
|
|
126
205
|
phone: string;
|
|
127
206
|
address: string;
|
|
128
|
-
|
|
207
|
+
custom_form_delivery?: any;
|
|
208
|
+
shipment:
|
|
209
|
+
| 'normal'
|
|
210
|
+
| 'black_cat_freezing'
|
|
211
|
+
| 'now'
|
|
212
|
+
| 'shop'
|
|
213
|
+
| 'global_express'
|
|
214
|
+
| 'black_cat'
|
|
215
|
+
| 'UNIMARTC2C'
|
|
216
|
+
| 'FAMIC2C'
|
|
217
|
+
| 'HILIFEC2C'
|
|
218
|
+
| 'OKMARTC2C'
|
|
219
|
+
| 'UNIMARTFREEZE'
|
|
220
|
+
| 'FAMIC2CFREEZE';
|
|
129
221
|
CVSStoreName: string;
|
|
130
222
|
CVSStoreID: string;
|
|
131
223
|
CVSTelephone: string;
|
|
132
224
|
MerchantTradeNo: string;
|
|
133
225
|
CVSAddress: string;
|
|
134
|
-
note
|
|
135
|
-
|
|
226
|
+
note?: string;
|
|
227
|
+
code_note?: string;
|
|
228
|
+
};
|
|
229
|
+
pay_status: string;
|
|
136
230
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
forKey: string[];
|
|
147
|
-
ruleValue: number;
|
|
148
|
-
startDate: string;
|
|
149
|
-
startTime: string;
|
|
150
|
-
endDate?: string;
|
|
151
|
-
endTime?: string;
|
|
152
|
-
status: 0 | 1 | -1;
|
|
153
|
-
type: 'voucher';
|
|
154
|
-
code?: string;
|
|
155
|
-
overlay: boolean;
|
|
156
|
-
bind?: {
|
|
157
|
-
id: string;
|
|
158
|
-
spec: string[];
|
|
159
|
-
count: number;
|
|
160
|
-
sale_price: number;
|
|
161
|
-
collection: string[];
|
|
162
|
-
discount_price: number;
|
|
163
|
-
}[];
|
|
164
|
-
start_ISO_Date: string;
|
|
165
|
-
end_ISO_Date: string;
|
|
166
|
-
reBackType:string;
|
|
167
|
-
rebate_total:number;
|
|
168
|
-
target:string;
|
|
169
|
-
targetList:string[];
|
|
170
|
-
}
|
|
231
|
+
constructor(subtotal: number, shipment: number) {
|
|
232
|
+
this.subtotal = subtotal;
|
|
233
|
+
this.shipment = shipment;
|
|
234
|
+
this.customer_info = this.initCustomerInfo();
|
|
235
|
+
this.user_info = this.initUserInfo();
|
|
236
|
+
this.total = 0;
|
|
237
|
+
this.pay_status = '0';
|
|
238
|
+
this.voucher = this.initVoucher();
|
|
239
|
+
}
|
|
171
240
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
rebate: number = 0;
|
|
178
|
-
cart_token: string = '';
|
|
179
|
-
tag: 'manual' = 'manual';
|
|
180
|
-
voucher: VoucherData;
|
|
181
|
-
lineItems: LineItem[] = [];
|
|
182
|
-
customer_info: CustomerInfo;
|
|
183
|
-
user_info: {
|
|
184
|
-
name: string;
|
|
185
|
-
email: string;
|
|
186
|
-
city?: string;
|
|
187
|
-
area?: string;
|
|
188
|
-
phone: string;
|
|
189
|
-
address: string;
|
|
190
|
-
custom_form_delivery?: any;
|
|
191
|
-
shipment: "normal" | "FAMIC2C" | "black_cat_freezing" | "UNIMARTC2C" | "HILIFEC2C" | "OKMARTC2C" | "now" | "shop" | "global_express" | "black_cat" | "UNIMARTFREEZE";
|
|
192
|
-
CVSStoreName: string;
|
|
193
|
-
CVSStoreID: string;
|
|
194
|
-
CVSTelephone: string;
|
|
195
|
-
MerchantTradeNo: string;
|
|
196
|
-
CVSAddress: string;
|
|
197
|
-
note?: string;
|
|
198
|
-
code_note?: string
|
|
241
|
+
private initCustomerInfo(): CustomerInfo {
|
|
242
|
+
return {
|
|
243
|
+
name: '',
|
|
244
|
+
phone: '',
|
|
245
|
+
email: '',
|
|
199
246
|
};
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
constructor(subtotal: number, shipment: number) {
|
|
203
|
-
this.subtotal = subtotal;
|
|
204
|
-
this.shipment = shipment;
|
|
205
|
-
this.customer_info = this.initCustomerInfo();
|
|
206
|
-
this.user_info = this.initUserInfo();
|
|
207
|
-
this.total = 0;
|
|
208
|
-
this.pay_status = "0";
|
|
209
|
-
this.voucher = this.initVoucher();
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
private initCustomerInfo(): CustomerInfo {
|
|
213
|
-
return {
|
|
214
|
-
name: '',
|
|
215
|
-
phone: '',
|
|
216
|
-
email: '',
|
|
217
|
-
};
|
|
218
|
-
}
|
|
247
|
+
}
|
|
219
248
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
249
|
+
private initUserInfo(): UserInfo {
|
|
250
|
+
return {
|
|
251
|
+
CVSAddress: '',
|
|
252
|
+
CVSStoreID: '',
|
|
253
|
+
CVSStoreName: '',
|
|
254
|
+
CVSTelephone: '',
|
|
255
|
+
MerchantTradeNo: '',
|
|
256
|
+
address: '',
|
|
257
|
+
email: '',
|
|
258
|
+
name: '',
|
|
259
|
+
note: '',
|
|
260
|
+
phone: '',
|
|
261
|
+
shipment: 'normal',
|
|
262
|
+
};
|
|
263
|
+
}
|
|
235
264
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
265
|
+
private initVoucher(): VoucherData {
|
|
266
|
+
return {
|
|
267
|
+
id: 0,
|
|
268
|
+
discount_total: 0,
|
|
269
|
+
end_ISO_Date: '',
|
|
270
|
+
for: 'product',
|
|
271
|
+
forKey: [],
|
|
272
|
+
method: 'fixed',
|
|
273
|
+
overlay: false,
|
|
274
|
+
reBackType: 'rebate',
|
|
275
|
+
rebate_total: 0,
|
|
276
|
+
rule: 'min_count',
|
|
277
|
+
ruleValue: 0,
|
|
278
|
+
startDate: '',
|
|
279
|
+
startTime: '',
|
|
280
|
+
start_ISO_Date: '',
|
|
281
|
+
status: 1,
|
|
282
|
+
target: '',
|
|
283
|
+
targetList: [],
|
|
284
|
+
title: '',
|
|
285
|
+
trigger: 'auto',
|
|
286
|
+
type: 'voucher',
|
|
287
|
+
value: '0',
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Tool } from '../../modules/tool.js';
|
|
2
2
|
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
3
3
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
5
|
+
import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
|
|
5
6
|
const html = String.raw;
|
|
6
7
|
export class DeliveryHTML {
|
|
7
8
|
static print(ogvc, dataArray, type) {
|
|
@@ -29,6 +30,8 @@ export class DeliveryHTML {
|
|
|
29
30
|
store: {},
|
|
30
31
|
twZipcode: [],
|
|
31
32
|
info: infoMap[type],
|
|
33
|
+
shippingMethod: [],
|
|
34
|
+
paymentMethod: [],
|
|
32
35
|
};
|
|
33
36
|
return BgWidget.fullDialog({
|
|
34
37
|
gvc: ogvc,
|
|
@@ -65,9 +68,13 @@ export class DeliveryHTML {
|
|
|
65
68
|
ApiUser.getPublicConfig('store-information', 'manager').then(r => {
|
|
66
69
|
return r.result && r.response ? r.response.value : {};
|
|
67
70
|
}),
|
|
71
|
+
ShipmentConfig.shipmentMethod({ type: 'all' }),
|
|
72
|
+
PaymentConfig.getSupportPayment(true),
|
|
68
73
|
]).then(dataArray => {
|
|
69
74
|
vm.twZipcode = dataArray[0];
|
|
70
75
|
vm.store = dataArray[1];
|
|
76
|
+
vm.shippingMethod = dataArray[2];
|
|
77
|
+
vm.paymentMethod = dataArray[3];
|
|
71
78
|
loading = false;
|
|
72
79
|
gvc.notifyDataChange(id);
|
|
73
80
|
});
|
|
@@ -299,7 +306,7 @@ export class DeliveryHTML {
|
|
|
299
306
|
<h1 class="subtitle">${vm.info.subtitle}時間:${glitter.ut.dateFormat(new Date(), 'yyyy-MM-dd hh:mm')}</h1>
|
|
300
307
|
</div>`;
|
|
301
308
|
}
|
|
302
|
-
static shipmentDetail(glitter, data) {
|
|
309
|
+
static shipmentDetail(vm, glitter, data) {
|
|
303
310
|
const orderData = data.orderData;
|
|
304
311
|
function paymentStatus(cart) {
|
|
305
312
|
const statusMessages = {
|
|
@@ -310,26 +317,27 @@ export class DeliveryHTML {
|
|
|
310
317
|
};
|
|
311
318
|
return statusMessages[`${cart.status}`] || '付款失敗';
|
|
312
319
|
}
|
|
320
|
+
const shippingMethod = vm.shippingMethod.find((ship) => ship.key === orderData.user_info.shipment);
|
|
321
|
+
const paymentMethod = vm.paymentMethod.find((pay) => pay.key === orderData.customer_info.payment_select);
|
|
322
|
+
const shippingAddr = ['UNIMARTC2C', 'UNIMARTFREEZE', 'FAMIC2C', 'FAMIC2CFREEZE', 'OKMARTC2C', 'HILIFEC2C'].includes(orderData.user_info.shipment)
|
|
323
|
+
? `${orderData.user_info.CVSStoreName} (${orderData.user_info.CVSAddress})`
|
|
324
|
+
: [orderData.user_info.city, orderData.user_info.area, orderData.user_info.address].filter(Boolean).join('');
|
|
313
325
|
return html `<div class="details">
|
|
314
326
|
<table>
|
|
315
327
|
<tr>
|
|
316
328
|
<td>訂單編號:${data.cart_token}</td>
|
|
317
|
-
<td>送貨方式:${
|
|
329
|
+
<td>送貨方式:${shippingMethod ? shippingMethod.name : '立即取貨'}</td>
|
|
318
330
|
</tr>
|
|
319
331
|
<tr>
|
|
320
332
|
<td>訂購日期:${glitter.ut.dateFormat(new Date(data.created_time), 'yyyy-MM-dd hh:mm')}</td>
|
|
321
|
-
<td>
|
|
322
|
-
送貨地址:${[orderData.user_info.city, orderData.user_info.area, orderData.user_info.address]
|
|
323
|
-
.filter(Boolean)
|
|
324
|
-
.join('')}
|
|
325
|
-
</td>
|
|
333
|
+
<td>送貨地址:${shippingAddr}</td>
|
|
326
334
|
</tr>
|
|
327
335
|
<tr>
|
|
328
336
|
<td>訂購人帳號:${orderData.email}</td>
|
|
329
337
|
<td>收件人姓名:${orderData.user_info.name}</td>
|
|
330
338
|
</tr>
|
|
331
339
|
<tr>
|
|
332
|
-
<td>付款方式:${
|
|
340
|
+
<td>付款方式:${paymentMethod ? paymentMethod.name : '線下付款'}</td>
|
|
333
341
|
<td>收件人電話:${orderData.user_info.phone}</td>
|
|
334
342
|
</tr>
|
|
335
343
|
<tr>
|
|
@@ -415,7 +423,7 @@ export class DeliveryHTML {
|
|
|
415
423
|
const orderData = data.orderData;
|
|
416
424
|
return [
|
|
417
425
|
this.shipmentHeader(vm, glitter),
|
|
418
|
-
this.shipmentDetail(glitter, data),
|
|
426
|
+
this.shipmentDetail(vm, glitter, data),
|
|
419
427
|
this.shipmentItems(gvc, orderData),
|
|
420
428
|
this.shipmentSummary(orderData),
|
|
421
429
|
this.shipmentNote(orderData),
|