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
|
@@ -36,56 +36,36 @@ export class CheckoutIndex {
|
|
|
36
36
|
{
|
|
37
37
|
"spec": [
|
|
38
38
|
"黑色",
|
|
39
|
-
"
|
|
39
|
+
"小號"
|
|
40
40
|
],
|
|
41
|
-
"id":
|
|
42
|
-
"count":
|
|
43
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
44
|
-
"title": "
|
|
45
|
-
"sale_price":
|
|
41
|
+
"id": 710,
|
|
42
|
+
"count": 5,
|
|
43
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
44
|
+
"title": "溫德米爾 茶几",
|
|
45
|
+
"sale_price": 1800,
|
|
46
46
|
"collection": [
|
|
47
47
|
"折扣專區",
|
|
48
48
|
"熱門商品",
|
|
49
49
|
"熱門商品 / 夏季限定"
|
|
50
50
|
],
|
|
51
|
-
"sku": "133",
|
|
52
|
-
"shipment_obj": {
|
|
53
|
-
"type": "weight",
|
|
54
|
-
"value": 100
|
|
55
|
-
},
|
|
56
|
-
"discount_price": 38,
|
|
57
|
-
"rebate": 0
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"spec": [
|
|
61
|
-
"米色",
|
|
62
|
-
"標準"
|
|
63
|
-
],
|
|
64
|
-
"id": 735,
|
|
65
|
-
"count": 10,
|
|
66
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
67
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
68
|
-
"sale_price": 3200,
|
|
69
|
-
"collection": [],
|
|
70
51
|
"sku": "",
|
|
71
52
|
"shipment_obj": {
|
|
72
|
-
"type": "
|
|
73
|
-
"value":
|
|
53
|
+
"type": "volume",
|
|
54
|
+
"value": 600
|
|
74
55
|
},
|
|
75
|
-
"
|
|
76
|
-
"discount_price": 5,
|
|
56
|
+
"discount_price": 17.6,
|
|
77
57
|
"rebate": 0
|
|
78
58
|
}
|
|
79
59
|
],
|
|
80
|
-
"total":
|
|
60
|
+
"total": 9212,
|
|
81
61
|
"email": "sam38124@gmail.com",
|
|
82
62
|
"user_info": {
|
|
83
|
-
"shipment": "
|
|
63
|
+
"shipment": "shop"
|
|
84
64
|
},
|
|
85
|
-
"shipment_fee":
|
|
65
|
+
"shipment_fee": 300,
|
|
86
66
|
"rebate": 0,
|
|
87
67
|
"use_rebate": 0,
|
|
88
|
-
"orderID": "
|
|
68
|
+
"orderID": "1732712547962",
|
|
89
69
|
"shipment_support": [
|
|
90
70
|
"OKMARTC2C",
|
|
91
71
|
"shop",
|
|
@@ -194,7 +174,17 @@ export class CheckoutIndex {
|
|
|
194
174
|
},
|
|
195
175
|
"orderSource": "",
|
|
196
176
|
"code_array": [],
|
|
197
|
-
"give_away": [
|
|
177
|
+
"give_away": [
|
|
178
|
+
{
|
|
179
|
+
"id": 737,
|
|
180
|
+
"spec": [
|
|
181
|
+
"淺木色",
|
|
182
|
+
"4人座"
|
|
183
|
+
],
|
|
184
|
+
"count": 1,
|
|
185
|
+
"voucher_id": 738
|
|
186
|
+
}
|
|
187
|
+
],
|
|
198
188
|
"user_rebate_sum": 39807,
|
|
199
189
|
"voucherList": [
|
|
200
190
|
{
|
|
@@ -233,59 +223,39 @@ export class CheckoutIndex {
|
|
|
233
223
|
{
|
|
234
224
|
"spec": [
|
|
235
225
|
"黑色",
|
|
236
|
-
"
|
|
226
|
+
"小號"
|
|
237
227
|
],
|
|
238
|
-
"id":
|
|
239
|
-
"count":
|
|
240
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
241
|
-
"title": "
|
|
242
|
-
"sale_price":
|
|
228
|
+
"id": 710,
|
|
229
|
+
"count": 5,
|
|
230
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
231
|
+
"title": "溫德米爾 茶几",
|
|
232
|
+
"sale_price": 1800,
|
|
243
233
|
"collection": [
|
|
244
234
|
"折扣專區",
|
|
245
235
|
"熱門商品",
|
|
246
236
|
"熱門商品 / 夏季限定"
|
|
247
237
|
],
|
|
248
|
-
"sku": "133",
|
|
249
|
-
"shipment_obj": {
|
|
250
|
-
"type": "weight",
|
|
251
|
-
"value": 100
|
|
252
|
-
},
|
|
253
|
-
"discount_price": 38,
|
|
254
|
-
"rebate": 0
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"spec": [
|
|
258
|
-
"米色",
|
|
259
|
-
"標準"
|
|
260
|
-
],
|
|
261
|
-
"id": 735,
|
|
262
|
-
"count": 10,
|
|
263
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
264
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
265
|
-
"sale_price": 3200,
|
|
266
|
-
"collection": [],
|
|
267
238
|
"sku": "",
|
|
268
239
|
"shipment_obj": {
|
|
269
|
-
"type": "
|
|
270
|
-
"value":
|
|
240
|
+
"type": "volume",
|
|
241
|
+
"value": 600
|
|
271
242
|
},
|
|
272
|
-
"
|
|
273
|
-
"discount_price": 5,
|
|
243
|
+
"discount_price": 17.6,
|
|
274
244
|
"rebate": 0
|
|
275
245
|
}
|
|
276
246
|
],
|
|
277
247
|
"times": 1,
|
|
278
|
-
"bind_subtotal":
|
|
248
|
+
"bind_subtotal": 9000,
|
|
279
249
|
"discount_total": 88,
|
|
280
250
|
"rebate_total": 0
|
|
281
251
|
},
|
|
282
252
|
{
|
|
283
|
-
"id":
|
|
253
|
+
"id": 738,
|
|
284
254
|
"for": "all",
|
|
285
255
|
"code": "",
|
|
286
256
|
"rule": "min_price",
|
|
287
257
|
"type": "voucher",
|
|
288
|
-
"title": "
|
|
258
|
+
"title": "滿100贈送",
|
|
289
259
|
"value": "0",
|
|
290
260
|
"device": [
|
|
291
261
|
"normal"
|
|
@@ -299,68 +269,639 @@ export class CheckoutIndex {
|
|
|
299
269
|
"trigger": "auto",
|
|
300
270
|
"counting": "single",
|
|
301
271
|
"ruleValue": 1000,
|
|
302
|
-
"startDate": "2024-11-
|
|
303
|
-
"startTime": "
|
|
304
|
-
"reBackType": "
|
|
272
|
+
"startDate": "2024-11-20",
|
|
273
|
+
"startTime": "20:00",
|
|
274
|
+
"reBackType": "giveaway",
|
|
305
275
|
"targetList": [],
|
|
306
276
|
"end_ISO_Date": "",
|
|
307
277
|
"macroLimited": 0,
|
|
308
278
|
"microLimited": 0,
|
|
309
279
|
"rebateEndDay": "30",
|
|
310
280
|
"conditionType": "order",
|
|
311
|
-
"start_ISO_Date": "2024-11-
|
|
281
|
+
"start_ISO_Date": "2024-11-20T12:00:00.000Z",
|
|
312
282
|
"add_on_products": [
|
|
313
|
-
|
|
283
|
+
{
|
|
284
|
+
"id": 737,
|
|
285
|
+
"seo": {
|
|
286
|
+
"title": "北歐風實木餐桌 - 優雅的餐桌選擇",
|
|
287
|
+
"domain": "北歐風實木餐桌 ( 贈品 )",
|
|
288
|
+
"content": "選擇北歐風實木餐桌,帶給您的家居新氣象。",
|
|
289
|
+
"keywords": ""
|
|
290
|
+
},
|
|
291
|
+
"type": "product",
|
|
292
|
+
"specs": [
|
|
293
|
+
{
|
|
294
|
+
"title": "顏色",
|
|
295
|
+
"option": [
|
|
296
|
+
{
|
|
297
|
+
"title": "淺木色",
|
|
298
|
+
"expand": true
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"title": "胡桃木色",
|
|
302
|
+
"expand": true
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"title": "黑色",
|
|
306
|
+
"expand": true
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"title": "尺寸",
|
|
312
|
+
"option": [
|
|
313
|
+
{
|
|
314
|
+
"title": "4人座"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"title": "6人座"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"title": "8人座"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"title": "北歐風實木餐桌 ( 贈品 )",
|
|
326
|
+
"token": {
|
|
327
|
+
"exp": 1764244210,
|
|
328
|
+
"iat": 1732708210,
|
|
329
|
+
"userID": 122538856,
|
|
330
|
+
"account": "rdtest",
|
|
331
|
+
"userData": {}
|
|
332
|
+
},
|
|
333
|
+
"status": "active",
|
|
334
|
+
"content": "北歐風實木餐桌,提供多種顏色與尺寸,適合不同家庭。",
|
|
335
|
+
"visible": "true",
|
|
336
|
+
"template": "",
|
|
337
|
+
"variants": [
|
|
338
|
+
{
|
|
339
|
+
"sku": "",
|
|
340
|
+
"cost": 0,
|
|
341
|
+
"spec": [
|
|
342
|
+
"淺木色",
|
|
343
|
+
"4人座"
|
|
344
|
+
],
|
|
345
|
+
"type": "variants",
|
|
346
|
+
"stock": 0,
|
|
347
|
+
"profit": 0,
|
|
348
|
+
"weight": "1",
|
|
349
|
+
"barcode": "",
|
|
350
|
+
"v_width": 0,
|
|
351
|
+
"editable": false,
|
|
352
|
+
"v_height": 0,
|
|
353
|
+
"v_length": 0,
|
|
354
|
+
"product_id": 737,
|
|
355
|
+
"sale_price": 3500,
|
|
356
|
+
"compare_price": 0,
|
|
357
|
+
"preview_image": "",
|
|
358
|
+
"shipment_type": "weight",
|
|
359
|
+
"shipment_weight": 0,
|
|
360
|
+
"show_understocking": "false"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"sku": "",
|
|
364
|
+
"cost": 0,
|
|
365
|
+
"spec": [
|
|
366
|
+
"淺木色",
|
|
367
|
+
"6人座"
|
|
368
|
+
],
|
|
369
|
+
"type": "variants",
|
|
370
|
+
"stock": 0,
|
|
371
|
+
"profit": 0,
|
|
372
|
+
"weight": "1",
|
|
373
|
+
"barcode": "",
|
|
374
|
+
"v_width": 0,
|
|
375
|
+
"editable": false,
|
|
376
|
+
"v_height": 0,
|
|
377
|
+
"v_length": 0,
|
|
378
|
+
"product_id": 737,
|
|
379
|
+
"sale_price": 3000,
|
|
380
|
+
"compare_price": 0,
|
|
381
|
+
"preview_image": "",
|
|
382
|
+
"shipment_type": "weight",
|
|
383
|
+
"shipment_weight": 0,
|
|
384
|
+
"show_understocking": "false"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"sku": "",
|
|
388
|
+
"cost": 0,
|
|
389
|
+
"spec": [
|
|
390
|
+
"淺木色",
|
|
391
|
+
"8人座"
|
|
392
|
+
],
|
|
393
|
+
"type": "variants",
|
|
394
|
+
"stock": 0,
|
|
395
|
+
"profit": 0,
|
|
396
|
+
"weight": "1",
|
|
397
|
+
"barcode": "",
|
|
398
|
+
"v_width": 0,
|
|
399
|
+
"editable": false,
|
|
400
|
+
"v_height": 0,
|
|
401
|
+
"v_length": 0,
|
|
402
|
+
"product_id": 737,
|
|
403
|
+
"sale_price": 2500,
|
|
404
|
+
"compare_price": 0,
|
|
405
|
+
"preview_image": "",
|
|
406
|
+
"shipment_type": "weight",
|
|
407
|
+
"shipment_weight": 0,
|
|
408
|
+
"show_understocking": "false"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"sku": "",
|
|
412
|
+
"cost": 0,
|
|
413
|
+
"spec": [
|
|
414
|
+
"胡桃木色",
|
|
415
|
+
"4人座"
|
|
416
|
+
],
|
|
417
|
+
"type": "variants",
|
|
418
|
+
"stock": 0,
|
|
419
|
+
"profit": 0,
|
|
420
|
+
"weight": "1",
|
|
421
|
+
"barcode": "",
|
|
422
|
+
"v_width": 0,
|
|
423
|
+
"editable": false,
|
|
424
|
+
"v_height": 0,
|
|
425
|
+
"v_length": 0,
|
|
426
|
+
"product_id": 737,
|
|
427
|
+
"sale_price": 2500,
|
|
428
|
+
"compare_price": 0,
|
|
429
|
+
"preview_image": "",
|
|
430
|
+
"shipment_type": "weight",
|
|
431
|
+
"shipment_weight": 0,
|
|
432
|
+
"show_understocking": "false"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"sku": "",
|
|
436
|
+
"cost": 0,
|
|
437
|
+
"spec": [
|
|
438
|
+
"胡桃木色",
|
|
439
|
+
"6人座"
|
|
440
|
+
],
|
|
441
|
+
"type": "variants",
|
|
442
|
+
"stock": 0,
|
|
443
|
+
"profit": 0,
|
|
444
|
+
"weight": "1",
|
|
445
|
+
"barcode": "",
|
|
446
|
+
"v_width": 0,
|
|
447
|
+
"editable": false,
|
|
448
|
+
"v_height": 0,
|
|
449
|
+
"v_length": 0,
|
|
450
|
+
"product_id": 737,
|
|
451
|
+
"sale_price": 2500,
|
|
452
|
+
"compare_price": 0,
|
|
453
|
+
"preview_image": "",
|
|
454
|
+
"shipment_type": "weight",
|
|
455
|
+
"shipment_weight": 0,
|
|
456
|
+
"show_understocking": "false"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"sku": "",
|
|
460
|
+
"cost": 0,
|
|
461
|
+
"spec": [
|
|
462
|
+
"胡桃木色",
|
|
463
|
+
"8人座"
|
|
464
|
+
],
|
|
465
|
+
"type": "variants",
|
|
466
|
+
"stock": 0,
|
|
467
|
+
"profit": 0,
|
|
468
|
+
"weight": "1",
|
|
469
|
+
"barcode": "",
|
|
470
|
+
"v_width": 0,
|
|
471
|
+
"editable": false,
|
|
472
|
+
"v_height": 0,
|
|
473
|
+
"v_length": 0,
|
|
474
|
+
"product_id": 737,
|
|
475
|
+
"sale_price": 2500,
|
|
476
|
+
"compare_price": 0,
|
|
477
|
+
"preview_image": "",
|
|
478
|
+
"shipment_type": "weight",
|
|
479
|
+
"shipment_weight": 0,
|
|
480
|
+
"show_understocking": "false"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"sku": "",
|
|
484
|
+
"cost": 0,
|
|
485
|
+
"spec": [
|
|
486
|
+
"黑色",
|
|
487
|
+
"4人座"
|
|
488
|
+
],
|
|
489
|
+
"type": "variants",
|
|
490
|
+
"stock": 0,
|
|
491
|
+
"profit": 0,
|
|
492
|
+
"weight": "1",
|
|
493
|
+
"barcode": "",
|
|
494
|
+
"v_width": 0,
|
|
495
|
+
"editable": false,
|
|
496
|
+
"v_height": 0,
|
|
497
|
+
"v_length": 0,
|
|
498
|
+
"product_id": 737,
|
|
499
|
+
"sale_price": 2500,
|
|
500
|
+
"compare_price": 0,
|
|
501
|
+
"preview_image": "",
|
|
502
|
+
"shipment_type": "weight",
|
|
503
|
+
"shipment_weight": 0,
|
|
504
|
+
"show_understocking": "false"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"sku": "",
|
|
508
|
+
"cost": 0,
|
|
509
|
+
"spec": [
|
|
510
|
+
"黑色",
|
|
511
|
+
"6人座"
|
|
512
|
+
],
|
|
513
|
+
"type": "variants",
|
|
514
|
+
"stock": 0,
|
|
515
|
+
"profit": 0,
|
|
516
|
+
"weight": "1",
|
|
517
|
+
"barcode": "",
|
|
518
|
+
"v_width": 0,
|
|
519
|
+
"editable": false,
|
|
520
|
+
"v_height": 0,
|
|
521
|
+
"v_length": 0,
|
|
522
|
+
"product_id": 737,
|
|
523
|
+
"sale_price": 2500,
|
|
524
|
+
"compare_price": 0,
|
|
525
|
+
"preview_image": "",
|
|
526
|
+
"shipment_type": "weight",
|
|
527
|
+
"shipment_weight": 0,
|
|
528
|
+
"show_understocking": "false"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"sku": "",
|
|
532
|
+
"cost": 0,
|
|
533
|
+
"spec": [
|
|
534
|
+
"黑色",
|
|
535
|
+
"8人座"
|
|
536
|
+
],
|
|
537
|
+
"type": "variants",
|
|
538
|
+
"stock": 0,
|
|
539
|
+
"profit": 0,
|
|
540
|
+
"weight": "1",
|
|
541
|
+
"barcode": "",
|
|
542
|
+
"v_width": 0,
|
|
543
|
+
"editable": false,
|
|
544
|
+
"v_height": 0,
|
|
545
|
+
"v_length": 0,
|
|
546
|
+
"product_id": 737,
|
|
547
|
+
"sale_price": 2500,
|
|
548
|
+
"compare_price": 0,
|
|
549
|
+
"preview_image": "",
|
|
550
|
+
"shipment_type": "weight",
|
|
551
|
+
"shipment_weight": 0,
|
|
552
|
+
"show_understocking": "false"
|
|
553
|
+
}
|
|
554
|
+
],
|
|
555
|
+
"hideIndex": "false",
|
|
556
|
+
"max_price": 3500,
|
|
557
|
+
"min_price": 2500,
|
|
558
|
+
"collection": [],
|
|
559
|
+
"productType": {
|
|
560
|
+
"product": false,
|
|
561
|
+
"giveaway": true,
|
|
562
|
+
"addProduct": false
|
|
563
|
+
},
|
|
564
|
+
"content_json": [],
|
|
565
|
+
"in_wish_list": false,
|
|
566
|
+
"content_array": [],
|
|
567
|
+
"preview_image": [
|
|
568
|
+
"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"
|
|
569
|
+
],
|
|
570
|
+
"relative_product": [],
|
|
571
|
+
"voucher_id": 738,
|
|
572
|
+
"selected": true,
|
|
573
|
+
"have_select": true
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"id": 739,
|
|
577
|
+
"seo": {
|
|
578
|
+
"title": "摩根鋼架書架 - 多色多層選擇",
|
|
579
|
+
"domain": "摩根鋼架書架 ( 贈品 )",
|
|
580
|
+
"content": "摩根鋼架書架,提供黑色、白色和灰色選擇,適合家庭及辦公室使用,尺寸有3層、4層、5層,價格合理。",
|
|
581
|
+
"keywords": ""
|
|
582
|
+
},
|
|
583
|
+
"type": "product",
|
|
584
|
+
"specs": [
|
|
585
|
+
{
|
|
586
|
+
"title": "顏色",
|
|
587
|
+
"option": [
|
|
588
|
+
{
|
|
589
|
+
"title": "黑色",
|
|
590
|
+
"expand": true
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"title": "白色",
|
|
594
|
+
"expand": true
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"title": "灰色",
|
|
598
|
+
"expand": true
|
|
599
|
+
}
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"title": "尺寸",
|
|
604
|
+
"option": [
|
|
605
|
+
{
|
|
606
|
+
"title": "3層"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"title": "4層"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"title": "5層"
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
],
|
|
617
|
+
"title": "摩根鋼架書架 ( 贈品 )",
|
|
618
|
+
"token": {
|
|
619
|
+
"exp": 1764244210,
|
|
620
|
+
"iat": 1732708210,
|
|
621
|
+
"userID": 122538856,
|
|
622
|
+
"account": "rdtest",
|
|
623
|
+
"userData": {}
|
|
624
|
+
},
|
|
625
|
+
"status": "active",
|
|
626
|
+
"content": "摩根鋼架書架,完美擺放您的書籍與裝飾品,適合不同空間需求,提供不同顏色及層數選擇。",
|
|
627
|
+
"visible": "true",
|
|
628
|
+
"template": "",
|
|
629
|
+
"variants": [
|
|
630
|
+
{
|
|
631
|
+
"sku": "",
|
|
632
|
+
"cost": 0,
|
|
633
|
+
"spec": [
|
|
634
|
+
"黑色",
|
|
635
|
+
"3層"
|
|
636
|
+
],
|
|
637
|
+
"type": "variants",
|
|
638
|
+
"stock": 0,
|
|
639
|
+
"profit": 0,
|
|
640
|
+
"weight": "1",
|
|
641
|
+
"barcode": "",
|
|
642
|
+
"v_width": 0,
|
|
643
|
+
"editable": false,
|
|
644
|
+
"v_height": 0,
|
|
645
|
+
"v_length": 0,
|
|
646
|
+
"product_id": 739,
|
|
647
|
+
"sale_price": 1500,
|
|
648
|
+
"compare_price": 0,
|
|
649
|
+
"preview_image": "",
|
|
650
|
+
"shipment_type": "weight",
|
|
651
|
+
"shipment_weight": 0,
|
|
652
|
+
"show_understocking": "false"
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"sku": "",
|
|
656
|
+
"cost": 0,
|
|
657
|
+
"spec": [
|
|
658
|
+
"黑色",
|
|
659
|
+
"4層"
|
|
660
|
+
],
|
|
661
|
+
"type": "variants",
|
|
662
|
+
"stock": 0,
|
|
663
|
+
"profit": 0,
|
|
664
|
+
"weight": "1",
|
|
665
|
+
"barcode": "",
|
|
666
|
+
"v_width": 0,
|
|
667
|
+
"editable": false,
|
|
668
|
+
"v_height": 0,
|
|
669
|
+
"v_length": 0,
|
|
670
|
+
"product_id": 739,
|
|
671
|
+
"sale_price": 1300,
|
|
672
|
+
"compare_price": 0,
|
|
673
|
+
"preview_image": "",
|
|
674
|
+
"shipment_type": "weight",
|
|
675
|
+
"shipment_weight": 0,
|
|
676
|
+
"show_understocking": "false"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"sku": "",
|
|
680
|
+
"cost": 0,
|
|
681
|
+
"spec": [
|
|
682
|
+
"黑色",
|
|
683
|
+
"5層"
|
|
684
|
+
],
|
|
685
|
+
"type": "variants",
|
|
686
|
+
"stock": 0,
|
|
687
|
+
"profit": 0,
|
|
688
|
+
"weight": "1",
|
|
689
|
+
"barcode": "",
|
|
690
|
+
"v_width": 0,
|
|
691
|
+
"editable": false,
|
|
692
|
+
"v_height": 0,
|
|
693
|
+
"v_length": 0,
|
|
694
|
+
"product_id": 739,
|
|
695
|
+
"sale_price": 1000,
|
|
696
|
+
"compare_price": 0,
|
|
697
|
+
"preview_image": "",
|
|
698
|
+
"shipment_type": "weight",
|
|
699
|
+
"shipment_weight": 0,
|
|
700
|
+
"show_understocking": "false"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"sku": "",
|
|
704
|
+
"cost": 0,
|
|
705
|
+
"spec": [
|
|
706
|
+
"白色",
|
|
707
|
+
"3層"
|
|
708
|
+
],
|
|
709
|
+
"type": "variants",
|
|
710
|
+
"stock": 0,
|
|
711
|
+
"profit": 0,
|
|
712
|
+
"weight": "1",
|
|
713
|
+
"barcode": "",
|
|
714
|
+
"v_width": 0,
|
|
715
|
+
"editable": false,
|
|
716
|
+
"v_height": 0,
|
|
717
|
+
"v_length": 0,
|
|
718
|
+
"product_id": 739,
|
|
719
|
+
"sale_price": 1000,
|
|
720
|
+
"compare_price": 0,
|
|
721
|
+
"preview_image": "",
|
|
722
|
+
"shipment_type": "weight",
|
|
723
|
+
"shipment_weight": 0,
|
|
724
|
+
"show_understocking": "false"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"sku": "",
|
|
728
|
+
"cost": 0,
|
|
729
|
+
"spec": [
|
|
730
|
+
"白色",
|
|
731
|
+
"4層"
|
|
732
|
+
],
|
|
733
|
+
"type": "variants",
|
|
734
|
+
"stock": 0,
|
|
735
|
+
"profit": 0,
|
|
736
|
+
"weight": "1",
|
|
737
|
+
"barcode": "",
|
|
738
|
+
"v_width": 0,
|
|
739
|
+
"editable": false,
|
|
740
|
+
"v_height": 0,
|
|
741
|
+
"v_length": 0,
|
|
742
|
+
"product_id": 739,
|
|
743
|
+
"sale_price": 1000,
|
|
744
|
+
"compare_price": 0,
|
|
745
|
+
"preview_image": "",
|
|
746
|
+
"shipment_type": "weight",
|
|
747
|
+
"shipment_weight": 0,
|
|
748
|
+
"show_understocking": "false"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"sku": "",
|
|
752
|
+
"cost": 0,
|
|
753
|
+
"spec": [
|
|
754
|
+
"白色",
|
|
755
|
+
"5層"
|
|
756
|
+
],
|
|
757
|
+
"type": "variants",
|
|
758
|
+
"stock": 0,
|
|
759
|
+
"profit": 0,
|
|
760
|
+
"weight": "1",
|
|
761
|
+
"barcode": "",
|
|
762
|
+
"v_width": 0,
|
|
763
|
+
"editable": false,
|
|
764
|
+
"v_height": 0,
|
|
765
|
+
"v_length": 0,
|
|
766
|
+
"product_id": 739,
|
|
767
|
+
"sale_price": 1000,
|
|
768
|
+
"compare_price": 0,
|
|
769
|
+
"preview_image": "",
|
|
770
|
+
"shipment_type": "weight",
|
|
771
|
+
"shipment_weight": 0,
|
|
772
|
+
"show_understocking": "false"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"sku": "",
|
|
776
|
+
"cost": 0,
|
|
777
|
+
"spec": [
|
|
778
|
+
"灰色",
|
|
779
|
+
"3層"
|
|
780
|
+
],
|
|
781
|
+
"type": "variants",
|
|
782
|
+
"stock": 0,
|
|
783
|
+
"profit": 0,
|
|
784
|
+
"weight": "1",
|
|
785
|
+
"barcode": "",
|
|
786
|
+
"v_width": 0,
|
|
787
|
+
"editable": false,
|
|
788
|
+
"v_height": 0,
|
|
789
|
+
"v_length": 0,
|
|
790
|
+
"product_id": 739,
|
|
791
|
+
"sale_price": 1000,
|
|
792
|
+
"compare_price": 0,
|
|
793
|
+
"preview_image": "",
|
|
794
|
+
"shipment_type": "weight",
|
|
795
|
+
"shipment_weight": 0,
|
|
796
|
+
"show_understocking": "false"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
"sku": "",
|
|
800
|
+
"cost": 0,
|
|
801
|
+
"spec": [
|
|
802
|
+
"灰色",
|
|
803
|
+
"4層"
|
|
804
|
+
],
|
|
805
|
+
"type": "variants",
|
|
806
|
+
"stock": 0,
|
|
807
|
+
"profit": 0,
|
|
808
|
+
"weight": "1",
|
|
809
|
+
"barcode": "",
|
|
810
|
+
"v_width": 0,
|
|
811
|
+
"editable": false,
|
|
812
|
+
"v_height": 0,
|
|
813
|
+
"v_length": 0,
|
|
814
|
+
"product_id": 739,
|
|
815
|
+
"sale_price": 1000,
|
|
816
|
+
"compare_price": 0,
|
|
817
|
+
"preview_image": "",
|
|
818
|
+
"shipment_type": "weight",
|
|
819
|
+
"shipment_weight": 0,
|
|
820
|
+
"show_understocking": "false"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"sku": "",
|
|
824
|
+
"cost": 0,
|
|
825
|
+
"spec": [
|
|
826
|
+
"灰色",
|
|
827
|
+
"5層"
|
|
828
|
+
],
|
|
829
|
+
"type": "variants",
|
|
830
|
+
"stock": 0,
|
|
831
|
+
"profit": 0,
|
|
832
|
+
"weight": "1",
|
|
833
|
+
"barcode": "",
|
|
834
|
+
"v_width": 0,
|
|
835
|
+
"editable": false,
|
|
836
|
+
"v_height": 0,
|
|
837
|
+
"v_length": 0,
|
|
838
|
+
"product_id": 739,
|
|
839
|
+
"sale_price": 1000,
|
|
840
|
+
"compare_price": 0,
|
|
841
|
+
"preview_image": "",
|
|
842
|
+
"shipment_type": "weight",
|
|
843
|
+
"shipment_weight": 0,
|
|
844
|
+
"show_understocking": "false"
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
"hideIndex": "false",
|
|
848
|
+
"max_price": 1500,
|
|
849
|
+
"min_price": 1000,
|
|
850
|
+
"collection": [],
|
|
851
|
+
"productType": {
|
|
852
|
+
"product": false,
|
|
853
|
+
"giveaway": true,
|
|
854
|
+
"addProduct": false
|
|
855
|
+
},
|
|
856
|
+
"content_json": [],
|
|
857
|
+
"in_wish_list": false,
|
|
858
|
+
"content_array": [],
|
|
859
|
+
"preview_image": [
|
|
860
|
+
"https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0412.09.55-AmodernMorgansteel-framebookshelfwithaminimalist,industrialdesign.Thebookshelffeaturessturdy,darkmetalframeswithmultipleopenwood.webp"
|
|
861
|
+
],
|
|
862
|
+
"relative_product": [],
|
|
863
|
+
"voucher_id": 738,
|
|
864
|
+
"have_select": true
|
|
865
|
+
}
|
|
314
866
|
],
|
|
315
867
|
"bind": [
|
|
316
868
|
{
|
|
317
869
|
"spec": [
|
|
318
870
|
"黑色",
|
|
319
|
-
"
|
|
871
|
+
"小號"
|
|
320
872
|
],
|
|
321
|
-
"id":
|
|
322
|
-
"count":
|
|
323
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/
|
|
324
|
-
"title": "
|
|
325
|
-
"sale_price":
|
|
873
|
+
"id": 710,
|
|
874
|
+
"count": 5,
|
|
875
|
+
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0514.20.13-AsophisticatedWindermerecoffeetablewithamodernyetclassicdesign.Thetablefeaturesasolidwoodconstructionwithasmooth,polishedsurfa.webp",
|
|
876
|
+
"title": "溫德米爾 茶几",
|
|
877
|
+
"sale_price": 1800,
|
|
326
878
|
"collection": [
|
|
327
879
|
"折扣專區",
|
|
328
880
|
"熱門商品",
|
|
329
881
|
"熱門商品 / 夏季限定"
|
|
330
882
|
],
|
|
331
|
-
"sku": "133",
|
|
332
|
-
"shipment_obj": {
|
|
333
|
-
"type": "weight",
|
|
334
|
-
"value": 100
|
|
335
|
-
},
|
|
336
|
-
"discount_price": 38,
|
|
337
|
-
"rebate": 0
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
"spec": [
|
|
341
|
-
"米色",
|
|
342
|
-
"標準"
|
|
343
|
-
],
|
|
344
|
-
"id": 735,
|
|
345
|
-
"count": 10,
|
|
346
|
-
"preview_image": "https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/DALL·E2024-11-0411.59.41-AstylishViennaupholstereddoublebedwithamodern,cozydesign.Thebedfeaturesahigh-qualityfabricheadboardandsoftpaddingforaddedcomf.webp",
|
|
347
|
-
"title": "維也納 布藝雙人床 ( 加購品 )",
|
|
348
|
-
"sale_price": 3200,
|
|
349
|
-
"collection": [],
|
|
350
883
|
"sku": "",
|
|
351
884
|
"shipment_obj": {
|
|
352
|
-
"type": "
|
|
353
|
-
"value":
|
|
885
|
+
"type": "volume",
|
|
886
|
+
"value": 600
|
|
354
887
|
},
|
|
355
|
-
"
|
|
356
|
-
"discount_price": 5,
|
|
888
|
+
"discount_price": 17.6,
|
|
357
889
|
"rebate": 0
|
|
358
890
|
}
|
|
359
891
|
],
|
|
360
892
|
"times": 1,
|
|
361
|
-
"bind_subtotal":
|
|
893
|
+
"bind_subtotal": 9000,
|
|
362
894
|
"discount_total": 0,
|
|
363
|
-
"rebate_total": 0
|
|
895
|
+
"rebate_total": 0,
|
|
896
|
+
"select_gif": {
|
|
897
|
+
"spec": [
|
|
898
|
+
"淺木色",
|
|
899
|
+
"4人座"
|
|
900
|
+
],
|
|
901
|
+
"id": 737,
|
|
902
|
+
"count": 1,
|
|
903
|
+
"voucher_id": 738
|
|
904
|
+
}
|
|
364
905
|
}
|
|
365
906
|
],
|
|
366
907
|
"distribution_info": {
|
|
@@ -538,6 +1079,12 @@ export class CheckoutIndex {
|
|
|
538
1079
|
<div class="${gClass('add-item-text')}">加購品</div>
|
|
539
1080
|
</div>`;
|
|
540
1081
|
}
|
|
1082
|
+
function giftBadge() {
|
|
1083
|
+
return html `
|
|
1084
|
+
<div class="${gClass('add-item-badge')}" style="background: #95ffe0;">
|
|
1085
|
+
<div class="${gClass('add-item-text')}">贈品</div>
|
|
1086
|
+
</div>`;
|
|
1087
|
+
}
|
|
541
1088
|
function addStyle() {
|
|
542
1089
|
gvc.addStyle(css `
|
|
543
1090
|
.${classPrefix}-container {
|
|
@@ -941,21 +1488,35 @@ export class CheckoutIndex {
|
|
|
941
1488
|
});
|
|
942
1489
|
}
|
|
943
1490
|
}
|
|
1491
|
+
function getBadgeClass() {
|
|
1492
|
+
if (item.is_add_on_items) {
|
|
1493
|
+
return addItemBadge();
|
|
1494
|
+
}
|
|
1495
|
+
else if (item.is_gift) {
|
|
1496
|
+
return giftBadge();
|
|
1497
|
+
}
|
|
1498
|
+
else {
|
|
1499
|
+
return ``;
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
944
1502
|
return html `
|
|
945
1503
|
<div class="d-flex flex-column border-bottom p-lg-3 px-1 py-3 gap-3">
|
|
946
1504
|
<div class="d-flex w-100 position-relative"
|
|
947
1505
|
style="gap:20px;">
|
|
948
1506
|
<div class="${gClass('first-td')} justify-content-start d-sm-none">
|
|
949
1507
|
<div style="width: 88px;height: 88px;border-radius: 20px;background: 50%/cover url('${item.preview_image}')"></div>
|
|
950
|
-
<span class="ms-2 d-none">${
|
|
1508
|
+
<span class="ms-2 d-none">${getBadgeClass()}${item.title}</span>
|
|
951
1509
|
</div>
|
|
952
1510
|
<div class="d-flex flex-sm-row flex-column w-100 position-relative"
|
|
953
1511
|
style="gap: 8px; position: relative;">
|
|
954
|
-
<div class="${gClass('first-td')} justify-content-start d-none d-sm-flex"
|
|
1512
|
+
<div class="${gClass('first-td')} justify-content-start d-none d-sm-flex"
|
|
1513
|
+
style="">
|
|
955
1514
|
<div style="width: 88px;height: 88px;border-radius: 20px;background: 50%/cover url('${item.preview_image}')"></div>
|
|
956
|
-
<span class="ms-2 d-flex align-items-start flex-column "
|
|
1515
|
+
<span class="ms-2 d-flex align-items-start flex-column "
|
|
1516
|
+
style="gap:5px;">${getBadgeClass()}${item.title}</span>
|
|
957
1517
|
</div>
|
|
958
|
-
<span class="d-flex align-items-start flex-column d-lg-none fw-bold"
|
|
1518
|
+
<span class="d-flex align-items-start flex-column d-lg-none fw-bold"
|
|
1519
|
+
style="gap:5px;font-size:17px;">${getBadgeClass()}${item.title}</span>
|
|
959
1520
|
<div class="${gClass('td')}">
|
|
960
1521
|
${item.spec ? item.spec.join(' / ') : ''}
|
|
961
1522
|
</div>
|
|
@@ -963,6 +1524,9 @@ export class CheckoutIndex {
|
|
|
963
1524
|
style="gap:10px;">
|
|
964
1525
|
<div class="">
|
|
965
1526
|
${(() => {
|
|
1527
|
+
if (item.is_gift) {
|
|
1528
|
+
return `NT.0`;
|
|
1529
|
+
}
|
|
966
1530
|
return `NT.${parseInt(item.sale_price, 10).toLocaleString()}`;
|
|
967
1531
|
})()}
|
|
968
1532
|
</div>
|
|
@@ -979,6 +1543,8 @@ export class CheckoutIndex {
|
|
|
979
1543
|
refreshCartData();
|
|
980
1544
|
});
|
|
981
1545
|
})}"
|
|
1546
|
+
${item.is_gift ? `disabled` : ``}
|
|
1547
|
+
|
|
982
1548
|
>
|
|
983
1549
|
${[...new Array(99)].map((_, index) => {
|
|
984
1550
|
return html `
|
|
@@ -986,7 +1552,7 @@ export class CheckoutIndex {
|
|
|
986
1552
|
${(index + 1 === item.count) ? `selected` : ``}>
|
|
987
1553
|
${index + 1}
|
|
988
1554
|
</option>`;
|
|
989
|
-
})}
|
|
1555
|
+
}).join('')}
|
|
990
1556
|
</select>
|
|
991
1557
|
</div>
|
|
992
1558
|
<div class="d-block d-md-none"
|
|
@@ -1027,7 +1593,7 @@ export class CheckoutIndex {
|
|
|
1027
1593
|
${vm.cartData.voucherList.filter((dd) => {
|
|
1028
1594
|
return dd.bind.find((d2) => {
|
|
1029
1595
|
return d2.id === item.id;
|
|
1030
|
-
});
|
|
1596
|
+
}) && dd.reBackType !== 'giveaway';
|
|
1031
1597
|
}).map((dd) => {
|
|
1032
1598
|
return `<div class="fs-6 w-100 " ><i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}</div>`;
|
|
1033
1599
|
}).join('<div class="my-1"></div>')}
|
|
@@ -1435,37 +2001,51 @@ export class CheckoutIndex {
|
|
|
1435
2001
|
|
|
1436
2002
|
</div>
|
|
1437
2003
|
</section>
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
2004
|
+
`;
|
|
2005
|
+
},
|
|
2006
|
+
};
|
|
2007
|
+
})())}
|
|
2008
|
+
<section class="border-bottom"></section>
|
|
2009
|
+
<section class="d-flex">
|
|
2010
|
+
<div class="flex-fill"></div>
|
|
2011
|
+
<div class="${gClass('price-container')}">
|
|
2012
|
+
<div class="${gClass(['price-row', 'text-1', 'bold'])}">
|
|
2013
|
+
<div>總金額</div>
|
|
2014
|
+
<div>NT. ${vm.cartData.total.toLocaleString()}</div>
|
|
2015
|
+
</div>
|
|
2016
|
+
</div>
|
|
2017
|
+
</section>
|
|
2018
|
+
<!--加購品-->
|
|
2019
|
+
${(() => {
|
|
2020
|
+
let add_on = [];
|
|
2021
|
+
vm.cartData.voucherList.filter((dd) => {
|
|
2022
|
+
if (dd.reBackType === 'add_on_items') {
|
|
2023
|
+
add_on = add_on.concat(dd.add_on_products);
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
2026
|
+
if (add_on.length) {
|
|
2027
|
+
return gvc.bindView(() => {
|
|
2028
|
+
const id = gvc.glitter.getUUID();
|
|
2029
|
+
return {
|
|
2030
|
+
bind: id,
|
|
2031
|
+
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
2032
|
+
const add_products = (yield ApiShop.getProduct({
|
|
2033
|
+
page: 0,
|
|
2034
|
+
limit: 100,
|
|
2035
|
+
productType: 'addProduct',
|
|
2036
|
+
id_list: add_on.join(',')
|
|
2037
|
+
}));
|
|
2038
|
+
if (!add_products.response.data.length) {
|
|
2039
|
+
return ``;
|
|
1444
2040
|
}
|
|
1445
|
-
|
|
1446
|
-
if (add_on.length) {
|
|
1447
|
-
return gvc.bindView(() => {
|
|
1448
|
-
const id = gvc.glitter.getUUID();
|
|
1449
|
-
return {
|
|
1450
|
-
bind: id,
|
|
1451
|
-
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
1452
|
-
const add_products = (yield ApiShop.getProduct({
|
|
1453
|
-
page: 0,
|
|
1454
|
-
limit: 100,
|
|
1455
|
-
productType: 'addProduct',
|
|
1456
|
-
id_list: add_on.join(',')
|
|
1457
|
-
}));
|
|
1458
|
-
if (!add_products.response.data.length) {
|
|
1459
|
-
return ``;
|
|
1460
|
-
}
|
|
1461
|
-
return html `
|
|
2041
|
+
return html `
|
|
1462
2042
|
<div class="${gClass('banner-bgr')}">
|
|
1463
2043
|
<span class="${gClass('banner-text')}">可加購商品</span>
|
|
1464
2044
|
</div>
|
|
1465
2045
|
<div class="d-flex align-items-center w-100"
|
|
1466
2046
|
style="overflow-x:auto;gap:10px;">
|
|
1467
2047
|
${add_products.response.data.map((dd) => {
|
|
1468
|
-
|
|
2048
|
+
return html `
|
|
1469
2049
|
<div class="d-flex py-3 align-items-center"
|
|
1470
2050
|
style="gap:10px;">
|
|
1471
2051
|
<div class="img-fluid "
|
|
@@ -1476,7 +2056,7 @@ export class CheckoutIndex {
|
|
|
1476
2056
|
background-position: center;
|
|
1477
2057
|
background-size: cover;
|
|
1478
2058
|
background-repeat: no-repeat;
|
|
1479
|
-
background-image: url(${dd.content.preview_image[0]});"></div>
|
|
2059
|
+
background-image: url('${dd.content.preview_image[0]}');"></div>
|
|
1480
2060
|
<div class="d-flex flex-column"
|
|
1481
2061
|
style="gap:5px;">
|
|
1482
2062
|
<div class="${gClass('banner-text')}"
|
|
@@ -1496,9 +2076,9 @@ export class CheckoutIndex {
|
|
|
1496
2076
|
</div>
|
|
1497
2077
|
<button class="${gClass('button-bgr')} mb-0 mt-2"
|
|
1498
2078
|
onclick="${gvc.event(() => {
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
2079
|
+
return gvc.glitter.innerDialog((gvc) => {
|
|
2080
|
+
var _a, _b;
|
|
2081
|
+
return html `
|
|
1502
2082
|
<div
|
|
1503
2083
|
class="bg-white shadow rounded-3"
|
|
1504
2084
|
style="overflow-y: auto; ${document.body.clientWidth > 768 ? `min-width: 400px; width: 600px;` : 'min-width: 90vw; max-width: 92.5vw;'}"
|
|
@@ -1512,8 +2092,8 @@ export class CheckoutIndex {
|
|
|
1512
2092
|
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1513
2093
|
style="cursor: pointer"
|
|
1514
2094
|
onclick="${gvc.event(() => {
|
|
1515
|
-
|
|
1516
|
-
|
|
2095
|
+
gvc.closeDialog();
|
|
2096
|
+
})}"
|
|
1517
2097
|
></i>
|
|
1518
2098
|
</div>
|
|
1519
2099
|
<div class="c_dialog">
|
|
@@ -1521,61 +2101,190 @@ export class CheckoutIndex {
|
|
|
1521
2101
|
<div class="c_dialog_main"
|
|
1522
2102
|
style="gap: 24px; height: auto; max-height: 500px; padding: 12px 20px;">
|
|
1523
2103
|
${PdClass.selectSpec({
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
2104
|
+
gvc,
|
|
2105
|
+
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
2106
|
+
prod: dd.content,
|
|
2107
|
+
vm: {
|
|
2108
|
+
specs: dd.content.specs.map((spec) => {
|
|
2109
|
+
return spec.option[0].title;
|
|
2110
|
+
}),
|
|
2111
|
+
quantity: '1',
|
|
2112
|
+
wishStatus: ((_b = glitter.share.wishList) !== null && _b !== void 0 ? _b : []).some((item) => {
|
|
2113
|
+
return item.id === dd.id;
|
|
2114
|
+
})
|
|
2115
|
+
},
|
|
2116
|
+
callback: () => {
|
|
2117
|
+
gvc.closeDialog();
|
|
2118
|
+
refreshCartData();
|
|
2119
|
+
}
|
|
2120
|
+
})}
|
|
1541
2121
|
</div>
|
|
1542
2122
|
</div>
|
|
1543
2123
|
</div>
|
|
1544
2124
|
</div>
|
|
1545
2125
|
</div>`;
|
|
1546
|
-
|
|
1547
|
-
|
|
2126
|
+
}, Tool.randomString(7));
|
|
2127
|
+
})}">
|
|
1548
2128
|
<span class="${gClass('button-text')}">加入購物車</span>
|
|
1549
2129
|
</button>
|
|
1550
2130
|
</div>
|
|
1551
2131
|
</div>`;
|
|
1552
|
-
|
|
2132
|
+
}).join('')}
|
|
1553
2133
|
</div>
|
|
1554
2134
|
`;
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
2135
|
+
})
|
|
2136
|
+
};
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
else {
|
|
2140
|
+
return ``;
|
|
2141
|
+
}
|
|
2142
|
+
return ``;
|
|
2143
|
+
})()}
|
|
2144
|
+
<!--贈品-->
|
|
2145
|
+
${(() => {
|
|
2146
|
+
let already_add = vm.cartData.lineItems.filter((dd) => {
|
|
2147
|
+
return dd.is_gift;
|
|
2148
|
+
});
|
|
2149
|
+
return vm.cartData.voucherList.filter((d1) => {
|
|
2150
|
+
return d1.reBackType === 'giveaway';
|
|
2151
|
+
}).map((dd) => {
|
|
2152
|
+
let isSelected = already_add.find((d2) => {
|
|
2153
|
+
return dd.add_on_products.find((d1) => {
|
|
2154
|
+
return d1.id === d2.id;
|
|
2155
|
+
});
|
|
2156
|
+
});
|
|
2157
|
+
already_add = already_add.filter((dd) => {
|
|
2158
|
+
return !dd === isSelected;
|
|
2159
|
+
});
|
|
2160
|
+
return html `
|
|
2161
|
+
<div class="${gClass('banner-bgr')}">
|
|
2162
|
+
<span class="${gClass('banner-text')}">${dd.title}</span>
|
|
2163
|
+
</div>
|
|
2164
|
+
<div class="d-flex align-items-center w-100"
|
|
2165
|
+
style="overflow-x:auto;gap:10px;">
|
|
2166
|
+
${dd.add_on_products.map((pd) => {
|
|
2167
|
+
try {
|
|
2168
|
+
return html `
|
|
2169
|
+
<div class="d-flex py-3 align-items-center"
|
|
2170
|
+
style="gap:10px;">
|
|
2171
|
+
<div class="img-fluid "
|
|
2172
|
+
style="width: 106px;
|
|
2173
|
+
min-width: 106px;
|
|
2174
|
+
height: 106px;
|
|
2175
|
+
border-radius: 3px;
|
|
2176
|
+
background-position: center;
|
|
2177
|
+
background-size: cover;
|
|
2178
|
+
background-repeat: no-repeat;
|
|
2179
|
+
background-image: url('${pd.preview_image[0]}');"></div>
|
|
2180
|
+
<div class="d-flex flex-column"
|
|
2181
|
+
style="gap:5px;">
|
|
2182
|
+
<div class="${gClass('banner-text')}"
|
|
2183
|
+
style="font-size: 15px;
|
|
2184
|
+
font-style: normal;
|
|
2185
|
+
font-weight: 400;
|
|
2186
|
+
white-space: nowrap;
|
|
2187
|
+
overflow: hidden;
|
|
2188
|
+
max-width: 130px;
|
|
2189
|
+
text-overflow: ellipsis;">${pd.title}
|
|
2190
|
+
</div>
|
|
2191
|
+
<div class="text-decoration-line-through text-danger"
|
|
2192
|
+
style="font-size: 14px;
|
|
2193
|
+
font-style: normal;
|
|
2194
|
+
font-weight: 700;
|
|
2195
|
+
line-height: 140%;">NT.${pd.min_price.toLocaleString()}
|
|
2196
|
+
</div>
|
|
2197
|
+
<button class="${gClass('button-bgr')} mb-0 mt-2"
|
|
2198
|
+
style="${(isSelected ? ((isSelected.id === pd.id) ? `background: gray !important;` : ``) : ``)}"
|
|
2199
|
+
onclick="${gvc.event(() => {
|
|
2200
|
+
if (isSelected && (isSelected.id === pd.id)) {
|
|
2201
|
+
return;
|
|
2202
|
+
}
|
|
2203
|
+
return gvc.glitter.innerDialog((gvc) => {
|
|
2204
|
+
var _a, _b;
|
|
2205
|
+
return html `
|
|
2206
|
+
<div
|
|
2207
|
+
class="bg-white shadow rounded-3"
|
|
2208
|
+
style="overflow-y: auto; ${document.body.clientWidth > 768 ? `min-width: 400px; width: 600px;` : 'min-width: 90vw; max-width: 92.5vw;'}"
|
|
2209
|
+
>
|
|
2210
|
+
<div class="bg-white shadow rounded-3"
|
|
2211
|
+
style="width: 100%; overflow-y: auto; position: relative;">
|
|
2212
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
2213
|
+
style="position: sticky; top: 0; background: #fff;">
|
|
2214
|
+
<div class="flex-fill"></div>
|
|
2215
|
+
<i
|
|
2216
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
2217
|
+
style="cursor: pointer"
|
|
2218
|
+
onclick="${gvc.event(() => {
|
|
2219
|
+
gvc.closeDialog();
|
|
2220
|
+
})}"
|
|
2221
|
+
></i>
|
|
2222
|
+
</div>
|
|
2223
|
+
<div class="c_dialog">
|
|
2224
|
+
<div class="c_dialog_body">
|
|
2225
|
+
<div class="c_dialog_main"
|
|
2226
|
+
style="gap: 24px; height: auto; max-height: 500px; padding: 12px 20px;">
|
|
2227
|
+
${PdClass.selectSpec({
|
|
2228
|
+
gvc,
|
|
2229
|
+
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
2230
|
+
prod: pd,
|
|
2231
|
+
vm: {
|
|
2232
|
+
specs: pd.specs.map((spec) => {
|
|
2233
|
+
return spec.option[0].title;
|
|
2234
|
+
}),
|
|
2235
|
+
quantity: '1',
|
|
2236
|
+
wishStatus: ((_b = glitter.share.wishList) !== null && _b !== void 0 ? _b : []).some((item) => {
|
|
2237
|
+
return item.id === dd.id;
|
|
2238
|
+
})
|
|
2239
|
+
},
|
|
2240
|
+
with_qty: false,
|
|
2241
|
+
callback: () => {
|
|
2242
|
+
let find = vm.cartData.lineItems.find((d1) => {
|
|
2243
|
+
return dd.add_on_products.find((d2) => {
|
|
2244
|
+
return d2.id === d1.id;
|
|
2245
|
+
});
|
|
2246
|
+
});
|
|
2247
|
+
if (find) {
|
|
2248
|
+
ApiCart.setCart((cartItem) => {
|
|
2249
|
+
cartItem.line_items.map((dd) => {
|
|
2250
|
+
if (dd.id === find.id) {
|
|
2251
|
+
dd.count--;
|
|
2252
|
+
}
|
|
2253
|
+
});
|
|
2254
|
+
cartItem.line_items = cartItem.line_items.filter((dd) => {
|
|
2255
|
+
return dd.count > 0;
|
|
2256
|
+
});
|
|
2257
|
+
refreshCartData();
|
|
2258
|
+
gvc.closeDialog();
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
else {
|
|
2262
|
+
refreshCartData();
|
|
2263
|
+
gvc.closeDialog();
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
})}
|
|
2267
|
+
</div>
|
|
2268
|
+
</div>
|
|
2269
|
+
</div>
|
|
2270
|
+
</div>
|
|
2271
|
+
</div>`;
|
|
2272
|
+
}, Tool.randomString(7));
|
|
2273
|
+
})}">
|
|
2274
|
+
|
|
2275
|
+
<span class="${gClass('button-text')}">${isSelected ? ((isSelected.id === pd.id) ? `已選擇` : `更換贈品`) : `選擇贈品`}</span>
|
|
2276
|
+
</button>
|
|
2277
|
+
</div>
|
|
2278
|
+
</div>`;
|
|
2279
|
+
}
|
|
2280
|
+
catch (e) {
|
|
2281
|
+
console.log(e);
|
|
2282
|
+
}
|
|
2283
|
+
}).join('')}
|
|
2284
|
+
</div>
|
|
2285
|
+
`;
|
|
2286
|
+
}).join('');
|
|
2287
|
+
})()}
|
|
1579
2288
|
<section>
|
|
1580
2289
|
<div class="${gClass('banner-bgr')}">
|
|
1581
2290
|
<span class="${gClass('banner-text')}">付款及配送方式</span>
|
|
@@ -2494,13 +3203,19 @@ export class CheckoutIndex {
|
|
|
2494
3203
|
})()) {
|
|
2495
3204
|
widget.event('error', { title: `請輸入「${FormWidget.checkLeakData(cartData.custom_form_format, cartData.custom_form_data)}」` });
|
|
2496
3205
|
}
|
|
2497
|
-
else if (
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
.
|
|
2502
|
-
|
|
2503
|
-
|
|
3206
|
+
else if ((() => {
|
|
3207
|
+
let gift_need = cartData.voucherList
|
|
3208
|
+
.filter((dd) => {
|
|
3209
|
+
return dd.reBackType === 'giveaway';
|
|
3210
|
+
}).length;
|
|
3211
|
+
let gift = 0;
|
|
3212
|
+
cartData.lineItems.filter((dd) => {
|
|
3213
|
+
return dd.is_gift;
|
|
3214
|
+
}).map((dd) => {
|
|
3215
|
+
gift += dd.count;
|
|
3216
|
+
});
|
|
3217
|
+
return gift < gift_need;
|
|
3218
|
+
})()) {
|
|
2504
3219
|
widget.event('error', { title: '請選擇「贈品」' });
|
|
2505
3220
|
}
|
|
2506
3221
|
else {
|
|
@@ -2622,11 +3337,13 @@ export class CheckoutIndex {
|
|
|
2622
3337
|
localStorage.setItem('checkout-payment', cartData.customer_info.payment_select);
|
|
2623
3338
|
localStorage.setItem('custom_form_data', JSON.stringify(cartData.custom_form_data));
|
|
2624
3339
|
localStorage.setItem('custom_user_info', JSON.stringify(cartData.user_info));
|
|
3340
|
+
localStorage.setItem('give_away', JSON.stringify(cartData.give_away));
|
|
2625
3341
|
}
|
|
2626
3342
|
static initial(cartData) {
|
|
2627
3343
|
cartData.customer_info = JSON.parse(localStorage.getItem('cart_customer_info') || "{}");
|
|
2628
3344
|
cartData.custom_form_data = JSON.parse(localStorage.getItem('custom_form_data') || "{}");
|
|
2629
3345
|
cartData.user_info = JSON.parse(localStorage.getItem('custom_user_info') || "{}");
|
|
3346
|
+
cartData.give_away = JSON.parse(localStorage.getItem('give_away') || "[]");
|
|
2630
3347
|
this.getPaymentMethod(cartData);
|
|
2631
3348
|
this.getShipmentMethod(cartData);
|
|
2632
3349
|
}
|