ts-glitter 16.0.7 → 16.0.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 +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -1
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -1
- package/lowcode/glitter-base/global/language.js +5 -1
- package/lowcode/glitter-base/global/language.ts +5 -1
- package/lowcode/official_view_component/official/form.js +1 -2
- package/lowcode/official_view_component/official/form.ts +1 -4
- package/lowcode/public-components/checkout/index.js +4 -3
- package/lowcode/public-components/checkout/index.ts +4 -3
- package/lowcode/public-components/headers/header-class.js +22 -1
- package/lowcode/public-components/headers/header-class.ts +23 -1
- package/lowcode/public-components/product/pd-class.ts +1 -0
- package/lowcode/public-components/user-manager/um-order.js +445 -439
- package/lowcode/public-components/user-manager/um-order.ts +527 -522
- package/package.json +1 -1
- package/src/api-public/services/shopping.js +1 -2
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +1 -8
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = 'V_16.0.
|
|
82
|
+
glitter.share.editerVersion = 'V_16.0.8';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -78,7 +78,7 @@ export class Entry {
|
|
|
78
78
|
}
|
|
79
79
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
80
80
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
81
|
-
glitter.share.editerVersion = 'V_16.0.
|
|
81
|
+
glitter.share.editerVersion = 'V_16.0.8';
|
|
82
82
|
glitter.share.start = new Date();
|
|
83
83
|
const vm: {
|
|
84
84
|
appConfig: any;
|
|
@@ -768,9 +768,12 @@ export class Language {
|
|
|
768
768
|
];
|
|
769
769
|
}
|
|
770
770
|
static getLanguageCustomText(text) {
|
|
771
|
+
if (Array.isArray(text)) {
|
|
772
|
+
text = text.join('');
|
|
773
|
+
}
|
|
771
774
|
const pattern = /#{{(.*?)}}/g;
|
|
772
775
|
let match;
|
|
773
|
-
let convert = text;
|
|
776
|
+
let convert = text || '';
|
|
774
777
|
while ((match = pattern.exec(text)) !== null) {
|
|
775
778
|
const placeholder = match[0];
|
|
776
779
|
const value = match[1];
|
|
@@ -778,6 +781,7 @@ export class Language {
|
|
|
778
781
|
return dd.tag === value;
|
|
779
782
|
});
|
|
780
783
|
if (find_) {
|
|
784
|
+
convert = convert || '';
|
|
781
785
|
convert = (convert.replace(placeholder, find_[Language.getLanguage()]));
|
|
782
786
|
}
|
|
783
787
|
}
|
|
@@ -778,10 +778,13 @@ export class Language {
|
|
|
778
778
|
|
|
779
779
|
//用戶自訂義多國語言
|
|
780
780
|
public static getLanguageCustomText(text: string) {
|
|
781
|
+
if(Array.isArray(text)){
|
|
782
|
+
text=text.join('')
|
|
783
|
+
}
|
|
781
784
|
const pattern = /#{{(.*?)}}/g;
|
|
782
785
|
// 使用正则表达式的 exec 方法来提取匹配项
|
|
783
786
|
let match;
|
|
784
|
-
let convert = text
|
|
787
|
+
let convert = text || ''
|
|
785
788
|
while ((match = pattern.exec(text)) !== null) {
|
|
786
789
|
const placeholder = match[0]; // 完整的匹配项,例如 "@{{value}}"
|
|
787
790
|
const value = match[1]; // 提取的值,例如 "value"
|
|
@@ -789,6 +792,7 @@ export class Language {
|
|
|
789
792
|
return dd.tag === value
|
|
790
793
|
});
|
|
791
794
|
if (find_) {
|
|
795
|
+
convert=convert||'';
|
|
792
796
|
convert = (convert.replace(placeholder, find_[Language.getLanguage()]));
|
|
793
797
|
}
|
|
794
798
|
|
|
@@ -410,7 +410,6 @@ export class FormWidget {
|
|
|
410
410
|
const glitter = obj.gvc.glitter;
|
|
411
411
|
const gvc = obj.gvc;
|
|
412
412
|
const formData = obj.formData;
|
|
413
|
-
|
|
414
413
|
function getRaw(array: []) {
|
|
415
414
|
return array
|
|
416
415
|
.map(
|
|
@@ -763,7 +762,6 @@ export class FormWidget {
|
|
|
763
762
|
)
|
|
764
763
|
.join('');
|
|
765
764
|
}
|
|
766
|
-
|
|
767
765
|
let groupList: any = {};
|
|
768
766
|
if (Array.isArray(obj.array)) {
|
|
769
767
|
obj.array.map((dd: any) => {
|
|
@@ -773,8 +771,7 @@ export class FormWidget {
|
|
|
773
771
|
});
|
|
774
772
|
}
|
|
775
773
|
|
|
776
|
-
return html
|
|
777
|
-
<div class="row m-0 p-0">
|
|
774
|
+
return html`<div class="row m-0 p-0">
|
|
778
775
|
${Object.keys(groupList)
|
|
779
776
|
.map((key) => {
|
|
780
777
|
if (key) {
|
|
@@ -1605,11 +1605,12 @@ export class CheckoutIndex {
|
|
|
1605
1605
|
})()}
|
|
1606
1606
|
</select>
|
|
1607
1607
|
</div>
|
|
1608
|
+
|
|
1608
1609
|
${vm.cartData.total > 20000 ? html `<p
|
|
1609
|
-
class="${gClass('shipping-hint')}">
|
|
1610
|
+
class="${gClass('shipping-hint')} d-none">
|
|
1610
1611
|
若總金額超過20,000元,無法提供四大超商配送</p>` : ''}
|
|
1611
1612
|
${vm.goodsWeight > 20 ? html `<p
|
|
1612
|
-
class="${gClass('shipping-hint')}">
|
|
1613
|
+
class="${gClass('shipping-hint')} d-none">
|
|
1613
1614
|
若訂單總重超過20公斤,無法提供中華郵政/黑貓宅配服務</p>` : ''}`;
|
|
1614
1615
|
},
|
|
1615
1616
|
})}
|
|
@@ -1682,7 +1683,7 @@ export class CheckoutIndex {
|
|
|
1682
1683
|
refresh: () => {
|
|
1683
1684
|
this.storeLocalData(vm.cartData);
|
|
1684
1685
|
},
|
|
1685
|
-
formData: vm.cartData.user_info.custom_form_delivery
|
|
1686
|
+
formData: vm.cartData.user_info.custom_form_delivery
|
|
1686
1687
|
}),
|
|
1687
1688
|
].join('');
|
|
1688
1689
|
}
|
|
@@ -1721,11 +1721,12 @@ export class CheckoutIndex {
|
|
|
1721
1721
|
})()}
|
|
1722
1722
|
</select>
|
|
1723
1723
|
</div>
|
|
1724
|
+
|
|
1724
1725
|
${vm.cartData.total > 20000 ? html`<p
|
|
1725
|
-
class="${gClass('shipping-hint')}">
|
|
1726
|
+
class="${gClass('shipping-hint')} d-none">
|
|
1726
1727
|
若總金額超過20,000元,無法提供四大超商配送</p>` : ''}
|
|
1727
1728
|
${vm.goodsWeight > 20 ? html`<p
|
|
1728
|
-
class="${gClass('shipping-hint')}">
|
|
1729
|
+
class="${gClass('shipping-hint')} d-none">
|
|
1729
1730
|
若訂單總重超過20公斤,無法提供中華郵政/黑貓宅配服務</p>` : ''}`;
|
|
1730
1731
|
},
|
|
1731
1732
|
})}
|
|
@@ -1796,7 +1797,7 @@ export class CheckoutIndex {
|
|
|
1796
1797
|
refresh: () => {
|
|
1797
1798
|
this.storeLocalData(vm.cartData);
|
|
1798
1799
|
},
|
|
1799
|
-
formData: vm.cartData.user_info.custom_form_delivery
|
|
1800
|
+
formData: vm.cartData.user_info.custom_form_delivery
|
|
1800
1801
|
}),
|
|
1801
1802
|
].join('');
|
|
1802
1803
|
} catch (e) {
|
|
@@ -221,7 +221,27 @@ export class HeaderClass {
|
|
|
221
221
|
</div>
|
|
222
222
|
<div class="d-flex flex-column gap-1 flex-fill">
|
|
223
223
|
<div class="${classPrefix}-title">${item.title}</div>
|
|
224
|
-
<div class="${classPrefix}-spec">${
|
|
224
|
+
<div class="${classPrefix}-spec ">${(() => {
|
|
225
|
+
console.log(`item.spec=>`, item);
|
|
226
|
+
const spec = (() => {
|
|
227
|
+
if (item.spec) {
|
|
228
|
+
return item.spec.map((dd, index) => {
|
|
229
|
+
try {
|
|
230
|
+
return (item.specs[index].option.find((d1) => {
|
|
231
|
+
return d1.title === dd;
|
|
232
|
+
}).language_title[Language.getLanguage()] || dd);
|
|
233
|
+
}
|
|
234
|
+
catch (e) {
|
|
235
|
+
return dd;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
})();
|
|
243
|
+
return spec.join(' / ');
|
|
244
|
+
})()}</div>
|
|
225
245
|
<div class="d-flex align-items-center justify-content-between">
|
|
226
246
|
<div class="d-flex align-items-center gap-1" style="font-size:14px;">
|
|
227
247
|
${Language.text('quantity')}:<select
|
|
@@ -286,6 +306,7 @@ ${Currency.convertCurrencyText((item.price * item.count))}
|
|
|
286
306
|
title: product.content.title,
|
|
287
307
|
count: item.count,
|
|
288
308
|
spec: item.spec,
|
|
309
|
+
specs: product.content.specs,
|
|
289
310
|
price: variant ? variant.sale_price : 0,
|
|
290
311
|
image: yield (() => __awaiter(this, void 0, void 0, function* () {
|
|
291
312
|
if (!variant) {
|
|
@@ -74,6 +74,7 @@ export class HeaderClass {
|
|
|
74
74
|
spec: string[];
|
|
75
75
|
price: number;
|
|
76
76
|
image: string;
|
|
77
|
+
specs:string[]
|
|
77
78
|
}[],
|
|
78
79
|
loading: true,
|
|
79
80
|
};
|
|
@@ -244,7 +245,27 @@ export class HeaderClass {
|
|
|
244
245
|
</div>
|
|
245
246
|
<div class="d-flex flex-column gap-1 flex-fill">
|
|
246
247
|
<div class="${classPrefix}-title">${item.title}</div>
|
|
247
|
-
<div class="${classPrefix}-spec">${
|
|
248
|
+
<div class="${classPrefix}-spec ">${(()=>{
|
|
249
|
+
console.log(`item.spec=>`,item)
|
|
250
|
+
const spec:any = (() => {
|
|
251
|
+
if (item.spec) {
|
|
252
|
+
return item.spec.map((dd: string, index: number) => {
|
|
253
|
+
try {
|
|
254
|
+
return (
|
|
255
|
+
(item.specs[index] as any).option.find((d1: any) => {
|
|
256
|
+
return d1.title === dd;
|
|
257
|
+
}).language_title[Language.getLanguage()] || dd
|
|
258
|
+
);
|
|
259
|
+
} catch (e) {
|
|
260
|
+
return dd;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
} else {
|
|
264
|
+
return [];
|
|
265
|
+
}
|
|
266
|
+
})();
|
|
267
|
+
return spec.join(' / ')
|
|
268
|
+
})()}</div>
|
|
248
269
|
<div class="d-flex align-items-center justify-content-between">
|
|
249
270
|
<div class="d-flex align-items-center gap-1" style="font-size:14px;">
|
|
250
271
|
${Language.text('quantity')}:<select
|
|
@@ -309,6 +330,7 @@ ${Currency.convertCurrencyText((item.price * item.count))}
|
|
|
309
330
|
title: product.content.title,
|
|
310
331
|
count: item.count,
|
|
311
332
|
spec: item.spec,
|
|
333
|
+
specs:product.content.specs,
|
|
312
334
|
price: variant ? variant.sale_price : 0,
|
|
313
335
|
image: await (async () => {
|
|
314
336
|
if (!variant) {
|