ts-glitter 14.2.3 → 14.2.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/backend-manager/bg-product.js +2 -1
- package/lowcode/backend-manager/bg-product.ts +2 -1
- package/lowcode/cms-plugin/shopping-discount-setting.js +1 -1
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1 -1
- package/lowcode/cms-plugin/shopping-order-manager.js +8 -1
- package/lowcode/cms-plugin/shopping-order-manager.ts +8 -1
- package/lowcode/public-components/blogs/blogs-01.js +4 -0
- package/lowcode/public-components/checkout/index.js +906 -189
- package/lowcode/public-components/checkout/index.ts +914 -194
- package/lowcode/public-components/product/pd-class.js +17 -12
- package/lowcode/public-components/product/pd-class.ts +20 -13
- package/package.json +1 -1
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/app-release.js.map +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/post.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/ai-robot.d.ts +0 -1
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/post.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +2 -0
- package/src/api-public/services/shopping.js +49 -50
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +50 -49
- package/src/index.js +3 -3
- package/src/index.js.map +1 -5
|
@@ -12,6 +12,7 @@ import {FormWidget} from "../../official_view_component/official/form.js";
|
|
|
12
12
|
import {ShareDialog} from "../../glitterBundle/dialog/ShareDialog.js";
|
|
13
13
|
import {Voucher as OriginVoucher, VoucherContent} from '../user-manager/um-voucher.js'
|
|
14
14
|
import {PdClass} from "../product/pd-class.js";
|
|
15
|
+
import * as vm from "node:vm";
|
|
15
16
|
|
|
16
17
|
const html = String.raw;
|
|
17
18
|
const css = String.raw;
|
|
@@ -41,56 +42,36 @@ export class CheckoutIndex {
|
|
|
41
42
|
{
|
|
42
43
|
"spec": [
|
|
43
44
|
"黑色",
|
|
44
|
-
"
|
|
45
|
+
"小號"
|
|
45
46
|
],
|
|
46
|
-
"id":
|
|
47
|
-
"count":
|
|
48
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
49
|
-
"title": "
|
|
50
|
-
"sale_price":
|
|
47
|
+
"id": 710,
|
|
48
|
+
"count": 5,
|
|
49
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
50
|
+
"title": "溫德米爾 茶几",
|
|
51
|
+
"sale_price": 1800,
|
|
51
52
|
"collection": [
|
|
52
53
|
"折扣專區",
|
|
53
54
|
"熱門商品",
|
|
54
55
|
"熱門商品 / 夏季限定"
|
|
55
56
|
],
|
|
56
|
-
"sku": "133",
|
|
57
|
-
"shipment_obj": {
|
|
58
|
-
"type": "weight",
|
|
59
|
-
"value": 100
|
|
60
|
-
},
|
|
61
|
-
"discount_price": 38,
|
|
62
|
-
"rebate": 0
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"spec": [
|
|
66
|
-
"米色",
|
|
67
|
-
"標準"
|
|
68
|
-
],
|
|
69
|
-
"id": 735,
|
|
70
|
-
"count": 10,
|
|
71
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
72
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
73
|
-
"sale_price": 3200,
|
|
74
|
-
"collection": [],
|
|
75
57
|
"sku": "",
|
|
76
58
|
"shipment_obj": {
|
|
77
|
-
"type": "
|
|
78
|
-
"value":
|
|
59
|
+
"type": "volume",
|
|
60
|
+
"value": 600
|
|
79
61
|
},
|
|
80
|
-
"
|
|
81
|
-
"discount_price": 5,
|
|
62
|
+
"discount_price": 17.6,
|
|
82
63
|
"rebate": 0
|
|
83
64
|
}
|
|
84
65
|
],
|
|
85
|
-
"total":
|
|
66
|
+
"total": 9212,
|
|
86
67
|
"email": "sam38124@gmail.com",
|
|
87
68
|
"user_info": {
|
|
88
|
-
"shipment": "
|
|
69
|
+
"shipment": "shop"
|
|
89
70
|
},
|
|
90
|
-
"shipment_fee":
|
|
71
|
+
"shipment_fee": 300,
|
|
91
72
|
"rebate": 0,
|
|
92
73
|
"use_rebate": 0,
|
|
93
|
-
"orderID": "
|
|
74
|
+
"orderID": "1732712547962",
|
|
94
75
|
"shipment_support": [
|
|
95
76
|
"OKMARTC2C",
|
|
96
77
|
"shop",
|
|
@@ -199,7 +180,17 @@ export class CheckoutIndex {
|
|
|
199
180
|
},
|
|
200
181
|
"orderSource": "",
|
|
201
182
|
"code_array": [],
|
|
202
|
-
"give_away": [
|
|
183
|
+
"give_away": [
|
|
184
|
+
{
|
|
185
|
+
"id": 737,
|
|
186
|
+
"spec": [
|
|
187
|
+
"淺木色",
|
|
188
|
+
"4人座"
|
|
189
|
+
],
|
|
190
|
+
"count": 1,
|
|
191
|
+
"voucher_id": 738
|
|
192
|
+
}
|
|
193
|
+
],
|
|
203
194
|
"user_rebate_sum": 39807,
|
|
204
195
|
"voucherList": [
|
|
205
196
|
{
|
|
@@ -238,59 +229,39 @@ export class CheckoutIndex {
|
|
|
238
229
|
{
|
|
239
230
|
"spec": [
|
|
240
231
|
"黑色",
|
|
241
|
-
"
|
|
232
|
+
"小號"
|
|
242
233
|
],
|
|
243
|
-
"id":
|
|
244
|
-
"count":
|
|
245
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
246
|
-
"title": "
|
|
247
|
-
"sale_price":
|
|
234
|
+
"id": 710,
|
|
235
|
+
"count": 5,
|
|
236
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
237
|
+
"title": "溫德米爾 茶几",
|
|
238
|
+
"sale_price": 1800,
|
|
248
239
|
"collection": [
|
|
249
240
|
"折扣專區",
|
|
250
241
|
"熱門商品",
|
|
251
242
|
"熱門商品 / 夏季限定"
|
|
252
243
|
],
|
|
253
|
-
"sku": "133",
|
|
254
|
-
"shipment_obj": {
|
|
255
|
-
"type": "weight",
|
|
256
|
-
"value": 100
|
|
257
|
-
},
|
|
258
|
-
"discount_price": 38,
|
|
259
|
-
"rebate": 0
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"spec": [
|
|
263
|
-
"米色",
|
|
264
|
-
"標準"
|
|
265
|
-
],
|
|
266
|
-
"id": 735,
|
|
267
|
-
"count": 10,
|
|
268
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
269
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
270
|
-
"sale_price": 3200,
|
|
271
|
-
"collection": [],
|
|
272
244
|
"sku": "",
|
|
273
245
|
"shipment_obj": {
|
|
274
|
-
"type": "
|
|
275
|
-
"value":
|
|
246
|
+
"type": "volume",
|
|
247
|
+
"value": 600
|
|
276
248
|
},
|
|
277
|
-
"
|
|
278
|
-
"discount_price": 5,
|
|
249
|
+
"discount_price": 17.6,
|
|
279
250
|
"rebate": 0
|
|
280
251
|
}
|
|
281
252
|
],
|
|
282
253
|
"times": 1,
|
|
283
|
-
"bind_subtotal":
|
|
254
|
+
"bind_subtotal": 9000,
|
|
284
255
|
"discount_total": 88,
|
|
285
256
|
"rebate_total": 0
|
|
286
257
|
},
|
|
287
258
|
{
|
|
288
|
-
"id":
|
|
259
|
+
"id": 738,
|
|
289
260
|
"for": "all",
|
|
290
261
|
"code": "",
|
|
291
262
|
"rule": "min_price",
|
|
292
263
|
"type": "voucher",
|
|
293
|
-
"title": "
|
|
264
|
+
"title": "滿100贈送",
|
|
294
265
|
"value": "0",
|
|
295
266
|
"device": [
|
|
296
267
|
"normal"
|
|
@@ -304,68 +275,639 @@ export class CheckoutIndex {
|
|
|
304
275
|
"trigger": "auto",
|
|
305
276
|
"counting": "single",
|
|
306
277
|
"ruleValue": 1000,
|
|
307
|
-
"startDate": "2024-11-
|
|
308
|
-
"startTime": "
|
|
309
|
-
"reBackType": "
|
|
278
|
+
"startDate": "2024-11-20",
|
|
279
|
+
"startTime": "20:00",
|
|
280
|
+
"reBackType": "giveaway",
|
|
310
281
|
"targetList": [],
|
|
311
282
|
"end_ISO_Date": "",
|
|
312
283
|
"macroLimited": 0,
|
|
313
284
|
"microLimited": 0,
|
|
314
285
|
"rebateEndDay": "30",
|
|
315
286
|
"conditionType": "order",
|
|
316
|
-
"start_ISO_Date": "2024-11-
|
|
287
|
+
"start_ISO_Date": "2024-11-20T12:00:00.000Z",
|
|
317
288
|
"add_on_products": [
|
|
318
|
-
|
|
289
|
+
{
|
|
290
|
+
"id": 737,
|
|
291
|
+
"seo": {
|
|
292
|
+
"title": "北歐風實木餐桌 - 優雅的餐桌選擇",
|
|
293
|
+
"domain": "北歐風實木餐桌 ( 贈品 )",
|
|
294
|
+
"content": "選擇北歐風實木餐桌,帶給您的家居新氣象。",
|
|
295
|
+
"keywords": ""
|
|
296
|
+
},
|
|
297
|
+
"type": "product",
|
|
298
|
+
"specs": [
|
|
299
|
+
{
|
|
300
|
+
"title": "顏色",
|
|
301
|
+
"option": [
|
|
302
|
+
{
|
|
303
|
+
"title": "淺木色",
|
|
304
|
+
"expand": true
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"title": "胡桃木色",
|
|
308
|
+
"expand": true
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"title": "黑色",
|
|
312
|
+
"expand": true
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"title": "尺寸",
|
|
318
|
+
"option": [
|
|
319
|
+
{
|
|
320
|
+
"title": "4人座"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"title": "6人座"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"title": "8人座"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
"title": "北歐風實木餐桌 ( 贈品 )",
|
|
332
|
+
"token": {
|
|
333
|
+
"exp": 1764244210,
|
|
334
|
+
"iat": 1732708210,
|
|
335
|
+
"userID": 122538856,
|
|
336
|
+
"account": "rdtest",
|
|
337
|
+
"userData": {}
|
|
338
|
+
},
|
|
339
|
+
"status": "active",
|
|
340
|
+
"content": "北歐風實木餐桌,提供多種顏色與尺寸,適合不同家庭。",
|
|
341
|
+
"visible": "true",
|
|
342
|
+
"template": "",
|
|
343
|
+
"variants": [
|
|
344
|
+
{
|
|
345
|
+
"sku": "",
|
|
346
|
+
"cost": 0,
|
|
347
|
+
"spec": [
|
|
348
|
+
"淺木色",
|
|
349
|
+
"4人座"
|
|
350
|
+
],
|
|
351
|
+
"type": "variants",
|
|
352
|
+
"stock": 0,
|
|
353
|
+
"profit": 0,
|
|
354
|
+
"weight": "1",
|
|
355
|
+
"barcode": "",
|
|
356
|
+
"v_width": 0,
|
|
357
|
+
"editable": false,
|
|
358
|
+
"v_height": 0,
|
|
359
|
+
"v_length": 0,
|
|
360
|
+
"product_id": 737,
|
|
361
|
+
"sale_price": 3500,
|
|
362
|
+
"compare_price": 0,
|
|
363
|
+
"preview_image": "",
|
|
364
|
+
"shipment_type": "weight",
|
|
365
|
+
"shipment_weight": 0,
|
|
366
|
+
"show_understocking": "false"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"sku": "",
|
|
370
|
+
"cost": 0,
|
|
371
|
+
"spec": [
|
|
372
|
+
"淺木色",
|
|
373
|
+
"6人座"
|
|
374
|
+
],
|
|
375
|
+
"type": "variants",
|
|
376
|
+
"stock": 0,
|
|
377
|
+
"profit": 0,
|
|
378
|
+
"weight": "1",
|
|
379
|
+
"barcode": "",
|
|
380
|
+
"v_width": 0,
|
|
381
|
+
"editable": false,
|
|
382
|
+
"v_height": 0,
|
|
383
|
+
"v_length": 0,
|
|
384
|
+
"product_id": 737,
|
|
385
|
+
"sale_price": 3000,
|
|
386
|
+
"compare_price": 0,
|
|
387
|
+
"preview_image": "",
|
|
388
|
+
"shipment_type": "weight",
|
|
389
|
+
"shipment_weight": 0,
|
|
390
|
+
"show_understocking": "false"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"sku": "",
|
|
394
|
+
"cost": 0,
|
|
395
|
+
"spec": [
|
|
396
|
+
"淺木色",
|
|
397
|
+
"8人座"
|
|
398
|
+
],
|
|
399
|
+
"type": "variants",
|
|
400
|
+
"stock": 0,
|
|
401
|
+
"profit": 0,
|
|
402
|
+
"weight": "1",
|
|
403
|
+
"barcode": "",
|
|
404
|
+
"v_width": 0,
|
|
405
|
+
"editable": false,
|
|
406
|
+
"v_height": 0,
|
|
407
|
+
"v_length": 0,
|
|
408
|
+
"product_id": 737,
|
|
409
|
+
"sale_price": 2500,
|
|
410
|
+
"compare_price": 0,
|
|
411
|
+
"preview_image": "",
|
|
412
|
+
"shipment_type": "weight",
|
|
413
|
+
"shipment_weight": 0,
|
|
414
|
+
"show_understocking": "false"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"sku": "",
|
|
418
|
+
"cost": 0,
|
|
419
|
+
"spec": [
|
|
420
|
+
"胡桃木色",
|
|
421
|
+
"4人座"
|
|
422
|
+
],
|
|
423
|
+
"type": "variants",
|
|
424
|
+
"stock": 0,
|
|
425
|
+
"profit": 0,
|
|
426
|
+
"weight": "1",
|
|
427
|
+
"barcode": "",
|
|
428
|
+
"v_width": 0,
|
|
429
|
+
"editable": false,
|
|
430
|
+
"v_height": 0,
|
|
431
|
+
"v_length": 0,
|
|
432
|
+
"product_id": 737,
|
|
433
|
+
"sale_price": 2500,
|
|
434
|
+
"compare_price": 0,
|
|
435
|
+
"preview_image": "",
|
|
436
|
+
"shipment_type": "weight",
|
|
437
|
+
"shipment_weight": 0,
|
|
438
|
+
"show_understocking": "false"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"sku": "",
|
|
442
|
+
"cost": 0,
|
|
443
|
+
"spec": [
|
|
444
|
+
"胡桃木色",
|
|
445
|
+
"6人座"
|
|
446
|
+
],
|
|
447
|
+
"type": "variants",
|
|
448
|
+
"stock": 0,
|
|
449
|
+
"profit": 0,
|
|
450
|
+
"weight": "1",
|
|
451
|
+
"barcode": "",
|
|
452
|
+
"v_width": 0,
|
|
453
|
+
"editable": false,
|
|
454
|
+
"v_height": 0,
|
|
455
|
+
"v_length": 0,
|
|
456
|
+
"product_id": 737,
|
|
457
|
+
"sale_price": 2500,
|
|
458
|
+
"compare_price": 0,
|
|
459
|
+
"preview_image": "",
|
|
460
|
+
"shipment_type": "weight",
|
|
461
|
+
"shipment_weight": 0,
|
|
462
|
+
"show_understocking": "false"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"sku": "",
|
|
466
|
+
"cost": 0,
|
|
467
|
+
"spec": [
|
|
468
|
+
"胡桃木色",
|
|
469
|
+
"8人座"
|
|
470
|
+
],
|
|
471
|
+
"type": "variants",
|
|
472
|
+
"stock": 0,
|
|
473
|
+
"profit": 0,
|
|
474
|
+
"weight": "1",
|
|
475
|
+
"barcode": "",
|
|
476
|
+
"v_width": 0,
|
|
477
|
+
"editable": false,
|
|
478
|
+
"v_height": 0,
|
|
479
|
+
"v_length": 0,
|
|
480
|
+
"product_id": 737,
|
|
481
|
+
"sale_price": 2500,
|
|
482
|
+
"compare_price": 0,
|
|
483
|
+
"preview_image": "",
|
|
484
|
+
"shipment_type": "weight",
|
|
485
|
+
"shipment_weight": 0,
|
|
486
|
+
"show_understocking": "false"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"sku": "",
|
|
490
|
+
"cost": 0,
|
|
491
|
+
"spec": [
|
|
492
|
+
"黑色",
|
|
493
|
+
"4人座"
|
|
494
|
+
],
|
|
495
|
+
"type": "variants",
|
|
496
|
+
"stock": 0,
|
|
497
|
+
"profit": 0,
|
|
498
|
+
"weight": "1",
|
|
499
|
+
"barcode": "",
|
|
500
|
+
"v_width": 0,
|
|
501
|
+
"editable": false,
|
|
502
|
+
"v_height": 0,
|
|
503
|
+
"v_length": 0,
|
|
504
|
+
"product_id": 737,
|
|
505
|
+
"sale_price": 2500,
|
|
506
|
+
"compare_price": 0,
|
|
507
|
+
"preview_image": "",
|
|
508
|
+
"shipment_type": "weight",
|
|
509
|
+
"shipment_weight": 0,
|
|
510
|
+
"show_understocking": "false"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"sku": "",
|
|
514
|
+
"cost": 0,
|
|
515
|
+
"spec": [
|
|
516
|
+
"黑色",
|
|
517
|
+
"6人座"
|
|
518
|
+
],
|
|
519
|
+
"type": "variants",
|
|
520
|
+
"stock": 0,
|
|
521
|
+
"profit": 0,
|
|
522
|
+
"weight": "1",
|
|
523
|
+
"barcode": "",
|
|
524
|
+
"v_width": 0,
|
|
525
|
+
"editable": false,
|
|
526
|
+
"v_height": 0,
|
|
527
|
+
"v_length": 0,
|
|
528
|
+
"product_id": 737,
|
|
529
|
+
"sale_price": 2500,
|
|
530
|
+
"compare_price": 0,
|
|
531
|
+
"preview_image": "",
|
|
532
|
+
"shipment_type": "weight",
|
|
533
|
+
"shipment_weight": 0,
|
|
534
|
+
"show_understocking": "false"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"sku": "",
|
|
538
|
+
"cost": 0,
|
|
539
|
+
"spec": [
|
|
540
|
+
"黑色",
|
|
541
|
+
"8人座"
|
|
542
|
+
],
|
|
543
|
+
"type": "variants",
|
|
544
|
+
"stock": 0,
|
|
545
|
+
"profit": 0,
|
|
546
|
+
"weight": "1",
|
|
547
|
+
"barcode": "",
|
|
548
|
+
"v_width": 0,
|
|
549
|
+
"editable": false,
|
|
550
|
+
"v_height": 0,
|
|
551
|
+
"v_length": 0,
|
|
552
|
+
"product_id": 737,
|
|
553
|
+
"sale_price": 2500,
|
|
554
|
+
"compare_price": 0,
|
|
555
|
+
"preview_image": "",
|
|
556
|
+
"shipment_type": "weight",
|
|
557
|
+
"shipment_weight": 0,
|
|
558
|
+
"show_understocking": "false"
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"hideIndex": "false",
|
|
562
|
+
"max_price": 3500,
|
|
563
|
+
"min_price": 2500,
|
|
564
|
+
"collection": [],
|
|
565
|
+
"productType": {
|
|
566
|
+
"product": false,
|
|
567
|
+
"giveaway": true,
|
|
568
|
+
"addProduct": false
|
|
569
|
+
},
|
|
570
|
+
"content_json": [],
|
|
571
|
+
"in_wish_list": false,
|
|
572
|
+
"content_array": [],
|
|
573
|
+
"preview_image": [
|
|
574
|
+
"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E 2024-11-04 11.13.58 - A Scandinavian-style solid wood dining table in a minimalist dining room setting. The table has a simple yet elegant design, showcasing natural wood g.webp"
|
|
575
|
+
],
|
|
576
|
+
"relative_product": [],
|
|
577
|
+
"voucher_id": 738,
|
|
578
|
+
"selected": true,
|
|
579
|
+
"have_select": true
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"id": 739,
|
|
583
|
+
"seo": {
|
|
584
|
+
"title": "摩根鋼架書架 - 多色多層選擇",
|
|
585
|
+
"domain": "摩根鋼架書架 ( 贈品 )",
|
|
586
|
+
"content": "摩根鋼架書架,提供黑色、白色和灰色選擇,適合家庭及辦公室使用,尺寸有3層、4層、5層,價格合理。",
|
|
587
|
+
"keywords": ""
|
|
588
|
+
},
|
|
589
|
+
"type": "product",
|
|
590
|
+
"specs": [
|
|
591
|
+
{
|
|
592
|
+
"title": "顏色",
|
|
593
|
+
"option": [
|
|
594
|
+
{
|
|
595
|
+
"title": "黑色",
|
|
596
|
+
"expand": true
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"title": "白色",
|
|
600
|
+
"expand": true
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"title": "灰色",
|
|
604
|
+
"expand": true
|
|
605
|
+
}
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"title": "尺寸",
|
|
610
|
+
"option": [
|
|
611
|
+
{
|
|
612
|
+
"title": "3層"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"title": "4層"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"title": "5層"
|
|
619
|
+
}
|
|
620
|
+
]
|
|
621
|
+
}
|
|
622
|
+
],
|
|
623
|
+
"title": "摩根鋼架書架 ( 贈品 )",
|
|
624
|
+
"token": {
|
|
625
|
+
"exp": 1764244210,
|
|
626
|
+
"iat": 1732708210,
|
|
627
|
+
"userID": 122538856,
|
|
628
|
+
"account": "rdtest",
|
|
629
|
+
"userData": {}
|
|
630
|
+
},
|
|
631
|
+
"status": "active",
|
|
632
|
+
"content": "摩根鋼架書架,完美擺放您的書籍與裝飾品,適合不同空間需求,提供不同顏色及層數選擇。",
|
|
633
|
+
"visible": "true",
|
|
634
|
+
"template": "",
|
|
635
|
+
"variants": [
|
|
636
|
+
{
|
|
637
|
+
"sku": "",
|
|
638
|
+
"cost": 0,
|
|
639
|
+
"spec": [
|
|
640
|
+
"黑色",
|
|
641
|
+
"3層"
|
|
642
|
+
],
|
|
643
|
+
"type": "variants",
|
|
644
|
+
"stock": 0,
|
|
645
|
+
"profit": 0,
|
|
646
|
+
"weight": "1",
|
|
647
|
+
"barcode": "",
|
|
648
|
+
"v_width": 0,
|
|
649
|
+
"editable": false,
|
|
650
|
+
"v_height": 0,
|
|
651
|
+
"v_length": 0,
|
|
652
|
+
"product_id": 739,
|
|
653
|
+
"sale_price": 1500,
|
|
654
|
+
"compare_price": 0,
|
|
655
|
+
"preview_image": "",
|
|
656
|
+
"shipment_type": "weight",
|
|
657
|
+
"shipment_weight": 0,
|
|
658
|
+
"show_understocking": "false"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"sku": "",
|
|
662
|
+
"cost": 0,
|
|
663
|
+
"spec": [
|
|
664
|
+
"黑色",
|
|
665
|
+
"4層"
|
|
666
|
+
],
|
|
667
|
+
"type": "variants",
|
|
668
|
+
"stock": 0,
|
|
669
|
+
"profit": 0,
|
|
670
|
+
"weight": "1",
|
|
671
|
+
"barcode": "",
|
|
672
|
+
"v_width": 0,
|
|
673
|
+
"editable": false,
|
|
674
|
+
"v_height": 0,
|
|
675
|
+
"v_length": 0,
|
|
676
|
+
"product_id": 739,
|
|
677
|
+
"sale_price": 1300,
|
|
678
|
+
"compare_price": 0,
|
|
679
|
+
"preview_image": "",
|
|
680
|
+
"shipment_type": "weight",
|
|
681
|
+
"shipment_weight": 0,
|
|
682
|
+
"show_understocking": "false"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"sku": "",
|
|
686
|
+
"cost": 0,
|
|
687
|
+
"spec": [
|
|
688
|
+
"黑色",
|
|
689
|
+
"5層"
|
|
690
|
+
],
|
|
691
|
+
"type": "variants",
|
|
692
|
+
"stock": 0,
|
|
693
|
+
"profit": 0,
|
|
694
|
+
"weight": "1",
|
|
695
|
+
"barcode": "",
|
|
696
|
+
"v_width": 0,
|
|
697
|
+
"editable": false,
|
|
698
|
+
"v_height": 0,
|
|
699
|
+
"v_length": 0,
|
|
700
|
+
"product_id": 739,
|
|
701
|
+
"sale_price": 1000,
|
|
702
|
+
"compare_price": 0,
|
|
703
|
+
"preview_image": "",
|
|
704
|
+
"shipment_type": "weight",
|
|
705
|
+
"shipment_weight": 0,
|
|
706
|
+
"show_understocking": "false"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"sku": "",
|
|
710
|
+
"cost": 0,
|
|
711
|
+
"spec": [
|
|
712
|
+
"白色",
|
|
713
|
+
"3層"
|
|
714
|
+
],
|
|
715
|
+
"type": "variants",
|
|
716
|
+
"stock": 0,
|
|
717
|
+
"profit": 0,
|
|
718
|
+
"weight": "1",
|
|
719
|
+
"barcode": "",
|
|
720
|
+
"v_width": 0,
|
|
721
|
+
"editable": false,
|
|
722
|
+
"v_height": 0,
|
|
723
|
+
"v_length": 0,
|
|
724
|
+
"product_id": 739,
|
|
725
|
+
"sale_price": 1000,
|
|
726
|
+
"compare_price": 0,
|
|
727
|
+
"preview_image": "",
|
|
728
|
+
"shipment_type": "weight",
|
|
729
|
+
"shipment_weight": 0,
|
|
730
|
+
"show_understocking": "false"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"sku": "",
|
|
734
|
+
"cost": 0,
|
|
735
|
+
"spec": [
|
|
736
|
+
"白色",
|
|
737
|
+
"4層"
|
|
738
|
+
],
|
|
739
|
+
"type": "variants",
|
|
740
|
+
"stock": 0,
|
|
741
|
+
"profit": 0,
|
|
742
|
+
"weight": "1",
|
|
743
|
+
"barcode": "",
|
|
744
|
+
"v_width": 0,
|
|
745
|
+
"editable": false,
|
|
746
|
+
"v_height": 0,
|
|
747
|
+
"v_length": 0,
|
|
748
|
+
"product_id": 739,
|
|
749
|
+
"sale_price": 1000,
|
|
750
|
+
"compare_price": 0,
|
|
751
|
+
"preview_image": "",
|
|
752
|
+
"shipment_type": "weight",
|
|
753
|
+
"shipment_weight": 0,
|
|
754
|
+
"show_understocking": "false"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"sku": "",
|
|
758
|
+
"cost": 0,
|
|
759
|
+
"spec": [
|
|
760
|
+
"白色",
|
|
761
|
+
"5層"
|
|
762
|
+
],
|
|
763
|
+
"type": "variants",
|
|
764
|
+
"stock": 0,
|
|
765
|
+
"profit": 0,
|
|
766
|
+
"weight": "1",
|
|
767
|
+
"barcode": "",
|
|
768
|
+
"v_width": 0,
|
|
769
|
+
"editable": false,
|
|
770
|
+
"v_height": 0,
|
|
771
|
+
"v_length": 0,
|
|
772
|
+
"product_id": 739,
|
|
773
|
+
"sale_price": 1000,
|
|
774
|
+
"compare_price": 0,
|
|
775
|
+
"preview_image": "",
|
|
776
|
+
"shipment_type": "weight",
|
|
777
|
+
"shipment_weight": 0,
|
|
778
|
+
"show_understocking": "false"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"sku": "",
|
|
782
|
+
"cost": 0,
|
|
783
|
+
"spec": [
|
|
784
|
+
"灰色",
|
|
785
|
+
"3層"
|
|
786
|
+
],
|
|
787
|
+
"type": "variants",
|
|
788
|
+
"stock": 0,
|
|
789
|
+
"profit": 0,
|
|
790
|
+
"weight": "1",
|
|
791
|
+
"barcode": "",
|
|
792
|
+
"v_width": 0,
|
|
793
|
+
"editable": false,
|
|
794
|
+
"v_height": 0,
|
|
795
|
+
"v_length": 0,
|
|
796
|
+
"product_id": 739,
|
|
797
|
+
"sale_price": 1000,
|
|
798
|
+
"compare_price": 0,
|
|
799
|
+
"preview_image": "",
|
|
800
|
+
"shipment_type": "weight",
|
|
801
|
+
"shipment_weight": 0,
|
|
802
|
+
"show_understocking": "false"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
"sku": "",
|
|
806
|
+
"cost": 0,
|
|
807
|
+
"spec": [
|
|
808
|
+
"灰色",
|
|
809
|
+
"4層"
|
|
810
|
+
],
|
|
811
|
+
"type": "variants",
|
|
812
|
+
"stock": 0,
|
|
813
|
+
"profit": 0,
|
|
814
|
+
"weight": "1",
|
|
815
|
+
"barcode": "",
|
|
816
|
+
"v_width": 0,
|
|
817
|
+
"editable": false,
|
|
818
|
+
"v_height": 0,
|
|
819
|
+
"v_length": 0,
|
|
820
|
+
"product_id": 739,
|
|
821
|
+
"sale_price": 1000,
|
|
822
|
+
"compare_price": 0,
|
|
823
|
+
"preview_image": "",
|
|
824
|
+
"shipment_type": "weight",
|
|
825
|
+
"shipment_weight": 0,
|
|
826
|
+
"show_understocking": "false"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
"sku": "",
|
|
830
|
+
"cost": 0,
|
|
831
|
+
"spec": [
|
|
832
|
+
"灰色",
|
|
833
|
+
"5層"
|
|
834
|
+
],
|
|
835
|
+
"type": "variants",
|
|
836
|
+
"stock": 0,
|
|
837
|
+
"profit": 0,
|
|
838
|
+
"weight": "1",
|
|
839
|
+
"barcode": "",
|
|
840
|
+
"v_width": 0,
|
|
841
|
+
"editable": false,
|
|
842
|
+
"v_height": 0,
|
|
843
|
+
"v_length": 0,
|
|
844
|
+
"product_id": 739,
|
|
845
|
+
"sale_price": 1000,
|
|
846
|
+
"compare_price": 0,
|
|
847
|
+
"preview_image": "",
|
|
848
|
+
"shipment_type": "weight",
|
|
849
|
+
"shipment_weight": 0,
|
|
850
|
+
"show_understocking": "false"
|
|
851
|
+
}
|
|
852
|
+
],
|
|
853
|
+
"hideIndex": "false",
|
|
854
|
+
"max_price": 1500,
|
|
855
|
+
"min_price": 1000,
|
|
856
|
+
"collection": [],
|
|
857
|
+
"productType": {
|
|
858
|
+
"product": false,
|
|
859
|
+
"giveaway": true,
|
|
860
|
+
"addProduct": false
|
|
861
|
+
},
|
|
862
|
+
"content_json": [],
|
|
863
|
+
"in_wish_list": false,
|
|
864
|
+
"content_array": [],
|
|
865
|
+
"preview_image": [
|
|
866
|
+
"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0412.09.55-AmodernMorgansteel-framebookshelfwithaminimalist,industrialdesign.Thebookshelffeaturessturdy,darkmetalframeswithmultipleopenwood.webp"
|
|
867
|
+
],
|
|
868
|
+
"relative_product": [],
|
|
869
|
+
"voucher_id": 738,
|
|
870
|
+
"have_select": true
|
|
871
|
+
}
|
|
319
872
|
],
|
|
320
873
|
"bind": [
|
|
321
874
|
{
|
|
322
875
|
"spec": [
|
|
323
876
|
"黑色",
|
|
324
|
-
"
|
|
877
|
+
"小號"
|
|
325
878
|
],
|
|
326
|
-
"id":
|
|
327
|
-
"count":
|
|
328
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
329
|
-
"title": "
|
|
330
|
-
"sale_price":
|
|
879
|
+
"id": 710,
|
|
880
|
+
"count": 5,
|
|
881
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
882
|
+
"title": "溫德米爾 茶几",
|
|
883
|
+
"sale_price": 1800,
|
|
331
884
|
"collection": [
|
|
332
885
|
"折扣專區",
|
|
333
886
|
"熱門商品",
|
|
334
887
|
"熱門商品 / 夏季限定"
|
|
335
888
|
],
|
|
336
|
-
"sku": "133",
|
|
337
|
-
"shipment_obj": {
|
|
338
|
-
"type": "weight",
|
|
339
|
-
"value": 100
|
|
340
|
-
},
|
|
341
|
-
"discount_price": 38,
|
|
342
|
-
"rebate": 0
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
"spec": [
|
|
346
|
-
"米色",
|
|
347
|
-
"標準"
|
|
348
|
-
],
|
|
349
|
-
"id": 735,
|
|
350
|
-
"count": 10,
|
|
351
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
352
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
353
|
-
"sale_price": 3200,
|
|
354
|
-
"collection": [],
|
|
355
889
|
"sku": "",
|
|
356
890
|
"shipment_obj": {
|
|
357
|
-
"type": "
|
|
358
|
-
"value":
|
|
891
|
+
"type": "volume",
|
|
892
|
+
"value": 600
|
|
359
893
|
},
|
|
360
|
-
"
|
|
361
|
-
"discount_price": 5,
|
|
894
|
+
"discount_price": 17.6,
|
|
362
895
|
"rebate": 0
|
|
363
896
|
}
|
|
364
897
|
],
|
|
365
898
|
"times": 1,
|
|
366
|
-
"bind_subtotal":
|
|
899
|
+
"bind_subtotal": 9000,
|
|
367
900
|
"discount_total": 0,
|
|
368
|
-
"rebate_total": 0
|
|
901
|
+
"rebate_total": 0,
|
|
902
|
+
"select_gif": {
|
|
903
|
+
"spec": [
|
|
904
|
+
"淺木色",
|
|
905
|
+
"4人座"
|
|
906
|
+
],
|
|
907
|
+
"id": 737,
|
|
908
|
+
"count": 1,
|
|
909
|
+
"voucher_id": 738
|
|
910
|
+
}
|
|
369
911
|
}
|
|
370
912
|
],
|
|
371
913
|
"distribution_info": {
|
|
@@ -566,6 +1108,13 @@ export class CheckoutIndex {
|
|
|
566
1108
|
</div>`;
|
|
567
1109
|
}
|
|
568
1110
|
|
|
1111
|
+
function giftBadge() {
|
|
1112
|
+
return html`
|
|
1113
|
+
<div class="${gClass('add-item-badge')}" style="background: #95ffe0;">
|
|
1114
|
+
<div class="${gClass('add-item-text')}">贈品</div>
|
|
1115
|
+
</div>`;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
569
1118
|
function addStyle() {
|
|
570
1119
|
gvc.addStyle(css`
|
|
571
1120
|
.${classPrefix}-container {
|
|
@@ -999,22 +1548,33 @@ export class CheckoutIndex {
|
|
|
999
1548
|
});
|
|
1000
1549
|
}
|
|
1001
1550
|
}
|
|
1002
|
-
|
|
1551
|
+
function getBadgeClass(){
|
|
1552
|
+
if(item.is_add_on_items){
|
|
1553
|
+
return addItemBadge()
|
|
1554
|
+
}else if(item.is_gift){
|
|
1555
|
+
return giftBadge()
|
|
1556
|
+
}else{
|
|
1557
|
+
return ``
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1003
1560
|
return html`
|
|
1004
1561
|
<div class="d-flex flex-column border-bottom p-lg-3 px-1 py-3 gap-3">
|
|
1005
1562
|
<div class="d-flex w-100 position-relative"
|
|
1006
1563
|
style="gap:20px;">
|
|
1007
1564
|
<div class="${gClass('first-td')} justify-content-start d-sm-none">
|
|
1008
1565
|
<div style="width: 88px;height: 88px;border-radius: 20px;background: 50%/cover url('${item.preview_image}')"></div>
|
|
1009
|
-
<span class="ms-2 d-none">${
|
|
1566
|
+
<span class="ms-2 d-none">${getBadgeClass()}${item.title}</span>
|
|
1010
1567
|
</div>
|
|
1011
1568
|
<div class="d-flex flex-sm-row flex-column w-100 position-relative"
|
|
1012
1569
|
style="gap: 8px; position: relative;">
|
|
1013
|
-
<div class="${gClass('first-td')} justify-content-start d-none d-sm-flex"
|
|
1570
|
+
<div class="${gClass('first-td')} justify-content-start d-none d-sm-flex"
|
|
1571
|
+
style="">
|
|
1014
1572
|
<div style="width: 88px;height: 88px;border-radius: 20px;background: 50%/cover url('${item.preview_image}')"></div>
|
|
1015
|
-
<span class="ms-2 d-flex align-items-start flex-column "
|
|
1573
|
+
<span class="ms-2 d-flex align-items-start flex-column "
|
|
1574
|
+
style="gap:5px;">${getBadgeClass()}${item.title}</span>
|
|
1016
1575
|
</div>
|
|
1017
|
-
<span class="d-flex align-items-start flex-column d-lg-none fw-bold"
|
|
1576
|
+
<span class="d-flex align-items-start flex-column d-lg-none fw-bold"
|
|
1577
|
+
style="gap:5px;font-size:17px;">${getBadgeClass()}${item.title}</span>
|
|
1018
1578
|
<div class="${gClass('td')}">
|
|
1019
1579
|
${item.spec ? item.spec.join(' / ') : ''}
|
|
1020
1580
|
</div>
|
|
@@ -1022,6 +1582,9 @@ export class CheckoutIndex {
|
|
|
1022
1582
|
style="gap:10px;">
|
|
1023
1583
|
<div class="">
|
|
1024
1584
|
${(() => {
|
|
1585
|
+
if(item.is_gift){
|
|
1586
|
+
return `NT.0`
|
|
1587
|
+
}
|
|
1025
1588
|
return `NT.${parseInt(item.sale_price, 10).toLocaleString()}`;
|
|
1026
1589
|
})()}
|
|
1027
1590
|
</div>
|
|
@@ -1039,6 +1602,8 @@ export class CheckoutIndex {
|
|
|
1039
1602
|
})
|
|
1040
1603
|
|
|
1041
1604
|
})}"
|
|
1605
|
+
${item.is_gift ? `disabled`:``}
|
|
1606
|
+
|
|
1042
1607
|
>
|
|
1043
1608
|
${[...new Array(99)].map((_, index) => {
|
|
1044
1609
|
return html`
|
|
@@ -1046,7 +1611,7 @@ export class CheckoutIndex {
|
|
|
1046
1611
|
${(index + 1 === item.count) ? `selected` : ``}>
|
|
1047
1612
|
${index + 1}
|
|
1048
1613
|
</option>`;
|
|
1049
|
-
})}
|
|
1614
|
+
}).join('')}
|
|
1050
1615
|
</select>
|
|
1051
1616
|
</div>
|
|
1052
1617
|
<div class="d-block d-md-none"
|
|
@@ -1086,8 +1651,8 @@ export class CheckoutIndex {
|
|
|
1086
1651
|
<div>
|
|
1087
1652
|
${vm.cartData.voucherList.filter((dd: any) => {
|
|
1088
1653
|
return dd.bind.find((d2: any) => {
|
|
1089
|
-
return d2.id === item.id
|
|
1090
|
-
})
|
|
1654
|
+
return d2.id === item.id
|
|
1655
|
+
}) && dd.reBackType!=='giveaway'
|
|
1091
1656
|
}).map((dd: any) => {
|
|
1092
1657
|
return `<div class="fs-6 w-100 " ><i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}</div>`
|
|
1093
1658
|
}).join('<div class="my-1"></div>')}
|
|
@@ -1533,37 +2098,52 @@ export class CheckoutIndex {
|
|
|
1533
2098
|
|
|
1534
2099
|
</div>
|
|
1535
2100
|
</section>
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
2101
|
+
`;
|
|
2102
|
+
},
|
|
2103
|
+
};
|
|
2104
|
+
})()
|
|
2105
|
+
)}
|
|
2106
|
+
<section class="border-bottom"></section>
|
|
2107
|
+
<section class="d-flex">
|
|
2108
|
+
<div class="flex-fill"></div>
|
|
2109
|
+
<div class="${gClass('price-container')}">
|
|
2110
|
+
<div class="${gClass(['price-row', 'text-1', 'bold'])}">
|
|
2111
|
+
<div>總金額</div>
|
|
2112
|
+
<div>NT. ${vm.cartData.total.toLocaleString()}</div>
|
|
2113
|
+
</div>
|
|
2114
|
+
</div>
|
|
2115
|
+
</section>
|
|
2116
|
+
<!--加購品-->
|
|
2117
|
+
${(() => {
|
|
2118
|
+
let add_on: any[] = []
|
|
2119
|
+
vm.cartData.voucherList.filter((dd: any) => {
|
|
2120
|
+
if (dd.reBackType === 'add_on_items') {
|
|
2121
|
+
add_on = add_on.concat(dd.add_on_products)
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
if (add_on.length) {
|
|
2125
|
+
return gvc.bindView(() => {
|
|
2126
|
+
const id = gvc.glitter.getUUID()
|
|
2127
|
+
return {
|
|
2128
|
+
bind: id,
|
|
2129
|
+
view: async () => {
|
|
2130
|
+
const add_products = (await ApiShop.getProduct({
|
|
2131
|
+
page: 0,
|
|
2132
|
+
limit: 100,
|
|
2133
|
+
productType: 'addProduct',
|
|
2134
|
+
id_list: add_on.join(',')
|
|
2135
|
+
}));
|
|
2136
|
+
if (!add_products.response.data.length) {
|
|
2137
|
+
return ``
|
|
2138
|
+
}
|
|
2139
|
+
return html`
|
|
1560
2140
|
<div class="${gClass('banner-bgr')}">
|
|
1561
2141
|
<span class="${gClass('banner-text')}">可加購商品</span>
|
|
1562
2142
|
</div>
|
|
1563
2143
|
<div class="d-flex align-items-center w-100"
|
|
1564
2144
|
style="overflow-x:auto;gap:10px;">
|
|
1565
2145
|
${add_products.response.data.map((dd: any) => {
|
|
1566
|
-
|
|
2146
|
+
return html`
|
|
1567
2147
|
<div class="d-flex py-3 align-items-center"
|
|
1568
2148
|
style="gap:10px;">
|
|
1569
2149
|
<div class="img-fluid "
|
|
@@ -1574,7 +2154,7 @@ export class CheckoutIndex {
|
|
|
1574
2154
|
background-position: center;
|
|
1575
2155
|
background-size: cover;
|
|
1576
2156
|
background-repeat: no-repeat;
|
|
1577
|
-
background-image: url(${dd.content.preview_image[0]});"></div>
|
|
2157
|
+
background-image: url('${dd.content.preview_image[0]}');"></div>
|
|
1578
2158
|
<div class="d-flex flex-column"
|
|
1579
2159
|
style="gap:5px;">
|
|
1580
2160
|
<div class="${gClass('banner-text')}"
|
|
@@ -1594,8 +2174,8 @@ export class CheckoutIndex {
|
|
|
1594
2174
|
</div>
|
|
1595
2175
|
<button class="${gClass('button-bgr')} mb-0 mt-2"
|
|
1596
2176
|
onclick="${gvc.event(() => {
|
|
1597
|
-
|
|
1598
|
-
|
|
2177
|
+
return gvc.glitter.innerDialog((gvc: GVC) => {
|
|
2178
|
+
return html`
|
|
1599
2179
|
<div
|
|
1600
2180
|
class="bg-white shadow rounded-3"
|
|
1601
2181
|
style="overflow-y: auto; ${document.body.clientWidth > 768 ? `min-width: 400px; width: 600px;` : 'min-width: 90vw; max-width: 92.5vw;'}"
|
|
@@ -1609,8 +2189,8 @@ export class CheckoutIndex {
|
|
|
1609
2189
|
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1610
2190
|
style="cursor: pointer"
|
|
1611
2191
|
onclick="${gvc.event(() => {
|
|
1612
|
-
|
|
1613
|
-
|
|
2192
|
+
gvc.closeDialog();
|
|
2193
|
+
})}"
|
|
1614
2194
|
></i>
|
|
1615
2195
|
</div>
|
|
1616
2196
|
<div class="c_dialog">
|
|
@@ -1618,67 +2198,199 @@ export class CheckoutIndex {
|
|
|
1618
2198
|
<div class="c_dialog_main"
|
|
1619
2199
|
style="gap: 24px; height: auto; max-height: 500px; padding: 12px 20px;">
|
|
1620
2200
|
${PdClass.selectSpec({
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
2201
|
+
gvc,
|
|
2202
|
+
titleFontColor: glitter.share.globalValue['theme_color.0.title'] ?? '#333333',
|
|
2203
|
+
prod: dd.content,
|
|
2204
|
+
vm: {
|
|
2205
|
+
specs: dd.content.specs.map((spec: {
|
|
2206
|
+
option: {
|
|
2207
|
+
title: string
|
|
2208
|
+
}[]
|
|
2209
|
+
}) => {
|
|
2210
|
+
return spec.option[0].title;
|
|
2211
|
+
}),
|
|
2212
|
+
quantity: '1',
|
|
2213
|
+
wishStatus: (glitter.share.wishList ?? []).some((item: {
|
|
2214
|
+
id: number
|
|
2215
|
+
}) => {
|
|
2216
|
+
return item.id === dd.id;
|
|
2217
|
+
})
|
|
2218
|
+
},
|
|
2219
|
+
callback: () => {
|
|
2220
|
+
gvc.closeDialog();
|
|
2221
|
+
refreshCartData()
|
|
2222
|
+
}
|
|
2223
|
+
})}
|
|
1644
2224
|
</div>
|
|
1645
2225
|
</div>
|
|
1646
2226
|
</div>
|
|
1647
2227
|
</div>
|
|
1648
2228
|
</div>`;
|
|
1649
|
-
|
|
1650
|
-
|
|
2229
|
+
}, Tool.randomString(7));
|
|
2230
|
+
})}">
|
|
1651
2231
|
<span class="${gClass('button-text')}">加入購物車</span>
|
|
1652
2232
|
</button>
|
|
1653
2233
|
</div>
|
|
1654
2234
|
</div>`
|
|
1655
|
-
|
|
2235
|
+
}).join('')}
|
|
1656
2236
|
</div>
|
|
1657
2237
|
`
|
|
1658
|
-
|
|
1659
|
-
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
})
|
|
2241
|
+
} else {
|
|
2242
|
+
return ``
|
|
2243
|
+
}
|
|
2244
|
+
return ``
|
|
2245
|
+
})()}
|
|
2246
|
+
<!--贈品-->
|
|
2247
|
+
${(() => {
|
|
2248
|
+
let already_add: any[] = vm.cartData.lineItems.filter((dd:any)=>{
|
|
2249
|
+
return dd.is_gift
|
|
2250
|
+
});
|
|
2251
|
+
return vm.cartData.voucherList.filter((d1: any) => {
|
|
2252
|
+
return d1.reBackType === 'giveaway'
|
|
2253
|
+
}).map((dd: any) => {
|
|
2254
|
+
let isSelected=already_add.find((d2)=>{
|
|
2255
|
+
return dd.add_on_products.find((d1:any)=>{
|
|
2256
|
+
return d1.id===d2.id
|
|
2257
|
+
})
|
|
2258
|
+
});
|
|
2259
|
+
already_add=already_add.filter((dd)=>{
|
|
2260
|
+
return !dd===isSelected
|
|
2261
|
+
})
|
|
2262
|
+
return html`
|
|
2263
|
+
<div class="${gClass('banner-bgr')}">
|
|
2264
|
+
<span class="${gClass('banner-text')}">${dd.title}</span>
|
|
2265
|
+
</div>
|
|
2266
|
+
<div class="d-flex align-items-center w-100"
|
|
2267
|
+
style="overflow-x:auto;gap:10px;">
|
|
2268
|
+
${dd.add_on_products.map((pd: any) => {
|
|
2269
|
+
try {
|
|
2270
|
+
return html`
|
|
2271
|
+
<div class="d-flex py-3 align-items-center"
|
|
2272
|
+
style="gap:10px;">
|
|
2273
|
+
<div class="img-fluid "
|
|
2274
|
+
style="width: 106px;
|
|
2275
|
+
min-width: 106px;
|
|
2276
|
+
height: 106px;
|
|
2277
|
+
border-radius: 3px;
|
|
2278
|
+
background-position: center;
|
|
2279
|
+
background-size: cover;
|
|
2280
|
+
background-repeat: no-repeat;
|
|
2281
|
+
background-image: url('${pd.preview_image[0]}');"></div>
|
|
2282
|
+
<div class="d-flex flex-column"
|
|
2283
|
+
style="gap:5px;">
|
|
2284
|
+
<div class="${gClass('banner-text')}"
|
|
2285
|
+
style="font-size: 15px;
|
|
2286
|
+
font-style: normal;
|
|
2287
|
+
font-weight: 400;
|
|
2288
|
+
white-space: nowrap;
|
|
2289
|
+
overflow: hidden;
|
|
2290
|
+
max-width: 130px;
|
|
2291
|
+
text-overflow: ellipsis;">${pd.title}
|
|
2292
|
+
</div>
|
|
2293
|
+
<div class="text-decoration-line-through text-danger"
|
|
2294
|
+
style="font-size: 14px;
|
|
2295
|
+
font-style: normal;
|
|
2296
|
+
font-weight: 700;
|
|
2297
|
+
line-height: 140%;">NT.${pd.min_price.toLocaleString()}
|
|
2298
|
+
</div>
|
|
2299
|
+
<button class="${gClass('button-bgr')} mb-0 mt-2"
|
|
2300
|
+
style="${(isSelected ? ((isSelected.id === pd.id) ? `background: gray !important;`:``):``) }"
|
|
2301
|
+
onclick="${gvc.event(() => {
|
|
2302
|
+
if(isSelected && (isSelected.id === pd.id) ){
|
|
2303
|
+
return
|
|
2304
|
+
}
|
|
2305
|
+
return gvc.glitter.innerDialog((gvc: GVC) => {
|
|
2306
|
+
return html`
|
|
2307
|
+
<div
|
|
2308
|
+
class="bg-white shadow rounded-3"
|
|
2309
|
+
style="overflow-y: auto; ${document.body.clientWidth > 768 ? `min-width: 400px; width: 600px;` : 'min-width: 90vw; max-width: 92.5vw;'}"
|
|
2310
|
+
>
|
|
2311
|
+
<div class="bg-white shadow rounded-3"
|
|
2312
|
+
style="width: 100%; overflow-y: auto; position: relative;">
|
|
2313
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
2314
|
+
style="position: sticky; top: 0; background: #fff;">
|
|
2315
|
+
<div class="flex-fill"></div>
|
|
2316
|
+
<i
|
|
2317
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
2318
|
+
style="cursor: pointer"
|
|
2319
|
+
onclick="${gvc.event(() => {
|
|
2320
|
+
gvc.closeDialog();
|
|
2321
|
+
})}"
|
|
2322
|
+
></i>
|
|
2323
|
+
</div>
|
|
2324
|
+
<div class="c_dialog">
|
|
2325
|
+
<div class="c_dialog_body">
|
|
2326
|
+
<div class="c_dialog_main"
|
|
2327
|
+
style="gap: 24px; height: auto; max-height: 500px; padding: 12px 20px;">
|
|
2328
|
+
${PdClass.selectSpec({
|
|
2329
|
+
gvc,
|
|
2330
|
+
titleFontColor: glitter.share.globalValue['theme_color.0.title'] ?? '#333333',
|
|
2331
|
+
prod: pd,
|
|
2332
|
+
vm: {
|
|
2333
|
+
specs: pd.specs.map((spec: {
|
|
2334
|
+
option: {
|
|
2335
|
+
title: string
|
|
2336
|
+
}[]
|
|
2337
|
+
}) => {
|
|
2338
|
+
return spec.option[0].title;
|
|
2339
|
+
}),
|
|
2340
|
+
quantity: '1',
|
|
2341
|
+
wishStatus: (glitter.share.wishList ?? []).some((item: {
|
|
2342
|
+
id: number
|
|
2343
|
+
}) => {
|
|
2344
|
+
return item.id === dd.id;
|
|
1660
2345
|
})
|
|
1661
|
-
}
|
|
1662
|
-
|
|
2346
|
+
},
|
|
2347
|
+
with_qty:false,
|
|
2348
|
+
callback: () => {
|
|
2349
|
+
let find=vm.cartData.lineItems.find((d1:any)=>{
|
|
2350
|
+
return dd.add_on_products.find((d2:any)=>{
|
|
2351
|
+
return d2.id===d1.id
|
|
2352
|
+
})
|
|
2353
|
+
});
|
|
2354
|
+
if(find){
|
|
2355
|
+
ApiCart.setCart((cartItem) => {
|
|
2356
|
+
cartItem.line_items.map((dd) => {
|
|
2357
|
+
if(dd.id===find.id){
|
|
2358
|
+
dd.count--
|
|
2359
|
+
}
|
|
2360
|
+
})
|
|
2361
|
+
cartItem.line_items=cartItem.line_items.filter((dd)=>{
|
|
2362
|
+
return dd.count>0
|
|
2363
|
+
})
|
|
2364
|
+
refreshCartData()
|
|
2365
|
+
gvc.closeDialog()
|
|
2366
|
+
})
|
|
2367
|
+
}else{
|
|
2368
|
+
refreshCartData()
|
|
2369
|
+
gvc.closeDialog()
|
|
2370
|
+
}
|
|
1663
2371
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
2372
|
+
})}
|
|
2373
|
+
</div>
|
|
2374
|
+
</div>
|
|
2375
|
+
</div>
|
|
2376
|
+
</div>
|
|
2377
|
+
</div>`;
|
|
2378
|
+
}, Tool.randomString(7));
|
|
2379
|
+
})}">
|
|
2380
|
+
|
|
2381
|
+
<span class="${gClass('button-text')}">${isSelected ? ((isSelected.id === pd.id) ? `已選擇`:`更換贈品`):`選擇贈品`}</span>
|
|
2382
|
+
</button>
|
|
2383
|
+
</div>
|
|
2384
|
+
</div>`
|
|
2385
|
+
}catch (e) {
|
|
2386
|
+
console.log(e)
|
|
2387
|
+
}
|
|
1666
2388
|
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
)}
|
|
1672
|
-
<section class="border-bottom"></section>
|
|
1673
|
-
<section class="d-flex">
|
|
1674
|
-
<div class="flex-fill"></div>
|
|
1675
|
-
<div class="${gClass('price-container')}">
|
|
1676
|
-
<div class="${gClass(['price-row', 'text-1', 'bold'])}">
|
|
1677
|
-
<div>總金額</div>
|
|
1678
|
-
<div>NT. ${vm.cartData.total.toLocaleString()}</div>
|
|
1679
|
-
</div>
|
|
1680
|
-
</div>
|
|
1681
|
-
</section>
|
|
2389
|
+
}).join('')}
|
|
2390
|
+
</div>
|
|
2391
|
+
`
|
|
2392
|
+
}).join('')
|
|
2393
|
+
})()}
|
|
1682
2394
|
<section>
|
|
1683
2395
|
<div class="${gClass('banner-bgr')}">
|
|
1684
2396
|
<span class="${gClass('banner-text')}">付款及配送方式</span>
|
|
@@ -2623,13 +3335,19 @@ export class CheckoutIndex {
|
|
|
2623
3335
|
})()) {
|
|
2624
3336
|
widget.event('error', {title: `請輸入「${FormWidget.checkLeakData(cartData.custom_form_format, cartData.custom_form_data)}」`});
|
|
2625
3337
|
} else if (
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
3338
|
+
(()=>{
|
|
3339
|
+
let gift_need= cartData.voucherList
|
|
3340
|
+
.filter((dd: any) => {
|
|
3341
|
+
return dd.reBackType === 'giveaway';
|
|
3342
|
+
}).length;
|
|
3343
|
+
let gift=0
|
|
3344
|
+
cartData.lineItems.filter((dd:any)=>{
|
|
3345
|
+
return dd.is_gift
|
|
3346
|
+
}).map((dd:any)=>{
|
|
3347
|
+
gift+=dd.count
|
|
2632
3348
|
})
|
|
3349
|
+
return gift<gift_need
|
|
3350
|
+
})()
|
|
2633
3351
|
) {
|
|
2634
3352
|
widget.event('error', {title: '請選擇「贈品」'});
|
|
2635
3353
|
} else {
|
|
@@ -2767,6 +3485,8 @@ export class CheckoutIndex {
|
|
|
2767
3485
|
localStorage.setItem('custom_form_data', JSON.stringify(cartData.custom_form_data))
|
|
2768
3486
|
//設定配送資訊
|
|
2769
3487
|
localStorage.setItem('custom_user_info', JSON.stringify(cartData.user_info))
|
|
3488
|
+
//贈品功能
|
|
3489
|
+
localStorage.setItem('give_away', JSON.stringify(cartData.give_away))
|
|
2770
3490
|
}
|
|
2771
3491
|
|
|
2772
3492
|
|
|
@@ -2774,7 +3494,7 @@ export class CheckoutIndex {
|
|
|
2774
3494
|
cartData.customer_info = JSON.parse(localStorage.getItem('cart_customer_info') || "{}")
|
|
2775
3495
|
cartData.custom_form_data = JSON.parse(localStorage.getItem('custom_form_data') || "{}")
|
|
2776
3496
|
cartData.user_info = JSON.parse(localStorage.getItem('custom_user_info') || "{}")
|
|
2777
|
-
|
|
3497
|
+
cartData.give_away = JSON.parse(localStorage.getItem('give_away') || "[]")
|
|
2778
3498
|
this.getPaymentMethod(cartData)
|
|
2779
3499
|
this.getShipmentMethod(cartData)
|
|
2780
3500
|
}
|