ts-glitter 21.0.4 → 21.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-blog.js +22 -37
- package/lowcode/backend-manager/bg-blog.ts +45 -34
- package/lowcode/backend-manager/bg-list-component.js +2 -2
- package/lowcode/backend-manager/bg-list-component.ts +2 -2
- package/lowcode/backend-manager/bg-widget.js +21 -0
- package/lowcode/backend-manager/bg-widget.ts +21 -0
- package/lowcode/cms-plugin/filter-options.js +3 -3
- package/lowcode/cms-plugin/filter-options.ts +1 -1
- package/lowcode/cms-plugin/pos-pages/models.ts +1 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +74 -8
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +98 -19
- package/lowcode/cms-plugin/product-service.js +2 -1
- package/lowcode/cms-plugin/product-service.ts +3 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +251 -6
- package/lowcode/cms-plugin/shopping-finance-setting.ts +291 -6
- package/lowcode/cms-plugin/shopping-order-manager.js +56 -46
- package/lowcode/cms-plugin/shopping-order-manager.ts +59 -47
- package/lowcode/cms-plugin/shopping-product-setting.js +10 -5
- package/lowcode/cms-plugin/shopping-product-setting.ts +14 -6
- package/lowcode/cms-plugin/shopping-setting-advance.js +21 -72
- package/lowcode/cms-plugin/shopping-setting-advance.ts +31 -98
- package/lowcode/css/editor.css +48 -16
- package/lowcode/css/front-end.css +16 -17
- package/lowcode/glitter-base/global/language.js +2 -0
- package/lowcode/glitter-base/global/language.ts +3 -0
- package/lowcode/glitter-base/global/shipment-config.js +4 -4
- package/lowcode/glitter-base/global/shipment-config.ts +1 -1
- package/lowcode/glitter-base/route/shopping.js +11 -0
- package/lowcode/glitter-base/route/shopping.ts +12 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +0 -1
- package/lowcode/official_view_component/form-widget/input-custom.ts +0 -1
- package/lowcode/public-components/checkout/index.js +578 -780
- package/lowcode/public-components/checkout/index.ts +2457 -2652
- package/lowcode/public-components/headers/header-class.js +252 -324
- package/lowcode/public-components/headers/header-class.ts +389 -480
- package/lowcode/public-components/modules/cart-module.js +433 -0
- package/lowcode/public-components/modules/cart-module.ts +491 -0
- package/lowcode/public-components/modules/product-module.js +45 -0
- package/lowcode/public-components/modules/product-module.ts +58 -0
- package/lowcode/public-components/product/product-detail.js +178 -184
- package/lowcode/public-components/product/product-detail.ts +564 -579
- package/lowcode/public-components/user-manager/um-order.js +162 -32
- package/lowcode/public-components/user-manager/um-order.ts +181 -46
- package/lowcode/public-models/product.ts +1 -0
- package/package.json +1 -1
- package/src/Language.js +1 -0
- package/src/Language.js.map +1 -1
- package/src/Language.ts +3 -0
- package/src/api-public/controllers/article.js +33 -29
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/article.ts +152 -146
- package/src/api-public/controllers/index.js +2 -0
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +2 -0
- package/src/api-public/controllers/shop.js +125 -47
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +148 -61
- package/src/api-public/controllers/user.js +51 -52
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +63 -52
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +5 -1
- package/src/api-public/services/checkout-event.d.ts +1 -0
- package/src/api-public/services/checkout-event.js +38 -13
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +38 -10
- package/src/api-public/services/factories/payment-strategy-factory.d.ts +6 -0
- package/src/api-public/services/factories/payment-strategy-factory.js +49 -0
- package/src/api-public/services/factories/payment-strategy-factory.js.map +1 -0
- package/src/api-public/services/factories/payment-strategy-factory.ts +71 -0
- package/src/api-public/services/fb-service.js +4 -4
- package/src/api-public/services/fb-service.js.map +1 -1
- package/src/api-public/services/financial-service.d.ts +2 -1
- package/src/api-public/services/financial-service.js +48 -53
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/financial-service.ts +29 -38
- package/src/api-public/services/financial-serviceV2.d.ts +298 -0
- package/src/api-public/services/financial-serviceV2.js +1158 -0
- package/src/api-public/services/financial-serviceV2.js.map +1 -0
- package/src/api-public/services/financial-serviceV2.ts +1518 -0
- package/src/api-public/services/interface/payment-keys-interface.d.ts +37 -0
- package/src/api-public/services/interface/payment-keys-interface.js +3 -0
- package/src/api-public/services/interface/payment-keys-interface.js.map +1 -0
- package/src/api-public/services/interface/payment-keys-interface.ts +46 -0
- package/src/api-public/services/interface/payment-strategy-interface.d.ts +17 -0
- package/src/api-public/services/interface/payment-strategy-interface.js +3 -0
- package/src/api-public/services/interface/payment-strategy-interface.js.map +1 -0
- package/src/api-public/services/interface/payment-strategy-interface.ts +48 -0
- package/src/api-public/services/migrate-event/public-user-config.d.ts +5 -0
- package/src/api-public/services/migrate-event/public-user-config.js +81 -0
- package/src/api-public/services/migrate-event/public-user-config.js.map +1 -0
- package/src/api-public/services/migrate-event/public-user-config.ts +106 -0
- package/src/api-public/services/model/handlePaymentTransaction.js +0 -68
- package/src/api-public/services/model/handlePaymentTransaction.js.map +1 -1
- package/src/api-public/services/model/handlePaymentTransaction.ts +62 -54
- package/src/api-public/services/monitor.d.ts +1 -0
- package/src/api-public/services/payment-service.d.ts +12 -0
- package/src/api-public/services/payment-service.js +83 -0
- package/src/api-public/services/payment-service.js.map +1 -0
- package/src/api-public/services/payment-service.ts +112 -0
- package/src/api-public/services/shopping.d.ts +2 -1
- package/src/api-public/services/shopping.js +60 -23
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +88 -16
- package/src/api-public/services/strategies/ecpay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/ecpay-strategy.js +26 -0
- package/src/api-public/services/strategies/ecpay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/ecpay-strategy.ts +30 -0
- package/src/api-public/services/strategies/ezpay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/ezpay-strategy.js +26 -0
- package/src/api-public/services/strategies/ezpay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/ezpay-strategy.ts +31 -0
- package/src/api-public/services/strategies/jkopay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/jkopay-strategy.js +32 -0
- package/src/api-public/services/strategies/jkopay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/jkopay-strategy.ts +36 -0
- package/src/api-public/services/strategies/linepay-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/linepay-strategy.js +32 -0
- package/src/api-public/services/strategies/linepay-strategy.js.map +1 -0
- package/src/api-public/services/strategies/linepay-strategy.ts +35 -0
- package/src/api-public/services/strategies/paynow-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/paynow-strategy.js +26 -0
- package/src/api-public/services/strategies/paynow-strategy.js.map +1 -0
- package/src/api-public/services/strategies/paynow-strategy.ts +29 -0
- package/src/api-public/services/strategies/paypal-strategy.d.ts +8 -0
- package/src/api-public/services/strategies/paypal-strategy.js +28 -0
- package/src/api-public/services/strategies/paypal-strategy.js.map +1 -0
- package/src/api-public/services/strategies/paypal-strategy.ts +31 -0
- package/src/api-public/services/updated-table-checked.d.ts +1 -0
- package/src/api-public/services/updated-table-checked.js +37 -15
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +56 -36
- package/src/api-public/utils/ut-permission.d.ts +1 -0
- package/src/app-project/serverless/src/index.js +17 -7
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +17 -7
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- package/src/app-project/serverless/src/modules/ssh.js +17 -7
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/config.d.ts +1 -1
- package/src/modules/AWSLib.js +3 -2
- package/src/modules/AWSLib.js.map +1 -1
- package/src/modules/CryptoJS.js +17 -7
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/redis.d.ts +1 -1
- package/src/modules/ssh.js +17 -7
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +2 -1
- package/src/modules/tool.js.map +1 -1
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/create-instance.js +4 -3
- package/src/services/create-instance.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +5 -1
- package/src/services/tool.js +3 -2
- package/src/services/tool.js.map +1 -1
- package/vp00rqhw1r.json +1 -0
- package/src/api-public/services/product-migrate.d.ts +0 -8
- package/src/api-public/services/product-migrate.js.map +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
2
1
|
import { GVC } from '../glitterBundle/GVController.js';
|
|
3
2
|
import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
4
3
|
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
5
|
-
import {
|
|
4
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
6
5
|
import { CheckInput } from '../modules/checkInput.js';
|
|
7
|
-
import { LanguageBackend } from './language-backend.js';
|
|
8
6
|
import { Tool } from '../modules/tool.js';
|
|
9
|
-
import { ProductAi } from './ai-generator/product-ai.js';
|
|
10
7
|
import { imageLibrary } from '../modules/image-library.js';
|
|
8
|
+
import { LanguageBackend } from './language-backend.js';
|
|
9
|
+
import { ProductAi } from './ai-generator/product-ai.js';
|
|
10
|
+
import { ApiPageConfig } from '../api/pageConfig.js';
|
|
11
11
|
import { Language } from '../glitter-base/global/language.js';
|
|
12
|
-
import { ShoppingShipmentSetting } from './shopping-shipment-setting.js';
|
|
13
|
-
import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
|
|
14
12
|
import { ApiUser } from '../glitter-base/route/user.js';
|
|
13
|
+
import { ApiShop } from '../glitter-base/route/shopping.js';
|
|
15
14
|
import { PaymentConfig } from '../glitter-base/global/payment-config.js';
|
|
15
|
+
import { ShipmentConfig } from '../glitter-base/global/shipment-config.js';
|
|
16
|
+
import { ShoppingShipmentSetting } from './shopping-shipment-setting.js';
|
|
16
17
|
|
|
17
18
|
type CustomFinance = {
|
|
18
19
|
name: string;
|
|
@@ -21,6 +22,12 @@ type CustomFinance = {
|
|
|
21
22
|
shipmentSupport: string[];
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
type ShipmentGroupData = {
|
|
26
|
+
key: string;
|
|
27
|
+
name: string;
|
|
28
|
+
list: string[];
|
|
29
|
+
};
|
|
30
|
+
|
|
24
31
|
const html = String.raw;
|
|
25
32
|
|
|
26
33
|
export class ShoppingFinanceSetting {
|
|
@@ -601,6 +608,12 @@ export class ShoppingFinanceSetting {
|
|
|
601
608
|
),
|
|
602
609
|
BgWidget.save(
|
|
603
610
|
gvc.event(() => {
|
|
611
|
+
//綠界支付的測試版切換
|
|
612
|
+
if (payData.key == "ecPay" && key_d.ActionURL == "https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5"){
|
|
613
|
+
key_d.MERCHANT_ID = "3002607";
|
|
614
|
+
key_d.HASH_KEY = "pwFHCqoQZGmho4w6";
|
|
615
|
+
key_d.HASH_IV = "EkRm7iFT261dpevs";
|
|
616
|
+
}
|
|
604
617
|
keyData[payData.key] = key_d;
|
|
605
618
|
saveData();
|
|
606
619
|
gvc.closeDialog();
|
|
@@ -1699,6 +1712,7 @@ export class ShoppingFinanceSetting {
|
|
|
1699
1712
|
[
|
|
1700
1713
|
{ title: '基本設定', key: 'delivery_setting' },
|
|
1701
1714
|
{ title: '物流追蹤', key: 'delivery_track' },
|
|
1715
|
+
{ title: '物流群組', key: 'delivery_group' },
|
|
1702
1716
|
{ title: '配送備註', key: 'delivery_note' },
|
|
1703
1717
|
],
|
|
1704
1718
|
gvc,
|
|
@@ -2890,7 +2904,278 @@ export class ShoppingFinanceSetting {
|
|
|
2890
2904
|
};
|
|
2891
2905
|
}),
|
|
2892
2906
|
]);
|
|
2907
|
+
} else if (vm.page === 'delivery_group') {
|
|
2908
|
+
const dvm = {
|
|
2909
|
+
id: gvc.glitter.getUUID(),
|
|
2910
|
+
loading: true,
|
|
2911
|
+
dataList: [] as ShipmentGroupData[],
|
|
2912
|
+
};
|
|
2913
|
+
|
|
2914
|
+
function updateGroup(dialogGVC: GVC) {
|
|
2915
|
+
dialog.dataLoading({ visible: true });
|
|
2916
|
+
setTimeout(() => {
|
|
2917
|
+
ApiUser.setPublicConfig({
|
|
2918
|
+
user_id: 'manager',
|
|
2919
|
+
key: 'logistics_group',
|
|
2920
|
+
value: dvm.dataList,
|
|
2921
|
+
}).then(() => {
|
|
2922
|
+
dialog.dataLoading({ visible: false });
|
|
2923
|
+
dialog.successMessage({ text: '設定成功' });
|
|
2924
|
+
dialogGVC.closeDialog();
|
|
2925
|
+
|
|
2926
|
+
dvm.loading = true;
|
|
2927
|
+
gvc.notifyDataChange(dvm.id);
|
|
2928
|
+
});
|
|
2929
|
+
}, 100);
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
function deleteProductLogisticGroup(group: string | undefined, callback: () => void) {
|
|
2933
|
+
if (group) {
|
|
2934
|
+
ApiShop.deleteProductLogistic({ group }).then(() => callback());
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
function editGroupDialog(item?: ShipmentGroupData) {
|
|
2939
|
+
const cloneData = structuredClone(item);
|
|
2940
|
+
const postData = item
|
|
2941
|
+
? structuredClone(item)
|
|
2942
|
+
: {
|
|
2943
|
+
key: Tool.randomString(8),
|
|
2944
|
+
name: '',
|
|
2945
|
+
list: [],
|
|
2946
|
+
};
|
|
2947
|
+
|
|
2948
|
+
return BgWidget.settingDialog({
|
|
2949
|
+
gvc,
|
|
2950
|
+
title: '設定群組',
|
|
2951
|
+
innerHTML: iGVC => {
|
|
2952
|
+
const id = iGVC.glitter.getUUID();
|
|
2953
|
+
let loading = true;
|
|
2954
|
+
let dataList: any = [];
|
|
2955
|
+
|
|
2956
|
+
return iGVC.bindView({
|
|
2957
|
+
bind: id,
|
|
2958
|
+
view: () => {
|
|
2959
|
+
if (loading) {
|
|
2960
|
+
return BgWidget.spinner();
|
|
2961
|
+
}
|
|
2962
|
+
return [
|
|
2963
|
+
html`<div class="tx_700">群組名稱</div>`,
|
|
2964
|
+
BgWidget.editeInput({
|
|
2965
|
+
gvc: iGVC,
|
|
2966
|
+
title: '',
|
|
2967
|
+
default: postData.name,
|
|
2968
|
+
placeHolder: '請輸入群組名稱',
|
|
2969
|
+
callback: value => {
|
|
2970
|
+
postData.name = value;
|
|
2971
|
+
},
|
|
2972
|
+
}),
|
|
2973
|
+
html`<div class="tx_700">包含的物流</div>`,
|
|
2974
|
+
BgWidget.multiCheckboxContainer(
|
|
2975
|
+
iGVC,
|
|
2976
|
+
dataList,
|
|
2977
|
+
postData.list,
|
|
2978
|
+
text => {
|
|
2979
|
+
postData.list = text;
|
|
2980
|
+
},
|
|
2981
|
+
{ single: false }
|
|
2982
|
+
),
|
|
2983
|
+
].join(BgWidget.mbContainer(12));
|
|
2984
|
+
},
|
|
2985
|
+
onCreate: () => {
|
|
2986
|
+
if (loading) {
|
|
2987
|
+
ApiPageConfig.getPrivateConfig((window.parent as any).appName, 'logistics_setting').then(
|
|
2988
|
+
(dd: any) => {
|
|
2989
|
+
if (dd.result && dd.response.result[0]) {
|
|
2990
|
+
const shipment_setting = dd.response.result[0].value;
|
|
2991
|
+
|
|
2992
|
+
// 合併 ShipmentConfig.list 和 shipment_setting.custom_delivery
|
|
2993
|
+
const combinedList = [
|
|
2994
|
+
...ShipmentConfig.list.map(dd => ({
|
|
2995
|
+
name: dd.title,
|
|
2996
|
+
value: dd.value,
|
|
2997
|
+
})),
|
|
2998
|
+
...(shipment_setting.custom_delivery ?? []).map((dd: any) => ({
|
|
2999
|
+
form: dd.form,
|
|
3000
|
+
name: dd.name,
|
|
3001
|
+
value: dd.id,
|
|
3002
|
+
})),
|
|
3003
|
+
];
|
|
3004
|
+
|
|
3005
|
+
// 過濾出 shipment_setting.support 中支援的項目
|
|
3006
|
+
const supportedList = combinedList.filter(d1 =>
|
|
3007
|
+
shipment_setting.support.some((d2: any) => d2 === d1.value)
|
|
3008
|
+
);
|
|
3009
|
+
|
|
3010
|
+
// 轉換為 dataList 所需的格式
|
|
3011
|
+
dataList = supportedList.map(data => ({
|
|
3012
|
+
key: data.value,
|
|
3013
|
+
name: data.name,
|
|
3014
|
+
}));
|
|
3015
|
+
}
|
|
3016
|
+
|
|
3017
|
+
// 更新狀態並通知資料變更
|
|
3018
|
+
loading = false;
|
|
3019
|
+
iGVC.notifyDataChange(id);
|
|
3020
|
+
}
|
|
3021
|
+
);
|
|
3022
|
+
}
|
|
3023
|
+
},
|
|
3024
|
+
});
|
|
3025
|
+
},
|
|
3026
|
+
footer_html: fGVC => {
|
|
3027
|
+
return [
|
|
3028
|
+
item
|
|
3029
|
+
? BgWidget.danger(
|
|
3030
|
+
fGVC.event(() => {
|
|
3031
|
+
dialog.checkYesOrNot({
|
|
3032
|
+
text: '若刪除此群組,有使用到此群組的商品將會改成全部物流皆可使用,確定要刪除此物流群組?',
|
|
3033
|
+
callback: bool => {
|
|
3034
|
+
if (bool) {
|
|
3035
|
+
dvm.dataList = dvm.dataList.filter(data => data.key !== item?.key);
|
|
3036
|
+
deleteProductLogisticGroup(item?.key, () => updateGroup(fGVC));
|
|
3037
|
+
}
|
|
3038
|
+
},
|
|
3039
|
+
});
|
|
3040
|
+
})
|
|
3041
|
+
)
|
|
3042
|
+
: '',
|
|
3043
|
+
BgWidget.cancel(
|
|
3044
|
+
fGVC.event(() => {
|
|
3045
|
+
if (item) {
|
|
3046
|
+
item = cloneData;
|
|
3047
|
+
}
|
|
3048
|
+
fGVC.closeDialog();
|
|
3049
|
+
})
|
|
3050
|
+
),
|
|
3051
|
+
BgWidget.save(
|
|
3052
|
+
fGVC.event(() => {
|
|
3053
|
+
for (const data of dvm.dataList) {
|
|
3054
|
+
if (data.key !== postData.key) {
|
|
3055
|
+
if (data.name === postData.name) {
|
|
3056
|
+
dialog.infoMessage({ text: `群組名「${postData.name}」已經存在` });
|
|
3057
|
+
return;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
if (Tool.ObjCompare(postData.list, data.list)) {
|
|
3061
|
+
dialog.infoMessage({ text: '此群組的物流組合已經存在,請調整您點選的物流' });
|
|
3062
|
+
return;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
if (postData.list.length === 0) {
|
|
3066
|
+
dialog.infoMessage({ text: '請勾選至少一種物流的組合' });
|
|
3067
|
+
return;
|
|
3068
|
+
}
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
if (item) {
|
|
3073
|
+
const target = dvm.dataList.find(data => data.key === item?.key);
|
|
3074
|
+
target && Object.assign(target, postData);
|
|
3075
|
+
} else {
|
|
3076
|
+
dvm.dataList.push(postData);
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
updateGroup(fGVC);
|
|
3080
|
+
})
|
|
3081
|
+
),
|
|
3082
|
+
].join('');
|
|
3083
|
+
},
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
view = view.concat([
|
|
3088
|
+
html` <div class="px-md-0 px-2">
|
|
3089
|
+
${BgWidget.normalInsignia('可以將多個物流設定成一個群組集中,在商品設定頁可以一次管理物流方式')}
|
|
3090
|
+
</div>`,
|
|
3091
|
+
gvc.bindView(() => {
|
|
3092
|
+
return {
|
|
3093
|
+
bind: dvm.id,
|
|
3094
|
+
view: () => {
|
|
3095
|
+
if (dvm.loading) {
|
|
3096
|
+
return BgWidget.spinner();
|
|
3097
|
+
}
|
|
3098
|
+
return dvm.dataList
|
|
3099
|
+
.map(item => {
|
|
3100
|
+
const dd = {
|
|
3101
|
+
title: item.name,
|
|
3102
|
+
value: item.key,
|
|
3103
|
+
list: item.list,
|
|
3104
|
+
type: 'font_awesome',
|
|
3105
|
+
src: html`<i class="fa-solid fa-object-group fs-4"></i>`,
|
|
3106
|
+
};
|
|
3107
|
+
|
|
3108
|
+
return html`
|
|
3109
|
+
<div class="col-12 col-md-4 p-0 p-md-2">
|
|
3110
|
+
<div
|
|
3111
|
+
class="w-100 position-relative main-card"
|
|
3112
|
+
style="padding: 24px; background: white; overflow: hidden; justify-content: space-between; align-items: center; gap: 18px; display: inline-flex;"
|
|
3113
|
+
>
|
|
3114
|
+
<div
|
|
3115
|
+
style="align-self: stretch; justify-content: flex-start; align-items: center; gap: 28px; display: inline-flex;"
|
|
3116
|
+
>
|
|
3117
|
+
<div>${dd.type === 'font_awesome' ? dd.src : html` <img src="${dd.src}" />`}</div>
|
|
3118
|
+
<div
|
|
3119
|
+
style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; display: inline-flex"
|
|
3120
|
+
>
|
|
3121
|
+
<div class="tx_normal">${dd.title}</div>
|
|
3122
|
+
</div>
|
|
3123
|
+
</div>
|
|
3124
|
+
<div>
|
|
3125
|
+
${BgWidget.customButton({
|
|
3126
|
+
button: { color: 'gray', size: 'sm' },
|
|
3127
|
+
text: { name: '設定群組' },
|
|
3128
|
+
event: gvc.event(() => editGroupDialog(item)),
|
|
3129
|
+
})}
|
|
3130
|
+
</div>
|
|
3131
|
+
</div>
|
|
3132
|
+
</div>
|
|
3133
|
+
${document.body.clientWidth > 768 ? '' : BgWidget.mbContainer(8)}
|
|
3134
|
+
`;
|
|
3135
|
+
})
|
|
3136
|
+
.concat([
|
|
3137
|
+
html` <div
|
|
3138
|
+
class="col-12 col-md-4 p-0 p-md-2"
|
|
3139
|
+
style="cursor: pointer;"
|
|
3140
|
+
onclick="${gvc.event(() => editGroupDialog())}"
|
|
3141
|
+
>
|
|
3142
|
+
<div
|
|
3143
|
+
class="w-100 main-card"
|
|
3144
|
+
style="max-height:73.59px;padding: 24px; background: white; overflow: hidden; flex-direction: column; justify-content: center; align-items: center; gap: 18px; display: inline-flex"
|
|
3145
|
+
>
|
|
3146
|
+
<div
|
|
3147
|
+
class="fw-bold"
|
|
3148
|
+
style="align-self: stretch; justify-content: center; align-items: center; gap: 14px; display: inline-flex;color:#4D86DB;"
|
|
3149
|
+
>
|
|
3150
|
+
<i class="fa-regular fa-circle-plus fs-5"></i>
|
|
3151
|
+
<div class="fs-5">新增物流群組</div>
|
|
3152
|
+
</div>
|
|
3153
|
+
</div>
|
|
3154
|
+
</div>`,
|
|
3155
|
+
])
|
|
3156
|
+
.join('');
|
|
3157
|
+
},
|
|
3158
|
+
divCreate: {
|
|
3159
|
+
class: 'row guide3-3 mt-3 px-1',
|
|
3160
|
+
},
|
|
3161
|
+
onCreate: () => {
|
|
3162
|
+
if (dvm.loading) {
|
|
3163
|
+
ApiUser.getPublicConfig('logistics_group', 'manager').then(r => {
|
|
3164
|
+
if (r.result) {
|
|
3165
|
+
dvm.dataList = r.response.value ?? [];
|
|
3166
|
+
}
|
|
3167
|
+
setTimeout(() => {
|
|
3168
|
+
dvm.loading = false;
|
|
3169
|
+
gvc.notifyDataChange(dvm.id);
|
|
3170
|
+
}, 100);
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
3173
|
+
},
|
|
3174
|
+
};
|
|
3175
|
+
}),
|
|
3176
|
+
]);
|
|
2893
3177
|
}
|
|
3178
|
+
|
|
2894
3179
|
// view.push(
|
|
2895
3180
|
// html`<div
|
|
2896
3181
|
// style="width: 100%;padding: 14px 16px;background: #FFF; display: flex;justify-content: end;position: fixed;bottom: 0;right: 0;z-index:1;gap:14px;"
|
|
@@ -331,24 +331,30 @@ export class ShoppingOrderManager {
|
|
|
331
331
|
})
|
|
332
332
|
.flat()),
|
|
333
333
|
];
|
|
334
|
+
function cartTokenComponent(cart_token, source_badge, is_watch_user) {
|
|
335
|
+
return html `<div style="min-width:200px;">
|
|
336
|
+
<div style="position: relative; height: 40px;">
|
|
337
|
+
<div
|
|
338
|
+
style="position: absolute; bottom: 9px; height: 9px; width: 127px; ${is_watch_user
|
|
339
|
+
? 'background-color: #ffe9b2'
|
|
340
|
+
: ''}"
|
|
341
|
+
></div>
|
|
342
|
+
<span style="position: absolute; bottom: 0;">${cart_token}${source_badge}</span>
|
|
343
|
+
</div>
|
|
344
|
+
</div>`;
|
|
345
|
+
}
|
|
334
346
|
return data.response.data.map((dd) => {
|
|
335
347
|
var _a;
|
|
336
348
|
const vt = OrderSetting.getAllStatusBadge(dd);
|
|
337
349
|
dd.orderData.total = dd.orderData.total || 0;
|
|
338
350
|
dd.orderData.customer_info = (_a = dd.orderData.customer_info) !== null && _a !== void 0 ? _a : {};
|
|
339
351
|
const isWatchUser = watchUsers.includes(dd.orderData.email);
|
|
340
|
-
const backgroundColor = isWatchUser ? `background-color: #ffe9b2` : '';
|
|
341
352
|
const tooltipText = isWatchUser ? '此份訂單的顧客為觀察名單' : '';
|
|
342
353
|
if (query.isShipment) {
|
|
343
354
|
return [
|
|
344
355
|
{
|
|
345
356
|
key: '訂單編號',
|
|
346
|
-
value:
|
|
347
|
-
class="d-flex align-items-center gap-2"
|
|
348
|
-
style="min-width: 200px; ${backgroundColor}"
|
|
349
|
-
>
|
|
350
|
-
${dd.cart_token}${vt.sourceBadge()}
|
|
351
|
-
</div>`,
|
|
357
|
+
value: cartTokenComponent(dd.cart_token, vt.sourceBadge(), isWatchUser),
|
|
352
358
|
tooltip: tooltipText,
|
|
353
359
|
},
|
|
354
360
|
{
|
|
@@ -378,12 +384,7 @@ export class ShoppingOrderManager {
|
|
|
378
384
|
return [
|
|
379
385
|
{
|
|
380
386
|
key: '訂單編號',
|
|
381
|
-
value:
|
|
382
|
-
class="d-flex align-items-center gap-2"
|
|
383
|
-
style="min-width: 200px; ${backgroundColor}"
|
|
384
|
-
>
|
|
385
|
-
${dd.cart_token}${vt.sourceBadge()}
|
|
386
|
-
</div>`,
|
|
387
|
+
value: cartTokenComponent(dd.cart_token, vt.sourceBadge(), isWatchUser),
|
|
387
388
|
tooltip: tooltipText,
|
|
388
389
|
},
|
|
389
390
|
{
|
|
@@ -1541,12 +1542,13 @@ export class ShoppingOrderManager {
|
|
|
1541
1542
|
['姓名', 'name'],
|
|
1542
1543
|
['電話', 'phone'],
|
|
1543
1544
|
['信箱', 'email'],
|
|
1545
|
+
['縣市', 'city'],
|
|
1546
|
+
['鄉鎮', 'area'],
|
|
1547
|
+
['地址', 'address'],
|
|
1544
1548
|
];
|
|
1545
1549
|
const receipt = (yield ApiUser.getPublicConfig('custom_form_checkout_recipient', 'manager')).response.value;
|
|
1546
1550
|
receipt.list.map((d1) => {
|
|
1547
|
-
if (!viewModel.find(dd => {
|
|
1548
|
-
return dd[1] === d1.key;
|
|
1549
|
-
})) {
|
|
1551
|
+
if (!viewModel.find(dd => dd[1] === d1.key)) {
|
|
1550
1552
|
viewModel.push([d1.title, d1.key]);
|
|
1551
1553
|
}
|
|
1552
1554
|
});
|
|
@@ -2603,7 +2605,7 @@ export class ShoppingOrderManager {
|
|
|
2603
2605
|
html ` <div class="d-flex flex-column" style="gap:8px;">
|
|
2604
2606
|
<div
|
|
2605
2607
|
class="d-flex align-items-center"
|
|
2606
|
-
style="
|
|
2608
|
+
style="gap: 8px; cursor: pointer;"
|
|
2607
2609
|
onclick="${gvc.event(() => {
|
|
2608
2610
|
if (userData.userID) {
|
|
2609
2611
|
child_vm.userID = userData.userID;
|
|
@@ -2611,31 +2613,44 @@ export class ShoppingOrderManager {
|
|
|
2611
2613
|
}
|
|
2612
2614
|
})}"
|
|
2613
2615
|
>
|
|
2614
|
-
${
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2616
|
+
${[
|
|
2617
|
+
(() => {
|
|
2618
|
+
var _a;
|
|
2619
|
+
const name = (_a = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _a === void 0 ? void 0 : _a.name;
|
|
2620
|
+
if (name) {
|
|
2621
|
+
return html `<span style="font-weight: 500; color: #4D86DB;">${name}</span>`;
|
|
2622
|
+
}
|
|
2623
|
+
return html `<span style="font-weight: normal; color: #393939;">訪客</span>`;
|
|
2624
|
+
})(),
|
|
2625
|
+
(() => {
|
|
2626
|
+
if (userData.status === 0) {
|
|
2627
|
+
return '';
|
|
2628
|
+
}
|
|
2629
|
+
if (userDataLoading) {
|
|
2630
|
+
return BgWidget.grayInsignia('讀取中');
|
|
2631
|
+
}
|
|
2632
|
+
if (userData.member === undefined) {
|
|
2633
|
+
return BgWidget.grayInsignia('訪客');
|
|
2634
|
+
}
|
|
2635
|
+
if ((userData === null || userData === void 0 ? void 0 : userData.member.length) > 0) {
|
|
2636
|
+
for (let i = 0; i < userData.member.length; i++) {
|
|
2637
|
+
if (userData.member[i].trigger) {
|
|
2638
|
+
return BgWidget.darkInsignia(userData.member[i].tag_name);
|
|
2639
|
+
}
|
|
2633
2640
|
}
|
|
2634
2641
|
}
|
|
2635
|
-
return BgWidget.
|
|
2636
|
-
}
|
|
2637
|
-
|
|
2638
|
-
|
|
2642
|
+
return BgWidget.darkInsignia('一般會員');
|
|
2643
|
+
})(),
|
|
2644
|
+
(() => {
|
|
2645
|
+
if (userData.status === 0) {
|
|
2646
|
+
return BgWidget.dangerInsignia('黑名單');
|
|
2647
|
+
}
|
|
2648
|
+
if (userData.status === 2) {
|
|
2649
|
+
return BgWidget.watchingInsignia('觀察名單');
|
|
2650
|
+
}
|
|
2651
|
+
return '';
|
|
2652
|
+
})(),
|
|
2653
|
+
].join('')}
|
|
2639
2654
|
</div>
|
|
2640
2655
|
<div style="color: #393939;font-weight: 400;">
|
|
2641
2656
|
${(_h = (_g = (_f = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _f === void 0 ? void 0 : _f.phone) !== null && _g !== void 0 ? _g : orderData.orderData.user_info.phone) !== null && _h !== void 0 ? _h : '此會員未填手機'}
|
|
@@ -2643,9 +2658,6 @@ export class ShoppingOrderManager {
|
|
|
2643
2658
|
<div style="color: #393939;font-weight: 400;word-break:break-all;">
|
|
2644
2659
|
${(_l = (_k = (_j = userData === null || userData === void 0 ? void 0 : userData.userData) === null || _j === void 0 ? void 0 : _j.email) !== null && _k !== void 0 ? _k : orderData.orderData.user_info.email) !== null && _l !== void 0 ? _l : ''}
|
|
2645
2660
|
</div>
|
|
2646
|
-
<div style="color: #393939;font-weight: 700;">
|
|
2647
|
-
${userData.status === 2 ? '* 此顧客列為觀察名單' : ''}
|
|
2648
|
-
</div>
|
|
2649
2661
|
</div>`,
|
|
2650
2662
|
BgWidget.horizontalLine(),
|
|
2651
2663
|
gvc.bindView({
|
|
@@ -2744,9 +2756,7 @@ export class ShoppingOrderManager {
|
|
|
2744
2756
|
orderData.orderData.user_info.area,
|
|
2745
2757
|
orderData.orderData.user_info.address,
|
|
2746
2758
|
]
|
|
2747
|
-
.filter(
|
|
2748
|
-
return dd;
|
|
2749
|
-
})
|
|
2759
|
+
.filter(Boolean)
|
|
2750
2760
|
.join('')}
|
|
2751
2761
|
</div>`);
|
|
2752
2762
|
}
|