@pisell/pisellos 0.0.475 → 0.0.477
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/model/strategy/adapter/walletPass/type.d.ts +2 -2
- package/dist/model/strategy/adapter/walletPass/utils.js +4 -3
- package/dist/modules/Customer/index.d.ts +1 -0
- package/dist/modules/Customer/index.js +28 -12
- package/dist/modules/Rules/index.d.ts +1 -1
- package/dist/modules/Rules/index.js +8 -8
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/lib/model/strategy/adapter/walletPass/type.d.ts +2 -2
- package/lib/model/strategy/adapter/walletPass/utils.js +3 -3
- package/lib/modules/Customer/index.d.ts +1 -0
- package/lib/modules/Customer/index.js +21 -6
- package/lib/modules/Rules/index.d.ts +1 -1
- package/lib/modules/Rules/index.js +4 -4
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/package.json +3 -2
|
@@ -41,7 +41,7 @@ export interface Voucher {
|
|
|
41
41
|
allowCrossProduct: boolean;
|
|
42
42
|
/** 可用商品数量上限 (仅多商品) 默认为0,表示不限制商品数量。 */
|
|
43
43
|
applicableProductLimit: number;
|
|
44
|
-
/** 单商品可用卡券上限(同一 Wallet Pass
|
|
44
|
+
/** 单商品可用卡券上限(同一 Wallet Pass 商品生成的卡券对同一商品的每个 unit 最多抵扣次数,总上限 = maxPassesPerItem × quantity)。默认为 0,表示不限制。 */
|
|
45
45
|
maxPassesPerItem: number;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -132,7 +132,7 @@ export interface EvaluatorInput {
|
|
|
132
132
|
allowCrossProduct: boolean;
|
|
133
133
|
/** 可用商品数量上限 (仅多商品) 默认为0,表示不限制商品数量。 */
|
|
134
134
|
applicableProductLimit: number;
|
|
135
|
-
/** 单商品可用卡券上限(同一 Wallet Pass
|
|
135
|
+
/** 单商品可用卡券上限(同一 Wallet Pass 商品生成的卡券对同一商品的每个 unit 最多抵扣次数,总上限 = maxPassesPerItem × quantity)。默认为 0,表示不限制。 */
|
|
136
136
|
maxPassesPerItem: number;
|
|
137
137
|
}>[];
|
|
138
138
|
}
|
|
@@ -135,10 +135,11 @@ export function processVouchers(applicableVouchers, orderTotalAmount, products)
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
// 按 maxPassesPerItem 过滤商品:排除已达到单商品可用卡券上限的商品
|
|
138
|
+
// maxPassesPerItem 是 per-unit 的限制,总上限 = maxPassesPerItem × quantity
|
|
138
139
|
var filterByMaxPassesPerItem = function filterByMaxPassesPerItem(products, usageMap, walletPassProductId, maxPassesPerItem) {
|
|
139
140
|
if (maxPassesPerItem <= 0) return products; // 0 = 不限制
|
|
140
141
|
return products.filter(function (p) {
|
|
141
|
-
return getItemPassUsage(usageMap, walletPassProductId, p.product_id) < maxPassesPerItem;
|
|
142
|
+
return getItemPassUsage(usageMap, walletPassProductId, p.product_id) < maxPassesPerItem * getProductQuantity(p);
|
|
142
143
|
});
|
|
143
144
|
};
|
|
144
145
|
// ================================================================
|
|
@@ -287,7 +288,7 @@ export function processVouchers(applicableVouchers, orderTotalAmount, products)
|
|
|
287
288
|
var availableAfterPassLimit = getApplicableProducts(voucher, productsData).filter(function (p) {
|
|
288
289
|
return p[amountField].greaterThan(0);
|
|
289
290
|
}).filter(function (p) {
|
|
290
|
-
return getItemPassUsage(itemPassUsage, product_id, p.product_id) < maxPassesPerItem;
|
|
291
|
+
return getItemPassUsage(itemPassUsage, product_id, p.product_id) < maxPassesPerItem * getProductQuantity(p);
|
|
291
292
|
});
|
|
292
293
|
if (availableAfterPassLimit.length === 0) {
|
|
293
294
|
return {
|
|
@@ -627,7 +628,7 @@ export function recalculateVouchers(allVouchers, selectedVouchers, orderTotalAmo
|
|
|
627
628
|
var filterByMaxPassesPerItem = function filterByMaxPassesPerItem(products, walletPassProductId, maxPassesPerItem) {
|
|
628
629
|
if (maxPassesPerItem <= 0) return products; // 0 = 不限制
|
|
629
630
|
return products.filter(function (p) {
|
|
630
|
-
return getItemPassUsage(walletPassProductId, p.product_id) < maxPassesPerItem;
|
|
631
|
+
return getItemPassUsage(walletPassProductId, p.product_id) < maxPassesPerItem * getProductQuantity(p);
|
|
631
632
|
});
|
|
632
633
|
};
|
|
633
634
|
|
|
@@ -9,6 +9,7 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
9
9
|
private cacheId;
|
|
10
10
|
private openCache;
|
|
11
11
|
private fatherModule;
|
|
12
|
+
private otherParams;
|
|
12
13
|
constructor(name?: string, version?: string);
|
|
13
14
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
15
|
/**
|
|
@@ -56,6 +56,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
56
56
|
_defineProperty(_assertThisInitialized(_this), "cacheId", void 0);
|
|
57
57
|
_defineProperty(_assertThisInitialized(_this), "openCache", false);
|
|
58
58
|
_defineProperty(_assertThisInitialized(_this), "fatherModule", void 0);
|
|
59
|
+
_defineProperty(_assertThisInitialized(_this), "otherParams", {});
|
|
59
60
|
return _this;
|
|
60
61
|
}
|
|
61
62
|
_createClass(CustomerModule, [{
|
|
@@ -70,6 +71,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
70
71
|
this.core = core;
|
|
71
72
|
this.store = options === null || options === void 0 ? void 0 : options.store;
|
|
72
73
|
this.request = this.core.getPlugin('request');
|
|
74
|
+
this.otherParams = (options === null || options === void 0 ? void 0 : options.otherParams) || {};
|
|
73
75
|
|
|
74
76
|
// 初始化状态
|
|
75
77
|
if (Array.isArray(options === null || options === void 0 || (_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.customerList)) {
|
|
@@ -112,7 +114,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
112
114
|
if (options !== null && options !== void 0 && (_options$otherParams2 = options.otherParams) !== null && _options$otherParams2 !== void 0 && _options$otherParams2.fatherModule) {
|
|
113
115
|
this.fatherModule = options.otherParams.fatherModule;
|
|
114
116
|
}
|
|
115
|
-
case
|
|
117
|
+
case 14:
|
|
116
118
|
case "end":
|
|
117
119
|
return _context.stop();
|
|
118
120
|
}
|
|
@@ -132,7 +134,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
132
134
|
key: "fetchCustomerListData",
|
|
133
135
|
value: (function () {
|
|
134
136
|
var _fetchCustomerListData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
135
|
-
var _res$data, _res$data2;
|
|
137
|
+
var _this$otherParams, _res$data, _this$otherParams2, _customerList2, _res$data2;
|
|
136
138
|
var params,
|
|
137
139
|
url,
|
|
138
140
|
_params$skip,
|
|
@@ -140,16 +142,21 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
140
142
|
_params$num,
|
|
141
143
|
num,
|
|
142
144
|
search,
|
|
143
|
-
|
|
145
|
+
_otherParams,
|
|
144
146
|
queryParams,
|
|
145
147
|
res,
|
|
148
|
+
_customerList,
|
|
149
|
+
_customerList3,
|
|
146
150
|
_args2 = arguments;
|
|
147
151
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
148
152
|
while (1) switch (_context2.prev = _context2.next) {
|
|
149
153
|
case 0:
|
|
150
154
|
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
151
|
-
url = '/customer/select-list';
|
|
152
|
-
|
|
155
|
+
url = '/customer/select-list'; // 如果是加盟子店铺,则使用加盟商的客户列表接口
|
|
156
|
+
if ((_this$otherParams = this.otherParams) !== null && _this$otherParams !== void 0 && _this$otherParams.isFranchisee) {
|
|
157
|
+
url = '/franchisee/customer/select-list';
|
|
158
|
+
}
|
|
159
|
+
_params$skip = params.skip, skip = _params$skip === void 0 ? 1 : _params$skip, _params$num = params.num, num = _params$num === void 0 ? DEFAULT_PAGE_SIZE : _params$num, search = params.search, _otherParams = _objectWithoutProperties(params, _excluded);
|
|
153
160
|
queryParams = _objectSpread(_objectSpread({
|
|
154
161
|
skip: skip,
|
|
155
162
|
num: num,
|
|
@@ -159,29 +166,38 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
159
166
|
search_wallet_pass_flag: 1
|
|
160
167
|
}, search && {
|
|
161
168
|
search: search
|
|
162
|
-
}),
|
|
163
|
-
_context2.next =
|
|
169
|
+
}), _otherParams);
|
|
170
|
+
_context2.next = 7;
|
|
164
171
|
return this.request.get(url, queryParams, {
|
|
165
172
|
cache: {
|
|
166
173
|
mode: RequestModeENUM.REMOTE_LOCAL,
|
|
167
174
|
type: "indexDB"
|
|
168
175
|
}
|
|
169
176
|
});
|
|
170
|
-
case
|
|
177
|
+
case 7:
|
|
171
178
|
res = _context2.sent;
|
|
172
179
|
if (!((res === null || res === void 0 ? void 0 : res.code) !== 200)) {
|
|
173
|
-
_context2.next =
|
|
180
|
+
_context2.next = 10;
|
|
174
181
|
break;
|
|
175
182
|
}
|
|
176
183
|
throw new Error(res === null || res === void 0 ? void 0 : res.message);
|
|
177
|
-
case
|
|
184
|
+
case 10:
|
|
185
|
+
// 如果是加盟子店铺,查询的接口返回的数据都是总店的客户数据,需要加上标识
|
|
186
|
+
_customerList = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [];
|
|
187
|
+
if ((_this$otherParams2 = this.otherParams) !== null && _this$otherParams2 !== void 0 && _this$otherParams2.isFranchisee && ((_customerList2 = _customerList) === null || _customerList2 === void 0 ? void 0 : _customerList2.length) > 0) {
|
|
188
|
+
_customerList = (_customerList3 = _customerList) === null || _customerList3 === void 0 ? void 0 : _customerList3.map(function (item) {
|
|
189
|
+
return _objectSpread(_objectSpread({}, item || {}), {}, {
|
|
190
|
+
is_franchisor_customer: 1 // 标识是总店的客户
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}
|
|
178
194
|
return _context2.abrupt("return", {
|
|
179
|
-
customerList:
|
|
195
|
+
customerList: _customerList,
|
|
180
196
|
total: (res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.count) || 0,
|
|
181
197
|
page: skip,
|
|
182
198
|
pageSize: num
|
|
183
199
|
});
|
|
184
|
-
case
|
|
200
|
+
case 13:
|
|
185
201
|
case "end":
|
|
186
202
|
return _context2.stop();
|
|
187
203
|
}
|
|
@@ -31,8 +31,8 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
31
31
|
productList: any[];
|
|
32
32
|
unavailableReason?: UnavailableReason;
|
|
33
33
|
};
|
|
34
|
-
private getUnavailableReason;
|
|
35
34
|
filterDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
35
|
+
private getUnavailableReason;
|
|
36
36
|
calcDiscount({ discountList, productList, orderTotalAmount, holders, isFormSubject, }: {
|
|
37
37
|
discountList: Discount[];
|
|
38
38
|
productList: any[];
|
|
@@ -212,6 +212,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
212
212
|
unavailableReason: unavailableReason
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
+
}, {
|
|
216
|
+
key: "filterDiscountListByType",
|
|
217
|
+
value: function filterDiscountListByType(discountList, type) {
|
|
218
|
+
return (discountList || []).filter(function (item) {
|
|
219
|
+
return item.type === type || item.tag === type;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
215
222
|
|
|
216
223
|
// 获取券不可用的原因
|
|
217
224
|
}, {
|
|
@@ -286,13 +293,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
286
293
|
}
|
|
287
294
|
return UnavailableReason.Unknown;
|
|
288
295
|
}
|
|
289
|
-
}, {
|
|
290
|
-
key: "filterDiscountListByType",
|
|
291
|
-
value: function filterDiscountListByType(discountList, type) {
|
|
292
|
-
return (discountList || []).filter(function (item) {
|
|
293
|
-
return item.type === type || item.tag === type;
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
296
|
}, {
|
|
297
297
|
key: "calcDiscount",
|
|
298
298
|
value: function calcDiscount(_ref2, options) {
|
|
@@ -1766,7 +1766,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1766
1766
|
processedItems.push(_objectSpread(_objectSpread({}, flatItem), {}, {
|
|
1767
1767
|
total: _targetProductTotal,
|
|
1768
1768
|
price: new Decimal(_productOriginTotal || 0).minus(fixedAmountPerItem).toNumber(),
|
|
1769
|
-
discount_list: [_discountDetail2],
|
|
1769
|
+
discount_list: _this3.filterDiscountListByType(flatItem.discount_list, 'promotion').concat([_discountDetail2]),
|
|
1770
1770
|
processed: true
|
|
1771
1771
|
}));
|
|
1772
1772
|
}
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 | 3 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
|
@@ -41,7 +41,7 @@ export interface Voucher {
|
|
|
41
41
|
allowCrossProduct: boolean;
|
|
42
42
|
/** 可用商品数量上限 (仅多商品) 默认为0,表示不限制商品数量。 */
|
|
43
43
|
applicableProductLimit: number;
|
|
44
|
-
/** 单商品可用卡券上限(同一 Wallet Pass
|
|
44
|
+
/** 单商品可用卡券上限(同一 Wallet Pass 商品生成的卡券对同一商品的每个 unit 最多抵扣次数,总上限 = maxPassesPerItem × quantity)。默认为 0,表示不限制。 */
|
|
45
45
|
maxPassesPerItem: number;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -132,7 +132,7 @@ export interface EvaluatorInput {
|
|
|
132
132
|
allowCrossProduct: boolean;
|
|
133
133
|
/** 可用商品数量上限 (仅多商品) 默认为0,表示不限制商品数量。 */
|
|
134
134
|
applicableProductLimit: number;
|
|
135
|
-
/** 单商品可用卡券上限(同一 Wallet Pass
|
|
135
|
+
/** 单商品可用卡券上限(同一 Wallet Pass 商品生成的卡券对同一商品的每个 unit 最多抵扣次数,总上限 = maxPassesPerItem × quantity)。默认为 0,表示不限制。 */
|
|
136
136
|
maxPassesPerItem: number;
|
|
137
137
|
}>[];
|
|
138
138
|
}
|
|
@@ -105,7 +105,7 @@ function processVouchers(applicableVouchers, orderTotalAmount, products) {
|
|
|
105
105
|
if (maxPassesPerItem <= 0)
|
|
106
106
|
return products2;
|
|
107
107
|
return products2.filter(
|
|
108
|
-
(p) => getItemPassUsage(usageMap, walletPassProductId, p.product_id) < maxPassesPerItem
|
|
108
|
+
(p) => getItemPassUsage(usageMap, walletPassProductId, p.product_id) < maxPassesPerItem * getProductQuantity(p)
|
|
109
109
|
);
|
|
110
110
|
};
|
|
111
111
|
const calculateAvailableMaxAmount = (voucher, productsData, itemPassUsage) => {
|
|
@@ -184,7 +184,7 @@ function processVouchers(applicableVouchers, orderTotalAmount, products) {
|
|
|
184
184
|
if (maxPassesPerItem > 0 && itemPassUsage) {
|
|
185
185
|
const deductTaxAndFee = (config == null ? void 0 : config.deductTaxAndFee) ?? true;
|
|
186
186
|
const amountField = deductTaxAndFee ? "remainingAmountWithTax" : "remainingAmountPure";
|
|
187
|
-
const availableAfterPassLimit = getApplicableProducts(voucher, productsData).filter((p) => p[amountField].greaterThan(0)).filter((p) => getItemPassUsage(itemPassUsage, product_id, p.product_id) < maxPassesPerItem);
|
|
187
|
+
const availableAfterPassLimit = getApplicableProducts(voucher, productsData).filter((p) => p[amountField].greaterThan(0)).filter((p) => getItemPassUsage(itemPassUsage, product_id, p.product_id) < maxPassesPerItem * getProductQuantity(p));
|
|
188
188
|
if (availableAfterPassLimit.length === 0) {
|
|
189
189
|
return { isAvailable: false, reasonCode: "max_passes_per_item_reached" };
|
|
190
190
|
}
|
|
@@ -404,7 +404,7 @@ function recalculateVouchers(allVouchers, selectedVouchers, orderTotalAmount, pr
|
|
|
404
404
|
if (maxPassesPerItem <= 0)
|
|
405
405
|
return products2;
|
|
406
406
|
return products2.filter(
|
|
407
|
-
(p) => getItemPassUsage(walletPassProductId, p.product_id) < maxPassesPerItem
|
|
407
|
+
(p) => getItemPassUsage(walletPassProductId, p.product_id) < maxPassesPerItem * getProductQuantity(p)
|
|
408
408
|
);
|
|
409
409
|
};
|
|
410
410
|
selectedVouchers.forEach((selectedVoucher) => {
|
|
@@ -9,6 +9,7 @@ export declare class CustomerModule extends BaseModule implements Module, Custom
|
|
|
9
9
|
private cacheId;
|
|
10
10
|
private openCache;
|
|
11
11
|
private fatherModule;
|
|
12
|
+
private otherParams;
|
|
12
13
|
constructor(name?: string, version?: string);
|
|
13
14
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
14
15
|
/**
|
|
@@ -46,12 +46,14 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
46
46
|
searchParams: {}
|
|
47
47
|
};
|
|
48
48
|
this.openCache = false;
|
|
49
|
+
this.otherParams = {};
|
|
49
50
|
}
|
|
50
51
|
async initialize(core, options) {
|
|
51
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
52
53
|
this.core = core;
|
|
53
54
|
this.store = options == null ? void 0 : options.store;
|
|
54
55
|
this.request = this.core.getPlugin("request");
|
|
56
|
+
this.otherParams = (options == null ? void 0 : options.otherParams) || {};
|
|
55
57
|
if (Array.isArray((_a = options == null ? void 0 : options.initialState) == null ? void 0 : _a.customerList)) {
|
|
56
58
|
const customerList = (0, import_lodash_es.cloneDeep)(options.initialState.customerList || []);
|
|
57
59
|
this.store.customerList = customerList;
|
|
@@ -95,9 +97,12 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
95
97
|
* @returns API响应数据
|
|
96
98
|
*/
|
|
97
99
|
async fetchCustomerListData(params = {}) {
|
|
98
|
-
var _a, _b;
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
var _a, _b, _c, _d;
|
|
101
|
+
let url = "/customer/select-list";
|
|
102
|
+
if ((_a = this.otherParams) == null ? void 0 : _a.isFranchisee) {
|
|
103
|
+
url = "/franchisee/customer/select-list";
|
|
104
|
+
}
|
|
105
|
+
const { skip = 1, num = import_constants.DEFAULT_PAGE_SIZE, search, ..._otherParams } = params;
|
|
101
106
|
const queryParams = {
|
|
102
107
|
skip,
|
|
103
108
|
num,
|
|
@@ -106,7 +111,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
106
111
|
search_wallet_flag: 1,
|
|
107
112
|
search_wallet_pass_flag: 1,
|
|
108
113
|
...search && { search },
|
|
109
|
-
...
|
|
114
|
+
..._otherParams
|
|
110
115
|
};
|
|
111
116
|
const res = await this.request.get(url, queryParams, {
|
|
112
117
|
cache: {
|
|
@@ -117,9 +122,19 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
117
122
|
if ((res == null ? void 0 : res.code) !== 200) {
|
|
118
123
|
throw new Error(res == null ? void 0 : res.message);
|
|
119
124
|
}
|
|
125
|
+
let _customerList = ((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.list) || [];
|
|
126
|
+
if (((_c = this.otherParams) == null ? void 0 : _c.isFranchisee) && (_customerList == null ? void 0 : _customerList.length) > 0) {
|
|
127
|
+
_customerList = _customerList == null ? void 0 : _customerList.map((item) => {
|
|
128
|
+
return {
|
|
129
|
+
...item || {},
|
|
130
|
+
is_franchisor_customer: 1
|
|
131
|
+
// 标识是总店的客户
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
120
135
|
return {
|
|
121
|
-
customerList:
|
|
122
|
-
total: ((
|
|
136
|
+
customerList: _customerList,
|
|
137
|
+
total: ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.count) || 0,
|
|
123
138
|
page: skip,
|
|
124
139
|
pageSize: num
|
|
125
140
|
};
|
|
@@ -31,8 +31,8 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
31
31
|
productList: any[];
|
|
32
32
|
unavailableReason?: UnavailableReason;
|
|
33
33
|
};
|
|
34
|
-
private getUnavailableReason;
|
|
35
34
|
filterDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
35
|
+
private getUnavailableReason;
|
|
36
36
|
calcDiscount({ discountList, productList, orderTotalAmount, holders, isFormSubject, }: {
|
|
37
37
|
discountList: Discount[];
|
|
38
38
|
productList: any[];
|
|
@@ -154,6 +154,9 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
154
154
|
unavailableReason
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
+
filterDiscountListByType(discountList, type) {
|
|
158
|
+
return (discountList || []).filter((item) => item.type === type || item.tag === type);
|
|
159
|
+
}
|
|
157
160
|
// 获取券不可用的原因
|
|
158
161
|
getUnavailableReason(discountList, productList) {
|
|
159
162
|
var _a;
|
|
@@ -186,9 +189,6 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
186
189
|
}
|
|
187
190
|
return import_types.UnavailableReason.Unknown;
|
|
188
191
|
}
|
|
189
|
-
filterDiscountListByType(discountList, type) {
|
|
190
|
-
return (discountList || []).filter((item) => item.type === type || item.tag === type);
|
|
191
|
-
}
|
|
192
192
|
calcDiscount({
|
|
193
193
|
discountList,
|
|
194
194
|
productList,
|
|
@@ -1391,7 +1391,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
1391
1391
|
...flatItem,
|
|
1392
1392
|
total: targetProductTotal,
|
|
1393
1393
|
price: new import_decimal.default(productOriginTotal || 0).minus(fixedAmountPerItem).toNumber(),
|
|
1394
|
-
discount_list: [discountDetail],
|
|
1394
|
+
discount_list: this.filterDiscountListByType(flatItem.discount_list, "promotion").concat([discountDetail]),
|
|
1395
1395
|
processed: true
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
311
311
|
date: string;
|
|
312
312
|
status: string;
|
|
313
313
|
week: string;
|
|
314
|
-
weekNum: 0 | 2 | 1 | 3 |
|
|
314
|
+
weekNum: 0 | 2 | 1 | 3 | 5 | 4 | 6;
|
|
315
315
|
}[]>;
|
|
316
316
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
317
317
|
private getScheduleDataByIds;
|
|
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
123
123
|
* 获取当前的客户搜索条件
|
|
124
124
|
* @returns 当前搜索条件
|
|
125
125
|
*/
|
|
126
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
126
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
127
127
|
/**
|
|
128
128
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
129
129
|
* @returns 客户状态
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@pisell/pisellos",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.477",
|
|
5
5
|
"description": "一个可扩展的前端模块化SDK框架,支持插件系统",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"docs": "typedoc --out docs src/index.ts",
|
|
24
24
|
"sync": "node sync.js",
|
|
25
25
|
"prepublishOnly": "npm run build",
|
|
26
|
-
"deploy": "npm run build && npm run changeset && npm run version && npm run release"
|
|
26
|
+
"deploy": "npm run build && npm run changeset && npm run version && npm run release",
|
|
27
|
+
"deploy:ci": "npm run build && npm run version && changeset publish --registry=https://registry.npmjs.com/ && npm run sync"
|
|
27
28
|
},
|
|
28
29
|
"repository": {
|
|
29
30
|
"type": "git",
|