@pisell/pisellos 2.1.60 → 2.1.61
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 +0 -1
- package/dist/index.js +0 -1
- package/dist/modules/Cart/types.d.ts +0 -2
- package/dist/modules/Cart/utils/cartProduct.js +0 -11
- package/dist/modules/Customer/index.js +1 -1
- package/dist/modules/Discount/types.d.ts +0 -15
- package/dist/modules/Payment/index.d.ts +1 -2
- package/dist/modules/Payment/index.js +7 -10
- package/dist/modules/Payment/utils.js +0 -3
- package/dist/modules/Payment/walletpass.d.ts +0 -23
- package/dist/modules/Payment/walletpass.js +95 -191
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Rules/index.d.ts +3 -8
- package/dist/modules/Rules/index.js +28 -158
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/Summary/types.d.ts +0 -2
- package/dist/modules/Summary/utils.d.ts +0 -6
- package/dist/modules/Summary/utils.js +0 -21
- package/dist/plugins/window.d.ts +0 -2
- package/dist/solution/BookingByStep/index.d.ts +0 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/Checkout/index.js +0 -2
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +1 -11
- package/dist/solution/ShopDiscount/types.d.ts +0 -1
- package/dist/solution/ShopDiscount/utils.js +11 -26
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/modules/Cart/types.d.ts +0 -2
- package/lib/modules/Cart/utils/cartProduct.js +0 -9
- package/lib/modules/Customer/index.js +1 -1
- package/lib/modules/Discount/types.d.ts +0 -15
- package/lib/modules/Payment/index.d.ts +1 -2
- package/lib/modules/Payment/index.js +0 -1
- package/lib/modules/Payment/utils.js +0 -3
- package/lib/modules/Payment/walletpass.d.ts +0 -23
- package/lib/modules/Payment/walletpass.js +17 -94
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Rules/index.d.ts +3 -8
- package/lib/modules/Rules/index.js +191 -373
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/Summary/types.d.ts +0 -2
- package/lib/modules/Summary/utils.d.ts +0 -6
- package/lib/modules/Summary/utils.js +0 -15
- package/lib/plugins/window.d.ts +0 -2
- package/lib/solution/BookingByStep/index.d.ts +0 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +6 -0
- package/lib/solution/Checkout/index.js +0 -2
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +0 -6
- package/lib/solution/ShopDiscount/types.d.ts +0 -1
- package/lib/solution/ShopDiscount/utils.js +6 -10
- package/package.json +1 -1
- package/dist/model/index.d.ts +0 -1
- package/dist/model/index.js +0 -1
- package/dist/model/strategy/adapter/index.d.ts +0 -3
- package/dist/model/strategy/adapter/index.js +0 -4
- package/dist/model/strategy/adapter/type.d.ts +0 -28
- package/dist/model/strategy/adapter/type.js +0 -1
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -496
- package/dist/model/strategy/adapter/walletPass/example.d.ts +0 -4
- package/dist/model/strategy/adapter/walletPass/example.js +0 -258
- package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
- package/dist/model/strategy/adapter/walletPass/index.js +0 -182
- package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
- package/dist/model/strategy/adapter/walletPass/locales.js +0 -23
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -163
- package/dist/model/strategy/adapter/walletPass/type.js +0 -1
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
- package/dist/model/strategy/adapter/walletPass/utils.js +0 -965
- package/dist/model/strategy/index.d.ts +0 -94
- package/dist/model/strategy/index.js +0 -551
- package/dist/model/strategy/strategy-example.d.ts +0 -5
- package/dist/model/strategy/strategy-example.js +0 -331
- package/dist/model/strategy/type.d.ts +0 -228
- package/dist/model/strategy/type.js +0 -94
- package/lib/model/index.d.ts +0 -1
- package/lib/model/index.js +0 -23
- package/lib/model/strategy/adapter/index.d.ts +0 -3
- package/lib/model/strategy/adapter/index.js +0 -45
- package/lib/model/strategy/adapter/type.d.ts +0 -28
- package/lib/model/strategy/adapter/type.js +0 -17
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
- package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -420
- package/lib/model/strategy/adapter/walletPass/example.d.ts +0 -4
- package/lib/model/strategy/adapter/walletPass/example.js +0 -207
- package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
- package/lib/model/strategy/adapter/walletPass/index.js +0 -142
- package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
- package/lib/model/strategy/adapter/walletPass/locales.js +0 -51
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -163
- package/lib/model/strategy/adapter/walletPass/type.js +0 -17
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
- package/lib/model/strategy/adapter/walletPass/utils.js +0 -660
- package/lib/model/strategy/index.d.ts +0 -94
- package/lib/model/strategy/index.js +0 -413
- package/lib/model/strategy/strategy-example.d.ts +0 -5
- package/lib/model/strategy/strategy-example.js +0 -318
- package/lib/model/strategy/type.d.ts +0 -228
- package/lib/model/strategy/type.js +0 -44
package/lib/index.js
CHANGED
|
@@ -38,7 +38,6 @@ __reExport(src_exports, require("./types"), module.exports);
|
|
|
38
38
|
__reExport(src_exports, require("./modules"), module.exports);
|
|
39
39
|
__reExport(src_exports, require("./plugins"), module.exports);
|
|
40
40
|
__reExport(src_exports, require("./solution"), module.exports);
|
|
41
|
-
__reExport(src_exports, require("./model"), module.exports);
|
|
42
41
|
var import_core = require("./core");
|
|
43
42
|
var import_core2 = __toESM(require("./core"));
|
|
44
43
|
var src_default = import_core2.default;
|
|
@@ -48,6 +47,5 @@ var src_default = import_core2.default;
|
|
|
48
47
|
...require("./types"),
|
|
49
48
|
...require("./modules"),
|
|
50
49
|
...require("./plugins"),
|
|
51
|
-
...require("./solution")
|
|
52
|
-
...require("./model")
|
|
50
|
+
...require("./solution")
|
|
53
51
|
});
|
|
@@ -88,14 +88,6 @@ var formatProductToCartItem = (params) => {
|
|
|
88
88
|
num,
|
|
89
89
|
discounts
|
|
90
90
|
});
|
|
91
|
-
const origin_total = getProductTotalPrice({
|
|
92
|
-
product: cartItem._productInit || cartItem._productOrigin,
|
|
93
|
-
bundle,
|
|
94
|
-
options,
|
|
95
|
-
num,
|
|
96
|
-
discounts: []
|
|
97
|
-
});
|
|
98
|
-
cartItem.summaryOriginTotal = (origin_total || 0) * (num || 1);
|
|
99
91
|
cartItem.image = product == null ? void 0 : product.cover;
|
|
100
92
|
cartItem.like_status = "common";
|
|
101
93
|
cartItem.duration = product == null ? void 0 : product.duration;
|
|
@@ -186,7 +178,6 @@ var getProductTotalPrice = (params) => {
|
|
|
186
178
|
price = (0, import_utils2.getDiscountAmount)({
|
|
187
179
|
tag: currentValue.type,
|
|
188
180
|
par_value: currentValue.discount.percent,
|
|
189
|
-
config: currentValue.config,
|
|
190
181
|
metadata: {
|
|
191
182
|
discount_card_type: (_a = currentValue == null ? void 0 : currentValue.discount) == null ? void 0 : _a.discount_card_type
|
|
192
183
|
}
|
|
@@ -101,7 +101,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
101
101
|
skip,
|
|
102
102
|
num,
|
|
103
103
|
sort_by: import_constants.SORT_BY,
|
|
104
|
-
with: ["latestWalletDetail.wallet", "contactsInfo"],
|
|
104
|
+
with: ["latestWalletDetail.wallet", "contactsInfo", "formRecord"],
|
|
105
105
|
search_wallet_flag: 1,
|
|
106
106
|
search_wallet_pass_flag: 1,
|
|
107
107
|
...search && { search },
|
|
@@ -25,8 +25,6 @@ interface Limitedrelationproductdata {
|
|
|
25
25
|
product_ids: number[];
|
|
26
26
|
product_collection_id: number[];
|
|
27
27
|
package_sub_item_usage_rules?: PackageSubItemUsageRules;
|
|
28
|
-
filter: 0 | 1;
|
|
29
|
-
exclude_product_ids: number[];
|
|
30
28
|
}
|
|
31
29
|
interface ApplicableProductDetails {
|
|
32
30
|
amount: string;
|
|
@@ -98,19 +96,6 @@ export interface Discount {
|
|
|
98
96
|
isSelected?: boolean;
|
|
99
97
|
isAvailable?: boolean;
|
|
100
98
|
isUsed?: boolean;
|
|
101
|
-
config?: {
|
|
102
|
-
isAvailable?: boolean;
|
|
103
|
-
/** 最大抵扣金额 */
|
|
104
|
-
maxDeductionAmount?: number;
|
|
105
|
-
/** 每单最多使用张数 */
|
|
106
|
-
maxUsagePerOrder?: number;
|
|
107
|
-
/** 是否抵扣税费与附加费 */
|
|
108
|
-
deductTaxAndFee?: boolean;
|
|
109
|
-
/** 适用粒度(多商品共用) */
|
|
110
|
-
allowCrossProduct?: boolean;
|
|
111
|
-
/** 可用商品数量上限 */
|
|
112
|
-
applicableProductLimit?: number;
|
|
113
|
-
};
|
|
114
99
|
applicableProductIds?: number[];
|
|
115
100
|
applicableProductDetails: ApplicableProductDetails[];
|
|
116
101
|
appliedProductDetails: ApplicableProductDetails[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
|
-
import { RequestPlugin
|
|
2
|
+
import { RequestPlugin } from '../../plugins';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
4
|
import { PaymentModuleAPI, PaymentMethod, PaymentOrder, PaymentItem, PaymentItemInput, PaymentUpdateFields, PushOrderParams, CashPayment, EftposPayment, WalletPassPayment, RoundingRule, RoundingInterval, RoundingResult } from './types';
|
|
5
5
|
export * from './types';
|
|
@@ -21,7 +21,6 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
|
|
|
21
21
|
request: RequestPlugin;
|
|
22
22
|
private app;
|
|
23
23
|
private store;
|
|
24
|
-
window: WindowPlugin;
|
|
25
24
|
private dbManager;
|
|
26
25
|
private logger;
|
|
27
26
|
protected otherParams: any;
|
|
@@ -70,7 +70,6 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
70
70
|
this.otherParams = options.otherParams || {};
|
|
71
71
|
this.request = core.getPlugin("request");
|
|
72
72
|
const appPlugin = core.getPlugin("app");
|
|
73
|
-
this.window = core.getPlugin("window");
|
|
74
73
|
if (!this.request) {
|
|
75
74
|
throw new Error("支付模块需要 request 插件支持");
|
|
76
75
|
}
|
|
@@ -25,9 +25,6 @@ __export(utils_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(utils_exports);
|
|
27
27
|
var getAvailableMaxAmount = (data) => {
|
|
28
|
-
if (typeof data._available_max_amount === "number") {
|
|
29
|
-
return data._available_max_amount;
|
|
30
|
-
}
|
|
31
28
|
return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
|
|
32
29
|
};
|
|
33
30
|
var formatWalletPassList2PreparePayments = (list) => {
|
|
@@ -9,7 +9,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
9
9
|
private userIdentificationCodes;
|
|
10
10
|
private searchResults;
|
|
11
11
|
private walletParams;
|
|
12
|
-
private walletInitData;
|
|
13
12
|
constructor(paymentModule: PaymentModule);
|
|
14
13
|
/**
|
|
15
14
|
* 发送事件的辅助方法
|
|
@@ -38,14 +37,7 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
38
37
|
initializeWalletDataFromBusinessAsync(businessData: WalletInitBusinessData): Promise<{
|
|
39
38
|
walletRecommendList: WalletRecommendItem[];
|
|
40
39
|
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
41
|
-
transformList: any[];
|
|
42
|
-
noApplicableVoucher: any[];
|
|
43
|
-
products: any[];
|
|
44
40
|
}>;
|
|
45
|
-
/**
|
|
46
|
-
* 获取订单基础详情
|
|
47
|
-
*/
|
|
48
|
-
getOrderBasicDetailAsync(orderId: string): Promise<any>;
|
|
49
41
|
/**
|
|
50
42
|
* 初始化钱包数据
|
|
51
43
|
* 先获取推荐列表,再获取用户识别码列表(顺序执行)
|
|
@@ -53,9 +45,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
53
45
|
initializeWalletDataAsync(baseParams: WalletDeductionRecommendParams): Promise<{
|
|
54
46
|
walletRecommendList: WalletRecommendItem[];
|
|
55
47
|
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
56
|
-
transformList: any[];
|
|
57
|
-
noApplicableVoucher: any[];
|
|
58
|
-
products: any[];
|
|
59
48
|
}>;
|
|
60
49
|
getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
|
|
61
50
|
formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
|
|
@@ -103,18 +92,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
|
103
92
|
* 清除搜索结果缓存
|
|
104
93
|
*/
|
|
105
94
|
clearSearchResults(): void;
|
|
106
|
-
/**
|
|
107
|
-
* 获取存储的钱包初始化数据
|
|
108
|
-
*/
|
|
109
|
-
getStoredWalletInitData(): {
|
|
110
|
-
transformList: any[];
|
|
111
|
-
noApplicableVoucher: any[];
|
|
112
|
-
products: any[];
|
|
113
|
-
} | null;
|
|
114
|
-
/**
|
|
115
|
-
* 清除存储的钱包初始化数据
|
|
116
|
-
*/
|
|
117
|
-
clearStoredWalletInitData(): void;
|
|
118
95
|
/**
|
|
119
96
|
* 清除所有缓存数据
|
|
120
97
|
*/
|
|
@@ -31,7 +31,6 @@ var WalletPassPaymentImpl = class {
|
|
|
31
31
|
this.userIdentificationCodes = [];
|
|
32
32
|
this.searchResults = [];
|
|
33
33
|
this.walletParams = null;
|
|
34
|
-
this.walletInitData = null;
|
|
35
34
|
}
|
|
36
35
|
/**
|
|
37
36
|
* 发送事件的辅助方法
|
|
@@ -43,9 +42,7 @@ var WalletPassPaymentImpl = class {
|
|
|
43
42
|
const fullEventName = `${this.paymentModule.name}:${eventName}`;
|
|
44
43
|
this.paymentModule.core.effects.emit(fullEventName, data);
|
|
45
44
|
} catch (error) {
|
|
46
|
-
this.paymentModule.logError("[WalletPass] 发送事件失败", error, {
|
|
47
|
-
hook
|
|
48
|
-
});
|
|
45
|
+
this.paymentModule.logError("[WalletPass] 发送事件失败", error, { hook });
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
/**
|
|
@@ -115,10 +112,7 @@ var WalletPassPaymentImpl = class {
|
|
|
115
112
|
if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0) {
|
|
116
113
|
return {
|
|
117
114
|
walletRecommendList: [],
|
|
118
|
-
userIdentificationCodes: []
|
|
119
|
-
transformList: [],
|
|
120
|
-
noApplicableVoucher: [],
|
|
121
|
-
products: []
|
|
115
|
+
userIdentificationCodes: []
|
|
122
116
|
};
|
|
123
117
|
}
|
|
124
118
|
this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationStarted, {
|
|
@@ -159,28 +153,11 @@ var WalletPassPaymentImpl = class {
|
|
|
159
153
|
endTime,
|
|
160
154
|
duration
|
|
161
155
|
});
|
|
162
|
-
this.paymentModule.logError(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
customer_id: businessData.customer_id,
|
|
168
|
-
totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
throw error;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* 获取订单基础详情
|
|
176
|
-
*/
|
|
177
|
-
async getOrderBasicDetailAsync(orderId) {
|
|
178
|
-
try {
|
|
179
|
-
const response = await this.paymentModule.request.get(
|
|
180
|
-
`/order/order/${orderId}/basic-detail`
|
|
181
|
-
);
|
|
182
|
-
return (response == null ? void 0 : response.data) || {};
|
|
183
|
-
} catch (error) {
|
|
156
|
+
this.paymentModule.logError(`[WalletPass] 从业务数据初始化钱包数据失败`, error, {
|
|
157
|
+
duration: `${duration}ms`,
|
|
158
|
+
customer_id: businessData.customer_id,
|
|
159
|
+
totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
|
|
160
|
+
});
|
|
184
161
|
throw error;
|
|
185
162
|
}
|
|
186
163
|
}
|
|
@@ -189,49 +166,19 @@ var WalletPassPaymentImpl = class {
|
|
|
189
166
|
* 先获取推荐列表,再获取用户识别码列表(顺序执行)
|
|
190
167
|
*/
|
|
191
168
|
async initializeWalletDataAsync(baseParams) {
|
|
192
|
-
var _a, _b;
|
|
193
169
|
try {
|
|
170
|
+
const walletRecommendList = await this.getWalletPassRecommendListAsync(baseParams);
|
|
194
171
|
const identificationParams = {
|
|
195
172
|
...baseParams,
|
|
196
173
|
available: 2,
|
|
197
|
-
prepare_payments:
|
|
174
|
+
prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
|
|
198
175
|
other_exact_codes: [],
|
|
199
176
|
filter_prepare_wallet_pass: 1
|
|
200
177
|
};
|
|
201
|
-
const
|
|
202
|
-
this.getUserIdentificationCodeListAsync(identificationParams),
|
|
203
|
-
baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)
|
|
204
|
-
]);
|
|
205
|
-
const walletPassEvaluator = (_b = (_a = this.paymentModule.window) == null ? void 0 : _a.getWalletPassEvaluator) == null ? void 0 : _b.call(_a);
|
|
206
|
-
if (!walletPassEvaluator) {
|
|
207
|
-
return {
|
|
208
|
-
walletRecommendList: [],
|
|
209
|
-
userIdentificationCodes: [],
|
|
210
|
-
transformList: [],
|
|
211
|
-
noApplicableVoucher: [],
|
|
212
|
-
products: []
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
const products = (orderBasicDetail == null ? void 0 : orderBasicDetail.detail) || baseParams.products;
|
|
216
|
-
const res = walletPassEvaluator == null ? void 0 : walletPassEvaluator.getRecommendedVouchers({
|
|
217
|
-
orderTotalAmount: baseParams.order_wait_pay_amount,
|
|
218
|
-
products,
|
|
219
|
-
vouchers: allList
|
|
220
|
-
});
|
|
221
|
-
const { recommended, transformList, noApplicableVoucher, recommendedAmount } = res;
|
|
222
|
-
console.log(res, "resres12");
|
|
223
|
-
this.walletRecommendList = recommended;
|
|
224
|
-
this.walletInitData = {
|
|
225
|
-
transformList,
|
|
226
|
-
noApplicableVoucher,
|
|
227
|
-
products: products || []
|
|
228
|
-
};
|
|
178
|
+
const userIdentificationCodes = await this.getUserIdentificationCodeListAsync(identificationParams);
|
|
229
179
|
return {
|
|
230
|
-
walletRecommendList
|
|
231
|
-
userIdentificationCodes
|
|
232
|
-
transformList,
|
|
233
|
-
noApplicableVoucher,
|
|
234
|
-
products: products || []
|
|
180
|
+
walletRecommendList,
|
|
181
|
+
userIdentificationCodes
|
|
235
182
|
};
|
|
236
183
|
} catch (error) {
|
|
237
184
|
this.paymentModule.logError("[WalletPass] 初始化钱包数据失败", error, {
|
|
@@ -314,14 +261,10 @@ var WalletPassPaymentImpl = class {
|
|
|
314
261
|
});
|
|
315
262
|
return this.userIdentificationCodes;
|
|
316
263
|
} catch (error) {
|
|
317
|
-
this.paymentModule.logError(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
customer_id: params.customer_id,
|
|
322
|
-
available: params.available
|
|
323
|
-
}
|
|
324
|
-
);
|
|
264
|
+
this.paymentModule.logError("[WalletPass] 获取用户识别码列表失败", error, {
|
|
265
|
+
customer_id: params.customer_id,
|
|
266
|
+
available: params.available
|
|
267
|
+
});
|
|
325
268
|
return [];
|
|
326
269
|
}
|
|
327
270
|
}
|
|
@@ -519,19 +462,6 @@ var WalletPassPaymentImpl = class {
|
|
|
519
462
|
this.searchResults = [];
|
|
520
463
|
this.paymentModule.logInfo("[WalletPass] 搜索结果缓存已清除");
|
|
521
464
|
}
|
|
522
|
-
/**
|
|
523
|
-
* 获取存储的钱包初始化数据
|
|
524
|
-
*/
|
|
525
|
-
getStoredWalletInitData() {
|
|
526
|
-
return this.walletInitData;
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* 清除存储的钱包初始化数据
|
|
530
|
-
*/
|
|
531
|
-
clearStoredWalletInitData() {
|
|
532
|
-
this.walletInitData = null;
|
|
533
|
-
this.paymentModule.logInfo("[WalletPass] 钱包初始化数据已清除");
|
|
534
|
-
}
|
|
535
465
|
/**
|
|
536
466
|
* 清除所有缓存数据
|
|
537
467
|
*/
|
|
@@ -540,18 +470,11 @@ var WalletPassPaymentImpl = class {
|
|
|
540
470
|
this.userIdentificationCodes = [];
|
|
541
471
|
this.searchResults = [];
|
|
542
472
|
this.walletParams = null;
|
|
543
|
-
this.walletInitData = null;
|
|
544
473
|
this.emitEvent(import_types.WalletPassHooks.OnWalletCacheCleared, {
|
|
545
474
|
clearedTypes: ["all"]
|
|
546
475
|
});
|
|
547
476
|
this.paymentModule.logInfo("[WalletPass] 所有缓存数据已清除", {
|
|
548
|
-
cleared_types: [
|
|
549
|
-
"walletRecommendList",
|
|
550
|
-
"userIdentificationCodes",
|
|
551
|
-
"searchResults",
|
|
552
|
-
"walletParams",
|
|
553
|
-
"walletInitData"
|
|
554
|
-
]
|
|
477
|
+
cleared_types: ["walletRecommendList", "userIdentificationCodes", "searchResults", "walletParams"]
|
|
555
478
|
});
|
|
556
479
|
}
|
|
557
480
|
};
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -1,42 +1,37 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Rules, RulesModuleAPI, DiscountResult } from './types';
|
|
4
|
-
import { Discount } from
|
|
4
|
+
import { Discount } from "../Discount/types";
|
|
5
5
|
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
6
|
-
import { WindowPlugin } from '../../plugins';
|
|
7
6
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
8
7
|
protected defaultName: string;
|
|
9
8
|
protected defaultVersion: string;
|
|
10
9
|
private store;
|
|
11
|
-
window: WindowPlugin;
|
|
12
10
|
private hooks;
|
|
13
11
|
constructor(name?: string, version?: string);
|
|
14
12
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
15
13
|
setRulesList(rulesList: Rules[]): Promise<void>;
|
|
16
14
|
getRulesList(): Rules[];
|
|
17
|
-
getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
|
|
18
15
|
private checkHolderMatch;
|
|
19
|
-
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders,
|
|
16
|
+
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
|
|
20
17
|
oldDiscountList: Discount[];
|
|
21
18
|
newDiscountList: Discount[];
|
|
22
19
|
productList: any[];
|
|
23
20
|
holders: {
|
|
24
21
|
form_record_id: number;
|
|
25
22
|
}[];
|
|
26
|
-
orderTotalAmount: number;
|
|
27
23
|
isFormSubject: boolean;
|
|
28
24
|
}): {
|
|
29
25
|
isAvailable: boolean;
|
|
30
26
|
discountList: Discount[];
|
|
31
27
|
productList: any[];
|
|
32
28
|
};
|
|
33
|
-
calcDiscount({ discountList, productList, holders,
|
|
29
|
+
calcDiscount({ discountList, productList, holders, isFormSubject, }: {
|
|
34
30
|
discountList: Discount[];
|
|
35
31
|
productList: any[];
|
|
36
32
|
holders: {
|
|
37
33
|
form_record_id: number;
|
|
38
34
|
}[];
|
|
39
|
-
orderTotalAmount: number;
|
|
40
35
|
isFormSubject: boolean;
|
|
41
36
|
}, options?: {
|
|
42
37
|
isSelected?: boolean;
|