@pisell/pisellos 2.2.42 → 2.2.43
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/strategy/adapter/index.d.ts +3 -0
- package/dist/model/strategy/adapter/index.js +4 -0
- package/dist/model/strategy/adapter/type.d.ts +28 -0
- package/dist/model/strategy/adapter/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +497 -0
- package/dist/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/dist/model/strategy/adapter/walletPass/example.js +258 -0
- package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/dist/model/strategy/adapter/walletPass/index.js +182 -0
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/dist/model/strategy/adapter/walletPass/locales.js +23 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +165 -0
- package/dist/model/strategy/adapter/walletPass/type.js +1 -0
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +965 -0
- package/dist/model/strategy/index.d.ts +94 -0
- package/dist/model/strategy/index.js +551 -0
- package/dist/model/strategy/strategy-example.d.ts +5 -0
- package/dist/model/strategy/strategy-example.js +331 -0
- package/dist/model/strategy/type.d.ts +228 -0
- package/dist/model/strategy/type.js +94 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +11 -0
- package/dist/modules/Discount/types.d.ts +15 -0
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +196 -95
- package/dist/modules/Rules/index.d.ts +8 -3
- package/dist/modules/Rules/index.js +143 -23
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +0 -9
- package/dist/modules/Schedule/index.js +2 -18
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +6 -0
- package/dist/modules/Summary/utils.js +21 -0
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +24 -23
- package/dist/solution/RegisterAndLogin/config.js +1 -339
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +13 -3
- package/dist/solution/ShopDiscount/types.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/model/index.d.ts +1 -0
- package/lib/model/index.js +23 -0
- package/lib/model/strategy/adapter/index.d.ts +3 -0
- package/lib/model/strategy/adapter/index.js +45 -0
- package/lib/model/strategy/adapter/type.d.ts +28 -0
- package/lib/model/strategy/adapter/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +84 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +421 -0
- package/lib/model/strategy/adapter/walletPass/example.d.ts +4 -0
- package/lib/model/strategy/adapter/walletPass/example.js +207 -0
- package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
- package/lib/model/strategy/adapter/walletPass/index.js +142 -0
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
- package/lib/model/strategy/adapter/walletPass/locales.js +51 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +165 -0
- package/lib/model/strategy/adapter/walletPass/type.js +17 -0
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +660 -0
- package/lib/model/strategy/index.d.ts +94 -0
- package/lib/model/strategy/index.js +413 -0
- package/lib/model/strategy/strategy-example.d.ts +5 -0
- package/lib/model/strategy/strategy-example.js +318 -0
- package/lib/model/strategy/type.d.ts +228 -0
- package/lib/model/strategy/type.js +44 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +9 -0
- package/lib/modules/Discount/types.d.ts +15 -0
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +99 -17
- package/lib/modules/Rules/index.d.ts +8 -3
- package/lib/modules/Rules/index.js +352 -187
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +0 -9
- package/lib/modules/Schedule/index.js +0 -11
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +6 -0
- package/lib/modules/Summary/utils.js +15 -0
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +3 -3
- package/lib/solution/RegisterAndLogin/config.js +1 -265
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +8 -2
- package/lib/solution/ShopDiscount/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -25,15 +25,6 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
25
25
|
setOtherProductsIds(ids: number[]): void;
|
|
26
26
|
getOtherProductsIds(): number[];
|
|
27
27
|
storeChange(): void;
|
|
28
|
-
/**
|
|
29
|
-
* 传入一个时间, 判断改时间是否在schedule 内
|
|
30
|
-
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
isInScheduleByDate({ date, schedule, }: {
|
|
34
|
-
date: string;
|
|
35
|
-
schedule: any;
|
|
36
|
-
}): boolean | undefined;
|
|
37
28
|
/**
|
|
38
29
|
* 传入一个时间, 判断改时间是否在schedule 内
|
|
39
30
|
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
@@ -159,17 +159,6 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
/**
|
|
163
|
-
* 传入一个时间, 判断改时间是否在schedule 内
|
|
164
|
-
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
165
|
-
* @returns
|
|
166
|
-
*/
|
|
167
|
-
isInScheduleByDate({
|
|
168
|
-
date,
|
|
169
|
-
schedule
|
|
170
|
-
}) {
|
|
171
|
-
return ScheduleModule.isInScheduleByDate({ date, schedule });
|
|
172
|
-
}
|
|
173
162
|
/**
|
|
174
163
|
* 传入一个时间, 判断改时间是否在schedule 内
|
|
175
164
|
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
@@ -13,6 +13,12 @@ export declare const getBundleDiscountList: (bundle: any[]) => any[];
|
|
|
13
13
|
* @returns 商品总价字符串,保留2位小数
|
|
14
14
|
*/
|
|
15
15
|
export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
16
|
+
/**
|
|
17
|
+
* 计算商品小计(不含其他费用 不包含折扣卡商品券抵扣金额)
|
|
18
|
+
* @param items - 购物车商品数组
|
|
19
|
+
* @returns 商品总价字符串,保留2位小数
|
|
20
|
+
*/
|
|
21
|
+
export declare const calculateOriginSubtotal: (items: CartItem[]) => string;
|
|
16
22
|
/**
|
|
17
23
|
* @title: 单个商品的税费
|
|
18
24
|
* @description:
|
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
32
|
calculateDeposit: () => calculateDeposit,
|
|
33
|
+
calculateOriginSubtotal: () => calculateOriginSubtotal,
|
|
33
34
|
calculatePriceDetails: () => calculatePriceDetails,
|
|
34
35
|
calculateSubtotal: () => calculateSubtotal,
|
|
35
36
|
calculateTaxFee: () => calculateTaxFee,
|
|
@@ -39,12 +40,15 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
39
40
|
var import_decimal = __toESM(require("decimal.js"));
|
|
40
41
|
var calculatePriceDetails = (shopInfo, items) => {
|
|
41
42
|
const subtotal = new import_decimal.default(calculateSubtotal(items));
|
|
43
|
+
const subOriginTotal = new import_decimal.default(calculateOriginSubtotal(items));
|
|
42
44
|
const totalTaxFee = new import_decimal.default(calculateTaxFee(shopInfo, items));
|
|
43
45
|
const total = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subtotal : subtotal.plus(totalTaxFee);
|
|
46
|
+
const originTotal = (shopInfo == null ? void 0 : shopInfo.is_price_include_tax) ? subOriginTotal : subOriginTotal.plus(totalTaxFee);
|
|
44
47
|
const deposit = calculateDeposit(items);
|
|
45
48
|
return {
|
|
46
49
|
subtotal: subtotal.toFixed(2),
|
|
47
50
|
total: total.toFixed(2),
|
|
51
|
+
originTotal: originTotal.toFixed(2),
|
|
48
52
|
taxTitle: shopInfo == null ? void 0 : shopInfo.tax_title,
|
|
49
53
|
totalTaxFee: totalTaxFee.toFixed(2),
|
|
50
54
|
isPriceIncludeTax: shopInfo == null ? void 0 : shopInfo.is_price_include_tax,
|
|
@@ -83,6 +87,16 @@ var calculateSubtotal = (items) => {
|
|
|
83
87
|
}, new import_decimal.default(0));
|
|
84
88
|
return subtotal.toFixed(2);
|
|
85
89
|
};
|
|
90
|
+
var calculateOriginSubtotal = (items) => {
|
|
91
|
+
if (!(items == null ? void 0 : items.length)) {
|
|
92
|
+
return "0.00";
|
|
93
|
+
}
|
|
94
|
+
const subtotal = items.reduce((sum, item) => {
|
|
95
|
+
const cartItemTotalPrice = new import_decimal.default(item.summaryOriginTotal || 0);
|
|
96
|
+
return sum.plus(cartItemTotalPrice);
|
|
97
|
+
}, new import_decimal.default(0));
|
|
98
|
+
return subtotal.toFixed(2);
|
|
99
|
+
};
|
|
86
100
|
var calculateTaxFee = (shopInfo, items) => {
|
|
87
101
|
if (!(items == null ? void 0 : items.length)) {
|
|
88
102
|
return "0.00";
|
|
@@ -124,6 +138,7 @@ var calculateDeposit = (items) => {
|
|
|
124
138
|
// Annotate the CommonJS export names for ESM import in node:
|
|
125
139
|
0 && (module.exports = {
|
|
126
140
|
calculateDeposit,
|
|
141
|
+
calculateOriginSubtotal,
|
|
127
142
|
calculatePriceDetails,
|
|
128
143
|
calculateSubtotal,
|
|
129
144
|
calculateTaxFee,
|
package/lib/plugins/window.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WalletPassEvaluator } from '../model';
|
|
1
2
|
import { Plugin } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* WindowPlugin 接口定义
|
|
@@ -14,6 +15,7 @@ export interface WindowPlugin extends Plugin {
|
|
|
14
15
|
document: Partial<Document>;
|
|
15
16
|
history: History;
|
|
16
17
|
interaction?: any;
|
|
18
|
+
getWalletPassEvaluator?: () => WalletPassEvaluator;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* 简单的 Storage 接口实现
|
|
@@ -144,6 +144,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
144
144
|
getSummary(): Promise<{
|
|
145
145
|
subtotal: string | number;
|
|
146
146
|
total: string | number;
|
|
147
|
+
originTotal: string | number;
|
|
147
148
|
taxTitle?: string | undefined;
|
|
148
149
|
totalTaxFee?: string | number | undefined;
|
|
149
150
|
isPriceIncludeTax?: 0 | 1 | undefined;
|
|
@@ -224,6 +224,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
224
224
|
product_id: item.product_id,
|
|
225
225
|
product_variant_id: item.product_variant_id,
|
|
226
226
|
quantity: item.num,
|
|
227
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
227
228
|
// 商品是否含税:1;0
|
|
228
229
|
is_charge_tax: item.is_charge_tax ?? 0,
|
|
229
230
|
// 若商品不含税,计算得到的税费,单位(元)
|
|
@@ -248,6 +249,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
248
249
|
},
|
|
249
250
|
product_bundle: item.product_bundle.map((bundle) => {
|
|
250
251
|
return {
|
|
252
|
+
is_price_include_tax: item.is_price_include_tax,
|
|
251
253
|
bundle_id: bundle.bundle_id,
|
|
252
254
|
bundle_product_id: bundle.bundle_product_id,
|
|
253
255
|
bundle_variant_id: bundle.bundle_variant_id,
|
|
@@ -1212,10 +1214,8 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
|
|
|
1212
1214
|
voucherPaymentItems,
|
|
1213
1215
|
savedVoucherPaymentItems
|
|
1214
1216
|
});
|
|
1215
|
-
if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0)
|
|
1216
|
-
this.updateStateAmountToRemaining(false);
|
|
1217
|
+
if ((savedVoucherPaymentItems == null ? void 0 : savedVoucherPaymentItems.length) === 0)
|
|
1217
1218
|
return;
|
|
1218
|
-
}
|
|
1219
1219
|
}
|
|
1220
1220
|
const allPaymentItemsSynced = paymentItems.every((item) => item.isSynced);
|
|
1221
1221
|
const remainingAmount = await this.calculateRemainingAmountAsync();
|
|
@@ -796,274 +796,10 @@ var webposConfig = {
|
|
|
796
796
|
})
|
|
797
797
|
}
|
|
798
798
|
};
|
|
799
|
-
var shopWebposConfig = {
|
|
800
|
-
sendEmailVerificationCode: {
|
|
801
|
-
url: "/auth/email/register-code",
|
|
802
|
-
method: "GET",
|
|
803
|
-
transformParams: (params) => ({
|
|
804
|
-
email: params.target
|
|
805
|
-
})
|
|
806
|
-
},
|
|
807
|
-
sendEmailLoginCode: {
|
|
808
|
-
url: "/auth/send-email-code",
|
|
809
|
-
method: "POST",
|
|
810
|
-
transformParams: (params) => ({
|
|
811
|
-
email: params.target,
|
|
812
|
-
purpose: params.purpose,
|
|
813
|
-
type: params.type
|
|
814
|
-
})
|
|
815
|
-
},
|
|
816
|
-
sendSmsRegisterCode: {
|
|
817
|
-
url: "/auth/mobile/sms-register",
|
|
818
|
-
method: "POST",
|
|
819
|
-
transformParams: (params) => ({
|
|
820
|
-
phone: String(params.phone),
|
|
821
|
-
country_calling_code: String(params.country_calling_code)
|
|
822
|
-
})
|
|
823
|
-
},
|
|
824
|
-
sendEmailRegisterLink: {
|
|
825
|
-
url: "/auth/email/link/new-send-register-link",
|
|
826
|
-
method: "POST",
|
|
827
|
-
transformParams: (email) => ({
|
|
828
|
-
email
|
|
829
|
-
})
|
|
830
|
-
},
|
|
831
|
-
verifyEmailRegistrationLink: {
|
|
832
|
-
url: "/auth/email/link/new-register",
|
|
833
|
-
method: "POST",
|
|
834
|
-
transformParams: (params) => ({
|
|
835
|
-
code: params.code,
|
|
836
|
-
password: params.password
|
|
837
|
-
})
|
|
838
|
-
},
|
|
839
|
-
emailPasswordLogin: {
|
|
840
|
-
url: "/tenant/auth/login/email",
|
|
841
|
-
method: "POST",
|
|
842
|
-
transformParams: (params) => ({
|
|
843
|
-
email: params.email,
|
|
844
|
-
password: params.password,
|
|
845
|
-
device: "webpos" + (/* @__PURE__ */ new Date()).getTime()
|
|
846
|
-
}),
|
|
847
|
-
options: (values) => ({
|
|
848
|
-
// withCredentials: true,
|
|
849
|
-
prefix: false,
|
|
850
|
-
cache: {
|
|
851
|
-
mode: "remote_local",
|
|
852
|
-
type: "indexDB",
|
|
853
|
-
cacheKeyData: values
|
|
854
|
-
}
|
|
855
|
-
})
|
|
856
|
-
},
|
|
857
|
-
emailCodeRegister: {
|
|
858
|
-
url: "/auth/email/register",
|
|
859
|
-
method: "POST",
|
|
860
|
-
transformParams: (params) => ({
|
|
861
|
-
email: params.email,
|
|
862
|
-
code: params.code,
|
|
863
|
-
password: params.password
|
|
864
|
-
})
|
|
865
|
-
},
|
|
866
|
-
phoneCodeRegister: {
|
|
867
|
-
url: "/auth/mobile/register",
|
|
868
|
-
method: "POST",
|
|
869
|
-
transformParams: (params) => ({
|
|
870
|
-
phone: String(params.phone),
|
|
871
|
-
password: params.password,
|
|
872
|
-
code: params.code,
|
|
873
|
-
country_calling_code: String(params.country_calling_code)
|
|
874
|
-
})
|
|
875
|
-
},
|
|
876
|
-
resendEmailRegisterLink: {
|
|
877
|
-
url: "/auth/email/link/resend_register_link",
|
|
878
|
-
method: "POST",
|
|
879
|
-
transformParams: (params) => ({
|
|
880
|
-
code: params.code
|
|
881
|
-
})
|
|
882
|
-
},
|
|
883
|
-
checkEmailLinkCode: {
|
|
884
|
-
url: "/auth/email/link/new-register-check-code",
|
|
885
|
-
method: "GET",
|
|
886
|
-
transformParams: (params) => ({
|
|
887
|
-
code: params.code
|
|
888
|
-
})
|
|
889
|
-
},
|
|
890
|
-
sendSmsLoginCode: {
|
|
891
|
-
url: "/auth/send-login-msg",
|
|
892
|
-
method: "POST",
|
|
893
|
-
transformParams: (params) => ({
|
|
894
|
-
phone: String(params.phone),
|
|
895
|
-
country_calling_code: String(params.country_calling_code)
|
|
896
|
-
})
|
|
897
|
-
},
|
|
898
|
-
phoneCodeLogin: {
|
|
899
|
-
url: "/auth/mobile-login",
|
|
900
|
-
method: "POST",
|
|
901
|
-
transformParams: (params) => ({
|
|
902
|
-
phone: String(params.phone),
|
|
903
|
-
country_calling_code: String(params.country_calling_code),
|
|
904
|
-
code: params.code
|
|
905
|
-
})
|
|
906
|
-
},
|
|
907
|
-
guestLogin: {
|
|
908
|
-
url: "/auth/guest/login",
|
|
909
|
-
method: "POST",
|
|
910
|
-
transformParams: (params) => ({
|
|
911
|
-
login_channel: params.login_channel,
|
|
912
|
-
guest_code: params.guest_code
|
|
913
|
-
})
|
|
914
|
-
},
|
|
915
|
-
checkEmailExists: {
|
|
916
|
-
url: "/auth/email/check-email",
|
|
917
|
-
method: "GET",
|
|
918
|
-
transformParams: (params) => ({
|
|
919
|
-
email: params.email,
|
|
920
|
-
sales_channel: "online_store"
|
|
921
|
-
})
|
|
922
|
-
},
|
|
923
|
-
checkEmailCode: {
|
|
924
|
-
url: "/auth/email/check-email-code",
|
|
925
|
-
method: "GET",
|
|
926
|
-
transformParams: (params) => ({
|
|
927
|
-
email: params.email,
|
|
928
|
-
code: params.code,
|
|
929
|
-
action: params.action
|
|
930
|
-
})
|
|
931
|
-
},
|
|
932
|
-
checkMobileCode: {
|
|
933
|
-
url: "/auth/mobile/check-mobile-code",
|
|
934
|
-
method: "GET",
|
|
935
|
-
transformParams: (params) => ({
|
|
936
|
-
phone: String(params.phone),
|
|
937
|
-
code: params.code,
|
|
938
|
-
country_calling_code: String(params.country_calling_code),
|
|
939
|
-
action: params.action
|
|
940
|
-
})
|
|
941
|
-
},
|
|
942
|
-
phonePasswordLogin: {
|
|
943
|
-
url: "/auth/mobile/login",
|
|
944
|
-
method: "POST",
|
|
945
|
-
transformParams: (params) => ({
|
|
946
|
-
phone: String(params.phone),
|
|
947
|
-
password: params.password,
|
|
948
|
-
country_calling_code: String(params.country_calling_code)
|
|
949
|
-
})
|
|
950
|
-
},
|
|
951
|
-
sendPasswordResetEmail: {
|
|
952
|
-
url: "/auth/email/reset-password-code",
|
|
953
|
-
method: "GET",
|
|
954
|
-
transformParams: (params) => ({
|
|
955
|
-
email: params.email
|
|
956
|
-
})
|
|
957
|
-
},
|
|
958
|
-
sendPasswordResetSms: {
|
|
959
|
-
url: "/auth/mobile/sms-forget",
|
|
960
|
-
method: "POST",
|
|
961
|
-
transformParams: (params) => ({
|
|
962
|
-
phone: String(params.phone),
|
|
963
|
-
country_calling_code: String(params.country_calling_code)
|
|
964
|
-
})
|
|
965
|
-
},
|
|
966
|
-
sendResetPasswordLink: {
|
|
967
|
-
url: "/auth/email/link/send_reset_pwd_link",
|
|
968
|
-
method: "POST",
|
|
969
|
-
transformParams: (params) => ({
|
|
970
|
-
email: params.email
|
|
971
|
-
})
|
|
972
|
-
},
|
|
973
|
-
checkResetPasswordCode: {
|
|
974
|
-
url: "/auth/email/link/check_code",
|
|
975
|
-
method: "GET",
|
|
976
|
-
transformParams: (params) => ({
|
|
977
|
-
code: params.code
|
|
978
|
-
})
|
|
979
|
-
},
|
|
980
|
-
resetPasswordByCode: {
|
|
981
|
-
url: "/auth/email/link/reset_pwd_by_code",
|
|
982
|
-
method: "POST",
|
|
983
|
-
transformParams: (params) => ({
|
|
984
|
-
code: params.code,
|
|
985
|
-
password: params.password
|
|
986
|
-
})
|
|
987
|
-
},
|
|
988
|
-
resetPasswordByEmail: {
|
|
989
|
-
url: "/auth/email/reset-password",
|
|
990
|
-
method: "POST",
|
|
991
|
-
transformParams: (params) => ({
|
|
992
|
-
email: params.email,
|
|
993
|
-
password: params.password,
|
|
994
|
-
code: params.code
|
|
995
|
-
})
|
|
996
|
-
},
|
|
997
|
-
resetPasswordByPhone: {
|
|
998
|
-
url: "/auth/mobile/reset-password",
|
|
999
|
-
method: "POST",
|
|
1000
|
-
transformParams: (params) => ({
|
|
1001
|
-
phone: String(params.phone),
|
|
1002
|
-
password: params.password,
|
|
1003
|
-
code: params.code,
|
|
1004
|
-
country_calling_code: String(params.country_calling_code)
|
|
1005
|
-
})
|
|
1006
|
-
},
|
|
1007
|
-
verifyCode: {
|
|
1008
|
-
url: "/auth/verify-code",
|
|
1009
|
-
method: "POST",
|
|
1010
|
-
transformParams: (params) => params
|
|
1011
|
-
},
|
|
1012
|
-
register: {
|
|
1013
|
-
url: "/auth/register",
|
|
1014
|
-
method: "POST",
|
|
1015
|
-
transformParams: (params) => params
|
|
1016
|
-
},
|
|
1017
|
-
login: {
|
|
1018
|
-
url: "/auth/login",
|
|
1019
|
-
method: "POST",
|
|
1020
|
-
transformParams: (params) => params
|
|
1021
|
-
},
|
|
1022
|
-
oauthLogin: {
|
|
1023
|
-
url: "/auth/oauth-login",
|
|
1024
|
-
method: "POST",
|
|
1025
|
-
transformParams: (params) => params
|
|
1026
|
-
},
|
|
1027
|
-
validateToken: {
|
|
1028
|
-
url: "/auth/validate",
|
|
1029
|
-
method: "GET",
|
|
1030
|
-
transformParams: (token) => ({}),
|
|
1031
|
-
options: {
|
|
1032
|
-
headers: (token) => ({
|
|
1033
|
-
Authorization: `Bearer ${token}`
|
|
1034
|
-
})
|
|
1035
|
-
}
|
|
1036
|
-
},
|
|
1037
|
-
logout: {
|
|
1038
|
-
url: "/auth/logout",
|
|
1039
|
-
method: "POST",
|
|
1040
|
-
transformParams: () => ({})
|
|
1041
|
-
},
|
|
1042
|
-
getCountries: {
|
|
1043
|
-
url: "/area/country",
|
|
1044
|
-
method: "GET",
|
|
1045
|
-
transformParams: () => ({})
|
|
1046
|
-
},
|
|
1047
|
-
facebookLogin: {
|
|
1048
|
-
url: "/auth/facebook/login",
|
|
1049
|
-
method: "POST",
|
|
1050
|
-
transformParams: (params) => ({
|
|
1051
|
-
token: params.token
|
|
1052
|
-
})
|
|
1053
|
-
},
|
|
1054
|
-
appleLogin: {
|
|
1055
|
-
url: "/auth/apple/login",
|
|
1056
|
-
method: "POST",
|
|
1057
|
-
transformParams: (params) => ({
|
|
1058
|
-
code: params.code
|
|
1059
|
-
})
|
|
1060
|
-
}
|
|
1061
|
-
};
|
|
1062
799
|
var channelConfigMap = {
|
|
1063
800
|
"online-store": onlineStoreConfig,
|
|
1064
801
|
"default": defaultConfig,
|
|
1065
|
-
"webpos": webposConfig
|
|
1066
|
-
"shop.webpos": shopWebposConfig
|
|
802
|
+
"webpos": webposConfig
|
|
1067
803
|
};
|
|
1068
804
|
function getChannelConfig(channel) {
|
|
1069
805
|
return channelConfigMap[channel] || channelConfigMap["default"];
|
|
@@ -21,6 +21,7 @@ export declare class ShopDiscountImpl extends BaseModule implements Module {
|
|
|
21
21
|
getCurrentBookingTime(): string | null;
|
|
22
22
|
private filterDiscountListByBookingTime;
|
|
23
23
|
setCustomer(customer: Customer): Promise<void>;
|
|
24
|
+
setOriginTotalAmount(amount: number): void;
|
|
24
25
|
setHolders(holders: {
|
|
25
26
|
form_record_id: number;
|
|
26
27
|
}[]): void;
|
|
@@ -55,7 +55,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
55
55
|
originalDiscountList: [],
|
|
56
56
|
currentBookingTime: "",
|
|
57
57
|
filteredDiscountList: [],
|
|
58
|
-
bookingSubject: void 0
|
|
58
|
+
bookingSubject: void 0,
|
|
59
|
+
orderTotalAmount: 0
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
// =========== 生命周期方法 ===========
|
|
@@ -193,6 +194,9 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
193
194
|
);
|
|
194
195
|
}
|
|
195
196
|
}
|
|
197
|
+
setOriginTotalAmount(amount) {
|
|
198
|
+
this.store.orderTotalAmount = amount;
|
|
199
|
+
}
|
|
196
200
|
// 设置holders
|
|
197
201
|
setHolders(holders) {
|
|
198
202
|
this.store.holders = holders;
|
|
@@ -212,6 +216,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
212
216
|
{
|
|
213
217
|
productList,
|
|
214
218
|
discountList: this.getDiscountList(),
|
|
219
|
+
orderTotalAmount: this.store.orderTotalAmount || 0,
|
|
215
220
|
holders: this.store.holders || [],
|
|
216
221
|
isFormSubject: ((_a = this.store.bookingSubject) == null ? void 0 : _a.type) === "form"
|
|
217
222
|
},
|
|
@@ -304,7 +309,8 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
304
309
|
oldDiscountList: this.getDiscountList(),
|
|
305
310
|
newDiscountList: withScanList,
|
|
306
311
|
holders: this.store.holders || [],
|
|
307
|
-
isFormSubject: ((_b = this.store.bookingSubject) == null ? void 0 : _b.type) === "form"
|
|
312
|
+
isFormSubject: ((_b = this.store.bookingSubject) == null ? void 0 : _b.type) === "form",
|
|
313
|
+
orderTotalAmount: this.store.orderTotalAmount || 0
|
|
308
314
|
}) || {
|
|
309
315
|
isAvailable: false,
|
|
310
316
|
productList: this.store.productList || [],
|