ts-glitter 21.9.0 → 21.9.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
@@ -19,8 +19,13 @@ import { PayConfig } from './cms-plugin/pos-pages/pay-config.js';
19
19
  import { ApiCart } from './glitter-base/route/api-cart.js';
20
20
  import { ApiUser } from './glitter-base/route/user.js';
21
21
  import { ApplicationConfig } from './application-config.js';
22
+ import { TriggerEvent } from './glitterBundle/plugins/trigger-event.js';
23
+ import { Ad } from './public-components/public/ad.js';
22
24
  export class Entry {
23
25
  static onCreate(glitter) {
26
+ glitter.share.ad = Ad;
27
+ glitter.share.TriggerEvent = TriggerEvent;
28
+ glitter.share.PayConfig = PayConfig;
24
29
  config.url = location.origin;
25
30
  window.glitterBackend = location.origin;
26
31
  const originalReplaceState = history.replaceState;
@@ -146,7 +151,7 @@ export class Entry {
146
151
  }
147
152
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
148
153
  console.log(`Entry-time:`, window.renderClock.stop());
149
- glitter.share.editerVersion = 'V_21.9.0';
154
+ glitter.share.editerVersion = 'V_21.9.2';
150
155
  glitter.share.start = new Date();
151
156
  const vm = { appConfig: [] };
152
157
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -12,10 +12,15 @@ import { ApiCart } from './glitter-base/route/api-cart.js';
12
12
  import { ApiUser } from './glitter-base/route/user.js';
13
13
  import { ApplicationConfig } from './application-config.js';
14
14
  import { TriggerEvent } from './glitterBundle/plugins/trigger-event.js';
15
+ import { Ad } from './public-components/public/ad.js';
15
16
 
16
17
  export class Entry {
17
18
  // 建立初始函式
18
19
  public static onCreate(glitter: Glitter) {
20
+ //設定GA和Pixel的橋接
21
+ glitter.share.ad=Ad;
22
+ glitter.share.TriggerEvent=TriggerEvent;
23
+ glitter.share.PayConfig=PayConfig;
19
24
  //設定後端路徑API
20
25
  config.url=location.origin;
21
26
  (window as any).glitterBackend=location.origin;
@@ -150,7 +155,7 @@ export class Entry {
150
155
  }
151
156
  (window as any).renderClock = (window as any).renderClock ?? createClock();
152
157
  console.log(`Entry-time:`, (window as any).renderClock.stop());
153
- glitter.share.editerVersion = 'V_21.9.0';
158
+ glitter.share.editerVersion = 'V_21.9.2';
154
159
  glitter.share.start = new Date();
155
160
  const vm = { appConfig: [] };
156
161
  (window as any).saasConfig = {
@@ -390,7 +390,7 @@ FilterOptions.reconciliationOptions = [
390
390
  FilterOptions.payloadStatusOptions = [
391
391
  { key: '1', name: '已付款' },
392
392
  { key: '3', name: '部分付款' },
393
- { key: '0', name: '未付款' },
393
+ { key: '0', name: '待核款 / 貨到付款 / 未付款' },
394
394
  { key: '-1', name: '付款失敗' },
395
395
  { key: '-2', name: '已退款' },
396
396
  ];
@@ -226,7 +226,7 @@ export class FilterOptions {
226
226
  static payloadStatusOptions = [
227
227
  { key: '1', name: '已付款' },
228
228
  { key: '3', name: '部分付款' },
229
- { key: '0', name: '未付款' },
229
+ { key: '0', name: '待核款 / 貨到付款 / 未付款' },
230
230
  { key: '-1', name: '付款失敗' },
231
231
  { key: '-2', name: '已退款' },
232
232
  ];
@@ -1,11 +1,10 @@
1
1
  type Status = 0 | 1 | -1;
2
2
  type VoucherMethod = 'percent' | 'fixed';
3
- type ReBackType = 'rebate' | 'discount' | 'shipment_free';
4
- type TriggerType = 'auto' | 'code';
5
3
  type VoucherFor = 'collection' | 'product' | 'all';
6
4
  type VoucherRule = 'min_price' | 'min_count';
5
+ type ReBackType = 'rebate' | 'discount' | 'shipment_free';
6
+ type TriggerType = 'auto' | 'code';
7
7
  type FilterType = 'normal' | 'block' | 'pos' | 'all';
8
- type PaymentMethod = 'ATM' | 'CreditCard' | 'ConvenienceStore';
9
8
  type ShipmentMethod =
10
9
  | 'normal'
11
10
  | 'FAMIC2C'
@@ -17,9 +16,12 @@ type ShipmentMethod =
17
16
  | 'global_express'
18
17
  | 'UNIMARTFREEZE'
19
18
  | 'black_cat_freezing'
20
- | 'black_cat';
21
-
19
+ | 'black_cat'
20
+ | 'FAMIC2CFREEZE';
21
+ type PaymentMethod = 'ATM' | 'CreditCard' | 'ConvenienceStore';
22
22
  type ViewModelType = 'list' | 'add' | 'replace' | 'select' | 'createInvoice' | 'viewInvoice' | 'recommend';
23
+ type POSPayment = 'cash' | 'credit' | 'line_pay';
24
+ type TradeStatus = '0' | '1' | '10200095';
23
25
 
24
26
  interface EditRecord {
25
27
  time: string;
@@ -88,13 +90,34 @@ interface CartData {
88
90
  }
89
91
 
90
92
  interface OrderData {
91
- cash_flow: PaymentFlow;
92
- editRecord: EditRecord[];
93
- distribution_info?: DistributionInfo;
93
+ distribution_info?: {
94
+ code: string;
95
+ condition: number;
96
+ link: string;
97
+ recommend_medium: any;
98
+ recommend_status: string;
99
+ recommend_user: any;
100
+ redirect: string;
101
+ relative: string;
102
+ relative_data: any;
103
+ share_type: string;
104
+ share_value: number;
105
+ startDate: string;
106
+ startTime: string;
107
+ status: boolean;
108
+ title: string;
109
+ voucher: number;
110
+ voucher_status: string;
111
+ };
94
112
  archived: 'true' | 'false';
95
- customer_info: UserInfo;
113
+ customer_info: any;
114
+ editRecord: any;
96
115
  method: string;
97
- shipment_selector: ShipmentSelector[];
116
+ shipment_selector: {
117
+ name: string;
118
+ value: string;
119
+ form: any;
120
+ }[];
98
121
  orderStatus: string;
99
122
  use_wallet: number;
100
123
  email: string;
@@ -105,16 +128,17 @@ interface OrderData {
105
128
  use_rebate: number;
106
129
  lineItems: LineItem[];
107
130
  user_info: UserInfo;
131
+ custom_receipt_form?: any;
132
+ custom_form_format?: any;
133
+ custom_form_data?: any;
108
134
  proof_purchase: any;
109
135
  progress: string;
110
136
  order_note: string;
111
137
  voucherList: VoucherData[];
112
138
  orderSource?: string;
113
139
  deliveryData: Record<string, string>;
140
+ cash_flow: PaymentFlow;
114
141
  pos_info: POSInfo;
115
- custom_receipt_form?: any;
116
- custom_form_format?: any;
117
- custom_form_data?: any;
118
142
  tags?: string[];
119
143
  fbp?: string;
120
144
  fbc?:string;
@@ -125,7 +149,7 @@ interface PaymentFlow {
125
149
  HandlingCharge?: string;
126
150
  PaymentType: PaymentMethod;
127
151
  PaymentDate?: string;
128
- TradeStatus?: '0' | '1' | '10200095';
152
+ TradeStatus?: TradeStatus;
129
153
  TradeAmt: string;
130
154
  TradeNo: string;
131
155
  credit_receipt?: any;
@@ -148,22 +172,32 @@ interface UserInfo {
148
172
  name: string;
149
173
  email: string;
150
174
  phone: string;
175
+ address: string;
176
+ shipment: ShipmentMethod;
177
+ CVSStoreName: string;
178
+ CVSStoreID: string;
179
+ CVSTelephone: string;
180
+ MerchantTradeNo: string;
181
+ CVSAddress: string;
182
+ note: string;
151
183
  city?: string;
152
184
  area?: string;
153
185
  shipment_date: string;
154
186
  shipment_refer: string;
155
- address: string;
156
187
  shipment_number?: string;
157
188
  state: string;
158
189
  company: string;
159
190
  country: string;
160
191
  postal_code: string;
161
192
  invoice_type: string;
193
+ custom_form_delivery?: any;
194
+ shipment_detail?: any;
195
+ code_note?: string;
162
196
  [key: string]: any;
163
197
  }
164
198
 
165
199
  interface POSInfo {
166
- payment: 'cash' | 'credit' | 'line_pay';
200
+ payment: POSPayment;
167
201
  who: {
168
202
  id: number;
169
203
  user: string;
@@ -185,18 +219,18 @@ interface POSConfig {
185
219
 
186
220
  interface LineItem {
187
221
  id: number;
188
- sku: string;
189
222
  spec: string[];
190
223
  count: number;
191
- stock: number;
192
- title: string;
224
+ sale_price: number;
225
+ sku: string;
193
226
  rebate: number;
194
227
  weight: number;
195
228
  is_gift: boolean;
196
- sale_price: number;
197
229
  origin_price: number;
198
230
  discount_price: number;
199
- deduction_log: any;
231
+ title?: string;
232
+ preview_image?: string;
233
+ deduction_log?: any;
200
234
  }
201
235
 
202
236
  interface OrderQuery {
@@ -205,6 +239,13 @@ interface OrderQuery {
205
239
  isShipment?: boolean;
206
240
  }
207
241
 
242
+ interface CustomerInfo {
243
+ name: string;
244
+ email: string;
245
+ phone: string;
246
+ payment_select?: string;
247
+ }
248
+
208
249
  interface ViewModel {
209
250
  id: string;
210
251
  loading: boolean;
@@ -22,6 +22,13 @@ export class OrderDetail {
22
22
  }
23
23
  initUserInfo() {
24
24
  return {
25
+ country: '',
26
+ postal_code: '',
27
+ invoice_type: '',
28
+ shipment_date: '',
29
+ shipment_refer: '',
30
+ state: '',
31
+ company: '',
25
32
  CVSAddress: '',
26
33
  CVSStoreID: '',
27
34
  CVSStoreName: '',
@@ -1,192 +1,3 @@
1
- export interface OrderData {
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;
41
- email: string;
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
- shipment_number?: string;
66
- note?: string;
67
- code_note?: string;
68
- };
69
- custom_receipt_form?: any;
70
- custom_form_format?: any;
71
- custom_form_data?: any;
72
- proof_purchase: any;
73
- progress: string;
74
- // progress: 'finish' | 'wait' | 'shipping' | "returns";
75
- order_note: string;
76
- voucherList: [
77
- {
78
- title: string;
79
- method: 'percent' | 'fixed';
80
- trigger: 'auto' | 'code';
81
- value: string;
82
- for: 'collection' | 'product';
83
- rule: 'min_price' | 'min_count';
84
- forKey: string[];
85
- ruleValue: number;
86
- startDate: string;
87
- startTime: string;
88
- endDate?: string;
89
- endTime?: string;
90
- status: 0 | 1 | -1;
91
- type: 'voucher';
92
- code?: string;
93
- overlay: boolean;
94
- bind?: {
95
- id: string;
96
- spec: string[];
97
- count: number;
98
- sale_price: number;
99
- collection: string[];
100
- discount_price: number;
101
- }[];
102
- start_ISO_Date: string;
103
- end_ISO_Date: string;
104
- },
105
- ];
106
- orderSource?: string;
107
- deliveryData: Record<string, string>;
108
- }
109
-
110
- export interface CartData {
111
- id: number;
112
- cart_token: string;
113
- status: number;
114
- email: string;
115
- orderData: OrderData;
116
- created_time: string;
117
- }
118
-
119
- interface DeductionLogEntry {
120
- [key: string]: number; // 物件,鍵是字串,值是數字
121
- }
122
-
123
- export interface LineItem {
124
- id: number;
125
- spec: string[];
126
- count: number;
127
- sale_price: number;
128
- title?: string;
129
- sku: string;
130
- preview_image?: string;
131
- deduction_log?: any;
132
- }
133
-
134
- interface CustomerInfo {
135
- name: string;
136
- email: string;
137
- phone: string;
138
- payment_select?: string;
139
- }
140
-
141
- interface UserInfo {
142
- name: string;
143
- email: string;
144
- phone: string;
145
- address: string;
146
- shipment: 'normal' | 'FAMIC2C' | 'UNIMARTC2C' | 'HILIFEC2C' | 'OKMARTC2C';
147
- CVSStoreName: string;
148
- CVSStoreID: string;
149
- CVSTelephone: string;
150
- MerchantTradeNo: string;
151
- CVSAddress: string;
152
- note: string;
153
- }
154
-
155
- interface VoucherData {
156
- id: number;
157
- discount_total: number;
158
- title: string;
159
- method: 'percent' | 'fixed';
160
- trigger: 'auto' | 'code';
161
- value: string;
162
- for: 'collection' | 'product';
163
- rule: 'min_price' | 'min_count';
164
- forKey: string[];
165
- ruleValue: number;
166
- startDate: string;
167
- startTime: string;
168
- endDate?: string;
169
- endTime?: string;
170
- status: 0 | 1 | -1;
171
- type: 'voucher';
172
- code?: string;
173
- overlay: boolean;
174
- bind?: {
175
- id: string;
176
- spec: string[];
177
- count: number;
178
- sale_price: number;
179
- collection: string[];
180
- discount_price: number;
181
- }[];
182
- start_ISO_Date: string;
183
- end_ISO_Date: string;
184
- reBackType: string;
185
- rebate_total: number;
186
- target: string;
187
- targetList: string[];
188
- }
189
-
190
1
  export class OrderDetail {
191
2
  subtotal: number;
192
3
  shipment: number;
@@ -249,6 +60,13 @@ export class OrderDetail {
249
60
 
250
61
  private initUserInfo(): UserInfo {
251
62
  return {
63
+ country: '',
64
+ postal_code: '',
65
+ invoice_type: '',
66
+ shipment_date: '',
67
+ shipment_refer: '',
68
+ state: '',
69
+ company: '',
252
70
  CVSAddress: '',
253
71
  CVSStoreID: '',
254
72
  CVSStoreName: '',
@@ -2,14 +2,13 @@ import { GVC } from '../../glitterBundle/GVController.js';
2
2
  import { Tool } from '../../modules/tool.js';
3
3
  import { BgWidget } from '../../backend-manager/bg-widget.js';
4
4
  import { ApiUser } from '../../glitter-base/route/user.js';
5
- import { CartData, OrderData } from './data.js';
6
5
  import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
7
6
  import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
8
7
  import { OrderExcel } from './order-excel.js';
9
8
 
10
9
  const html = String.raw;
11
10
 
12
- type PrintType = 'shipment' | 'pick' | 'address' | 'shipAddr';
11
+ export type PrintType = 'shipment' | 'pick' | 'address' | 'shipAddr';
13
12
 
14
13
  type InfoObject = {
15
14
  title: string;