ts-glitter 22.0.6 → 22.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 +4 -1
- package/lowcode/Entry.ts +5 -1
- package/lowcode/cms-plugin/order/order-module.ts +1 -0
- package/lowcode/cms-plugin/shopping-product-setting.js +55 -35
- package/lowcode/cms-plugin/shopping-product-setting.ts +55 -36
- package/lowcode/glitterBundle/Glitter.js +1 -1
- package/lowcode/glitterBundle/Glitter.ts +3 -1
- package/lowcode/r.html +411 -739
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -92,6 +92,9 @@ export class Entry {
|
|
|
92
92
|
location.href = shopp;
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
+
if (navigator.userAgent.includes('Googlebot')) {
|
|
96
|
+
Language.setLanguage(window.language);
|
|
97
|
+
}
|
|
95
98
|
if (window.language !== Language.getLanguage()) {
|
|
96
99
|
const url = new URL(`${glitter.root_path}${Language.getLanguageLinkPrefix()}${window.glitter_page}${new URL(location.href).search}`);
|
|
97
100
|
if (glitter.getUrlParameter('appName')) {
|
|
@@ -151,7 +154,7 @@ export class Entry {
|
|
|
151
154
|
}
|
|
152
155
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
153
156
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
154
|
-
glitter.share.editerVersion = 'V_22.0.
|
|
157
|
+
glitter.share.editerVersion = 'V_22.0.8';
|
|
155
158
|
glitter.share.start = new Date();
|
|
156
159
|
const vm = { appConfig: [] };
|
|
157
160
|
window.saasConfig = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -95,6 +95,10 @@ export class Entry {
|
|
|
95
95
|
location.href = shopp;
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
+
//Google爬蟲的話語言為網址連結
|
|
99
|
+
if(navigator.userAgent.includes('Googlebot')){
|
|
100
|
+
Language.setLanguage((window as any).language)
|
|
101
|
+
}
|
|
98
102
|
if ((window as any).language !== Language.getLanguage()) {
|
|
99
103
|
const url = new URL(
|
|
100
104
|
`${glitter.root_path}${Language.getLanguageLinkPrefix()}${(window as any).glitter_page}${new URL(location.href).search}`
|
|
@@ -155,7 +159,7 @@ export class Entry {
|
|
|
155
159
|
}
|
|
156
160
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
157
161
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
158
|
-
glitter.share.editerVersion = 'V_22.0.
|
|
162
|
+
glitter.share.editerVersion = 'V_22.0.8';
|
|
159
163
|
glitter.share.start = new Date();
|
|
160
164
|
const vm = { appConfig: [] };
|
|
161
165
|
(window as any).saasConfig = {
|
|
@@ -779,30 +779,35 @@ export class ShoppingProductSetting {
|
|
|
779
779
|
})));
|
|
780
780
|
}
|
|
781
781
|
if (postMD.product_category === 'commodity') {
|
|
782
|
-
map_.push(BgWidget.mainCard(
|
|
783
|
-
|
|
782
|
+
map_.push(BgWidget.mainCard(gvc.bindView(() => {
|
|
783
|
+
const id = gvc.glitter.getUUID();
|
|
784
|
+
return {
|
|
785
|
+
bind: id,
|
|
786
|
+
view: () => {
|
|
787
|
+
var _b;
|
|
788
|
+
return ` <div class="d-flex flex-column" style="gap:18px;">
|
|
784
789
|
<div class="d-flex flex-column guide5-7" style="gap:18px;">
|
|
785
790
|
<div style="font-weight: 700;">商品材積</div>
|
|
786
791
|
<div class="row">
|
|
787
792
|
${[
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
793
|
+
{
|
|
794
|
+
title: '長度',
|
|
795
|
+
value: 'v_length',
|
|
796
|
+
unit: '公分',
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
title: '寬度',
|
|
800
|
+
value: 'v_width',
|
|
801
|
+
unit: '公分',
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
title: '高度',
|
|
805
|
+
value: 'v_height',
|
|
806
|
+
unit: '公分',
|
|
807
|
+
},
|
|
808
|
+
]
|
|
809
|
+
.map(dd => {
|
|
810
|
+
return html ` <div
|
|
806
811
|
style="display: flex;justify-content: center;align-items: center;gap: 10px;position: relative;"
|
|
807
812
|
class=" col-12 col-sm-4 mb-2"
|
|
808
813
|
>
|
|
@@ -812,14 +817,14 @@ export class ShoppingProductSetting {
|
|
|
812
817
|
style="border-radius: 10px;border: 1px solid #DDD;height: 40px;width: calc(100% - 50px);"
|
|
813
818
|
type="number"
|
|
814
819
|
onchange="${gvc.event(e => {
|
|
815
|
-
|
|
816
|
-
|
|
820
|
+
variant[dd.value] = e.value;
|
|
821
|
+
})}"
|
|
817
822
|
value="${variant[dd.value]}"
|
|
818
823
|
/>
|
|
819
824
|
<div style="color: #8D8D8D;position: absolute;right: 25px;top: 7px;">${dd.unit}</div>
|
|
820
825
|
</div>`;
|
|
821
|
-
|
|
822
|
-
|
|
826
|
+
})
|
|
827
|
+
.join('')}
|
|
823
828
|
</div>
|
|
824
829
|
</div>
|
|
825
830
|
<div style="font-weight: 700;">商品重量</div>
|
|
@@ -828,23 +833,38 @@ export class ShoppingProductSetting {
|
|
|
828
833
|
class="col-6"
|
|
829
834
|
style="display: flex;height: 40px;padding: 10px 18px;align-items: center;gap: 10px;border-radius: 10px;border: 1px solid #DDD;"
|
|
830
835
|
placeholder="請輸入商品重量"
|
|
831
|
-
value="${variant.weight || 0}"
|
|
836
|
+
value="${(variant.weight || 0) * (variant.unit !== 'k' ? 1 : 1000)}"
|
|
832
837
|
onchange="${gvc.event(e => {
|
|
833
|
-
|
|
834
|
-
|
|
838
|
+
variant.weight = parseFloat(e.value) * (variant.unit !== 'k' ? 1 : 0.001);
|
|
839
|
+
})}"
|
|
835
840
|
/>
|
|
841
|
+
|
|
836
842
|
<div class="col-6" style="display: flex;align-items: center;gap: 10px;">
|
|
837
843
|
<div style="white-space: nowrap;">單位</div>
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
+
${BgWidget.select({
|
|
845
|
+
title: '',
|
|
846
|
+
default: (_b = variant.unit) !== null && _b !== void 0 ? _b : 'kg',
|
|
847
|
+
callback: (value) => {
|
|
848
|
+
variant.unit = value;
|
|
849
|
+
gvc.notifyDataChange(id);
|
|
850
|
+
},
|
|
851
|
+
options: [
|
|
852
|
+
{
|
|
853
|
+
key: 'kg', value: '公斤'
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
key: 'k', value: '公克'
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
gvc: gvc
|
|
860
|
+
})}
|
|
844
861
|
</div>
|
|
845
862
|
</div>
|
|
846
|
-
</div
|
|
847
|
-
|
|
863
|
+
</div>`;
|
|
864
|
+
},
|
|
865
|
+
divCreate: {}
|
|
866
|
+
};
|
|
867
|
+
})));
|
|
848
868
|
}
|
|
849
869
|
map_.push(BgWidget.mainCard(html `
|
|
850
870
|
<div class="d-flex flex-column" style="gap: 18px;">
|
|
@@ -906,30 +906,34 @@ export class ShoppingProductSetting {
|
|
|
906
906
|
}
|
|
907
907
|
if (postMD.product_category === 'commodity') {
|
|
908
908
|
map_.push(
|
|
909
|
-
BgWidget.mainCard(
|
|
910
|
-
|
|
909
|
+
BgWidget.mainCard(gvc.bindView(()=>{
|
|
910
|
+
const id=gvc.glitter.getUUID()
|
|
911
|
+
return {
|
|
912
|
+
bind:id,
|
|
913
|
+
view:()=>{
|
|
914
|
+
return ` <div class="d-flex flex-column" style="gap:18px;">
|
|
911
915
|
<div class="d-flex flex-column guide5-7" style="gap:18px;">
|
|
912
916
|
<div style="font-weight: 700;">商品材積</div>
|
|
913
917
|
<div class="row">
|
|
914
918
|
${[
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
919
|
+
{
|
|
920
|
+
title: '長度',
|
|
921
|
+
value: 'v_length',
|
|
922
|
+
unit: '公分',
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
title: '寬度',
|
|
926
|
+
value: 'v_width',
|
|
927
|
+
unit: '公分',
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
title: '高度',
|
|
931
|
+
value: 'v_height',
|
|
932
|
+
unit: '公分',
|
|
933
|
+
},
|
|
934
|
+
]
|
|
935
|
+
.map(dd => {
|
|
936
|
+
return html` <div
|
|
933
937
|
style="display: flex;justify-content: center;align-items: center;gap: 10px;position: relative;"
|
|
934
938
|
class=" col-12 col-sm-4 mb-2"
|
|
935
939
|
>
|
|
@@ -939,14 +943,14 @@ export class ShoppingProductSetting {
|
|
|
939
943
|
style="border-radius: 10px;border: 1px solid #DDD;height: 40px;width: calc(100% - 50px);"
|
|
940
944
|
type="number"
|
|
941
945
|
onchange="${gvc.event(e => {
|
|
942
|
-
|
|
943
|
-
|
|
946
|
+
variant[dd.value] = e.value;
|
|
947
|
+
})}"
|
|
944
948
|
value="${variant[dd.value]}"
|
|
945
949
|
/>
|
|
946
950
|
<div style="color: #8D8D8D;position: absolute;right: 25px;top: 7px;">${dd.unit}</div>
|
|
947
951
|
</div>`;
|
|
948
|
-
|
|
949
|
-
|
|
952
|
+
})
|
|
953
|
+
.join('')}
|
|
950
954
|
</div>
|
|
951
955
|
</div>
|
|
952
956
|
<div style="font-weight: 700;">商品重量</div>
|
|
@@ -955,24 +959,39 @@ export class ShoppingProductSetting {
|
|
|
955
959
|
class="col-6"
|
|
956
960
|
style="display: flex;height: 40px;padding: 10px 18px;align-items: center;gap: 10px;border-radius: 10px;border: 1px solid #DDD;"
|
|
957
961
|
placeholder="請輸入商品重量"
|
|
958
|
-
value="${variant.weight || 0}"
|
|
962
|
+
value="${(variant.weight || 0) * (variant.unit!=='k' ? 1:1000)}"
|
|
959
963
|
onchange="${gvc.event(e => {
|
|
960
|
-
|
|
961
|
-
|
|
964
|
+
variant.weight = parseFloat(e.value) * (variant.unit!=='k' ? 1:0.001);
|
|
965
|
+
})}"
|
|
962
966
|
/>
|
|
967
|
+
|
|
963
968
|
<div class="col-6" style="display: flex;align-items: center;gap: 10px;">
|
|
964
969
|
<div style="white-space: nowrap;">單位</div>
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
970
|
+
${BgWidget.select({
|
|
971
|
+
title:'',
|
|
972
|
+
default:variant.unit ?? 'kg',
|
|
973
|
+
callback:(value)=>{
|
|
974
|
+
variant.unit=value;
|
|
975
|
+
gvc.notifyDataChange(id)
|
|
976
|
+
},
|
|
977
|
+
options:[
|
|
978
|
+
{
|
|
979
|
+
key:'kg',value:'公斤'
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
key:'k',value:'公克'
|
|
983
|
+
}
|
|
984
|
+
],
|
|
985
|
+
gvc:gvc
|
|
986
|
+
})}
|
|
971
987
|
</div>
|
|
972
988
|
</div>
|
|
973
|
-
</div
|
|
974
|
-
|
|
975
|
-
|
|
989
|
+
</div>`
|
|
990
|
+
},
|
|
991
|
+
divCreate:{}
|
|
992
|
+
}
|
|
993
|
+
})
|
|
994
|
+
))
|
|
976
995
|
}
|
|
977
996
|
map_.push(
|
|
978
997
|
BgWidget.mainCard(html`
|
|
@@ -106,7 +106,7 @@ export class Glitter {
|
|
|
106
106
|
printWindow.document.querySelector('img').onload = function () {
|
|
107
107
|
printWindow.focus();
|
|
108
108
|
printWindow.print();
|
|
109
|
-
printWindow.close();
|
|
109
|
+
printWindow.onafterprint = () => printWindow.close();
|
|
110
110
|
};
|
|
111
111
|
},
|
|
112
112
|
resize_img_url: (link) => {
|
|
@@ -783,8 +783,10 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
783
783
|
printWindow.document.querySelector('img').onload = function() {
|
|
784
784
|
printWindow.focus();
|
|
785
785
|
printWindow.print();
|
|
786
|
-
|
|
786
|
+
// 選擇性:列印後關閉視窗
|
|
787
|
+
printWindow.onafterprint = () => printWindow.close();
|
|
787
788
|
};
|
|
789
|
+
|
|
788
790
|
},
|
|
789
791
|
resize_img_url: (link: string) => {
|
|
790
792
|
let rela_link = link;
|