ts-glitter 18.2.7 → 18.2.9
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-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 +63 -111
- package/lowcode/public-components/checkout/index.ts +160 -217
- 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/shop.js +34 -30
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +42 -32
- 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.js +2 -0
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +3 -0
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/shopping.js +12 -5
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +14 -5
- 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,6 +2457,7 @@ 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: () => {
|
|
@@ -2534,7 +2492,7 @@ export class CheckoutIndex {
|
|
|
2534
2492
|
</button></div>
|
|
2535
2493
|
</div>`;
|
|
2536
2494
|
}, divCreate: {
|
|
2537
|
-
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;'};`
|
|
2538
2496
|
}, onCreate: () => {
|
|
2539
2497
|
const publicKey = res.response.publicKey;
|
|
2540
2498
|
const secret = res.response.data.result.secret;
|
|
@@ -2561,20 +2519,14 @@ export class CheckoutIndex {
|
|
|
2561
2519
|
});
|
|
2562
2520
|
}
|
|
2563
2521
|
});
|
|
2564
|
-
}, `paynow
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
if (key && cartKeys.some((cartKey) => key === null || key === void 0 ? void 0 : key.includes(cartKey))) {
|
|
2571
|
-
const formatKey = key === null || key === void 0 ? void 0 : key.replace(window.appName, '');
|
|
2572
|
-
const cart = new ApiCart(formatKey);
|
|
2573
|
-
cart.setCart((cartItem) => {
|
|
2574
|
-
cartItem.line_items = cartItem.line_items.filter((item) => !lineItemIds.includes(item.id));
|
|
2575
|
-
});
|
|
2576
|
-
}
|
|
2522
|
+
}, `paynow`, {
|
|
2523
|
+
animation: (document.body.clientWidth > 800) ? Animation.fade : Animation.popup,
|
|
2524
|
+
dismiss: () => {
|
|
2525
|
+
document.body.style.setProperty('overflow-y', 'auto');
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2577
2528
|
}
|
|
2529
|
+
localStorage.setItem('clear_cart_items', JSON.stringify(vm.cartData.lineItems.map((item) => item.id)));
|
|
2578
2530
|
if (res.response.off_line || res.response.is_free) {
|
|
2579
2531
|
location.href = res.response.return_url;
|
|
2580
2532
|
}
|