ts-glitter 16.5.0 → 16.5.2
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-blog.js +1 -0
- package/lowcode/backend-manager/bg-blog.ts +1 -0
- package/lowcode/backend-manager/bg-recommend.js +40 -32
- package/lowcode/backend-manager/bg-recommend.ts +38 -31
- package/lowcode/cms-plugin/pos-pages/products-page.js +212 -200
- package/lowcode/cms-plugin/pos-pages/products-page.ts +214 -202
- package/lowcode/jspage/main.js +27 -14
- package/lowcode/jspage/main.ts +29 -14
- package/package.json +1 -1
- package/src/api-public/services/shopping.js +0 -1
- package/src/api-public/services/shopping.js.map +1 -1
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.5.
|
|
82
|
+
glitter.share.editerVersion = 'V_16.5.2';
|
|
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.5.
|
|
81
|
+
glitter.share.editerVersion = 'V_16.5.2';
|
|
82
82
|
glitter.share.start = new Date();
|
|
83
83
|
const vm: {
|
|
84
84
|
appConfig: any;
|
|
@@ -687,6 +687,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
687
687
|
}, 400);
|
|
688
688
|
function checkSwitchToUiEditor() {
|
|
689
689
|
function next() {
|
|
690
|
+
localStorage.setItem('preview_data', JSON.stringify(vm.data.content));
|
|
690
691
|
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
691
692
|
window.parent.glitter.setUrlParameter('language', language);
|
|
692
693
|
window.parent.glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
@@ -752,6 +752,7 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
752
752
|
},400)
|
|
753
753
|
function checkSwitchToUiEditor(){
|
|
754
754
|
function next(){
|
|
755
|
+
localStorage.setItem('preview_data', JSON.stringify(vm.data.content));
|
|
755
756
|
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id);
|
|
756
757
|
(window.parent as any).glitter.setUrlParameter('language', language);
|
|
757
758
|
(window.parent as any).glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
@@ -751,19 +751,22 @@ export class BgRecommend {
|
|
|
751
751
|
gvc.bindView({
|
|
752
752
|
bind: 'listProduct',
|
|
753
753
|
view: () => {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
newOrder.productCheck.
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
?
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
754
|
+
try {
|
|
755
|
+
let returnHTML = '';
|
|
756
|
+
if (newOrder.productCheck.length) {
|
|
757
|
+
newOrder.productCheck.map((product, index) => {
|
|
758
|
+
var _a, _b;
|
|
759
|
+
let selectVariant = product.content.variants[parseInt((_a = product.selectIndex) !== null && _a !== void 0 ? _a : 0)];
|
|
760
|
+
console.log(`selectVariant=>`, selectVariant);
|
|
761
|
+
selectVariant.preview_image = (_b = selectVariant.preview_image) !== null && _b !== void 0 ? _b : '';
|
|
762
|
+
let productIMG = typeof selectVariant.preview_image == 'string' ? selectVariant.preview_image : selectVariant.preview_image[0];
|
|
763
|
+
productIMG = productIMG
|
|
764
|
+
? productIMG
|
|
765
|
+
: product.content.preview_image[0]
|
|
766
|
+
? product.content.preview_image[0]
|
|
767
|
+
: BgWidget.noImageURL;
|
|
768
|
+
selectVariant.qty = selectVariant.qty || 1;
|
|
769
|
+
returnHTML += html `
|
|
767
770
|
<div style="width: 100%;display: flex;align-items: center;position: relative;padding-right: 20px;">
|
|
768
771
|
<div class="flex-fill d-flex align-items-center col-5" style="font-size: 16px;font-weight: 700;gap: 12px;">
|
|
769
772
|
<div style="width: 54px;height: 54px; background: url('${productIMG}') lightgray 50% / cover no-repeat;"></div>
|
|
@@ -775,27 +778,27 @@ export class BgRecommend {
|
|
|
775
778
|
</div>
|
|
776
779
|
<div class="d-flex" style="gap:8px;font-weight: 400;">
|
|
777
780
|
${(() => {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
781
|
+
if (selectVariant.spec.length > 0) {
|
|
782
|
+
let tempHTML = ``;
|
|
783
|
+
selectVariant.spec.map((spec) => {
|
|
784
|
+
tempHTML += html ` <div
|
|
782
785
|
style="display: flex;height: 22px;padding: 4px 6px;justify-content: center;align-items: center;gap: 10px;border-radius: 7px;background: #EAEAEA;"
|
|
783
786
|
>
|
|
784
787
|
${spec}
|
|
785
788
|
</div>`;
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
789
|
+
});
|
|
790
|
+
return tempHTML;
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
return html `
|
|
791
794
|
<div
|
|
792
795
|
style="display: flex;height: 22px;padding: 4px 6px;justify-content: center;align-items: center;gap: 10px;border-radius: 7px;background: #EAEAEA;"
|
|
793
796
|
>
|
|
794
797
|
單一規格
|
|
795
798
|
</div>
|
|
796
799
|
`;
|
|
797
|
-
|
|
798
|
-
|
|
800
|
+
}
|
|
801
|
+
})()}
|
|
799
802
|
</div>
|
|
800
803
|
<div style="color: #8D8D8D;font-size: 14px;font-weight: 400;">
|
|
801
804
|
存貨單位 (SKU): ${selectVariant.sku.length ? selectVariant.sku : 'sku未指定'}
|
|
@@ -807,9 +810,9 @@ export class BgRecommend {
|
|
|
807
810
|
style="display: flex;padding-right: 40px;align-items: flex-start;font-size: 16px;font-weight: 400;"
|
|
808
811
|
>
|
|
809
812
|
$${(() => {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
+
const price = parseInt(`${selectVariant.sale_price}`, 10);
|
|
814
|
+
return isNaN(price) ? 0 : price.toLocaleString();
|
|
815
|
+
})()}
|
|
813
816
|
</div>
|
|
814
817
|
<div style="min-width: 6%;font-size: 16px;font-weight: 400;width: 100px;text-align: right;">
|
|
815
818
|
<span>$${(selectVariant.sale_price * selectVariant.qty).toLocaleString()}</span>
|
|
@@ -817,9 +820,9 @@ export class BgRecommend {
|
|
|
817
820
|
class="d-flex align-items-center cursor_pointer"
|
|
818
821
|
style="position: absolute;right:0;top:50%;transform: translateY(-50%)"
|
|
819
822
|
onclick="${gvc.event(() => {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
+
newOrder.productCheck.splice(index, 1);
|
|
824
|
+
gvc.notifyDataChange('listProduct');
|
|
825
|
+
})}"
|
|
823
826
|
>
|
|
824
827
|
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="10" viewBox="0 0 11 10" fill="none">
|
|
825
828
|
<path
|
|
@@ -839,9 +842,14 @@ export class BgRecommend {
|
|
|
839
842
|
</div>
|
|
840
843
|
</div>
|
|
841
844
|
`;
|
|
842
|
-
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
return returnHTML;
|
|
848
|
+
}
|
|
849
|
+
catch (e) {
|
|
850
|
+
console.log(e);
|
|
851
|
+
return `error`;
|
|
843
852
|
}
|
|
844
|
-
return returnHTML;
|
|
845
853
|
},
|
|
846
854
|
divCreate: {
|
|
847
855
|
style: `display: flex;flex-direction: column;align-items: flex-start;gap: 18px;align-self: stretch;`,
|
|
@@ -878,20 +878,23 @@ export class BgRecommend {
|
|
|
878
878
|
gvc.bindView({
|
|
879
879
|
bind: 'listProduct',
|
|
880
880
|
view: () => {
|
|
881
|
-
|
|
881
|
+
try {
|
|
882
|
+
let returnHTML = '';
|
|
882
883
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
884
|
+
if (newOrder.productCheck.length) {
|
|
885
|
+
newOrder.productCheck.map((product: any, index: number) => {
|
|
886
|
+
let selectVariant = product.content.variants[parseInt(product.selectIndex ?? 0)];
|
|
887
|
+
console.log(`selectVariant=>`,selectVariant)
|
|
888
|
+
selectVariant.preview_image=selectVariant.preview_image ?? ''
|
|
889
|
+
let productIMG =
|
|
890
|
+
typeof selectVariant.preview_image == 'string' ? selectVariant.preview_image : selectVariant.preview_image[0];
|
|
891
|
+
productIMG = productIMG
|
|
892
|
+
? productIMG
|
|
893
|
+
: product.content.preview_image[0]
|
|
894
|
+
? product.content.preview_image[0]
|
|
895
|
+
: BgWidget.noImageURL;
|
|
896
|
+
selectVariant.qty = selectVariant.qty || 1;
|
|
897
|
+
returnHTML += html`
|
|
895
898
|
<div style="width: 100%;display: flex;align-items: center;position: relative;padding-right: 20px;">
|
|
896
899
|
<div class="flex-fill d-flex align-items-center col-5" style="font-size: 16px;font-weight: 700;gap: 12px;">
|
|
897
900
|
<div style="width: 54px;height: 54px; background: url('${productIMG}') lightgray 50% / cover no-repeat;"></div>
|
|
@@ -903,26 +906,26 @@ export class BgRecommend {
|
|
|
903
906
|
</div>
|
|
904
907
|
<div class="d-flex" style="gap:8px;font-weight: 400;">
|
|
905
908
|
${(() => {
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
909
|
+
if (selectVariant.spec.length > 0) {
|
|
910
|
+
let tempHTML = ``;
|
|
911
|
+
selectVariant.spec.map((spec: string) => {
|
|
912
|
+
tempHTML += html` <div
|
|
910
913
|
style="display: flex;height: 22px;padding: 4px 6px;justify-content: center;align-items: center;gap: 10px;border-radius: 7px;background: #EAEAEA;"
|
|
911
914
|
>
|
|
912
915
|
${spec}
|
|
913
916
|
</div>`;
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
917
|
+
});
|
|
918
|
+
return tempHTML;
|
|
919
|
+
} else {
|
|
920
|
+
return html`
|
|
918
921
|
<div
|
|
919
922
|
style="display: flex;height: 22px;padding: 4px 6px;justify-content: center;align-items: center;gap: 10px;border-radius: 7px;background: #EAEAEA;"
|
|
920
923
|
>
|
|
921
924
|
單一規格
|
|
922
925
|
</div>
|
|
923
926
|
`;
|
|
924
|
-
|
|
925
|
-
|
|
927
|
+
}
|
|
928
|
+
})()}
|
|
926
929
|
</div>
|
|
927
930
|
<div style="color: #8D8D8D;font-size: 14px;font-weight: 400;">
|
|
928
931
|
存貨單位 (SKU): ${selectVariant.sku.length ? selectVariant.sku : 'sku未指定'}
|
|
@@ -934,9 +937,9 @@ export class BgRecommend {
|
|
|
934
937
|
style="display: flex;padding-right: 40px;align-items: flex-start;font-size: 16px;font-weight: 400;"
|
|
935
938
|
>
|
|
936
939
|
$${(() => {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
+
const price = parseInt(`${selectVariant.sale_price}`, 10);
|
|
941
|
+
return isNaN(price) ? 0 : price.toLocaleString();
|
|
942
|
+
})()}
|
|
940
943
|
</div>
|
|
941
944
|
<div style="min-width: 6%;font-size: 16px;font-weight: 400;width: 100px;text-align: right;">
|
|
942
945
|
<span>$${(selectVariant.sale_price * selectVariant.qty).toLocaleString()}</span>
|
|
@@ -944,9 +947,9 @@ export class BgRecommend {
|
|
|
944
947
|
class="d-flex align-items-center cursor_pointer"
|
|
945
948
|
style="position: absolute;right:0;top:50%;transform: translateY(-50%)"
|
|
946
949
|
onclick="${gvc.event(() => {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
+
newOrder.productCheck.splice(index, 1);
|
|
951
|
+
gvc.notifyDataChange('listProduct');
|
|
952
|
+
})}"
|
|
950
953
|
>
|
|
951
954
|
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="10" viewBox="0 0 11 10" fill="none">
|
|
952
955
|
<path
|
|
@@ -966,9 +969,13 @@ export class BgRecommend {
|
|
|
966
969
|
</div>
|
|
967
970
|
</div>
|
|
968
971
|
`;
|
|
969
|
-
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
return returnHTML;
|
|
975
|
+
}catch (e) {
|
|
976
|
+
console.log(e)
|
|
977
|
+
return `error`
|
|
970
978
|
}
|
|
971
|
-
return returnHTML;
|
|
972
979
|
},
|
|
973
980
|
divCreate: {
|
|
974
981
|
style: `display: flex;flex-direction: column;align-items: flex-start;gap: 18px;align-self: stretch;`,
|