ts-glitter 21.5.3 → 21.5.5
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/account-info.js +79 -67
- package/lowcode/cms-plugin/account-info.ts +327 -311
- package/lowcode/cms-plugin/information/information-module.ts +3 -1
- package/lowcode/cms-plugin/list-header-option.js +1 -0
- package/lowcode/cms-plugin/list-header-option.ts +1 -0
- package/lowcode/cms-plugin/shopping-information.js +468 -0
- package/lowcode/cms-plugin/shopping-information.ts +557 -0
- package/lowcode/cms-plugin/shopping-market-shopee.js +283 -231
- package/lowcode/cms-plugin/shopping-market-shopee.ts +401 -361
- package/lowcode/cms-plugin/shopping-order-manager.js +16 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +18 -3
- package/lowcode/glitter-base/global/language.js +4 -1
- package/lowcode/glitter-base/global/language.ts +4 -2
- package/lowcode/glitter-base/route/shopee.js +48 -11
- package/lowcode/glitter-base/route/shopee.ts +119 -80
- package/lowcode/glitterBundle/plugins/html-render.js +121 -90
- package/lowcode/glitterBundle/plugins/html-render.ts +367 -318
- package/lowcode/modules/image-library.js +2 -3
- package/lowcode/modules/image-library.ts +21 -7
- package/lowcode/public-components/checkout/index.js +90 -41
- package/lowcode/public-components/checkout/index.ts +101 -49
- package/lowcode/public-components/footer/footer-initial.js +11 -2
- package/lowcode/public-components/footer/footer-initial.ts +29 -18
- package/lowcode/public-components/headers/header-class.js +47 -35
- package/lowcode/public-components/headers/header-class.ts +54 -38
- package/lowcode/public-components/layout-plugin/social-links-01.js +122 -3
- package/lowcode/public-components/layout-plugin/social-links-01.ts +135 -10
- package/lowcode/public-components/product/pd-card-01.js +23 -14
- package/lowcode/public-components/product/pd-card-01.ts +25 -14
- package/lowcode/public-components/product/pd-card-02.js +23 -16
- package/lowcode/public-components/product/pd-card-02.ts +25 -16
- package/lowcode/public-components/product/pd-card-03.js +25 -16
- package/lowcode/public-components/product/pd-card-03.ts +27 -16
- package/lowcode/public-components/terms-related/index.js +13 -2
- package/lowcode/public-components/terms-related/index.ts +15 -2
- package/lowcode/public-components/user-manager/um-class.js +490 -501
- package/lowcode/public-components/user-manager/um-class.ts +872 -882
- package/lowcode/public-components/user-manager/um-info.js +41 -40
- package/lowcode/public-components/user-manager/um-info.ts +54 -56
- package/lowcode/public-components/user-manager/um-login.js +10 -13
- package/lowcode/public-components/user-manager/um-login.ts +15 -23
- package/lowcode/public-components/user-manager/um-orderlist.js +60 -51
- package/lowcode/public-components/user-manager/um-orderlist.ts +289 -275
- package/lowcode/public-components/user-manager/um-rebate.js +104 -82
- package/lowcode/public-components/user-manager/um-rebate.ts +294 -267
- package/lowcode/public-components/user-manager/um-receive.js +582 -0
- package/lowcode/public-components/user-manager/um-receive.ts +599 -0
- package/lowcode/public-components/user-manager/um-wishlist.js +72 -68
- package/lowcode/public-components/user-manager/um-wishlist.ts +240 -230
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +17 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +32 -0
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/post.js +17 -7
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/rebate.js +2 -11
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/rebate.ts +5 -12
- package/src/api-public/services/shopee.d.ts +23 -2
- package/src/api-public/services/shopee.js +230 -111
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +1012 -838
- package/src/api-public/services/user.js +2 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +3 -3
- package/src/index.js +17 -7
- package/src/index.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/services/backend-service.js +17 -7
- package/src/services/backend-service.js.map +1 -1
- package/src/services/template.d.ts +1 -1
- package/src/services/template.js +24 -18
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +34 -37
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import { GVC } from '../../glitterBundle/GVController.js';
|
|
2
|
+
import { UmClass } from './um-class.js';
|
|
3
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
4
|
+
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
5
|
+
import { Language } from '../../glitter-base/global/language.js';
|
|
6
|
+
import { FormCheck } from '../../cms-plugin/module/form-check.js';
|
|
7
|
+
import { FormWidget } from '../../official_view_component/official/form.js';
|
|
8
|
+
import { CartModule } from '../../public-components/modules/cart-module.js';
|
|
9
|
+
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
10
|
+
|
|
11
|
+
const html = String.raw;
|
|
12
|
+
|
|
13
|
+
export class UMReceive {
|
|
14
|
+
static main(gvc: GVC, widget: any, subData: any) {
|
|
15
|
+
const glitter = gvc.glitter;
|
|
16
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
17
|
+
const vm = {
|
|
18
|
+
id: glitter.getUUID(),
|
|
19
|
+
loading: true,
|
|
20
|
+
userData: {} as any,
|
|
21
|
+
funnyForm: [] as any,
|
|
22
|
+
dataList: [] as any,
|
|
23
|
+
dataKeys: [] as string[],
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
let changePage = (index: string, type: 'page' | 'home', subData: any) => {};
|
|
27
|
+
gvc.glitter.getModule(new URL('./official_event/page/change-page.js', gvc.glitter.root_path).href, cl => {
|
|
28
|
+
changePage = cl.changePage;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return gvc.bindView({
|
|
32
|
+
bind: vm.id,
|
|
33
|
+
view: async () => {
|
|
34
|
+
if (vm.loading) {
|
|
35
|
+
return UmClass.spinner();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return html`
|
|
39
|
+
<div class="row mx-auto p-0">
|
|
40
|
+
<div class="w-100 align-items-center d-flex py-3 pb-lg-3 pt-lg-0" style="gap:10px;">
|
|
41
|
+
<div
|
|
42
|
+
class="d-none d-lg-flex"
|
|
43
|
+
style="background: #FF9705;width:4px;height: 20px;"
|
|
44
|
+
onclick="${gvc.event(() => {
|
|
45
|
+
gvc.glitter.getModule(
|
|
46
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
47
|
+
cl => {
|
|
48
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
})}"
|
|
52
|
+
></div>
|
|
53
|
+
<div
|
|
54
|
+
class="d-flex d-lg-none align-items-center justify-content-center"
|
|
55
|
+
style="width:20px;height: 20px;"
|
|
56
|
+
onclick="${gvc.event(() => {
|
|
57
|
+
gvc.glitter.getModule(
|
|
58
|
+
new URL(gvc.glitter.root_path + 'official_event/page/change-page.js', import.meta.url).href,
|
|
59
|
+
cl => {
|
|
60
|
+
cl.changePage('account_userinfo', 'home', {});
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
})}"
|
|
64
|
+
>
|
|
65
|
+
<i class="fa-solid fa-angle-left fs-4"></i>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="um-info-title fw-bold" style="font-size: 24px;">${Language.text('recipient_info')}</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="col-12" style="min-height: 500px;">
|
|
70
|
+
${vm.dataList
|
|
71
|
+
.map((data: any, index: number) => {
|
|
72
|
+
const cloneForm = JSON.parse(JSON.stringify(vm.funnyForm));
|
|
73
|
+
return html`<div class="px-0 py-2 px-md-2 py-md-4 mb-3">
|
|
74
|
+
<h5>收件人 ${index + 1}</h5>
|
|
75
|
+
${FormWidget.editorView({
|
|
76
|
+
gvc: gvc,
|
|
77
|
+
array: cloneForm.map((dd: any, index: number) => {
|
|
78
|
+
dd.col = '6';
|
|
79
|
+
if (index === cloneForm.length - 1) {
|
|
80
|
+
dd.col = '12';
|
|
81
|
+
}
|
|
82
|
+
return dd;
|
|
83
|
+
}),
|
|
84
|
+
refresh: () => {
|
|
85
|
+
gvc.notifyDataChange(vm.id);
|
|
86
|
+
},
|
|
87
|
+
formData: data,
|
|
88
|
+
})}
|
|
89
|
+
</div>`;
|
|
90
|
+
})
|
|
91
|
+
.join('')}
|
|
92
|
+
<div class="d-flex justify-content-end">
|
|
93
|
+
<div
|
|
94
|
+
class="um-nav-btn um-nav-btn-active d-flex align-items-center justify-content-center fw-bold"
|
|
95
|
+
onclick="${gvc.event(() => {
|
|
96
|
+
vm.userData.receive_list = vm.dataList
|
|
97
|
+
.map((data: any) => {
|
|
98
|
+
const temp = {} as any;
|
|
99
|
+
vm.dataKeys.map(key => {
|
|
100
|
+
temp[key] = data[key];
|
|
101
|
+
});
|
|
102
|
+
return temp;
|
|
103
|
+
})
|
|
104
|
+
.filter((data: any) => {
|
|
105
|
+
return Object.values(data).some(Boolean);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
ApiUser.updateUserData({
|
|
109
|
+
userData: vm.userData,
|
|
110
|
+
}).then(res => {
|
|
111
|
+
dialog.dataLoading({ visible: false });
|
|
112
|
+
if (!res.result && res.response.data.msg === 'email-verify-false') {
|
|
113
|
+
dialog.errorMessage({ text: Language.text('email_verification_code_incorrect') });
|
|
114
|
+
} else if (!res.result && res.response.data.msg === 'phone-verify-false') {
|
|
115
|
+
dialog.errorMessage({ text: Language.text('sms_verification_code_incorrect') });
|
|
116
|
+
} else if (!res.result && res.response.data.msg === 'phone-exists') {
|
|
117
|
+
dialog.errorMessage({ text: Language.text('phone_number_already_exists') });
|
|
118
|
+
} else if (!res.result && res.response.data.msg === 'email-exists') {
|
|
119
|
+
dialog.errorMessage({ text: Language.text('email_already_exists') });
|
|
120
|
+
} else if (!res.result) {
|
|
121
|
+
dialog.errorMessage({ text: Language.text('update_exception') });
|
|
122
|
+
} else {
|
|
123
|
+
dialog.successMessage({ text: Language.text('change_success') });
|
|
124
|
+
gvc.recreateView();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
})}"
|
|
128
|
+
>
|
|
129
|
+
${Language.text('confirm')}
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
`;
|
|
135
|
+
},
|
|
136
|
+
onCreate: () => {
|
|
137
|
+
if (vm.loading) {
|
|
138
|
+
const classPrefix = 'cart-prefix';
|
|
139
|
+
CartModule.addStyle(gvc, classPrefix);
|
|
140
|
+
Promise.all([ApiUser.getUserData(GlobalUser.token, 'me'), this.funnyQuickFormFrame(classPrefix)]).then(
|
|
141
|
+
dataArray => {
|
|
142
|
+
// dataArray[0] => userData
|
|
143
|
+
vm.userData = dataArray[0].response.userData;
|
|
144
|
+
|
|
145
|
+
if (vm.userData.receive_list) {
|
|
146
|
+
vm.dataList = [...vm.userData.receive_list, ...new Array(3 - vm.userData.receive_list.length).fill({})];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// dataArray[1] => funnyForm
|
|
150
|
+
vm.funnyForm = dataArray[1];
|
|
151
|
+
vm.dataKeys = vm.funnyForm.map((item: any) => item.key).filter(Boolean);
|
|
152
|
+
|
|
153
|
+
// render view
|
|
154
|
+
vm.loading = false;
|
|
155
|
+
gvc.notifyDataChange(vm.id);
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static async funnyQuickFormFrame(classPrefix: string) {
|
|
164
|
+
const res = await ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager');
|
|
165
|
+
|
|
166
|
+
const share_receipt_form = FormCheck.initialRecipientForm(res.response.value.list ?? []).filter(dd => {
|
|
167
|
+
return !dd.hidden;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const receipt_form = JSON.parse(JSON.stringify(share_receipt_form)).map((dd: any) => {
|
|
171
|
+
switch (dd.key) {
|
|
172
|
+
case 'name':
|
|
173
|
+
dd.form_config.place_holder = Language.text('please_enter_name');
|
|
174
|
+
dd.title = Language.text('name');
|
|
175
|
+
break;
|
|
176
|
+
case 'phone':
|
|
177
|
+
dd.form_config.place_holder = Language.text('please_enter_contact_number');
|
|
178
|
+
dd.title = Language.text('contact_number');
|
|
179
|
+
break;
|
|
180
|
+
case 'email':
|
|
181
|
+
dd.form_config.place_holder = Language.text('please_enter_email');
|
|
182
|
+
dd.title = Language.text('email');
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
dd.col = '4';
|
|
186
|
+
return dd;
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
const list = (() => {
|
|
190
|
+
try {
|
|
191
|
+
return [
|
|
192
|
+
...receipt_form,
|
|
193
|
+
...[
|
|
194
|
+
{
|
|
195
|
+
col: '6',
|
|
196
|
+
key: 'invoice_type',
|
|
197
|
+
page: 'form-select',
|
|
198
|
+
type: 'form_plugin_v2',
|
|
199
|
+
group: '',
|
|
200
|
+
title: Language.text('invoice_recipient'),
|
|
201
|
+
col_sm: '12',
|
|
202
|
+
appName: 'cms_system',
|
|
203
|
+
require: 'true',
|
|
204
|
+
readonly: 'write',
|
|
205
|
+
formFormat: '{}',
|
|
206
|
+
moduleName: '下拉選單',
|
|
207
|
+
style_data: {
|
|
208
|
+
input: {
|
|
209
|
+
list: [],
|
|
210
|
+
class: '',
|
|
211
|
+
style: '',
|
|
212
|
+
version: 'v2',
|
|
213
|
+
},
|
|
214
|
+
label: {
|
|
215
|
+
list: [],
|
|
216
|
+
class: 'form-label fs-base ',
|
|
217
|
+
style: '',
|
|
218
|
+
version: 'v2',
|
|
219
|
+
},
|
|
220
|
+
container: {
|
|
221
|
+
list: [],
|
|
222
|
+
class: '',
|
|
223
|
+
style: '',
|
|
224
|
+
version: 'v2',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
form_config: {
|
|
228
|
+
type: 'name',
|
|
229
|
+
title: '',
|
|
230
|
+
option: [
|
|
231
|
+
{
|
|
232
|
+
name: Language.text('personal'),
|
|
233
|
+
index: 0,
|
|
234
|
+
value: 'me',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: Language.text('company'),
|
|
238
|
+
index: 1,
|
|
239
|
+
value: 'company',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: Language.text('donate_invoice'),
|
|
243
|
+
index: 2,
|
|
244
|
+
value: 'donate',
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
input_style: { list: [], version: 'v2' },
|
|
248
|
+
title_style: { list: [], version: 'v2' },
|
|
249
|
+
place_holder: '',
|
|
250
|
+
},
|
|
251
|
+
hidden_code: "return (form_data['invoice_method']==='nouse')",
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
col: '6',
|
|
255
|
+
key: 'send_type',
|
|
256
|
+
page: 'form-select',
|
|
257
|
+
type: 'form_plugin_v2',
|
|
258
|
+
group: '',
|
|
259
|
+
title: Language.text('invoice_method'),
|
|
260
|
+
col_sm: '12',
|
|
261
|
+
appName: 'cms_system',
|
|
262
|
+
require: 'true',
|
|
263
|
+
readonly: 'write',
|
|
264
|
+
formFormat: '{}',
|
|
265
|
+
moduleName: '下拉選單',
|
|
266
|
+
style_data: {
|
|
267
|
+
input: {
|
|
268
|
+
list: [],
|
|
269
|
+
class: '',
|
|
270
|
+
style: '',
|
|
271
|
+
version: 'v2',
|
|
272
|
+
},
|
|
273
|
+
label: {
|
|
274
|
+
list: [],
|
|
275
|
+
class: 'form-label fs-base ',
|
|
276
|
+
style: '',
|
|
277
|
+
version: 'v2',
|
|
278
|
+
},
|
|
279
|
+
container: {
|
|
280
|
+
list: [],
|
|
281
|
+
class: '',
|
|
282
|
+
style: '',
|
|
283
|
+
version: 'v2',
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
form_config: {
|
|
287
|
+
type: 'name',
|
|
288
|
+
title: '',
|
|
289
|
+
option: [
|
|
290
|
+
{
|
|
291
|
+
name: Language.text('send_to_user_email'),
|
|
292
|
+
index: 0,
|
|
293
|
+
value: 'email',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: Language.text('mobile_barcode_device'),
|
|
297
|
+
index: 1,
|
|
298
|
+
value: 'carrier',
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
input_style: { list: [], version: 'v2' },
|
|
302
|
+
title_style: { list: [], version: 'v2' },
|
|
303
|
+
place_holder: '',
|
|
304
|
+
},
|
|
305
|
+
hidden_code:
|
|
306
|
+
" if(form_data['invoice_type']!=='me' || (form_data['invoice_method']==='nouse') || (form_data['invoice_method']==='off_line')){\n form_data[form_key]=undefined\nreturn true\n }else{\n return false\n }",
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
key: 'carrier_num',
|
|
310
|
+
page: 'input',
|
|
311
|
+
type: 'form_plugin_v2',
|
|
312
|
+
group: '',
|
|
313
|
+
title: Language.text('carrier_number'),
|
|
314
|
+
appName: 'cms_system',
|
|
315
|
+
require: 'false',
|
|
316
|
+
readonly: 'write',
|
|
317
|
+
formFormat: '{}',
|
|
318
|
+
moduleName: '輸入框',
|
|
319
|
+
col: '3',
|
|
320
|
+
col_sm: '12',
|
|
321
|
+
style_data: {
|
|
322
|
+
input: {
|
|
323
|
+
list: [],
|
|
324
|
+
class: '',
|
|
325
|
+
style: '',
|
|
326
|
+
version: 'v2',
|
|
327
|
+
},
|
|
328
|
+
label: {
|
|
329
|
+
list: [],
|
|
330
|
+
class: 'form-label fs-base ',
|
|
331
|
+
style: '',
|
|
332
|
+
version: 'v2',
|
|
333
|
+
},
|
|
334
|
+
container: {
|
|
335
|
+
list: [],
|
|
336
|
+
class: '',
|
|
337
|
+
style: '',
|
|
338
|
+
version: 'v2',
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
form_config: {
|
|
342
|
+
type: 'name',
|
|
343
|
+
title: '',
|
|
344
|
+
input_style: { list: [], version: 'v2' },
|
|
345
|
+
title_style: { list: [], version: 'v2' },
|
|
346
|
+
place_holder: Language.text('please_enter_carrier_number'),
|
|
347
|
+
},
|
|
348
|
+
hidden_code:
|
|
349
|
+
" \n if(form_data['invoice_type']!=='me' || form_data['send_type']!=='carrier'){\n form_data[form_key]=undefined\nreturn true\n }else{\n return false\n }",
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
key: 'company',
|
|
353
|
+
page: 'input',
|
|
354
|
+
type: 'form_plugin_v2',
|
|
355
|
+
group: '',
|
|
356
|
+
title: Language.text('company_name'),
|
|
357
|
+
appName: 'cms_system',
|
|
358
|
+
require: 'false',
|
|
359
|
+
readonly: 'write',
|
|
360
|
+
formFormat: '{}',
|
|
361
|
+
moduleName: '輸入框',
|
|
362
|
+
col: '3',
|
|
363
|
+
col_sm: '12',
|
|
364
|
+
style_data: {
|
|
365
|
+
input: {
|
|
366
|
+
list: [],
|
|
367
|
+
class: '',
|
|
368
|
+
style: '',
|
|
369
|
+
version: 'v2',
|
|
370
|
+
},
|
|
371
|
+
label: {
|
|
372
|
+
list: [],
|
|
373
|
+
class: 'form-label fs-base ',
|
|
374
|
+
style: '',
|
|
375
|
+
version: 'v2',
|
|
376
|
+
},
|
|
377
|
+
container: {
|
|
378
|
+
list: [],
|
|
379
|
+
class: '',
|
|
380
|
+
style: '',
|
|
381
|
+
version: 'v2',
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
form_config: {
|
|
385
|
+
type: 'name',
|
|
386
|
+
title: '',
|
|
387
|
+
input_style: { list: [], version: 'v2' },
|
|
388
|
+
title_style: { list: [], version: 'v2' },
|
|
389
|
+
place_holder: Language.text('please_enter_company_name'),
|
|
390
|
+
},
|
|
391
|
+
hidden_code:
|
|
392
|
+
" if(form_data['invoice_type']!=='company' || (form_data['invoice_method']==='nouse')){\n form_data[form_key]=undefined\nreturn true\n }else{\n return false\n }",
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
key: 'gui_number',
|
|
396
|
+
page: 'input',
|
|
397
|
+
type: 'form_plugin_v2',
|
|
398
|
+
group: '',
|
|
399
|
+
title: Language.text('company_tax_id'),
|
|
400
|
+
col: '3',
|
|
401
|
+
col_sm: '12',
|
|
402
|
+
appName: 'cms_system',
|
|
403
|
+
require: 'false',
|
|
404
|
+
readonly: 'write',
|
|
405
|
+
formFormat: '{}',
|
|
406
|
+
moduleName: '輸入框',
|
|
407
|
+
style_data: {
|
|
408
|
+
input: {
|
|
409
|
+
list: [],
|
|
410
|
+
class: '',
|
|
411
|
+
style: '',
|
|
412
|
+
version: 'v2',
|
|
413
|
+
},
|
|
414
|
+
label: {
|
|
415
|
+
list: [],
|
|
416
|
+
class: 'form-label fs-base ',
|
|
417
|
+
style: '',
|
|
418
|
+
version: 'v2',
|
|
419
|
+
},
|
|
420
|
+
container: {
|
|
421
|
+
list: [],
|
|
422
|
+
class: '',
|
|
423
|
+
style: '',
|
|
424
|
+
version: 'v2',
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
form_config: {
|
|
428
|
+
type: 'name',
|
|
429
|
+
title: '',
|
|
430
|
+
input_style: { list: [], version: 'v2' },
|
|
431
|
+
title_style: { list: [], version: 'v2' },
|
|
432
|
+
place_holder: Language.text('please_enter_company_tax_id'),
|
|
433
|
+
},
|
|
434
|
+
hidden_code:
|
|
435
|
+
" if(form_data['invoice_type']!=='company'){\n form_data[form_key]=undefined\nreturn true\n }else{\n return false\n }",
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
col: '6',
|
|
439
|
+
key: 'love_code',
|
|
440
|
+
page: 'input',
|
|
441
|
+
type: 'form_plugin_v2',
|
|
442
|
+
group: '',
|
|
443
|
+
title: Language.text('donation_code'),
|
|
444
|
+
col_sm: '12',
|
|
445
|
+
appName: 'cms_system',
|
|
446
|
+
require: 'false',
|
|
447
|
+
readonly: 'write',
|
|
448
|
+
formFormat: '{}',
|
|
449
|
+
moduleName: '輸入框',
|
|
450
|
+
style_data: {
|
|
451
|
+
input: {
|
|
452
|
+
list: [],
|
|
453
|
+
class: '',
|
|
454
|
+
style: '',
|
|
455
|
+
version: 'v2',
|
|
456
|
+
},
|
|
457
|
+
label: {
|
|
458
|
+
list: [],
|
|
459
|
+
class: 'form-label fs-base ',
|
|
460
|
+
style: '',
|
|
461
|
+
version: 'v2',
|
|
462
|
+
},
|
|
463
|
+
container: {
|
|
464
|
+
list: [],
|
|
465
|
+
class: '',
|
|
466
|
+
style: '',
|
|
467
|
+
version: 'v2',
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
form_config: {
|
|
471
|
+
type: 'name',
|
|
472
|
+
title: '',
|
|
473
|
+
input_style: { list: [], version: 'v2' },
|
|
474
|
+
title_style: { list: [], version: 'v2' },
|
|
475
|
+
place_holder: Language.text('please_enter_donation_code'),
|
|
476
|
+
},
|
|
477
|
+
hidden_code:
|
|
478
|
+
" if(form_data['invoice_type']!=='donate' || (form_data['invoice_method']==='nouse')){\n form_data[form_key]=undefined\nreturn true\n }else{\n return false\n }",
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
{
|
|
482
|
+
col: '12',
|
|
483
|
+
key: 'note',
|
|
484
|
+
page: 'multiple_line_text',
|
|
485
|
+
type: 'form_plugin_v2',
|
|
486
|
+
group: '',
|
|
487
|
+
title: Language.text('delivery_notes'),
|
|
488
|
+
col_sm: '12',
|
|
489
|
+
appName: 'cms_system',
|
|
490
|
+
require: 'false',
|
|
491
|
+
readonly: 'write',
|
|
492
|
+
formFormat: '{}',
|
|
493
|
+
moduleName: '多行文字區塊',
|
|
494
|
+
style_data: {
|
|
495
|
+
input: {
|
|
496
|
+
list: [],
|
|
497
|
+
class: '',
|
|
498
|
+
style: '',
|
|
499
|
+
version: 'v2',
|
|
500
|
+
},
|
|
501
|
+
label: {
|
|
502
|
+
list: [],
|
|
503
|
+
class: 'form-label fs-base ',
|
|
504
|
+
style: '',
|
|
505
|
+
version: 'v2',
|
|
506
|
+
},
|
|
507
|
+
container: {
|
|
508
|
+
list: [],
|
|
509
|
+
class: '',
|
|
510
|
+
style: '',
|
|
511
|
+
version: 'v2',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
form_config: {
|
|
515
|
+
type: 'text',
|
|
516
|
+
title: '',
|
|
517
|
+
title_style: { list: [], version: 'v2' },
|
|
518
|
+
place_holder: Language.text('enter_delivery_notes'),
|
|
519
|
+
},
|
|
520
|
+
hidden_code: 'return false',
|
|
521
|
+
},
|
|
522
|
+
];
|
|
523
|
+
} catch (error) {
|
|
524
|
+
console.error(error);
|
|
525
|
+
return [];
|
|
526
|
+
}
|
|
527
|
+
})();
|
|
528
|
+
|
|
529
|
+
function sortObjectKeys<T>(obj: T): T {
|
|
530
|
+
if (Array.isArray(obj)) {
|
|
531
|
+
return obj.map(sortObjectKeys) as any;
|
|
532
|
+
} else if (obj !== null && typeof obj === 'object') {
|
|
533
|
+
const sortedKeys = Object.keys(obj).sort();
|
|
534
|
+
const result: any = {};
|
|
535
|
+
for (const key of sortedKeys) {
|
|
536
|
+
result[key] = sortObjectKeys((obj as any)[key]);
|
|
537
|
+
}
|
|
538
|
+
return result;
|
|
539
|
+
}
|
|
540
|
+
return obj;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function gClass(text: string | string[]): string {
|
|
544
|
+
if (Array.isArray(text)) {
|
|
545
|
+
return text.map(c => gClass(c)).join(' ');
|
|
546
|
+
}
|
|
547
|
+
return `${classPrefix}-${text}`;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const formatList = list.map((dd: any) => {
|
|
551
|
+
dd.form_config.title_style = {
|
|
552
|
+
list: [
|
|
553
|
+
{
|
|
554
|
+
class: ['company', 'gui_number', 'carrier_num', 'love_code'].includes(dd.key)
|
|
555
|
+
? gClass('label') + ' mt-2'
|
|
556
|
+
: gClass('label') + ' mb-2',
|
|
557
|
+
style:
|
|
558
|
+
'return `color:${glitter.share.globalValue[`theme_color.0.title`]} !important;font-size:16px !important;`',
|
|
559
|
+
stylist: [],
|
|
560
|
+
dataType: 'code',
|
|
561
|
+
style_from: 'code',
|
|
562
|
+
classDataType: 'static',
|
|
563
|
+
},
|
|
564
|
+
],
|
|
565
|
+
class: 'form-label',
|
|
566
|
+
style: 'font-size: 20px;font-style: normal;font-weight: 400;line-height: 140%; color:#393939 !important;',
|
|
567
|
+
stylist: [],
|
|
568
|
+
version: 'v2',
|
|
569
|
+
dataType: 'static',
|
|
570
|
+
style_from: 'code',
|
|
571
|
+
classDataType: 'static',
|
|
572
|
+
};
|
|
573
|
+
dd.form_config.input_style = {
|
|
574
|
+
list: [
|
|
575
|
+
{
|
|
576
|
+
class: gClass('input'),
|
|
577
|
+
style: 'return `border-radius: ${widget.formData.radius}px !important;`',
|
|
578
|
+
stylist: [],
|
|
579
|
+
dataType: 'code',
|
|
580
|
+
style_from: 'code',
|
|
581
|
+
classDataType: 'static',
|
|
582
|
+
},
|
|
583
|
+
],
|
|
584
|
+
class: ' mb-3',
|
|
585
|
+
style: 'background: #FFF;',
|
|
586
|
+
stylist: [],
|
|
587
|
+
version: 'v2',
|
|
588
|
+
dataType: 'static',
|
|
589
|
+
style_from: 'code',
|
|
590
|
+
classDataType: 'static',
|
|
591
|
+
};
|
|
592
|
+
return dd;
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
return sortObjectKeys(formatList);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
(window as any).glitter.setModule(import.meta.url, UMReceive);
|