ts-glitter 18.2.6 → 18.2.8
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 +30 -1
- package/lowcode/Entry.ts +36 -1
- package/lowcode/cms-plugin/customer-message-user.js +503 -8
- package/lowcode/cms-plugin/customer-message-user.ts +549 -12
- package/lowcode/cms-plugin/shopping-finance-setting.js +4 -4
- package/lowcode/cms-plugin/shopping-finance-setting.ts +4 -4
- package/lowcode/cms-plugin/shopping-information.js +16 -0
- package/lowcode/cms-plugin/shopping-information.ts +16 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +138 -77
- package/lowcode/cms-plugin/shopping-order-manager.ts +177 -102
- package/lowcode/glitter-base/global/language.js +6 -0
- package/lowcode/glitter-base/global/language.ts +6 -0
- package/lowcode/glitterBundle/GVController.js +2 -2
- package/lowcode/glitterBundle/GVController.ts +2 -2
- package/lowcode/glitterBundle/dialog/dialog_inner.js +5 -2
- package/lowcode/glitterBundle/dialog/dialog_inner.ts +5 -2
- package/lowcode/glitterBundle/module/Animation.js +59 -0
- package/lowcode/glitterBundle/module/Animation.ts +62 -0
- package/lowcode/glitterBundle/module/PageManager.js +3 -3
- package/lowcode/glitterBundle/module/PageManager.ts +1 -1
- package/lowcode/index.html +1 -0
- package/lowcode/public-components/checkout/index.js +77 -117
- package/lowcode/public-components/checkout/index.ts +174 -221
- package/lowcode/public-components/footer/footer-01.js +3 -0
- package/lowcode/public-components/footer/footer-01.ts +3 -0
- package/lowcode/public-components/footer/footer-02.js +3 -0
- package/lowcode/public-components/footer/footer-02.ts +3 -0
- package/lowcode/public-components/footer/footer-03.js +3 -0
- package/lowcode/public-components/footer/footer-03.ts +3 -0
- package/lowcode/public-components/product/pd-class.js +868 -355
- package/lowcode/public-components/product/pd-class.ts +1005 -438
- package/lowcode/public-components/product/product-detail.js +1 -1
- package/lowcode/public-components/product/product-detail.ts +3 -1
- package/package.json +1 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/delivery.js.map +1 -1
- package/src/api-public/controllers/delivery.ts +2 -0
- package/src/api-public/controllers/shop.js +3 -2
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +4 -3
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/ai-robot.js.map +1 -1
- package/src/api-public/services/fb-api.js.map +1 -1
- package/src/api-public/services/financial-service.d.ts +4 -0
- package/src/api-public/services/financial-service.js +48 -23
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +57 -26
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/shopping.js +7 -0
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +9 -0
- package/src/api-public/services/user.d.ts +2 -2
- package/src/api-public/services/user.js +8 -2
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +8 -2
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
|
@@ -24,6 +24,7 @@ import { FakeOrder } from './fake-order.js';
|
|
|
24
24
|
import { FormCheck } from '../../cms-plugin/module/form-check.js';
|
|
25
25
|
import { Currency } from '../../glitter-base/global/currency.js';
|
|
26
26
|
import { ShipmentConfig } from "../../glitter-base/global/shipment-config.js";
|
|
27
|
+
import { Animation } from "../../glitterBundle/module/Animation.js";
|
|
27
28
|
const html = String.raw;
|
|
28
29
|
export class CheckoutIndex {
|
|
29
30
|
static main(gvc, widget, subData) {
|
|
@@ -1271,28 +1272,31 @@ export class CheckoutIndex {
|
|
|
1271
1272
|
onclick="${gvc.event(() => {
|
|
1272
1273
|
var _a;
|
|
1273
1274
|
const titleFontColor = (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
1274
|
-
console.log(`dd.content=>`, dd.content);
|
|
1275
1275
|
gvc.glitter.innerDialog((gvc) => {
|
|
1276
1276
|
var _a, _b;
|
|
1277
|
-
return html `
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1277
|
+
return html `
|
|
1278
|
+
<div class=" bg-white shadow ${document.body.clientWidth > 768 ? `rounded-3` : ` position-absolute bottom-0`}"
|
|
1279
|
+
style=" ${document.body.clientWidth > 768 ? `min-width: 400px; width: 1000px;max-height:calc(100% - 150px);overflow-y: auto;` : 'width:calc(100vw);height:100%;'}">
|
|
1280
|
+
<div class="bg-white shadow ${document.body.clientWidth > 768 ? `rounded-3` : `h-100`}" style="
|
|
1281
|
+
width: 100%; position: relative;${document.body.clientWidth > 768 ? `` : `overflow-y: auto;`}">
|
|
1282
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
1283
|
+
style="position: sticky; top: 0; background: #fff;z-index:12;">
|
|
1284
|
+
<div class="fw-bold fs-5"
|
|
1285
|
+
style="color:${titleFontColor}; white-space: nowrap;text-overflow: ellipsis;max-width: calc(100% - 40px); overflow: hidden;">
|
|
1286
|
+
${dd.content.title}
|
|
1287
|
+
</div>
|
|
1288
|
+
<div class="flex-fill"></div>
|
|
1289
|
+
<i
|
|
1290
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1291
|
+
style="cursor: pointer"
|
|
1292
|
+
onclick="${gvc.event(() => {
|
|
1288
1293
|
gvc.closeDialog();
|
|
1289
1294
|
})}"
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
${PdClass.selectSpec({
|
|
1295
|
+
></i>
|
|
1296
|
+
</div>
|
|
1297
|
+
<div class="c_dialog_main"
|
|
1298
|
+
style="gap: 24px; max-height: calc(100% - 100px); ${document.body.clientWidth < 800 ? `padding: 12px 20px;` : `padding: 30px;`}">
|
|
1299
|
+
${PdClass.selectSpec({
|
|
1296
1300
|
gvc,
|
|
1297
1301
|
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
1298
1302
|
prod: dd.content,
|
|
@@ -1337,65 +1341,13 @@ export class CheckoutIndex {
|
|
|
1337
1341
|
}
|
|
1338
1342
|
},
|
|
1339
1343
|
})}
|
|
1340
|
-
|
|
1341
|
-
</div>
|
|
1342
|
-
</div>
|
|
1343
|
-
</div>
|
|
1344
|
-
</div>`;
|
|
1345
|
-
}, Tool.randomString(7));
|
|
1346
|
-
return;
|
|
1347
|
-
return gvc.glitter.innerDialog((gvc) => {
|
|
1348
|
-
var _a, _b;
|
|
1349
|
-
return html ` <div
|
|
1350
|
-
class="bg-white shadow rounded-3"
|
|
1351
|
-
style="overflow-y: auto; ${document.body.clientWidth > 768
|
|
1352
|
-
? `min-width: 400px; width: 600px;`
|
|
1353
|
-
: 'min-width: 90vw; max-width: 92.5vw;'}"
|
|
1354
|
-
>
|
|
1355
|
-
<div class="bg-white shadow rounded-3" style="width: 100%; overflow-y: auto; position: relative;">
|
|
1356
|
-
<div
|
|
1357
|
-
class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
1358
|
-
style="position: sticky; top: 0; background: #fff;"
|
|
1359
|
-
>
|
|
1360
|
-
<div class="flex-fill"></div>
|
|
1361
|
-
<i
|
|
1362
|
-
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1363
|
-
style="cursor: pointer"
|
|
1364
|
-
onclick="${gvc.event(() => {
|
|
1365
|
-
gvc.closeDialog();
|
|
1366
|
-
})}"
|
|
1367
|
-
></i>
|
|
1368
|
-
</div>
|
|
1369
|
-
<div class="c_dialog">
|
|
1370
|
-
<div class="c_dialog_body">
|
|
1371
|
-
<div
|
|
1372
|
-
class="c_dialog_main"
|
|
1373
|
-
style="gap: 24px; height: auto; max-height: 500px; padding: 12px 20px;"
|
|
1374
|
-
>
|
|
1375
|
-
${PdClass.selectSpec({
|
|
1376
|
-
gvc,
|
|
1377
|
-
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
1378
|
-
prod: dd.content,
|
|
1379
|
-
vm: {
|
|
1380
|
-
specs: dd.content.specs.map((spec) => {
|
|
1381
|
-
return spec.option[0].title;
|
|
1382
|
-
}),
|
|
1383
|
-
quantity: '1',
|
|
1384
|
-
wishStatus: ((_b = glitter.share.wishList) !== null && _b !== void 0 ? _b : []).some((item) => {
|
|
1385
|
-
return item.id === dd.id;
|
|
1386
|
-
}),
|
|
1387
|
-
},
|
|
1388
|
-
callback: () => {
|
|
1389
|
-
gvc.closeDialog();
|
|
1390
|
-
refreshCartData();
|
|
1391
|
-
},
|
|
1392
|
-
})}
|
|
1393
|
-
</div>
|
|
1394
|
-
</div>
|
|
1344
|
+
<div class="d-sm-none" style="height:100px;"></div>
|
|
1395
1345
|
</div>
|
|
1396
1346
|
</div>
|
|
1397
1347
|
</div>`;
|
|
1398
|
-
}, Tool.randomString(7)
|
|
1348
|
+
}, Tool.randomString(7), {
|
|
1349
|
+
animation: (document.body.clientWidth < 768) ? Animation.popup : Animation.fade
|
|
1350
|
+
});
|
|
1399
1351
|
})}"
|
|
1400
1352
|
>
|
|
1401
1353
|
<span class="${gClass('button-text')}">${Language.text('add_to_cart')}</span>
|
|
@@ -1456,25 +1408,29 @@ export class CheckoutIndex {
|
|
|
1456
1408
|
const titleFontColor = (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333';
|
|
1457
1409
|
gvc.glitter.innerDialog((gvc) => {
|
|
1458
1410
|
var _a, _b;
|
|
1459
|
-
return html `
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1411
|
+
return html `
|
|
1412
|
+
<div class=" bg-white shadow ${document.body.clientWidth > 768 ? `rounded-3` : ` position-absolute bottom-0`}"
|
|
1413
|
+
style=" ${document.body.clientWidth > 768 ? `min-width: 400px; width: 1000px;max-height:calc(100% - 150px);overflow-y: auto;` : 'width:calc(100vw);height:100%;'}">
|
|
1414
|
+
<div class="bg-white shadow ${document.body.clientWidth > 768 ? `rounded-3` : `h-100`}" style="
|
|
1415
|
+
width: 100%; position: relative;${document.body.clientWidth > 768 ? `` : `overflow-y: auto;`}">
|
|
1416
|
+
<div class="w-100 d-flex align-items-center p-3 border-bottom"
|
|
1417
|
+
style="position: sticky; top: 0; background: #fff;z-index:12;">
|
|
1418
|
+
<div class="fw-bold fs-5"
|
|
1419
|
+
style="color:${titleFontColor}; white-space: nowrap;text-overflow: ellipsis;max-width: calc(100% - 40px); overflow: hidden;">
|
|
1420
|
+
${pd.title}
|
|
1421
|
+
</div>
|
|
1422
|
+
<div class="flex-fill"></div>
|
|
1423
|
+
<i
|
|
1424
|
+
class="fa-regular fa-circle-xmark fs-5 text-dark"
|
|
1425
|
+
style="cursor: pointer"
|
|
1426
|
+
onclick="${gvc.event(() => {
|
|
1470
1427
|
gvc.closeDialog();
|
|
1471
1428
|
})}"
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
${PdClass.selectSpec({
|
|
1429
|
+
></i>
|
|
1430
|
+
</div>
|
|
1431
|
+
<div class="c_dialog_main"
|
|
1432
|
+
style="gap: 24px; max-height: calc(100% - 100px); ${document.body.clientWidth < 800 ? `padding: 12px 20px;` : `padding: 30px;`}">
|
|
1433
|
+
${PdClass.selectSpec({
|
|
1478
1434
|
gvc,
|
|
1479
1435
|
titleFontColor: (_a = glitter.share.globalValue['theme_color.0.title']) !== null && _a !== void 0 ? _a : '#333333',
|
|
1480
1436
|
prod: pd,
|
|
@@ -1518,12 +1474,13 @@ export class CheckoutIndex {
|
|
|
1518
1474
|
}
|
|
1519
1475
|
},
|
|
1520
1476
|
})}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1477
|
+
<div class="d-sm-none" style="height:100px;"></div>
|
|
1478
|
+
</div>
|
|
1479
|
+
</div>
|
|
1480
|
+
</div>`;
|
|
1481
|
+
}, Tool.randomString(7), {
|
|
1482
|
+
animation: (document.body.clientWidth < 768) ? Animation.popup : Animation.fade
|
|
1483
|
+
});
|
|
1527
1484
|
})}"
|
|
1528
1485
|
>
|
|
1529
1486
|
<span class="${gClass('button-text')}"
|
|
@@ -2500,32 +2457,42 @@ export class CheckoutIndex {
|
|
|
2500
2457
|
return "paynow API失敗";
|
|
2501
2458
|
}
|
|
2502
2459
|
glitter.innerDialog((gvc) => {
|
|
2460
|
+
document.body.style.setProperty('overflow-y', 'hidden', 'important');
|
|
2503
2461
|
return gvc.bindView({
|
|
2504
2462
|
bind: `paynow`,
|
|
2505
2463
|
view: () => {
|
|
2506
2464
|
return html `<div class="w-100 h-100 d-flex align-items-center justify-content-center">
|
|
2507
|
-
<
|
|
2465
|
+
${document.body.clientWidth < 800 ? `
|
|
2466
|
+
<div class="pt-5 bg-white position-relative vw-100" style="height: ${window.innerHeight}px;overflow-y: auto;">
|
|
2467
|
+
` : `<div class="p-3 bg-white position-relative" style="max-height: calc(100vh - 90px);overflow-y:auto;">`}
|
|
2508
2468
|
<div style="position: absolute; right: 15px;top:15px;z-index:1;" onclick="${gvc.event(() => {
|
|
2509
2469
|
gvc.closeDialog();
|
|
2510
2470
|
})}">
|
|
2511
2471
|
<i class="fa-regular fa-circle-xmark fs-5 text-dark cursor_pointer"></i>
|
|
2512
2472
|
</div>
|
|
2513
|
-
<div id="paynow-container">
|
|
2473
|
+
<div id="paynow-container" class="" style="">
|
|
2514
2474
|
<div style="width:200px;height:200px;">loading...</div>
|
|
2515
2475
|
|
|
2516
2476
|
</div>
|
|
2517
|
-
<div class="w-100
|
|
2477
|
+
<div class="px-3 px-sm-0 w-100"><button class="${gClass(verify.length > 0 ? 'button-bgr-disable' : 'button-bgr')} " id="checkoutButton" onclick="${gvc.event(() => {
|
|
2518
2478
|
const PayNow = window.PayNow;
|
|
2479
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
2480
|
+
dialog.dataLoading({ visible: true });
|
|
2519
2481
|
PayNow.checkout().then((response) => {
|
|
2482
|
+
dialog.dataLoading({ visible: false });
|
|
2520
2483
|
console.log("response -- ", response);
|
|
2521
2484
|
if (response.error) {
|
|
2485
|
+
dialog.errorMessage({
|
|
2486
|
+
text: response.error.message
|
|
2487
|
+
});
|
|
2522
2488
|
}
|
|
2523
2489
|
});
|
|
2524
|
-
})}"
|
|
2525
|
-
|
|
2490
|
+
})}">
|
|
2491
|
+
<span class="${gClass('button-text')}">確認結帳</span>
|
|
2492
|
+
</button></div>
|
|
2526
2493
|
</div>`;
|
|
2527
2494
|
}, divCreate: {
|
|
2528
|
-
class: `
|
|
2495
|
+
class: ` h-100 d-flex align-items-center justify-content-center`, style: `max-width:100vw;${document.body.clientWidth < 800 ? 'width:100%;' : 'width:400px;'};`
|
|
2529
2496
|
}, onCreate: () => {
|
|
2530
2497
|
const publicKey = res.response.publicKey;
|
|
2531
2498
|
const secret = res.response.data.result.secret;
|
|
@@ -2552,21 +2519,14 @@ export class CheckoutIndex {
|
|
|
2552
2519
|
});
|
|
2553
2520
|
}
|
|
2554
2521
|
});
|
|
2555
|
-
}, `paynow
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
if (key && cartKeys.some((cartKey) => key === null || key === void 0 ? void 0 : key.includes(cartKey))) {
|
|
2562
|
-
const formatKey = key === null || key === void 0 ? void 0 : key.replace(window.appName, '');
|
|
2563
|
-
const cart = new ApiCart(formatKey);
|
|
2564
|
-
cart.setCart((cartItem) => {
|
|
2565
|
-
cartItem.line_items = cartItem.line_items.filter((item) => !lineItemIds.includes(item.id));
|
|
2566
|
-
});
|
|
2567
|
-
}
|
|
2522
|
+
}, `paynow`, {
|
|
2523
|
+
animation: (document.body.clientWidth > 800) ? Animation.fade : Animation.popup,
|
|
2524
|
+
dismiss: () => {
|
|
2525
|
+
document.body.style.setProperty('overflow-y', 'auto');
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2568
2528
|
}
|
|
2569
|
-
|
|
2529
|
+
localStorage.setItem('clear_cart_items', JSON.stringify(vm.cartData.lineItems.map((item) => item.id)));
|
|
2570
2530
|
if (res.response.off_line || res.response.is_free) {
|
|
2571
2531
|
location.href = res.response.return_url;
|
|
2572
2532
|
}
|