ts-glitter 14.9.0 → 14.9.3
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-recommend.js +0 -1
- package/lowcode/backend-manager/bg-recommend.ts +0 -1
- package/lowcode/cms-plugin/shopping-information.js +22 -3
- package/lowcode/cms-plugin/shopping-information.ts +19 -1
- package/lowcode/cms-plugin/shopping-order-manager.js +0 -2
- package/lowcode/cms-plugin/shopping-order-manager.ts +0 -3
- package/lowcode/cms-plugin/shopping-product-setting.js +25 -25
- package/lowcode/cms-plugin/shopping-product-setting.ts +74 -32
- package/lowcode/glitter-base/route/user.js +5 -0
- package/lowcode/glitter-base/route/user.ts +5 -0
- package/lowcode/public-components/checkout/index.js +2 -2
- package/lowcode/public-components/checkout/index.ts +25 -24
- package/lowcode/public-components/headers/header-class.js +326 -0
- package/lowcode/public-components/headers/header-class.ts +349 -0
- package/lowcode/public-components/headers/sy-02.js +113 -446
- package/lowcode/public-components/headers/sy-02.ts +219 -580
- package/lowcode/public-components/headers/sy-03.js +5 -1
- package/lowcode/public-components/headers/sy-03.ts +6 -1
- package/lowcode/public-components/headers/sy-04.js +5 -1
- package/lowcode/public-components/headers/sy-04.ts +5 -1
- package/lowcode/public-components/headers/sy-05.ts +0 -2
- package/lowcode/public-components/product/pd-card-01.js +3 -1
- package/lowcode/public-components/product/pd-card-01.ts +3 -1
- package/lowcode/public-components/product/pd-card-02.js +3 -1
- package/lowcode/public-components/product/pd-card-02.ts +4 -1
- package/lowcode/public-components/product/pd-card-03.js +3 -1
- package/lowcode/public-components/product/pd-card-03.ts +3 -1
- package/lowcode/public-components/product/pd-class.js +9 -4
- package/lowcode/public-components/product/pd-class.ts +10 -4
- package/lowcode/public-components/user-manager/um-class.js +4 -0
- package/lowcode/public-components/user-manager/um-class.ts +4 -0
- package/package.json +1 -1
- package/src/api-public/services/ai-robot.d.ts +1 -0
- package/src/index.js +3 -3
- package/src/index.js.map +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -80,7 +80,7 @@ export class Entry {
|
|
|
80
80
|
}
|
|
81
81
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
82
82
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
83
|
-
glitter.share.editerVersion = 'V_14.9.
|
|
83
|
+
glitter.share.editerVersion = 'V_14.9.3';
|
|
84
84
|
glitter.share.start = new Date();
|
|
85
85
|
const vm = {
|
|
86
86
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -82,7 +82,7 @@ export class Entry {
|
|
|
82
82
|
|
|
83
83
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
84
84
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
85
|
-
glitter.share.editerVersion = 'V_14.9.
|
|
85
|
+
glitter.share.editerVersion = 'V_14.9.3';
|
|
86
86
|
glitter.share.start = new Date();
|
|
87
87
|
const vm: {
|
|
88
88
|
appConfig: any;
|
|
@@ -960,7 +960,6 @@ export class BgRecommend {
|
|
|
960
960
|
}).then((data) => {
|
|
961
961
|
searchLoading = true;
|
|
962
962
|
newOrder.productArray = data.response.data;
|
|
963
|
-
console.log("newOrder.productArray -- ", newOrder.productArray);
|
|
964
963
|
gvc.notifyDataChange('productArray');
|
|
965
964
|
});
|
|
966
965
|
return BgWidget.spinner();
|
|
@@ -1095,7 +1095,6 @@ export class BgRecommend {
|
|
|
1095
1095
|
}).then((data) => {
|
|
1096
1096
|
searchLoading = true;
|
|
1097
1097
|
newOrder.productArray = data.response.data;
|
|
1098
|
-
console.log("newOrder.productArray -- " , newOrder.productArray)
|
|
1099
1098
|
gvc.notifyDataChange('productArray');
|
|
1100
1099
|
});
|
|
1101
1100
|
return BgWidget.spinner();
|
|
@@ -161,7 +161,7 @@ export class ShoppingInformation {
|
|
|
161
161
|
view: () => {
|
|
162
162
|
if (vm.mainLoading) {
|
|
163
163
|
ApiUser.getPublicConfig("store-information", "manager").then((r) => {
|
|
164
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
164
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
165
165
|
vm.data = r.response.value;
|
|
166
166
|
const data = r.response.value;
|
|
167
167
|
vm.data = {
|
|
@@ -172,8 +172,9 @@ export class ShoppingInformation {
|
|
|
172
172
|
"category": (_e = data.category) !== null && _e !== void 0 ? _e : "",
|
|
173
173
|
"pos_type": (_f = data.pos_type) !== null && _f !== void 0 ? _f : "retails",
|
|
174
174
|
"ai_search": (_g = data.ai_search) !== null && _g !== void 0 ? _g : false,
|
|
175
|
-
"
|
|
176
|
-
"
|
|
175
|
+
"wishlist": (_h = data.wishlist) !== null && _h !== void 0 ? _h : true,
|
|
176
|
+
"shop_name": (_j = data.shop_name) !== null && _j !== void 0 ? _j : "",
|
|
177
|
+
"support_pos_payment": (_k = data.support_pos_payment) !== null && _k !== void 0 ? _k : [
|
|
177
178
|
"cash",
|
|
178
179
|
"creditCard",
|
|
179
180
|
"line"
|
|
@@ -291,6 +292,23 @@ export class ShoppingInformation {
|
|
|
291
292
|
: ``}
|
|
292
293
|
/>
|
|
293
294
|
</div>
|
|
295
|
+
<div class="d-flex flex-column" style="gap:8px;">
|
|
296
|
+
<div style="color: #393939;font-size: 16px;">啟用心願單功能</div>
|
|
297
|
+
<div style="color: #8D8D8D;font-size:13px;">啟用心願單功能,方便客戶收藏並管理喜愛的商品清單。<br>
|
|
298
|
+
隨時查看心儀商品,提升購物體驗與轉換率。
|
|
299
|
+
</div>
|
|
300
|
+
<div class="cursor_pointer form-check form-switch m-0 p-0"
|
|
301
|
+
style="margin-top: 10px;">
|
|
302
|
+
<input
|
|
303
|
+
class="form-check-input m-0"
|
|
304
|
+
type="checkbox"
|
|
305
|
+
onchange="${gvc.event((e, event) => {
|
|
306
|
+
vm.data.wishlist = !vm.data.wishlist;
|
|
307
|
+
})}"
|
|
308
|
+
${vm.data.wishlist ? `checked` : ``}
|
|
309
|
+
/>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
294
312
|
${gvc.bindView(() => {
|
|
295
313
|
const id = gvc.glitter.getUUID();
|
|
296
314
|
const html = String.raw;
|
|
@@ -418,6 +436,7 @@ export class ShoppingInformation {
|
|
|
418
436
|
};
|
|
419
437
|
})}
|
|
420
438
|
</div>
|
|
439
|
+
|
|
421
440
|
</div>
|
|
422
441
|
`, `guide6-3`);
|
|
423
442
|
}, divCreate: {}
|
|
@@ -180,6 +180,7 @@ export class ShoppingInformation {
|
|
|
180
180
|
"category": data.category ?? "",
|
|
181
181
|
"pos_type": data.pos_type ?? "retails",
|
|
182
182
|
"ai_search": data.ai_search ?? false,
|
|
183
|
+
"wishlist": data.wishlist ?? true,
|
|
183
184
|
"shop_name": data.shop_name ?? "",
|
|
184
185
|
"support_pos_payment": data.support_pos_payment ?? [
|
|
185
186
|
"cash",
|
|
@@ -299,6 +300,23 @@ export class ShoppingInformation {
|
|
|
299
300
|
: ``}
|
|
300
301
|
/>
|
|
301
302
|
</div>
|
|
303
|
+
<div class="d-flex flex-column" style="gap:8px;">
|
|
304
|
+
<div style="color: #393939;font-size: 16px;">啟用心願單功能</div>
|
|
305
|
+
<div style="color: #8D8D8D;font-size:13px;">啟用心願單功能,方便客戶收藏並管理喜愛的商品清單。<br>
|
|
306
|
+
隨時查看心儀商品,提升購物體驗與轉換率。
|
|
307
|
+
</div>
|
|
308
|
+
<div class="cursor_pointer form-check form-switch m-0 p-0"
|
|
309
|
+
style="margin-top: 10px;">
|
|
310
|
+
<input
|
|
311
|
+
class="form-check-input m-0"
|
|
312
|
+
type="checkbox"
|
|
313
|
+
onchange="${gvc.event((e, event) => {
|
|
314
|
+
vm.data.wishlist = !vm.data.wishlist
|
|
315
|
+
})}"
|
|
316
|
+
${vm.data.wishlist ? `checked`: ``}
|
|
317
|
+
/>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
302
320
|
${gvc.bindView(() => {
|
|
303
321
|
const id = gvc.glitter.getUUID()
|
|
304
322
|
const html = String.raw
|
|
@@ -433,6 +451,7 @@ export class ShoppingInformation {
|
|
|
433
451
|
}
|
|
434
452
|
})}
|
|
435
453
|
</div>
|
|
454
|
+
|
|
436
455
|
</div>
|
|
437
456
|
`,`guide6-3`)
|
|
438
457
|
}, divCreate: {}
|
|
@@ -445,7 +464,6 @@ export class ShoppingInformation {
|
|
|
445
464
|
return {
|
|
446
465
|
bind: `domain`,
|
|
447
466
|
view: () => {
|
|
448
|
-
|
|
449
467
|
return BgWidget.mainCard(html`
|
|
450
468
|
<div class="d-flex flex-column" style="gap:24px">
|
|
451
469
|
<div class="d-flex flex-column" style="">
|
|
@@ -2951,8 +2951,6 @@ export class ShoppingOrderManager {
|
|
|
2951
2951
|
delete passData.tag;
|
|
2952
2952
|
const dialog = new ShareDialog(glitter);
|
|
2953
2953
|
passData.line_items = passData.lineItems;
|
|
2954
|
-
console.log("passData -- ", passData);
|
|
2955
|
-
return;
|
|
2956
2954
|
dialog.dataLoading({ visible: true });
|
|
2957
2955
|
if (checkOrderEmpty(passData)) {
|
|
2958
2956
|
ApiShop.toManualCheckout(passData).then((r) => {
|
|
@@ -3331,9 +3331,6 @@ export class ShoppingOrderManager {
|
|
|
3331
3331
|
delete passData.tag;
|
|
3332
3332
|
const dialog = new ShareDialog(glitter);
|
|
3333
3333
|
passData.line_items = passData.lineItems;
|
|
3334
|
-
//
|
|
3335
|
-
console.log("passData -- " , passData);
|
|
3336
|
-
return
|
|
3337
3334
|
dialog.dataLoading({visible: true});
|
|
3338
3335
|
if (checkOrderEmpty(passData)) {
|
|
3339
3336
|
ApiShop.toManualCheckout(passData).then((r) => {
|
|
@@ -870,20 +870,19 @@ export class ShoppingProductSetting {
|
|
|
870
870
|
<div
|
|
871
871
|
style="width: 136px;text-align: center;color: #36B;cursor: pointer;"
|
|
872
872
|
onclick="${obj.gvc.event(() => {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
}
|
|
878
|
-
else {
|
|
879
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
880
|
-
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
881
|
-
}
|
|
882
|
-
}, html `
|
|
873
|
+
console.log("postMD -- ", postMD.preview_image);
|
|
874
|
+
imageLibrary.selectImageFromArray(postMD.preview_image, {
|
|
875
|
+
gvc: gvc,
|
|
876
|
+
title: html `
|
|
883
877
|
<div class="d-flex flex-column"
|
|
884
878
|
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
885
879
|
圖片庫
|
|
886
|
-
</div>`,
|
|
880
|
+
</div>`,
|
|
881
|
+
getSelect: (imageUrl) => {
|
|
882
|
+
variant.preview_image = imageUrl;
|
|
883
|
+
gvc.notifyDataChange(id);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
887
886
|
})}"
|
|
888
887
|
>
|
|
889
888
|
變更
|
|
@@ -1474,6 +1473,10 @@ export class ShoppingProductSetting {
|
|
|
1474
1473
|
preview_image: '',
|
|
1475
1474
|
});
|
|
1476
1475
|
}
|
|
1476
|
+
postMD.variants.map((dd) => {
|
|
1477
|
+
dd.checked = undefined;
|
|
1478
|
+
return dd;
|
|
1479
|
+
});
|
|
1477
1480
|
obj.vm.replaceData = postMD;
|
|
1478
1481
|
obj.gvc.notifyDataChange(variantsViewID);
|
|
1479
1482
|
}
|
|
@@ -3311,28 +3314,25 @@ export class ShoppingProductSetting {
|
|
|
3311
3314
|
>
|
|
3312
3315
|
<div
|
|
3313
3316
|
onclick="${gvc.event(() => {
|
|
3314
|
-
imageLibrary.
|
|
3315
|
-
|
|
3317
|
+
imageLibrary.selectImageFromArray(postMD.preview_image, {
|
|
3318
|
+
gvc: gvc,
|
|
3319
|
+
title: html `<div
|
|
3320
|
+
class="d-flex flex-column"
|
|
3321
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
3322
|
+
>
|
|
3323
|
+
統一設定圖片
|
|
3324
|
+
</div>`,
|
|
3325
|
+
getSelect: (imageUrl) => {
|
|
3316
3326
|
postMD.variants
|
|
3317
3327
|
.filter((dd) => {
|
|
3318
3328
|
return dd.spec[0] === spec.title;
|
|
3319
3329
|
})
|
|
3320
3330
|
.forEach((d1) => {
|
|
3321
|
-
d1.preview_image =
|
|
3331
|
+
d1.preview_image = imageUrl;
|
|
3322
3332
|
});
|
|
3323
3333
|
obj.gvc.notifyDataChange(vm.id);
|
|
3324
3334
|
}
|
|
3325
|
-
|
|
3326
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
3327
|
-
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
3328
|
-
}
|
|
3329
|
-
}, html `
|
|
3330
|
-
<div
|
|
3331
|
-
class="d-flex flex-column"
|
|
3332
|
-
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
3333
|
-
>
|
|
3334
|
-
統一設定圖片
|
|
3335
|
-
</div>`, {});
|
|
3335
|
+
});
|
|
3336
3336
|
})}"
|
|
3337
3337
|
>
|
|
3338
3338
|
${BgWidget.validImageBox({
|
|
@@ -971,24 +971,40 @@ export class ShoppingProductSetting {
|
|
|
971
971
|
<div
|
|
972
972
|
style="width: 136px;text-align: center;color: #36B;cursor: pointer;"
|
|
973
973
|
onclick="${obj.gvc.event(() => {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
} else {
|
|
981
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
982
|
-
dialog.errorMessage({text: '請選擇至少一張圖片'});
|
|
983
|
-
}
|
|
984
|
-
},
|
|
985
|
-
html`
|
|
974
|
+
console.log("postMD -- " , postMD.preview_image)
|
|
975
|
+
imageLibrary.selectImageFromArray(
|
|
976
|
+
postMD.preview_image,
|
|
977
|
+
{
|
|
978
|
+
gvc:gvc,
|
|
979
|
+
title:html`
|
|
986
980
|
<div class="d-flex flex-column"
|
|
987
981
|
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
988
982
|
圖片庫
|
|
989
983
|
</div>`,
|
|
990
|
-
|
|
991
|
-
|
|
984
|
+
getSelect:(imageUrl)=>{
|
|
985
|
+
variant.preview_image = imageUrl;
|
|
986
|
+
gvc.notifyDataChange(id);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
// imageLibrary.selectImageLibrary(
|
|
991
|
+
// gvc,
|
|
992
|
+
// (urlArray) => {
|
|
993
|
+
// if (urlArray.length > 0) {
|
|
994
|
+
// variant.preview_image = urlArray[0].data;
|
|
995
|
+
// gvc.notifyDataChange(id);
|
|
996
|
+
// } else {
|
|
997
|
+
// const dialog = new ShareDialog(gvc.glitter);
|
|
998
|
+
// dialog.errorMessage({text: '請選擇至少一張圖片'});
|
|
999
|
+
// }
|
|
1000
|
+
// },
|
|
1001
|
+
// html`
|
|
1002
|
+
// <div class="d-flex flex-column"
|
|
1003
|
+
// style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
1004
|
+
// 圖片庫
|
|
1005
|
+
// </div>`,
|
|
1006
|
+
// {mul: false}
|
|
1007
|
+
// );
|
|
992
1008
|
})}"
|
|
993
1009
|
>
|
|
994
1010
|
變更
|
|
@@ -1734,6 +1750,10 @@ export class ShoppingProductSetting {
|
|
|
1734
1750
|
preview_image: '',
|
|
1735
1751
|
});
|
|
1736
1752
|
}
|
|
1753
|
+
postMD.variants.map((dd: any) => {
|
|
1754
|
+
dd.checked = undefined;
|
|
1755
|
+
return dd;
|
|
1756
|
+
});
|
|
1737
1757
|
|
|
1738
1758
|
obj.vm.replaceData = postMD;
|
|
1739
1759
|
obj.gvc.notifyDataChange(variantsViewID);
|
|
@@ -3891,32 +3911,54 @@ export class ShoppingProductSetting {
|
|
|
3891
3911
|
>
|
|
3892
3912
|
<div
|
|
3893
3913
|
onclick="${gvc.event(() => {
|
|
3894
|
-
imageLibrary.
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3914
|
+
imageLibrary.selectImageFromArray(
|
|
3915
|
+
postMD.preview_image,
|
|
3916
|
+
{
|
|
3917
|
+
gvc:gvc,
|
|
3918
|
+
title:html`<div
|
|
3919
|
+
class="d-flex flex-column"
|
|
3920
|
+
style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
3921
|
+
>
|
|
3922
|
+
統一設定圖片
|
|
3923
|
+
</div>`,
|
|
3924
|
+
getSelect:(imageUrl)=>{
|
|
3898
3925
|
postMD.variants
|
|
3899
3926
|
.filter((dd) => {
|
|
3900
3927
|
return dd.spec[0] === spec.title;
|
|
3901
3928
|
})
|
|
3902
3929
|
.forEach((d1) => {
|
|
3903
|
-
d1.preview_image =
|
|
3930
|
+
d1.preview_image = imageUrl;
|
|
3904
3931
|
});
|
|
3905
3932
|
obj.gvc.notifyDataChange(vm.id);
|
|
3906
|
-
} else {
|
|
3907
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
3908
|
-
dialog.errorMessage({text: '請選擇至少一張圖片'});
|
|
3909
3933
|
}
|
|
3910
|
-
}
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
)
|
|
3934
|
+
}
|
|
3935
|
+
)
|
|
3936
|
+
// imageLibrary.selectImageLibrary(
|
|
3937
|
+
// gvc,
|
|
3938
|
+
// (urlArray) => {
|
|
3939
|
+
// if (urlArray.length > 0) {
|
|
3940
|
+
// postMD.variants
|
|
3941
|
+
// .filter((dd) => {
|
|
3942
|
+
// return dd.spec[0] === spec.title;
|
|
3943
|
+
// })
|
|
3944
|
+
// .forEach((d1) => {
|
|
3945
|
+
// d1.preview_image = urlArray[0].data;
|
|
3946
|
+
// });
|
|
3947
|
+
// obj.gvc.notifyDataChange(vm.id);
|
|
3948
|
+
// } else {
|
|
3949
|
+
// const dialog = new ShareDialog(gvc.glitter);
|
|
3950
|
+
// dialog.errorMessage({text: '請選擇至少一張圖片'});
|
|
3951
|
+
// }
|
|
3952
|
+
// },
|
|
3953
|
+
// html`
|
|
3954
|
+
// <div
|
|
3955
|
+
// class="d-flex flex-column"
|
|
3956
|
+
// style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;"
|
|
3957
|
+
// >
|
|
3958
|
+
// 統一設定圖片
|
|
3959
|
+
// </div>`,
|
|
3960
|
+
// {}
|
|
3961
|
+
// );
|
|
3920
3962
|
})}"
|
|
3921
3963
|
>
|
|
3922
3964
|
${BgWidget.validImageBox({
|
|
@@ -648,6 +648,11 @@ export class ApiUser {
|
|
|
648
648
|
case 'message_setting':
|
|
649
649
|
config[key + user_id] = res;
|
|
650
650
|
break;
|
|
651
|
+
case 'image-manager':
|
|
652
|
+
if (!Array.isArray(res.response.value)) {
|
|
653
|
+
res.response.value = [];
|
|
654
|
+
}
|
|
655
|
+
break;
|
|
651
656
|
}
|
|
652
657
|
if (key.indexOf('alt_') === 0) {
|
|
653
658
|
config[key + user_id] = res;
|
|
@@ -698,6 +698,11 @@ export class ApiUser {
|
|
|
698
698
|
case 'message_setting':
|
|
699
699
|
config[key + user_id] = res;
|
|
700
700
|
break;
|
|
701
|
+
case 'image-manager':
|
|
702
|
+
if(!Array.isArray(res.response.value)){
|
|
703
|
+
res.response.value=[]
|
|
704
|
+
}
|
|
705
|
+
break
|
|
701
706
|
}
|
|
702
707
|
if(key.indexOf('alt_')===0){
|
|
703
708
|
config[key + user_id] = res;
|
|
@@ -7,18 +7,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
11
10
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
12
11
|
import { CheckInput } from '../../modules/checkInput.js';
|
|
13
12
|
import { Tool } from '../../modules/tool.js';
|
|
13
|
+
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
14
14
|
import { ApiCart } from '../../glitter-base/route/api-cart.js';
|
|
15
15
|
import { ApiDelivery } from '../../glitter-base/route/delivery.js';
|
|
16
16
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
17
|
+
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
17
18
|
import { FormWidget } from '../../official_view_component/official/form.js';
|
|
18
19
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
19
20
|
import { PdClass } from '../product/pd-class.js';
|
|
20
21
|
import { Ad } from '../public/ad.js';
|
|
21
|
-
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
22
22
|
import { Language } from '../../glitter-base/global/language.js';
|
|
23
23
|
import { FakeOrder } from './fake-order.js';
|
|
24
24
|
const html = String.raw;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { GVC } from '../../glitterBundle/GVController.js';
|
|
2
|
-
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
3
2
|
import { GlobalUser } from '../../glitter-base/global/global-user.js';
|
|
4
3
|
import { CheckInput } from '../../modules/checkInput.js';
|
|
5
4
|
import { Tool } from '../../modules/tool.js';
|
|
5
|
+
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
6
6
|
import { ApiCart, CartItem } from '../../glitter-base/route/api-cart.js';
|
|
7
7
|
import { ApiDelivery } from '../../glitter-base/route/delivery.js';
|
|
8
8
|
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
9
|
+
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
9
10
|
import { FormWidget } from '../../official_view_component/official/form.js';
|
|
10
11
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
11
12
|
import { Voucher as OriginVoucher, VoucherContent } from '../user-manager/um-voucher.js';
|
|
12
13
|
import { PdClass } from '../product/pd-class.js';
|
|
13
14
|
import * as vm from 'node:vm';
|
|
14
15
|
import { Ad } from '../public/ad.js';
|
|
15
|
-
import { ApiWallet } from '../../glitter-base/route/wallet.js';
|
|
16
16
|
import { Language } from '../../glitter-base/global/language.js';
|
|
17
17
|
import { FakeOrder } from './fake-order.js';
|
|
18
18
|
|
|
@@ -390,6 +390,7 @@ export class CheckoutIndex {
|
|
|
390
390
|
const dialog = new ShareDialog(gvc.glitter);
|
|
391
391
|
dialog.dataLoading({ visible: true });
|
|
392
392
|
const beta = false;
|
|
393
|
+
|
|
393
394
|
if (!beta) {
|
|
394
395
|
new Promise(async (resolve, reject) => {
|
|
395
396
|
new Promise((resolve, reject) => {
|
|
@@ -572,6 +573,7 @@ export class CheckoutIndex {
|
|
|
572
573
|
glitter.share.reloadCartData = () => {
|
|
573
574
|
refreshCartData();
|
|
574
575
|
};
|
|
576
|
+
|
|
575
577
|
return gvc.bindView(
|
|
576
578
|
(() => {
|
|
577
579
|
return {
|
|
@@ -632,9 +634,9 @@ export class CheckoutIndex {
|
|
|
632
634
|
return addItemBadge();
|
|
633
635
|
} else if (item.is_gift) {
|
|
634
636
|
return giftBadge();
|
|
635
|
-
} else if(item.is_hidden){
|
|
637
|
+
} else if (item.is_hidden) {
|
|
636
638
|
return hiddenBadge();
|
|
637
|
-
}else{
|
|
639
|
+
} else {
|
|
638
640
|
return ``;
|
|
639
641
|
}
|
|
640
642
|
}
|
|
@@ -777,18 +779,18 @@ export class CheckoutIndex {
|
|
|
777
779
|
return `<div class="fs-6 w-100 " ><i class="fa-solid fa-tickets-perforated me-2"></i>${dd.title}</div>`;
|
|
778
780
|
})
|
|
779
781
|
.join('<div class="my-1"></div>')}
|
|
780
|
-
${(()=>{
|
|
781
|
-
let min= (item.min_qty && parseInt(item.min_qty,10)) || 1;
|
|
782
|
-
let count=0;
|
|
783
|
-
for (const b of vm.cartData.lineItems){
|
|
784
|
-
if(b.id===item.id){
|
|
785
|
-
count+=b.count
|
|
782
|
+
${(() => {
|
|
783
|
+
let min = (item.min_qty && parseInt(item.min_qty, 10)) || 1;
|
|
784
|
+
let count = 0;
|
|
785
|
+
for (const b of vm.cartData.lineItems) {
|
|
786
|
+
if (b.id === item.id) {
|
|
787
|
+
count += b.count;
|
|
786
788
|
}
|
|
787
789
|
}
|
|
788
|
-
if(count<min){
|
|
789
|
-
return `<div class="text-danger">${Language.text('min_p_count').replace('_c_',min)}</div
|
|
790
|
-
}else{
|
|
791
|
-
return
|
|
790
|
+
if (count < min) {
|
|
791
|
+
return `<div class="text-danger">${Language.text('min_p_count').replace('_c_', min)}</div>`;
|
|
792
|
+
} else {
|
|
793
|
+
return ``;
|
|
792
794
|
}
|
|
793
795
|
})()}
|
|
794
796
|
</div>
|
|
@@ -2382,19 +2384,18 @@ export class CheckoutIndex {
|
|
|
2382
2384
|
if (!this.checkFormData(gvc, vm.cartData, widget)) {
|
|
2383
2385
|
return;
|
|
2384
2386
|
}
|
|
2385
|
-
for (const item of vm.cartData.lineItems){
|
|
2387
|
+
for (const item of vm.cartData.lineItems) {
|
|
2386
2388
|
const title = (item.language_data && item.language_data[Language.getLanguage()].title) || item.title;
|
|
2387
|
-
let min= (item.min_qty && parseInt(item.min_qty,10)) || 1;
|
|
2388
|
-
let count=0;
|
|
2389
|
-
for (const b of vm.cartData.lineItems){
|
|
2390
|
-
if(b.id===item.id){
|
|
2391
|
-
count+=b.count
|
|
2389
|
+
let min = (item.min_qty && parseInt(item.min_qty, 10)) || 1;
|
|
2390
|
+
let count = 0;
|
|
2391
|
+
for (const b of vm.cartData.lineItems) {
|
|
2392
|
+
if (b.id === item.id) {
|
|
2393
|
+
count += b.count;
|
|
2392
2394
|
}
|
|
2393
|
-
|
|
2394
2395
|
}
|
|
2395
|
-
if(count<min){
|
|
2396
|
-
dialog.errorMessage({text:Language.text('min_p_count_d').replace('_c_',min).replace('_p_'
|
|
2397
|
-
return
|
|
2396
|
+
if (count < min) {
|
|
2397
|
+
dialog.errorMessage({ text: Language.text('min_p_count_d').replace('_c_', min).replace('_p_', `『${title}』`) });
|
|
2398
|
+
return;
|
|
2398
2399
|
}
|
|
2399
2400
|
}
|
|
2400
2401
|
if (vm.cartData.user_info_same) {
|