ts-glitter 20.6.8 → 20.7.0
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 +2 -2
- package/lowcode/Entry.ts +2 -2
- package/lowcode/backend-manager/bg-blog.js +617 -621
- package/lowcode/backend-manager/bg-blog.ts +2323 -2325
- package/lowcode/backend-manager/bg-line.js +5 -4
- package/lowcode/backend-manager/bg-line.ts +5 -4
- package/lowcode/backend-manager/bg-list-component.js +9 -0
- package/lowcode/backend-manager/bg-list-component.ts +15 -1
- package/lowcode/backend-manager/bg-notify.js +6 -4
- package/lowcode/backend-manager/bg-notify.ts +6 -4
- package/lowcode/backend-manager/bg-product.js +145 -0
- package/lowcode/backend-manager/bg-product.ts +153 -0
- package/lowcode/backend-manager/bg-sns.js +5 -3
- package/lowcode/backend-manager/bg-sns.ts +5 -3
- package/lowcode/backend-manager/bg-widget.js +92 -4
- package/lowcode/backend-manager/bg-widget.ts +122 -6
- package/lowcode/backend-manager/splitPage.js +0 -39
- package/lowcode/backend-manager/splitPage.ts +0 -40
- package/lowcode/cms-plugin/auto-fcm-advertise.js +17 -5
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +19 -6
- package/lowcode/cms-plugin/auto-fcm-history.js +2732 -0
- package/lowcode/cms-plugin/auto-fcm-history.ts +2995 -0
- package/lowcode/cms-plugin/cms-router.js +5 -0
- package/lowcode/cms-plugin/cms-router.ts +6 -0
- package/lowcode/cms-plugin/filter-options.js +80 -27
- package/lowcode/cms-plugin/filter-options.ts +83 -27
- package/lowcode/cms-plugin/language-backend.js +50 -39
- package/lowcode/cms-plugin/language-backend.ts +109 -95
- package/lowcode/cms-plugin/menus-setting.js +175 -151
- package/lowcode/cms-plugin/menus-setting.ts +620 -591
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/data.js +7 -7
- package/lowcode/cms-plugin/module/data.ts +262 -233
- package/lowcode/cms-plugin/module/delivery-html.js +18 -10
- package/lowcode/cms-plugin/module/delivery-html.ts +26 -10
- package/lowcode/cms-plugin/module/order-setting.js +458 -328
- package/lowcode/cms-plugin/module/order-setting.ts +622 -351
- package/lowcode/cms-plugin/module/product-excel.js +1 -1
- package/lowcode/cms-plugin/module/product-excel.ts +2 -1
- package/lowcode/cms-plugin/order/order-module.js +90 -1
- package/lowcode/cms-plugin/order/order-module.ts +106 -1
- package/lowcode/cms-plugin/pos-pages/payment-page.js +11 -8
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +28 -15
- package/lowcode/cms-plugin/pos-pages/products-page.js +0 -39
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -40
- package/lowcode/cms-plugin/shopping-collections.ts +1 -3
- package/lowcode/cms-plugin/shopping-finance-setting.js +19 -80
- package/lowcode/cms-plugin/shopping-finance-setting.ts +19 -87
- package/lowcode/cms-plugin/shopping-order-manager.js +122 -38
- package/lowcode/cms-plugin/shopping-order-manager.ts +160 -58
- package/lowcode/cms-plugin/shopping-product-setting.js +364 -376
- package/lowcode/cms-plugin/shopping-product-setting.ts +406 -415
- package/lowcode/cms-plugin/shopping-setting-advance.js +57 -16
- package/lowcode/cms-plugin/shopping-setting-advance.ts +69 -18
- package/lowcode/cms-plugin/stock-history.js +75 -63
- package/lowcode/cms-plugin/stock-history.ts +390 -376
- package/lowcode/cms-plugin/user/user-module.js +2 -43
- package/lowcode/cms-plugin/user/user-module.ts +2 -46
- package/lowcode/cms-plugin/user-list.js +4 -6
- package/lowcode/cms-plugin/user-list.ts +35 -38
- package/lowcode/css/editor.css +42 -3
- package/lowcode/glitter-base/global/language.js +6 -1
- package/lowcode/glitter-base/global/language.ts +10 -4
- package/lowcode/glitter-base/global/payment-config.js +19 -16
- package/lowcode/glitter-base/global/payment-config.ts +22 -16
- package/lowcode/glitter-base/global/shipment-config.js +6 -5
- package/lowcode/glitter-base/global/shipment-config.ts +12 -10
- package/lowcode/glitter-base/route/fcm.js +21 -1
- package/lowcode/glitter-base/route/fcm.ts +22 -2
- package/lowcode/glitter-base/route/shopping.js +8 -32
- package/lowcode/glitter-base/route/shopping.ts +10 -33
- package/lowcode/glitter-base/route/stock.ts +1 -0
- package/lowcode/glitter-base/route/user.js +11 -2
- package/lowcode/glitter-base/route/user.ts +23 -12
- package/lowcode/jspage/function-page/setting_editor.js +9 -0
- package/lowcode/jspage/function-page/setting_editor.ts +9 -0
- package/lowcode/public-components/blogs/list.js +223 -195
- package/lowcode/public-components/blogs/list.ts +383 -352
- package/lowcode/public-components/product/product-list.js +8 -4
- package/lowcode/public-components/product/product-list.ts +9 -4
- package/lowcode/public-components/terms-related/index.js +1 -1
- package/lowcode/public-components/terms-related/index.ts +1 -1
- package/lowcode/public-components/user-manager/um-login.js +1 -1
- package/lowcode/public-components/user-manager/um-login.ts +2 -2
- package/lowcode/public-components/user-manager/um-order.js +41 -5
- package/lowcode/public-components/user-manager/um-order.ts +58 -20
- package/lowcode/public-components/user-manager/um-voucher.ts +2 -2
- package/nhi4veq3gk.json +1 -0
- package/package.json +1 -1
- package/src/Language.d.ts +2 -0
- package/src/Language.js +66 -65
- package/src/Language.js.map +1 -1
- package/src/Language.ts +719 -715
- package/src/api-public/config/shipment-config.js +3 -2
- package/src/api-public/config/shipment-config.js.map +1 -1
- package/src/api-public/config/shipment-config.ts +3 -2
- package/src/api-public/controllers/ai-chat.js.map +1 -1
- package/src/api-public/controllers/ai-chat.ts +1 -2
- package/src/api-public/controllers/fcm.js +23 -58
- package/src/api-public/controllers/fcm.js.map +1 -1
- package/src/api-public/controllers/fcm.ts +28 -56
- package/src/api-public/controllers/shop.js +7 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +17 -10
- package/src/api-public/controllers/user.js +1 -0
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +2 -0
- package/src/api-public/services/auto-send-email.js +247 -187
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +568 -505
- package/src/api-public/services/delivery.js +1 -1
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/delivery.ts +6 -5
- package/src/api-public/services/financial-service.js +1 -2
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +4 -6
- package/src/api-public/services/manager.d.ts +4 -3
- package/src/api-public/services/manager.js +8 -12
- package/src/api-public/services/manager.js.map +1 -1
- package/src/api-public/services/manager.ts +57 -59
- package/src/api-public/services/model/handlePaymentTransaction.d.ts +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.js +23 -3
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +25 -36
- package/src/api-public/services/schedule.d.ts +1 -0
- package/src/api-public/services/schedule.js +27 -0
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +30 -0
- package/src/api-public/services/shopping.d.ts +22 -2
- package/src/api-public/services/shopping.js +371 -95
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +499 -141
- package/src/api-public/services/stock.js +0 -3
- package/src/api-public/services/stock.js.map +1 -1
- package/src/api-public/services/stock.ts +3 -3
- package/src/api-public/services/user.d.ts +1 -0
- package/src/api-public/services/user.js +32 -12
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +38 -19
- package/src/api-public/services/workers.js +3 -3
- package/src/api-public/services/workers.js.map +1 -1
- package/src/api-public/services/workers.ts +103 -103
- package/src/app-project/ios/proshake/AppDelegate.swift +51 -7
- package/src/app-project/ios/proshake/Info.plist +11 -9
- package/src/app-project/ios/proshake/SceneDelegate.swift +18 -0
- package/src/app-project/ios/proshake/glitter-interface/BasicUtil.swift +43 -2
- package/src/app-project/ios/proshake/glitter-interface/Ecommerce.swift +56 -0
- package/src/app-project/ios/proshake.xcodeproj/project.xcworkspace/xcuserdata/jianzhi.wang.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/src/app-project/serverless/src/modules/database.js +1 -1
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.ts +171 -171
- package/src/controllers/template.d.ts +1 -1
- package/src/controllers/template.js +16 -16
- package/src/controllers/template.js.map +1 -1
- package/src/controllers/template.ts +98 -84
- package/src/modules/database.js +3 -1
- package/src/modules/database.js.map +1 -1
- package/src/modules/database.ts +185 -181
- package/src/modules/firebase.d.ts +17 -0
- package/src/modules/firebase.js +126 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +169 -0
- package/src/public-config-initial/auto-fcm.js +8 -2
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +15 -6
- package/src/services/app.d.ts +2 -1
- package/src/services/app.js.map +1 -1
- package/src/services/app.ts +2 -1
- package/src/services/ios-project.js +12 -6
- package/src/services/ios-project.js.map +1 -1
- package/src/services/ios-project.ts +12 -6
- package/src/services/template.d.ts +3 -2
- package/src/services/template.js +2 -1
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +13 -20
|
@@ -1098,6 +1098,7 @@ export class ProductExcel {
|
|
|
1098
1098
|
};
|
|
1099
1099
|
productData.id = id_list[postMD.length];
|
|
1100
1100
|
productData.title = this.checkString(row[0]);
|
|
1101
|
+
productData.sub_title = this.checkString(row[29]);
|
|
1101
1102
|
productData.status = row[1] == '啟用' ? 'active' : 'draft';
|
|
1102
1103
|
productData.collection = (_b = row[2].split(',')) !== null && _b !== void 0 ? _b : [];
|
|
1103
1104
|
productData.collection = productData.collection.map((item) => item.replace(/\s+/g, ''));
|
|
@@ -1182,7 +1183,6 @@ export class ProductExcel {
|
|
|
1182
1183
|
variantData.stock = this.checkNumber(row[26]);
|
|
1183
1184
|
variantData.save_stock = this.checkNumber(row[27]);
|
|
1184
1185
|
variantData.barcode = this.checkString(row[28]);
|
|
1185
|
-
productData.sub_title = this.checkString(row[29]);
|
|
1186
1186
|
productData.variants.push(JSON.parse(JSON.stringify(variantData)));
|
|
1187
1187
|
}
|
|
1188
1188
|
}
|
|
@@ -1303,6 +1303,7 @@ export class ProductExcel {
|
|
|
1303
1303
|
};
|
|
1304
1304
|
productData.id = id_list[postMD.length];
|
|
1305
1305
|
productData.title = this.checkString(row[0]);
|
|
1306
|
+
productData.sub_title = this.checkString(row[29]);
|
|
1306
1307
|
productData.status = row[1] == '啟用' ? 'active' : 'draft';
|
|
1307
1308
|
productData.collection = row[2].split(',') ?? [];
|
|
1308
1309
|
// 去除多餘空白
|
|
@@ -1401,7 +1402,7 @@ export class ProductExcel {
|
|
|
1401
1402
|
variantData.stock = this.checkNumber(row[26]);
|
|
1402
1403
|
variantData.save_stock = this.checkNumber(row[27]);
|
|
1403
1404
|
variantData.barcode = this.checkString(row[28]);
|
|
1404
|
-
|
|
1405
|
+
|
|
1405
1406
|
productData.variants.push(JSON.parse(JSON.stringify(variantData)));
|
|
1406
1407
|
}
|
|
1407
1408
|
}
|
|
@@ -12,6 +12,7 @@ import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
|
12
12
|
import { BgProduct } from '../../backend-manager/bg-product.js';
|
|
13
13
|
import { ApiDelivery } from '../../glitter-base/route/delivery.js';
|
|
14
14
|
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
15
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
15
16
|
import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
|
|
16
17
|
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
17
18
|
import { PaymentPage } from '../pos-pages/payment-page.js';
|
|
@@ -248,9 +249,11 @@ export class OrderModule {
|
|
|
248
249
|
});
|
|
249
250
|
}
|
|
250
251
|
static formatRecord(gvc, vm, orderID, record) {
|
|
251
|
-
const orderNumbers = record.match(/{{order=(\d+)}}/g) || [];
|
|
252
|
+
const orderNumbers = record.match(/{{order=(\d+[a-zA-Z]?)}}/g) || [];
|
|
253
|
+
console.log("orderNumbers - ", orderNumbers);
|
|
252
254
|
orderNumbers.map((order) => {
|
|
253
255
|
const pureOrder = order.replace(/{{order=|}}/g, '');
|
|
256
|
+
console.log("pureOrder -- ", pureOrder);
|
|
254
257
|
record = record.replace(order, BgWidget.blueNote(`#${pureOrder}`, gvc.event(() => {
|
|
255
258
|
vm.data.cart_token = pureOrder;
|
|
256
259
|
vm.type = 'replace';
|
|
@@ -694,4 +697,90 @@ export class OrderModule {
|
|
|
694
697
|
},
|
|
695
698
|
});
|
|
696
699
|
}
|
|
700
|
+
static useOrderTags(obj) {
|
|
701
|
+
const gvc = obj.gvc;
|
|
702
|
+
const vmt = {
|
|
703
|
+
id: gvc.glitter.getUUID(),
|
|
704
|
+
loading: true,
|
|
705
|
+
search: '',
|
|
706
|
+
dataList: [],
|
|
707
|
+
postData: obj.def,
|
|
708
|
+
};
|
|
709
|
+
return BgWidget.settingDialog({
|
|
710
|
+
gvc,
|
|
711
|
+
title: '使用現有標籤',
|
|
712
|
+
innerHTML: gvc2 => {
|
|
713
|
+
return gvc2.bindView({
|
|
714
|
+
bind: vmt.id,
|
|
715
|
+
view: () => {
|
|
716
|
+
if (vmt.loading) {
|
|
717
|
+
return BgWidget.spinner();
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
return [
|
|
721
|
+
BgWidget.searchPlace(gvc2.event(e => {
|
|
722
|
+
vmt.search = e.value;
|
|
723
|
+
vmt.loading = true;
|
|
724
|
+
gvc2.notifyDataChange(vmt.id);
|
|
725
|
+
}), vmt.search, '搜尋標籤', '0', '0'),
|
|
726
|
+
BgWidget.renderOptions(gvc2, vmt),
|
|
727
|
+
].join(BgWidget.mbContainer(18));
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
divCreate: {},
|
|
731
|
+
onCreate: () => {
|
|
732
|
+
if (vmt.loading) {
|
|
733
|
+
ApiUser.getPublicConfig(obj.config_key, 'manager').then((dd) => {
|
|
734
|
+
var _a, _b;
|
|
735
|
+
if (dd.result && ((_b = (_a = dd.response) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.list)) {
|
|
736
|
+
const responseList = dd.response.value.list;
|
|
737
|
+
const list = [...new Set([...responseList, ...obj.def])];
|
|
738
|
+
vmt.dataList = list.filter((item) => item.includes(vmt.search));
|
|
739
|
+
}
|
|
740
|
+
vmt.loading = false;
|
|
741
|
+
gvc2.notifyDataChange(vmt.id);
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
});
|
|
746
|
+
},
|
|
747
|
+
footer_html: gvc2 => {
|
|
748
|
+
return [
|
|
749
|
+
html `<div
|
|
750
|
+
style="color: #393939; text-decoration-line: underline; cursor: pointer"
|
|
751
|
+
onclick="${gvc2.event(() => {
|
|
752
|
+
vmt.postData = [];
|
|
753
|
+
vmt.loading = true;
|
|
754
|
+
gvc2.notifyDataChange(vmt.id);
|
|
755
|
+
})}"
|
|
756
|
+
>
|
|
757
|
+
清除全部
|
|
758
|
+
</div>`,
|
|
759
|
+
BgWidget.cancel(gvc2.event(() => {
|
|
760
|
+
gvc2.closeDialog();
|
|
761
|
+
})),
|
|
762
|
+
BgWidget.save(gvc2.event(() => {
|
|
763
|
+
obj.callback(vmt.postData);
|
|
764
|
+
gvc2.closeDialog();
|
|
765
|
+
})),
|
|
766
|
+
].join('');
|
|
767
|
+
},
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
static getOrderManagerTag() {
|
|
771
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
772
|
+
return yield ApiUser.getPublicConfig('order_manager_tags', 'manager').then((dd) => {
|
|
773
|
+
var _a, _b;
|
|
774
|
+
if (dd.result && ((_b = (_a = dd.response) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.list)) {
|
|
775
|
+
return dd.response.value.list.map((item) => {
|
|
776
|
+
return {
|
|
777
|
+
key: item,
|
|
778
|
+
name: `#${item}`,
|
|
779
|
+
};
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
return [];
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
}
|
|
697
786
|
}
|
|
@@ -4,6 +4,7 @@ import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
|
4
4
|
import { BgProduct } from '../../backend-manager/bg-product.js';
|
|
5
5
|
import { ApiDelivery } from '../../glitter-base/route/delivery.js';
|
|
6
6
|
import { ApiShop } from '../../glitter-base/route/shopping.js';
|
|
7
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
7
8
|
import { PaymentConfig } from '../../glitter-base/global/payment-config.js';
|
|
8
9
|
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
9
10
|
import { PaymentPage } from '../pos-pages/payment-page.js';
|
|
@@ -271,9 +272,12 @@ export class OrderModule {
|
|
|
271
272
|
|
|
272
273
|
static formatRecord(gvc: GVC, vm: any, orderID: string, record: string): string {
|
|
273
274
|
// 處理訂單連結
|
|
274
|
-
|
|
275
|
+
|
|
276
|
+
const orderNumbers = record.match(/{{order=(\d+[a-zA-Z]?)}}/g) || [];
|
|
277
|
+
console.log("orderNumbers - ", orderNumbers);
|
|
275
278
|
orderNumbers.map((order: string) => {
|
|
276
279
|
const pureOrder = order.replace(/{{order=|}}/g, '');
|
|
280
|
+
console.log("pureOrder -- " , pureOrder );
|
|
277
281
|
record = record.replace(
|
|
278
282
|
order,
|
|
279
283
|
BgWidget.blueNote(
|
|
@@ -422,6 +426,7 @@ export class OrderModule {
|
|
|
422
426
|
}
|
|
423
427
|
|
|
424
428
|
const storeKeys = Object.keys(dd.deduction_log || {});
|
|
429
|
+
//todo 不能變更為負數
|
|
425
430
|
if (storeKeys.length > 0) {
|
|
426
431
|
let selectStore = '';
|
|
427
432
|
for (const key of storeKeys) {
|
|
@@ -782,4 +787,104 @@ export class OrderModule {
|
|
|
782
787
|
},
|
|
783
788
|
});
|
|
784
789
|
}
|
|
790
|
+
|
|
791
|
+
static useOrderTags(obj: {
|
|
792
|
+
gvc: GVC;
|
|
793
|
+
config_key: 'order_manager_tags';
|
|
794
|
+
def: string[];
|
|
795
|
+
callback: (dataArray: string[]) => void;
|
|
796
|
+
}) {
|
|
797
|
+
const gvc = obj.gvc;
|
|
798
|
+
|
|
799
|
+
const vmt = {
|
|
800
|
+
id: gvc.glitter.getUUID(),
|
|
801
|
+
loading: true,
|
|
802
|
+
search: '',
|
|
803
|
+
dataList: [] as string[],
|
|
804
|
+
postData: obj.def,
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
return BgWidget.settingDialog({
|
|
808
|
+
gvc,
|
|
809
|
+
title: '使用現有標籤',
|
|
810
|
+
innerHTML: gvc2 => {
|
|
811
|
+
return gvc2.bindView({
|
|
812
|
+
bind: vmt.id,
|
|
813
|
+
view: () => {
|
|
814
|
+
if (vmt.loading) {
|
|
815
|
+
return BgWidget.spinner();
|
|
816
|
+
} else {
|
|
817
|
+
return [
|
|
818
|
+
BgWidget.searchPlace(
|
|
819
|
+
gvc2.event(e => {
|
|
820
|
+
vmt.search = e.value;
|
|
821
|
+
vmt.loading = true;
|
|
822
|
+
gvc2.notifyDataChange(vmt.id);
|
|
823
|
+
}),
|
|
824
|
+
vmt.search,
|
|
825
|
+
'搜尋標籤',
|
|
826
|
+
'0',
|
|
827
|
+
'0'
|
|
828
|
+
),
|
|
829
|
+
BgWidget.renderOptions(gvc2, vmt),
|
|
830
|
+
].join(BgWidget.mbContainer(18));
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
divCreate: {},
|
|
834
|
+
onCreate: () => {
|
|
835
|
+
if (vmt.loading) {
|
|
836
|
+
ApiUser.getPublicConfig(obj.config_key, 'manager').then((dd: any) => {
|
|
837
|
+
if (dd.result && dd.response?.value?.list) {
|
|
838
|
+
const responseList = dd.response.value.list;
|
|
839
|
+
const list = [...new Set([...responseList, ...obj.def])];
|
|
840
|
+
vmt.dataList = list.filter((item: string) => item.includes(vmt.search));
|
|
841
|
+
}
|
|
842
|
+
vmt.loading = false;
|
|
843
|
+
gvc2.notifyDataChange(vmt.id);
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
},
|
|
847
|
+
});
|
|
848
|
+
},
|
|
849
|
+
footer_html: gvc2 => {
|
|
850
|
+
return [
|
|
851
|
+
html`<div
|
|
852
|
+
style="color: #393939; text-decoration-line: underline; cursor: pointer"
|
|
853
|
+
onclick="${gvc2.event(() => {
|
|
854
|
+
vmt.postData = [];
|
|
855
|
+
vmt.loading = true;
|
|
856
|
+
gvc2.notifyDataChange(vmt.id);
|
|
857
|
+
})}"
|
|
858
|
+
>
|
|
859
|
+
清除全部
|
|
860
|
+
</div>`,
|
|
861
|
+
BgWidget.cancel(
|
|
862
|
+
gvc2.event(() => {
|
|
863
|
+
gvc2.closeDialog();
|
|
864
|
+
})
|
|
865
|
+
),
|
|
866
|
+
BgWidget.save(
|
|
867
|
+
gvc2.event(() => {
|
|
868
|
+
obj.callback(vmt.postData);
|
|
869
|
+
gvc2.closeDialog();
|
|
870
|
+
})
|
|
871
|
+
),
|
|
872
|
+
].join('');
|
|
873
|
+
},
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
static async getOrderManagerTag() {
|
|
878
|
+
return await ApiUser.getPublicConfig('order_manager_tags', 'manager').then((dd: any) => {
|
|
879
|
+
if (dd.result && dd.response?.value?.list) {
|
|
880
|
+
return dd.response.value.list.map((item: string) => {
|
|
881
|
+
return {
|
|
882
|
+
key: item,
|
|
883
|
+
name: `#${item}`,
|
|
884
|
+
};
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
return [];
|
|
888
|
+
});
|
|
889
|
+
}
|
|
785
890
|
}
|
|
@@ -27,6 +27,7 @@ import { TempOrder } from './temp-order.js';
|
|
|
27
27
|
import { PaymentFunction } from './payment-function.js';
|
|
28
28
|
import { UmClass } from '../../public-components/user-manager/um-class.js';
|
|
29
29
|
import { FormCheck } from '../module/form-check.js';
|
|
30
|
+
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
30
31
|
const html = String.raw;
|
|
31
32
|
export class PaymentPage {
|
|
32
33
|
static checkout(params) {
|
|
@@ -45,14 +46,16 @@ export class PaymentPage {
|
|
|
45
46
|
}
|
|
46
47
|
static shipmentSupport(orderDetail) {
|
|
47
48
|
const defaultOptions = [{ title: '立即取貨', value: 'now' }];
|
|
48
|
-
const availableOptions =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
const availableOptions = ShipmentConfig.list
|
|
50
|
+
.filter(item => {
|
|
51
|
+
const isPayNow = Boolean(item.paynow_id);
|
|
52
|
+
const includeKey = item.value === 'normal' || item.value === 'shop';
|
|
53
|
+
const isSupport = orderDetail.shipment_support.includes(item.value);
|
|
54
|
+
return (isPayNow || includeKey) && isSupport;
|
|
55
|
+
})
|
|
56
|
+
.map(item => {
|
|
57
|
+
return { title: item.title, value: item.value };
|
|
58
|
+
});
|
|
56
59
|
return defaultOptions.concat(availableOptions);
|
|
57
60
|
}
|
|
58
61
|
static main(obj) {
|
|
@@ -19,6 +19,7 @@ import { TempOrder } from './temp-order.js';
|
|
|
19
19
|
import { PaymentFunction } from './payment-function.js';
|
|
20
20
|
import { UmClass } from '../../public-components/user-manager/um-class.js';
|
|
21
21
|
import { FormCheck } from '../module/form-check.js';
|
|
22
|
+
import { ShipmentConfig } from '../../glitter-base/global/shipment-config.js';
|
|
22
23
|
|
|
23
24
|
const html = String.raw;
|
|
24
25
|
|
|
@@ -48,14 +49,26 @@ export class PaymentPage {
|
|
|
48
49
|
const defaultOptions = [{ title: '立即取貨', value: 'now' }];
|
|
49
50
|
|
|
50
51
|
// 可用的運送選項
|
|
51
|
-
const availableOptions =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
const availableOptions = ShipmentConfig.list
|
|
53
|
+
.filter(item => {
|
|
54
|
+
const isPayNow = Boolean(item.paynow_id);
|
|
55
|
+
const includeKey = item.value === 'normal' || item.value === 'shop';
|
|
56
|
+
const isSupport = orderDetail.shipment_support.includes(item.value);
|
|
57
|
+
return (isPayNow || includeKey) && isSupport;
|
|
58
|
+
})
|
|
59
|
+
.map(item => {
|
|
60
|
+
return { title: item.title, value: item.value };
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// 可用的運送選項(原)
|
|
64
|
+
// const availableOptions = [
|
|
65
|
+
// { title: '一般宅配', value: 'normal' },
|
|
66
|
+
// { title: '全家店到店', value: 'FAMIC2C' },
|
|
67
|
+
// { title: '萊爾富店到店', value: 'HILIFEC2C' },
|
|
68
|
+
// { title: 'OK超商店到店', value: 'OKMARTC2C' },
|
|
69
|
+
// { title: '7-ELEVEN超商交貨便', value: 'UNIMARTC2C' },
|
|
70
|
+
// { title: '門市取貨', value: 'shop' },
|
|
71
|
+
// ].filter(option => orderDetail.shipment_support.includes(option.value));
|
|
59
72
|
|
|
60
73
|
// 合併預設選項和可用運送選項
|
|
61
74
|
return defaultOptions.concat(availableOptions);
|
|
@@ -111,13 +124,13 @@ export class PaymentPage {
|
|
|
111
124
|
const userInfo = obj.ogOrderData.user_info || {};
|
|
112
125
|
userInfo.shipment = userInfo.shipment || 'now';
|
|
113
126
|
|
|
114
|
-
const orderDetail =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
const orderDetail =
|
|
128
|
+
(await this.checkout({
|
|
129
|
+
line_items: obj.ogOrderData.lineItems,
|
|
130
|
+
user_info: userInfo,
|
|
131
|
+
code_array: obj.ogOrderData.code_array || [],
|
|
132
|
+
use_rebate: obj.ogOrderData.use_rebate,
|
|
133
|
+
})) || {};
|
|
121
134
|
|
|
122
135
|
// 確保 voucherList 存在
|
|
123
136
|
obj.ogOrderData.voucherList = obj.ogOrderData.voucherList || [];
|
|
@@ -480,45 +480,6 @@ ProductsPage.pageSplitV2 = (gvc, countPage, nowPage, callback) => {
|
|
|
480
480
|
loading: false,
|
|
481
481
|
dataList: [],
|
|
482
482
|
};
|
|
483
|
-
gvc.addStyle(`
|
|
484
|
-
.page-link-v2 {
|
|
485
|
-
display: inline-flex;
|
|
486
|
-
height: 32px;
|
|
487
|
-
padding: 10px;
|
|
488
|
-
flex-direction: column;
|
|
489
|
-
justify-content: center;
|
|
490
|
-
align-items: center;
|
|
491
|
-
gap: 10px;
|
|
492
|
-
cursor: pointer;
|
|
493
|
-
background: #fff;
|
|
494
|
-
border: 1px solid #393939;
|
|
495
|
-
color: #393939;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
.page-link-prev {
|
|
499
|
-
border-radius: 7px 0px 0px 7px;
|
|
500
|
-
border: 1px solid #d8d8d8;
|
|
501
|
-
background: #fff;
|
|
502
|
-
color: #393939;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.page-link-next {
|
|
506
|
-
border-radius: 0px 7px 7px 0px;
|
|
507
|
-
border: 1px solid #d8d8d8;
|
|
508
|
-
background: #fff;
|
|
509
|
-
color: #393939;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.page-link-active {
|
|
513
|
-
background: #393939;
|
|
514
|
-
color: #fff;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
.angle-style {
|
|
518
|
-
font-size: 12px;
|
|
519
|
-
color: #d8d8d8;
|
|
520
|
-
}
|
|
521
|
-
`);
|
|
522
483
|
return gvc.bindView({
|
|
523
484
|
bind: vm.id,
|
|
524
485
|
view: () => {
|
|
@@ -23,46 +23,6 @@ export class ProductsPage {
|
|
|
23
23
|
dataList: <any>[],
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
gvc.addStyle(`
|
|
27
|
-
.page-link-v2 {
|
|
28
|
-
display: inline-flex;
|
|
29
|
-
height: 32px;
|
|
30
|
-
padding: 10px;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
align-items: center;
|
|
34
|
-
gap: 10px;
|
|
35
|
-
cursor: pointer;
|
|
36
|
-
background: #fff;
|
|
37
|
-
border: 1px solid #393939;
|
|
38
|
-
color: #393939;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.page-link-prev {
|
|
42
|
-
border-radius: 7px 0px 0px 7px;
|
|
43
|
-
border: 1px solid #d8d8d8;
|
|
44
|
-
background: #fff;
|
|
45
|
-
color: #393939;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.page-link-next {
|
|
49
|
-
border-radius: 0px 7px 7px 0px;
|
|
50
|
-
border: 1px solid #d8d8d8;
|
|
51
|
-
background: #fff;
|
|
52
|
-
color: #393939;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.page-link-active {
|
|
56
|
-
background: #393939;
|
|
57
|
-
color: #fff;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.angle-style {
|
|
61
|
-
font-size: 12px;
|
|
62
|
-
color: #d8d8d8;
|
|
63
|
-
}
|
|
64
|
-
`);
|
|
65
|
-
|
|
66
26
|
return gvc.bindView({
|
|
67
27
|
bind: vm.id,
|
|
68
28
|
view: () => {
|
|
@@ -6,7 +6,7 @@ import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
|
6
6
|
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
7
7
|
import { FilterOptions } from './filter-options.js';
|
|
8
8
|
import { CheckInput } from '../modules/checkInput.js';
|
|
9
|
-
import { Language } from '../glitter-base/global/language.js';
|
|
9
|
+
import { Language, LanguageLocation } from '../glitter-base/global/language.js';
|
|
10
10
|
|
|
11
11
|
type ViewModel = {
|
|
12
12
|
id: string;
|
|
@@ -34,8 +34,6 @@ interface LanguageData {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
type LanguageLocation = 'en-US' | 'zh-CN' | 'zh-TW';
|
|
38
|
-
|
|
39
37
|
type Collection = {
|
|
40
38
|
title: string;
|
|
41
39
|
code: string;
|
|
@@ -20,6 +20,7 @@ import { Language } from '../glitter-base/global/language.js';
|
|
|
20
20
|
import { ShoppingShipmentSetting } from './shopping-shipment-setting.js';
|
|
21
21
|
import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
|
|
22
22
|
import { ApiUser } from '../glitter-base/route/user.js';
|
|
23
|
+
import { PaymentConfig } from '../glitter-base/global/payment-config.js';
|
|
23
24
|
const html = String.raw;
|
|
24
25
|
export class ShoppingFinanceSetting {
|
|
25
26
|
static main(gvc) {
|
|
@@ -219,9 +220,12 @@ export class ShoppingFinanceSetting {
|
|
|
219
220
|
let h = '';
|
|
220
221
|
const cloneData = structuredClone(keyData);
|
|
221
222
|
if (vm.page === 'online') {
|
|
222
|
-
h = html ` <div class="
|
|
223
|
+
h = html ` <div class="px-md-0 px-2 mb-2">
|
|
224
|
+
${BgWidget.normalInsignia('透過線上金流,消費者可於線上進行結帳付款')}
|
|
225
|
+
</div>
|
|
223
226
|
<div class="row">
|
|
224
|
-
${
|
|
227
|
+
${PaymentConfig.onlinePay
|
|
228
|
+
.filter(item => item.type !== 'pos')
|
|
225
229
|
.map(dd => {
|
|
226
230
|
var _a;
|
|
227
231
|
keyData[dd.key] = (_a = keyData[dd.key]) !== null && _a !== void 0 ? _a : {};
|
|
@@ -471,7 +475,7 @@ export class ShoppingFinanceSetting {
|
|
|
471
475
|
key_d.STORE_ID = text;
|
|
472
476
|
},
|
|
473
477
|
placeHolder: '請輸入STORE_ID',
|
|
474
|
-
})
|
|
478
|
+
}),
|
|
475
479
|
].join('');
|
|
476
480
|
case 'paynow':
|
|
477
481
|
return [
|
|
@@ -594,7 +598,7 @@ export class ShoppingFinanceSetting {
|
|
|
594
598
|
}
|
|
595
599
|
if (vm.page === 'offline') {
|
|
596
600
|
const offlinePayArray = [
|
|
597
|
-
...
|
|
601
|
+
...PaymentConfig.defalutOfflinePay,
|
|
598
602
|
...keyData.payment_info_custom.map((dd) => {
|
|
599
603
|
return {
|
|
600
604
|
key: dd.id,
|
|
@@ -603,8 +607,8 @@ export class ShoppingFinanceSetting {
|
|
|
603
607
|
};
|
|
604
608
|
}),
|
|
605
609
|
];
|
|
606
|
-
h = html ` <div class="
|
|
607
|
-
${BgWidget.
|
|
610
|
+
h = html ` <div class="px-md-0 px-2 mb-2">
|
|
611
|
+
${BgWidget.normalInsignia('透過設定線下金流,結帳後訂單將進入手動核款的流程,亦可使用超商取貨付款')}
|
|
608
612
|
</div>
|
|
609
613
|
<div class="row">
|
|
610
614
|
${offlinePayArray
|
|
@@ -722,9 +726,12 @@ export class ShoppingFinanceSetting {
|
|
|
722
726
|
</div>`;
|
|
723
727
|
}
|
|
724
728
|
if (vm.page === 'pos') {
|
|
725
|
-
h = html
|
|
729
|
+
h = html ` <div class="px-md-0 px-2 mb-2">
|
|
730
|
+
${BgWidget.normalInsignia('設定實體店面所需串接的付款方式')}
|
|
731
|
+
</div>
|
|
726
732
|
<div class="row">
|
|
727
|
-
${
|
|
733
|
+
${PaymentConfig.onlinePay
|
|
734
|
+
.filter(item => item.type === 'pos')
|
|
728
735
|
.map(dd => {
|
|
729
736
|
return html ` <div class="col-12 col-lg-3 col-md-4 p-0 p-md-2">
|
|
730
737
|
<div
|
|
@@ -826,7 +833,7 @@ export class ShoppingFinanceSetting {
|
|
|
826
833
|
], gvc, vm.page, (key) => {
|
|
827
834
|
vm.page = key;
|
|
828
835
|
gvc.notifyDataChange(vm.id);
|
|
829
|
-
}
|
|
836
|
+
}),
|
|
830
837
|
h,
|
|
831
838
|
].join('');
|
|
832
839
|
}
|
|
@@ -857,7 +864,7 @@ export class ShoppingFinanceSetting {
|
|
|
857
864
|
}
|
|
858
865
|
},
|
|
859
866
|
}),
|
|
860
|
-
].join(
|
|
867
|
+
].join('')}
|
|
861
868
|
${BgWidget.mbContainer(240)}
|
|
862
869
|
`);
|
|
863
870
|
}
|
|
@@ -1504,7 +1511,7 @@ export class ShoppingFinanceSetting {
|
|
|
1504
1511
|
];
|
|
1505
1512
|
if (vm.page === 'delivery_setting') {
|
|
1506
1513
|
view = view.concat([
|
|
1507
|
-
html `<div class="
|
|
1514
|
+
html `<div class="px-md-0 px-2">
|
|
1508
1515
|
${BgWidget.normalInsignia('設定支援的配送方式,供消費者於前臺自行選擇合適的物流,另外可於商品頁面設定特定商品支援的配送')}
|
|
1509
1516
|
</div>`,
|
|
1510
1517
|
gvc.bindView(() => {
|
|
@@ -2145,7 +2152,7 @@ export class ShoppingFinanceSetting {
|
|
|
2145
2152
|
}
|
|
2146
2153
|
else if (vm.page === 'delivery_track') {
|
|
2147
2154
|
view = view.concat([
|
|
2148
|
-
html ` <div class="
|
|
2155
|
+
html ` <div class="px-md-0 px-2">
|
|
2149
2156
|
${BgWidget.normalInsignia('透過設定物流追蹤,可直接列印托運單進行出貨,並自動追蹤貨態')}
|
|
2150
2157
|
</div>`,
|
|
2151
2158
|
gvc.bindView(() => {
|
|
@@ -2805,72 +2812,4 @@ export class ShoppingFinanceSetting {
|
|
|
2805
2812
|
});
|
|
2806
2813
|
}
|
|
2807
2814
|
}
|
|
2808
|
-
ShoppingFinanceSetting.onlinePayArray = () => {
|
|
2809
|
-
return [
|
|
2810
|
-
{
|
|
2811
|
-
key: 'newWebPay',
|
|
2812
|
-
name: '藍新金流',
|
|
2813
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/logo.jpg',
|
|
2814
|
-
},
|
|
2815
|
-
{
|
|
2816
|
-
key: 'ecPay',
|
|
2817
|
-
name: '綠界金流',
|
|
2818
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/52415944_122858408.428215.png',
|
|
2819
|
-
},
|
|
2820
|
-
{
|
|
2821
|
-
key: 'paynow',
|
|
2822
|
-
name: 'PayNow 立吉富',
|
|
2823
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/download.png',
|
|
2824
|
-
},
|
|
2825
|
-
{
|
|
2826
|
-
key: 'paypal',
|
|
2827
|
-
name: 'PayPal',
|
|
2828
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/174861.png',
|
|
2829
|
-
},
|
|
2830
|
-
{
|
|
2831
|
-
key: 'line_pay',
|
|
2832
|
-
name: 'Line Pay',
|
|
2833
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/tw-11134207-7r98t-ltrond04grjj74.jpeg',
|
|
2834
|
-
},
|
|
2835
|
-
{
|
|
2836
|
-
key: 'jkopay',
|
|
2837
|
-
name: '街口支付',
|
|
2838
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/1200x630waw.png',
|
|
2839
|
-
},
|
|
2840
|
-
];
|
|
2841
|
-
};
|
|
2842
|
-
ShoppingFinanceSetting.offlinePayArray = () => {
|
|
2843
|
-
return [
|
|
2844
|
-
{
|
|
2845
|
-
key: 'atm',
|
|
2846
|
-
name: 'ATM銀行轉帳',
|
|
2847
|
-
customerClass: 'guide2-3',
|
|
2848
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/20200804163522idfs9.jpg',
|
|
2849
|
-
},
|
|
2850
|
-
{
|
|
2851
|
-
key: 'line',
|
|
2852
|
-
name: 'LINE 轉帳',
|
|
2853
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/unnamed.webp',
|
|
2854
|
-
},
|
|
2855
|
-
{
|
|
2856
|
-
key: 'cash_on_delivery',
|
|
2857
|
-
name: '貨到付款',
|
|
2858
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/images.png',
|
|
2859
|
-
},
|
|
2860
|
-
];
|
|
2861
|
-
};
|
|
2862
|
-
ShoppingFinanceSetting.posPayArray = () => {
|
|
2863
|
-
return [
|
|
2864
|
-
{
|
|
2865
|
-
key: 'line_pay_scan',
|
|
2866
|
-
name: 'Line Pay',
|
|
2867
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/tw-11134207-7r98t-ltrond04grjj74.jpeg',
|
|
2868
|
-
},
|
|
2869
|
-
{
|
|
2870
|
-
key: 'ut_credit_card',
|
|
2871
|
-
name: '聯合信用卡',
|
|
2872
|
-
img: 'https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/unnamed (1) copy.jpg',
|
|
2873
|
-
},
|
|
2874
|
-
];
|
|
2875
|
-
};
|
|
2876
2815
|
window.glitter.setModule(import.meta.url, ShoppingFinanceSetting);
|