ts-glitter 18.2.7 → 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-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/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.map +1 -1
- package/src/api-public/services/financial-service.ts +1 -0
- 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
package/lowcode/Entry.js
CHANGED
|
@@ -16,9 +16,29 @@ import { EditorConfig } from './editor-config.js';
|
|
|
16
16
|
import { ShareDialog } from './glitterBundle/dialog/ShareDialog.js';
|
|
17
17
|
import { Language } from './glitter-base/global/language.js';
|
|
18
18
|
import { PayConfig } from "./cms-plugin/pos-pages/pay-config.js";
|
|
19
|
+
import { ApiCart } from "./glitter-base/route/api-cart.js";
|
|
19
20
|
export class Entry {
|
|
20
21
|
static onCreate(glitter) {
|
|
21
22
|
var _a, _b;
|
|
23
|
+
if (glitter.getUrlParameter('EndCheckout') === '1') {
|
|
24
|
+
try {
|
|
25
|
+
const lineItemIds = JSON.parse(localStorage.getItem('clear_cart_items'));
|
|
26
|
+
const cartKeys = [ApiCart.cartPrefix, ApiCart.buyItNow, ApiCart.globalCart];
|
|
27
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
28
|
+
const key = localStorage.key(i);
|
|
29
|
+
if (key && cartKeys.some((cartKey) => key === null || key === void 0 ? void 0 : key.includes(cartKey))) {
|
|
30
|
+
const formatKey = key === null || key === void 0 ? void 0 : key.replace(window.appName, '');
|
|
31
|
+
const cart = new ApiCart(formatKey);
|
|
32
|
+
cart.setCart((cartItem) => {
|
|
33
|
+
cartItem.line_items = cartItem.line_items.filter((item) => !lineItemIds.includes(item.id));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
localStorage.removeItem('clear_cart_items');
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
22
42
|
const clock = glitter.ut.clock();
|
|
23
43
|
const hashLoop = setInterval(() => {
|
|
24
44
|
try {
|
|
@@ -112,7 +132,7 @@ export class Entry {
|
|
|
112
132
|
}
|
|
113
133
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : clockF();
|
|
114
134
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
115
|
-
glitter.share.editerVersion = 'V_18.2.
|
|
135
|
+
glitter.share.editerVersion = 'V_18.2.8';
|
|
116
136
|
glitter.share.start = new Date();
|
|
117
137
|
const vm = {
|
|
118
138
|
appConfig: [],
|
|
@@ -288,6 +308,15 @@ export class Entry {
|
|
|
288
308
|
}
|
|
289
309
|
return planText;
|
|
290
310
|
};
|
|
311
|
+
window.addEventListener('resize', () => {
|
|
312
|
+
const width = window.innerWidth;
|
|
313
|
+
const height = window.innerHeight;
|
|
314
|
+
for (const b of document.querySelectorAll(`.glitter-dialog`)) {
|
|
315
|
+
b.style.height = `${height}px`;
|
|
316
|
+
b.style.minHeight = `${height}px`;
|
|
317
|
+
}
|
|
318
|
+
console.log(`視窗大小變化: 寬度=${width}px, 高度=${height}px`);
|
|
319
|
+
});
|
|
291
320
|
}
|
|
292
321
|
static checkIframe(glitter) {
|
|
293
322
|
if (glitter.getUrlParameter('isIframe') === 'true') {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -8,9 +8,33 @@ import {EditorConfig} from './editor-config.js';
|
|
|
8
8
|
import {ShareDialog} from './glitterBundle/dialog/ShareDialog.js';
|
|
9
9
|
import {Language} from './glitter-base/global/language.js';
|
|
10
10
|
import {PayConfig} from "./cms-plugin/pos-pages/pay-config.js";
|
|
11
|
+
import {Animation, AnimationConfig} from "./glitterBundle/module/Animation.js";
|
|
12
|
+
import {ApiCart} from "./glitter-base/route/api-cart.js";
|
|
11
13
|
|
|
12
14
|
export class Entry {
|
|
13
15
|
public static onCreate(glitter: Glitter) {
|
|
16
|
+
//判斷結帳成功清空購物車紀錄
|
|
17
|
+
if(glitter.getUrlParameter('EndCheckout')==='1'){
|
|
18
|
+
try {
|
|
19
|
+
const lineItemIds = JSON.parse(localStorage.getItem('clear_cart_items') as string);
|
|
20
|
+
const cartKeys = [ApiCart.cartPrefix, ApiCart.buyItNow, ApiCart.globalCart];
|
|
21
|
+
|
|
22
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
23
|
+
const key = localStorage.key(i);
|
|
24
|
+
if (key && cartKeys.some((cartKey) => key?.includes(cartKey))) {
|
|
25
|
+
const formatKey = key?.replace((window as any).appName, '');
|
|
26
|
+
const cart = new ApiCart(formatKey);
|
|
27
|
+
cart.setCart((cartItem) => {
|
|
28
|
+
cartItem.line_items = cartItem.line_items.filter((item) => !lineItemIds.includes(item.id));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
localStorage.removeItem('clear_cart_items')
|
|
33
|
+
}catch (e) {
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
14
38
|
//判斷是否有hash則跳轉
|
|
15
39
|
const clock=glitter.ut.clock()
|
|
16
40
|
const hashLoop = setInterval(() => {
|
|
@@ -111,7 +135,7 @@ export class Entry {
|
|
|
111
135
|
}
|
|
112
136
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
113
137
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
114
|
-
glitter.share.editerVersion = 'V_18.2.
|
|
138
|
+
glitter.share.editerVersion = 'V_18.2.8';
|
|
115
139
|
glitter.share.start = new Date();
|
|
116
140
|
const vm: {
|
|
117
141
|
appConfig: any;
|
|
@@ -291,6 +315,17 @@ export class Entry {
|
|
|
291
315
|
}
|
|
292
316
|
return planText
|
|
293
317
|
}
|
|
318
|
+
|
|
319
|
+
// 監聽視窗大小變化
|
|
320
|
+
window.addEventListener('resize', () => {
|
|
321
|
+
const width = window.innerWidth; // 視窗的寬度
|
|
322
|
+
const height = window.innerHeight; // 視窗的高度
|
|
323
|
+
for (const b of document.querySelectorAll(`.glitter-dialog`)){
|
|
324
|
+
(b as any).style.height=`${height}px`;
|
|
325
|
+
(b as any).style.minHeight=`${height}px`
|
|
326
|
+
}
|
|
327
|
+
console.log(`視窗大小變化: 寬度=${width}px, 高度=${height}px`);
|
|
328
|
+
});
|
|
294
329
|
}
|
|
295
330
|
|
|
296
331
|
// 判斷是否為Iframe來覆寫Glitter代碼
|