ts-glitter 21.3.7 → 21.3.9
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-line.js +12 -1
- package/lowcode/backend-manager/bg-line.ts +16 -1
- package/lowcode/backend-manager/bg-notify.js +13 -2
- package/lowcode/backend-manager/bg-notify.ts +17 -2
- package/lowcode/backend-manager/bg-product.js +81 -30
- package/lowcode/backend-manager/bg-product.ts +95 -34
- package/lowcode/backend-manager/bg-recommend.js +109 -141
- package/lowcode/backend-manager/bg-recommend.ts +122 -144
- package/lowcode/backend-manager/bg-sns.js +14 -4
- package/lowcode/backend-manager/bg-sns.ts +18 -4
- package/lowcode/backend-manager/bg-widget.js +176 -12
- package/lowcode/backend-manager/bg-widget.ts +198 -13
- package/lowcode/cms-plugin/POS-setting.js +2 -2
- package/lowcode/cms-plugin/POS-setting.ts +2 -2
- package/lowcode/cms-plugin/auto-fcm-advertise.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +16 -2
- package/lowcode/cms-plugin/auto-fcm-history.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-history.ts +16 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +18 -2
- package/lowcode/cms-plugin/module/order-excel.ts +20 -9
- package/lowcode/cms-plugin/module/product-setting.js +2 -1
- package/lowcode/cms-plugin/module/product-setting.ts +2 -1
- package/lowcode/cms-plugin/module/user-excel.js +1 -1
- package/lowcode/cms-plugin/module/user-excel.ts +2 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.js +4 -3
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +12 -6
- package/lowcode/cms-plugin/pos-pages/products-page.js +9 -5
- package/lowcode/cms-plugin/pos-pages/products-page.ts +11 -5
- package/lowcode/cms-plugin/shopping-allowance-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +3 -2
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -0
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -0
- package/lowcode/cms-plugin/shopping-invoice-manager.js +7 -4
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +12 -11
- package/lowcode/cms-plugin/shopping-order-manager.js +21 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +30 -11
- package/lowcode/cms-plugin/shopping-product-setting.js +45 -41
- package/lowcode/cms-plugin/shopping-product-setting.ts +55 -48
- package/lowcode/cms-plugin/shopping-rebate.js +52 -46
- package/lowcode/cms-plugin/shopping-rebate.ts +402 -396
- package/lowcode/cms-plugin/shopping-setting-advance.js +6 -6
- package/lowcode/cms-plugin/shopping-setting-advance.ts +7 -7
- package/lowcode/cms-plugin/shopping-setting-basic.js +44 -0
- package/lowcode/cms-plugin/shopping-setting-basic.ts +63 -1
- package/lowcode/cms-plugin/shopping-setting-stock-log.js +57 -0
- package/lowcode/cms-plugin/shopping-setting-stock-log.ts +101 -0
- package/lowcode/cms-plugin/user-list.js +10 -9
- package/lowcode/cms-plugin/user-list.ts +11 -8
- package/lowcode/css/editor.css +1 -1
- package/lowcode/form-view/editor/image-selector.js +83 -82
- package/lowcode/form-view/editor/image-selector.ts +115 -107
- package/lowcode/glitter-base/route/user.js +27 -34
- package/lowcode/glitter-base/route/user.ts +31 -40
- package/lowcode/glitterBundle/dialog/ShareDialog.js +1 -0
- package/lowcode/glitterBundle/dialog/ShareDialog.ts +2 -0
- package/lowcode/glitterBundle/dialog/dialog.js +2 -2
- package/lowcode/glitterBundle/dialog/dialog.ts +2 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +5 -11
- package/lowcode/glitterBundle/plugins/editor-elem.ts +11 -11
- package/lowcode/modules/image-library.js +836 -486
- package/lowcode/modules/image-library.ts +1760 -1418
- package/lowcode/modules/tool.js +10 -9
- package/lowcode/modules/tool.ts +11 -10
- package/lowcode/public-models/product.ts +13 -0
- package/nxv0ptv53w.json +1 -0
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +2 -2
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +5 -2
- package/src/api-public/controllers/stock.js +1 -1
- package/src/api-public/controllers/stock.js.map +1 -1
- package/src/api-public/controllers/stock.ts +93 -81
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +2 -2
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/diff-record.d.ts +25 -0
- package/src/api-public/services/diff-record.js +158 -0
- package/src/api-public/services/diff-record.js.map +1 -0
- package/src/api-public/services/diff-record.ts +217 -0
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/public-table-check.js +25 -7
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/public-table-check.ts +53 -31
- package/src/api-public/services/shopping.d.ts +2 -12
- package/src/api-public/services/shopping.js +16 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +33 -7
- package/src/api-public/services/stock.d.ts +1 -1
- package/src/api-public/services/stock.js +19 -17
- package/src/api-public/services/stock.js.map +1 -1
- package/src/api-public/services/stock.ts +711 -696
- package/src/api-public/services/user.d.ts +1 -1
- package/src/api-public/services/user.js +18 -8
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +34 -27
- package/src/app-project/serverless/src/index.js +7 -17
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +7 -17
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/ssh.js +7 -17
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/firebase/message.js +2 -1
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +2 -1
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +17 -7
- package/src/index.js.map +5 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/CryptoJS.js +7 -17
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/ssh.js +7 -17
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +5 -0
- package/src/modules/tool.js +19 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +27 -0
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +2 -1
- package/src/services/ses.js.map +1 -1
|
@@ -580,6 +580,7 @@ export class BgRecommend {
|
|
|
580
580
|
${BgWidget.title(vm.data.title || '新增分銷連結')}
|
|
581
581
|
<div class="flex-fill"></div>
|
|
582
582
|
</div>`,
|
|
583
|
+
BgWidget.mbContainer(18),
|
|
583
584
|
BgWidget.container1x2({
|
|
584
585
|
html: gvc.bindView(() => {
|
|
585
586
|
const id = glitter.getUUID();
|
|
@@ -750,153 +751,120 @@ export class BgRecommend {
|
|
|
750
751
|
}, { single: true, readonly: vm.readonly })}`,
|
|
751
752
|
].join(BgWidget.mbContainer(18))),
|
|
752
753
|
BgWidget.mainCard([
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
754
|
+
BgWidget.title('分潤商品', 'font-size: 16px;'),
|
|
755
|
+
html ` <div class="my-2"></div>`,
|
|
756
|
+
gvc.bindView(() => {
|
|
757
|
+
var _a;
|
|
758
|
+
const subVM = {
|
|
759
|
+
id: gvc.glitter.getUUID(),
|
|
760
|
+
loading: true,
|
|
761
|
+
dataList: [],
|
|
762
|
+
};
|
|
763
|
+
function getSelectProducts(id_array) {
|
|
764
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
765
|
+
const products_data = yield ApiShop.getProduct({
|
|
766
|
+
page: 0,
|
|
767
|
+
limit: 99999,
|
|
768
|
+
id_list: id_array.join(','),
|
|
769
|
+
}).then(data => data.response.data);
|
|
770
|
+
return products_data;
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
(_a = newOrder.productCheck) !== null && _a !== void 0 ? _a : (newOrder.productCheck = []);
|
|
774
|
+
const relativeCloneData = structuredClone(newOrder.productCheck);
|
|
775
|
+
return {
|
|
776
|
+
bind: subVM.id,
|
|
777
|
+
view: () => {
|
|
778
|
+
if (subVM.loading) {
|
|
779
|
+
return BgWidget.spinner();
|
|
780
|
+
}
|
|
781
|
+
return html `
|
|
782
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
783
|
+
<div
|
|
784
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
785
|
+
style="gap: 24px; justify-content: space-between;"
|
|
786
|
+
>
|
|
787
|
+
<div class="form-check-label c_updown_label">
|
|
788
|
+
<div class="tx_normal">產品列表</div>
|
|
789
|
+
</div>
|
|
790
|
+
${BgWidget.grayButton('選擇商品', gvc.event(() => {
|
|
791
|
+
BgProduct.productsDialog({
|
|
792
|
+
gvc: gvc,
|
|
793
|
+
default: relativeCloneData.map((dd) => dd.id),
|
|
794
|
+
callback: product_array => {
|
|
795
|
+
getSelectProducts(product_array).then(resp => {
|
|
796
|
+
newOrder.productCheck = resp;
|
|
797
|
+
subVM.loading = true;
|
|
798
|
+
gvc.notifyDataChange(subVM.id);
|
|
799
|
+
});
|
|
800
|
+
},
|
|
801
|
+
});
|
|
802
|
+
}), { textStyle: 'font-weight: 400;' })}
|
|
803
|
+
</div>
|
|
804
|
+
${subVM.dataList
|
|
805
|
+
.map((opt, index) => {
|
|
806
|
+
return html `
|
|
784
807
|
<div
|
|
785
|
-
|
|
808
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
786
809
|
>
|
|
787
|
-
<
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
810
|
+
<span class="tx_normal" style="min-width: 20px;">${index + 1}.</span>
|
|
811
|
+
${BgWidget.validImageBox({
|
|
812
|
+
gvc: gvc,
|
|
813
|
+
image: opt.image,
|
|
814
|
+
width: 40,
|
|
815
|
+
})}
|
|
816
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
817
|
+
${opt.value}
|
|
818
|
+
${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
791
819
|
</div>
|
|
820
|
+
<div class="flex-fill"></div>
|
|
821
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
822
|
+
newOrder.productCheck.splice(index, 1);
|
|
823
|
+
subVM.dataList.splice(index, 1);
|
|
824
|
+
gvc.notifyDataChange(subVM.id);
|
|
825
|
+
}), '移除')}
|
|
792
826
|
</div>
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
newOrder.productCheck.
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
stroke-width="1.3"
|
|
828
|
-
stroke-linecap="round"
|
|
829
|
-
/>
|
|
830
|
-
<path
|
|
831
|
-
d="M9.99805 9.24219L1.51276 0.756907"
|
|
832
|
-
stroke="#DDDDDD"
|
|
833
|
-
stroke-width="1.3"
|
|
834
|
-
stroke-linecap="round"
|
|
835
|
-
/>
|
|
836
|
-
</svg>
|
|
837
|
-
</div>
|
|
838
|
-
</div>
|
|
839
|
-
</div>
|
|
840
|
-
`;
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
return returnHTML;
|
|
844
|
-
}
|
|
845
|
-
catch (e) {
|
|
846
|
-
console.log(e);
|
|
847
|
-
return `error`;
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
divCreate: {
|
|
851
|
-
style: `display: flex;flex-direction: column;align-items: flex-start;gap: 18px;align-self: stretch;`,
|
|
852
|
-
class: ``,
|
|
853
|
-
},
|
|
854
|
-
}),
|
|
855
|
-
gvc.bindView({
|
|
856
|
-
bind: 'addProduct',
|
|
857
|
-
view: () => {
|
|
858
|
-
return html `
|
|
859
|
-
<div
|
|
860
|
-
class="w-100 d-flex justify-content-center align-items-center"
|
|
861
|
-
style="color: #36B;gap:5px;"
|
|
862
|
-
onclick="${gvc.event(() => {
|
|
863
|
-
let confirm = true;
|
|
864
|
-
BgProduct.productsDialog({
|
|
865
|
-
gvc: gvc,
|
|
866
|
-
default: newOrder.productCheck.map((dd) => {
|
|
867
|
-
return dd.id;
|
|
868
|
-
}),
|
|
869
|
-
callback: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
870
|
-
const dialog = new ShareDialog(glitter);
|
|
871
|
-
dialog.dataLoading({ visible: true });
|
|
872
|
-
const pd = yield ApiShop.getProduct({
|
|
873
|
-
limit: 1000,
|
|
874
|
-
page: 0,
|
|
875
|
-
id_list: value.join(','),
|
|
876
|
-
});
|
|
877
|
-
newOrder.productCheck = pd.response.data;
|
|
878
|
-
dialog.dataLoading({ visible: false });
|
|
879
|
-
gvc.notifyDataChange(id);
|
|
880
|
-
}),
|
|
881
|
-
filter: d1 => {
|
|
882
|
-
return !newOrder.productCheck.find((dd) => {
|
|
883
|
-
return dd.id === d1;
|
|
827
|
+
`;
|
|
828
|
+
})
|
|
829
|
+
.join('') ||
|
|
830
|
+
html `<div class="w-100 d-flex align-content-center justify-content-center">
|
|
831
|
+
尚未加入任何賣場商品
|
|
832
|
+
</div>`}
|
|
833
|
+
</div>
|
|
834
|
+
`;
|
|
835
|
+
},
|
|
836
|
+
onCreate: () => {
|
|
837
|
+
if (subVM.loading) {
|
|
838
|
+
if (newOrder.productCheck.length === 0) {
|
|
839
|
+
setTimeout(() => {
|
|
840
|
+
subVM.dataList = [];
|
|
841
|
+
subVM.loading = false;
|
|
842
|
+
gvc.notifyDataChange(subVM.id);
|
|
843
|
+
}, 100);
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
847
|
+
const products_data = yield getSelectProducts(newOrder.productCheck.map((p) => p.id));
|
|
848
|
+
newOrder.productCheck = products_data;
|
|
849
|
+
subVM.dataList = products_data.map((product) => {
|
|
850
|
+
return {
|
|
851
|
+
key: product.id,
|
|
852
|
+
value: product.content.title,
|
|
853
|
+
image: product.content.preview_image[0] || BgWidget.noImageURL,
|
|
854
|
+
};
|
|
855
|
+
});
|
|
856
|
+
resolve(subVM.dataList);
|
|
857
|
+
})).then(data => {
|
|
858
|
+
subVM.dataList = data;
|
|
859
|
+
subVM.loading = false;
|
|
860
|
+
gvc.notifyDataChange(subVM.id);
|
|
884
861
|
});
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
設定分潤商品
|
|
890
|
-
<i class="fa-duotone fa-solid fa-gear"></i>
|
|
891
|
-
</div>
|
|
892
|
-
`;
|
|
893
|
-
},
|
|
894
|
-
divCreate: {
|
|
895
|
-
style: `width: 100%;display: flex;align-items: center;margin:24px 0;cursor: pointer;`,
|
|
896
|
-
class: ``,
|
|
897
|
-
},
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
};
|
|
898
866
|
}),
|
|
899
|
-
].join(
|
|
867
|
+
].join('')),
|
|
900
868
|
vm.readonly
|
|
901
869
|
? gvc.bindView(() => {
|
|
902
870
|
const id = gvc.glitter.getUUID();
|
|
@@ -695,6 +695,7 @@ export class BgRecommend {
|
|
|
695
695
|
${BgWidget.title(vm.data.title || '新增分銷連結')}
|
|
696
696
|
<div class="flex-fill"></div>
|
|
697
697
|
</div>`,
|
|
698
|
+
BgWidget.mbContainer(18),
|
|
698
699
|
BgWidget.container1x2(
|
|
699
700
|
{
|
|
700
701
|
html: gvc.bindView(() => {
|
|
@@ -876,157 +877,133 @@ export class BgRecommend {
|
|
|
876
877
|
),
|
|
877
878
|
BgWidget.mainCard(
|
|
878
879
|
[
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
880
|
+
BgWidget.title('分潤商品', 'font-size: 16px;'),
|
|
881
|
+
html` <div class="my-2"></div>`,
|
|
882
|
+
gvc.bindView(() => {
|
|
883
|
+
const subVM = {
|
|
884
|
+
id: gvc.glitter.getUUID(),
|
|
885
|
+
loading: true,
|
|
886
|
+
dataList: [] as OptionsItem[],
|
|
887
|
+
};
|
|
885
888
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
889
|
+
async function getSelectProducts(id_array: number[]) {
|
|
890
|
+
const products_data = await ApiShop.getProduct({
|
|
891
|
+
page: 0,
|
|
892
|
+
limit: 99999,
|
|
893
|
+
id_list: id_array.join(','),
|
|
894
|
+
}).then(data => data.response.data);
|
|
895
|
+
|
|
896
|
+
return products_data;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
newOrder.productCheck ??= [];
|
|
900
|
+
const relativeCloneData = structuredClone(newOrder.productCheck);
|
|
901
|
+
|
|
902
|
+
return {
|
|
903
|
+
bind: subVM.id,
|
|
904
|
+
view: () => {
|
|
905
|
+
if (subVM.loading) {
|
|
906
|
+
return BgWidget.spinner();
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return html`
|
|
910
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
911
|
+
<div
|
|
912
|
+
class="d-flex align-items-center gray-bottom-line-18"
|
|
913
|
+
style="gap: 24px; justify-content: space-between;"
|
|
914
|
+
>
|
|
915
|
+
<div class="form-check-label c_updown_label">
|
|
916
|
+
<div class="tx_normal">產品列表</div>
|
|
917
|
+
</div>
|
|
918
|
+
${BgWidget.grayButton(
|
|
919
|
+
'選擇商品',
|
|
920
|
+
gvc.event(() => {
|
|
921
|
+
BgProduct.productsDialog({
|
|
922
|
+
gvc: gvc,
|
|
923
|
+
default: relativeCloneData.map((dd: any) => dd.id),
|
|
924
|
+
callback: product_array => {
|
|
925
|
+
getSelectProducts(product_array).then(resp => {
|
|
926
|
+
newOrder.productCheck = resp;
|
|
927
|
+
subVM.loading = true;
|
|
928
|
+
gvc.notifyDataChange(subVM.id);
|
|
929
|
+
});
|
|
930
|
+
},
|
|
931
|
+
});
|
|
932
|
+
}),
|
|
933
|
+
{ textStyle: 'font-weight: 400;' }
|
|
934
|
+
)}
|
|
935
|
+
</div>
|
|
936
|
+
${subVM.dataList
|
|
937
|
+
.map((opt, index) => {
|
|
938
|
+
return html`
|
|
912
939
|
<div
|
|
913
|
-
|
|
940
|
+
class="d-flex align-items-center form-check-label c_updown_label gap-3"
|
|
914
941
|
>
|
|
915
|
-
<
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
942
|
+
<span class="tx_normal" style="min-width: 20px;">${index + 1}.</span>
|
|
943
|
+
${BgWidget.validImageBox({
|
|
944
|
+
gvc: gvc,
|
|
945
|
+
image: opt.image,
|
|
946
|
+
width: 40,
|
|
947
|
+
})}
|
|
948
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
949
|
+
${opt.value}
|
|
950
|
+
${opt.note ? html` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
919
951
|
</div>
|
|
952
|
+
<div class="flex-fill"></div>
|
|
953
|
+
${BgWidget.cancel(
|
|
954
|
+
gvc.event(() => {
|
|
955
|
+
newOrder.productCheck.splice(index, 1);
|
|
956
|
+
subVM.dataList.splice(index, 1);
|
|
957
|
+
gvc.notifyDataChange(subVM.id);
|
|
958
|
+
}),
|
|
959
|
+
'移除'
|
|
960
|
+
)}
|
|
920
961
|
</div>
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
/>
|
|
960
|
-
<path
|
|
961
|
-
d="M9.99805 9.24219L1.51276 0.756907"
|
|
962
|
-
stroke="#DDDDDD"
|
|
963
|
-
stroke-width="1.3"
|
|
964
|
-
stroke-linecap="round"
|
|
965
|
-
/>
|
|
966
|
-
</svg>
|
|
967
|
-
</div>
|
|
968
|
-
</div>
|
|
969
|
-
</div>
|
|
970
|
-
`;
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
return returnHTML;
|
|
974
|
-
} catch (e) {
|
|
975
|
-
console.log(e);
|
|
976
|
-
return `error`;
|
|
977
|
-
}
|
|
978
|
-
},
|
|
979
|
-
divCreate: {
|
|
980
|
-
style: `display: flex;flex-direction: column;align-items: flex-start;gap: 18px;align-self: stretch;`,
|
|
981
|
-
class: ``,
|
|
982
|
-
},
|
|
983
|
-
}),
|
|
984
|
-
gvc.bindView({
|
|
985
|
-
bind: 'addProduct',
|
|
986
|
-
view: () => {
|
|
987
|
-
return html`
|
|
988
|
-
<div
|
|
989
|
-
class="w-100 d-flex justify-content-center align-items-center"
|
|
990
|
-
style="color: #36B;gap:5px;"
|
|
991
|
-
onclick="${gvc.event(() => {
|
|
992
|
-
let confirm = true;
|
|
993
|
-
// productData.content
|
|
994
|
-
BgProduct.productsDialog({
|
|
995
|
-
gvc: gvc,
|
|
996
|
-
default: newOrder.productCheck.map((dd: any) => {
|
|
997
|
-
return dd.id;
|
|
998
|
-
}),
|
|
999
|
-
callback: async value => {
|
|
1000
|
-
const dialog = new ShareDialog(glitter);
|
|
1001
|
-
dialog.dataLoading({ visible: true });
|
|
1002
|
-
const pd = await ApiShop.getProduct({
|
|
1003
|
-
limit: 1000,
|
|
1004
|
-
page: 0,
|
|
1005
|
-
id_list: value.join(','),
|
|
1006
|
-
});
|
|
1007
|
-
newOrder.productCheck = pd.response.data;
|
|
1008
|
-
dialog.dataLoading({ visible: false });
|
|
1009
|
-
gvc.notifyDataChange(id);
|
|
1010
|
-
},
|
|
1011
|
-
filter: d1 => {
|
|
1012
|
-
return !newOrder.productCheck.find((dd: any) => {
|
|
1013
|
-
return dd.id === d1;
|
|
1014
|
-
});
|
|
1015
|
-
},
|
|
962
|
+
`;
|
|
963
|
+
})
|
|
964
|
+
.join('') ||
|
|
965
|
+
html`<div class="w-100 d-flex align-content-center justify-content-center">
|
|
966
|
+
尚未加入任何賣場商品
|
|
967
|
+
</div>`}
|
|
968
|
+
</div>
|
|
969
|
+
`;
|
|
970
|
+
},
|
|
971
|
+
onCreate: () => {
|
|
972
|
+
if (subVM.loading) {
|
|
973
|
+
if (newOrder.productCheck.length === 0) {
|
|
974
|
+
setTimeout(() => {
|
|
975
|
+
subVM.dataList = [];
|
|
976
|
+
subVM.loading = false;
|
|
977
|
+
gvc.notifyDataChange(subVM.id);
|
|
978
|
+
}, 100);
|
|
979
|
+
} else {
|
|
980
|
+
new Promise<OptionsItem[]>(async resolve => {
|
|
981
|
+
const products_data = await getSelectProducts(
|
|
982
|
+
newOrder.productCheck.map((p: any) => p.id)
|
|
983
|
+
);
|
|
984
|
+
|
|
985
|
+
newOrder.productCheck = products_data;
|
|
986
|
+
|
|
987
|
+
subVM.dataList = products_data.map((product: any) => {
|
|
988
|
+
return {
|
|
989
|
+
key: product.id,
|
|
990
|
+
value: product.content.title,
|
|
991
|
+
image: product.content.preview_image[0] || BgWidget.noImageURL,
|
|
992
|
+
};
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
resolve(subVM.dataList);
|
|
996
|
+
}).then(data => {
|
|
997
|
+
subVM.dataList = data;
|
|
998
|
+
subVM.loading = false;
|
|
999
|
+
gvc.notifyDataChange(subVM.id);
|
|
1016
1000
|
});
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
</div>
|
|
1022
|
-
`;
|
|
1023
|
-
},
|
|
1024
|
-
divCreate: {
|
|
1025
|
-
style: `width: 100%;display: flex;align-items: center;margin:24px 0;cursor: pointer;`,
|
|
1026
|
-
class: ``,
|
|
1027
|
-
},
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
};
|
|
1028
1005
|
}),
|
|
1029
|
-
].join(
|
|
1006
|
+
].join('')
|
|
1030
1007
|
),
|
|
1031
1008
|
// 訂單記錄
|
|
1032
1009
|
vm.readonly
|
|
@@ -1805,6 +1782,7 @@ export class BgRecommend {
|
|
|
1805
1782
|
}
|
|
1806
1783
|
|
|
1807
1784
|
vm.data.lineItems = newOrder.productCheck;
|
|
1785
|
+
|
|
1808
1786
|
vm.data.start_ISO_Date = new Date(`${vm.data.startDate} ${vm.data.startTime}`).toISOString();
|
|
1809
1787
|
if (vm.data.endDate && vm.data.endTime) {
|
|
1810
1788
|
vm.data.end_ISO_Date = new Date(`${vm.data.endDate} ${vm.data.endTime}`).toISOString();
|