@pisell/pisellos 1.0.24 → 1.0.26
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/modules/AccountList/index.js +1 -1
- package/dist/modules/Date/index.js +25 -12
- package/dist/modules/Date/types.d.ts +2 -0
- package/dist/modules/Rules/index.js +6 -5
- package/dist/solution/BookingByStep/index.d.ts +1 -0
- package/dist/solution/BookingByStep/index.js +6 -3
- package/dist/solution/ShopDiscount/index.js +1 -1
- package/lib/modules/AccountList/index.js +1 -1
- package/lib/modules/Date/index.js +31 -26
- package/lib/modules/Date/types.d.ts +2 -0
- package/lib/modules/Rules/index.js +6 -5
- package/lib/solution/BookingByStep/index.d.ts +1 -0
- package/lib/solution/BookingByStep/index.js +5 -3
- package/lib/solution/ShopDiscount/index.js +1 -1
- package/package.json +1 -1
|
@@ -326,7 +326,7 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
326
326
|
});
|
|
327
327
|
|
|
328
328
|
// 检测 如果被删除的是活跃账号,则默认把第一个账号设置为 activeAccount
|
|
329
|
-
if (((_this$getActiveAccoun = this.getActiveAccount()) === null || _this$getActiveAccoun === void 0 ? void 0 : _this$getActiveAccoun.getId()) === id) {
|
|
329
|
+
if (!this.getActiveAccount() || ((_this$getActiveAccoun = this.getActiveAccount()) === null || _this$getActiveAccoun === void 0 ? void 0 : _this$getActiveAccoun.getId()) === id || this.store.accounts.length === 1) {
|
|
330
330
|
this.setActiveAccount(this.store.accounts[0].getId());
|
|
331
331
|
}
|
|
332
332
|
_context6.next = 12;
|
|
@@ -93,11 +93,14 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
93
93
|
key: "getResourceDates",
|
|
94
94
|
value: function () {
|
|
95
95
|
var _getResourceDates = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
96
|
-
var _params$query;
|
|
97
|
-
var currentDateList, currentDateListMap, resourceIds, hasResource, dates;
|
|
96
|
+
var _params$query, currentDateList, currentDateListMap, resourceIds, hasResource, dates;
|
|
98
97
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
99
98
|
while (1) switch (_context2.prev = _context2.next) {
|
|
100
99
|
case 0:
|
|
100
|
+
if (!params.useCache) {
|
|
101
|
+
_context2.next = 7;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
101
104
|
// 发请求之前,做一道检测,看 dateList 里是否有对应日期,且对应日期里是否都有对应 resource_ids 的资源
|
|
102
105
|
currentDateList = this.getDateList() || [];
|
|
103
106
|
currentDateListMap = new Map(currentDateList.map(function (item) {
|
|
@@ -112,18 +115,18 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
112
115
|
});
|
|
113
116
|
});
|
|
114
117
|
if (!hasResource) {
|
|
115
|
-
_context2.next =
|
|
118
|
+
_context2.next = 7;
|
|
116
119
|
break;
|
|
117
120
|
}
|
|
118
121
|
return _context2.abrupt("return", currentDateList);
|
|
119
|
-
case
|
|
120
|
-
_context2.next =
|
|
122
|
+
case 7:
|
|
123
|
+
_context2.next = 9;
|
|
121
124
|
return this.getResourceAvailableTimeList(params);
|
|
122
|
-
case
|
|
125
|
+
case 9:
|
|
123
126
|
dates = _context2.sent;
|
|
124
127
|
this.setDateList(dates);
|
|
125
128
|
return _context2.abrupt("return", dates);
|
|
126
|
-
case
|
|
129
|
+
case 12:
|
|
127
130
|
case "end":
|
|
128
131
|
return _context2.stop();
|
|
129
132
|
}
|
|
@@ -151,7 +154,7 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
151
154
|
return n.date === item.date;
|
|
152
155
|
});
|
|
153
156
|
if (currentItemIndex !== -1) {
|
|
154
|
-
var _item$resource;
|
|
157
|
+
var _item$resource, _currentItem$resource3;
|
|
155
158
|
var currentItem = currentDateList[currentItemIndex];
|
|
156
159
|
// 看那一天的数据有没有相同的,把不同的资源合并进去即可
|
|
157
160
|
var newResource = (_item$resource = item.resource) === null || _item$resource === void 0 ? void 0 : _item$resource.filter(function (n) {
|
|
@@ -160,6 +163,16 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
160
163
|
return m.id === n.id;
|
|
161
164
|
}));
|
|
162
165
|
});
|
|
166
|
+
// 如果有相同的资源,则使用 item 中的新的resource.times,而不是 currentItem 中的
|
|
167
|
+
(_currentItem$resource3 = currentItem.resource) === null || _currentItem$resource3 === void 0 || _currentItem$resource3.forEach(function (n) {
|
|
168
|
+
var _item$resource2;
|
|
169
|
+
var newResource = (_item$resource2 = item.resource) === null || _item$resource2 === void 0 ? void 0 : _item$resource2.find(function (m) {
|
|
170
|
+
return m.id === n.id;
|
|
171
|
+
});
|
|
172
|
+
if (newResource) {
|
|
173
|
+
n.times = newResource.times;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
163
176
|
currentItem.resource = [].concat(_toConsumableArray(currentItem.resource || []), _toConsumableArray(newResource || []));
|
|
164
177
|
currentDateList[currentItemIndex] = currentItem;
|
|
165
178
|
} else {
|
|
@@ -172,11 +185,11 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
172
185
|
key: "fetchResourceDates",
|
|
173
186
|
value: function () {
|
|
174
187
|
var _fetchResourceDates = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
175
|
-
var url, query, fetchUrl, _ref, start_date, end_date, resource_ids, res;
|
|
188
|
+
var url, query, _params$useCache, useCache, fetchUrl, _ref, start_date, end_date, resource_ids, res;
|
|
176
189
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
177
190
|
while (1) switch (_context3.prev = _context3.next) {
|
|
178
191
|
case 0:
|
|
179
|
-
url = params.url, query = params.query;
|
|
192
|
+
url = params.url, query = params.query, _params$useCache = params.useCache, useCache = _params$useCache === void 0 ? true : _params$useCache;
|
|
180
193
|
fetchUrl = url || '/schedule/resource/list';
|
|
181
194
|
_ref = query || {}, start_date = _ref.start_date, end_date = _ref.end_date, resource_ids = _ref.resource_ids;
|
|
182
195
|
_context3.prev = 3;
|
|
@@ -185,9 +198,9 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
185
198
|
start_date: start_date,
|
|
186
199
|
end_date: end_date,
|
|
187
200
|
resource_ids: resource_ids,
|
|
188
|
-
front_end_cache_id: this.cacheId
|
|
201
|
+
front_end_cache_id: useCache && this.cacheId
|
|
189
202
|
}, {
|
|
190
|
-
useCache:
|
|
203
|
+
useCache: useCache
|
|
191
204
|
});
|
|
192
205
|
case 6:
|
|
193
206
|
res = _context3.sent;
|
|
@@ -330,7 +330,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
330
330
|
// 找到适用于此商品的所有优惠券,仅考虑isSelected不为false的优惠券
|
|
331
331
|
var applicableDiscounts = sortedDiscountList.filter(function (discount) {
|
|
332
332
|
// 如果商品价格为 0,其实不需要使用任何优惠券,直接 return true
|
|
333
|
-
if (Number(product.price) === 0 || !product.price) return false;
|
|
333
|
+
if (Number(product.price) === 0 && discount.tag === 'good_pass' || Number(product.total) === 0 && discount.tag !== 'good_pass' || !product.price) return false;
|
|
334
334
|
// 如果优惠券已被使用,则跳过
|
|
335
335
|
var targetUsedDiscounts = usedDiscounts.get(discount.id);
|
|
336
336
|
if (targetUsedDiscounts && (discount.tag || discount.type) === 'good_pass') return false;
|
|
@@ -422,16 +422,17 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
422
422
|
|
|
423
423
|
// 记录实际应用了优惠券的商品信息
|
|
424
424
|
var appliedProducts = appliedDiscountProducts.get(_selectedDiscount.id) || [];
|
|
425
|
+
var productOriginTotal = product.origin_total || product.total || 0;
|
|
425
426
|
|
|
426
427
|
// 计算使用折扣卡/商品券以后,单个商品的总 total
|
|
427
|
-
var targetProductTotal = _selectedDiscount.tag === 'good_pass' ? new Decimal(
|
|
428
|
+
var targetProductTotal = _selectedDiscount.tag === 'good_pass' ? new Decimal(productOriginTotal).minus(new Decimal(product.price || 0)).toNumber() : new Decimal(100).minus(_selectedDiscount.par_value || 0).div(100).mul(new Decimal(productOriginTotal)).toNumber();
|
|
428
429
|
var discountDetail = {
|
|
429
|
-
amount: new Decimal(
|
|
430
|
+
amount: new Decimal(productOriginTotal).minus(new Decimal(targetProductTotal)).toNumber(),
|
|
430
431
|
type: _selectedDiscount.tag === 'product_discount_card' ? 'discount_card' : _selectedDiscount.tag,
|
|
431
432
|
discount: {
|
|
432
433
|
resource_id: _selectedDiscount.id,
|
|
433
434
|
title: _selectedDiscount.format_title,
|
|
434
|
-
original_amount:
|
|
435
|
+
original_amount: productOriginTotal,
|
|
435
436
|
product_id: originProduct.id,
|
|
436
437
|
percent: _selectedDiscount.par_value
|
|
437
438
|
},
|
|
@@ -465,7 +466,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
465
466
|
price: _selectedDiscount.tag === 'good_pass' ? 0 : product.price,
|
|
466
467
|
quantity: isNeedSplit ? 1 : product.quantity,
|
|
467
468
|
total: targetProductTotal,
|
|
468
|
-
origin_total:
|
|
469
|
+
origin_total: productOriginTotal
|
|
469
470
|
}));
|
|
470
471
|
}
|
|
471
472
|
}
|
|
@@ -131,6 +131,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
131
131
|
getCart(): CartItem[];
|
|
132
132
|
getAvailableDate(params?: {
|
|
133
133
|
url?: string;
|
|
134
|
+
useCache?: boolean;
|
|
134
135
|
products?: ProductData[];
|
|
135
136
|
startDate?: string;
|
|
136
137
|
endDate?: string;
|
|
@@ -681,6 +681,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
681
681
|
startDate,
|
|
682
682
|
endDate,
|
|
683
683
|
type,
|
|
684
|
+
_params$useCache,
|
|
685
|
+
useCache,
|
|
684
686
|
tempProducts,
|
|
685
687
|
dateRange,
|
|
686
688
|
tempStartDate,
|
|
@@ -696,7 +698,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
696
698
|
case 0:
|
|
697
699
|
params = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
|
|
698
700
|
// 开始日期如果小于今天,直接以今天当做开始日期
|
|
699
|
-
products = params.products, startDate = params.startDate, endDate = params.endDate, type = params.type; // 前端传递的 startDate,可能是今天之前的,如果 startDate 小于今天 且 endDate 小于或等于今天,需要把 startDate 置为今天
|
|
701
|
+
products = params.products, startDate = params.startDate, endDate = params.endDate, type = params.type, _params$useCache = params.useCache, useCache = _params$useCache === void 0 ? true : _params$useCache; // 前端传递的 startDate,可能是今天之前的,如果 startDate 小于今天 且 endDate 小于或等于今天,需要把 startDate 置为今天
|
|
700
702
|
if (dayjs(startDate).isBefore(dayjs(), 'day') && (dayjs(endDate).isAfter(dayjs(), 'day') || dayjs(endDate).isSame(dayjs(), 'day'))) {
|
|
701
703
|
startDate = dayjs().format('YYYY-MM-DD');
|
|
702
704
|
}
|
|
@@ -738,7 +740,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
738
740
|
resource_ids: resourceIds
|
|
739
741
|
},
|
|
740
742
|
rules: rules,
|
|
741
|
-
type: type
|
|
743
|
+
type: type,
|
|
744
|
+
useCache: useCache
|
|
742
745
|
});
|
|
743
746
|
case 15:
|
|
744
747
|
res = _context12.sent;
|
|
@@ -1407,7 +1410,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1407
1410
|
var resources = [];
|
|
1408
1411
|
if (dateRange !== null && dateRange !== void 0 && dateRange.length) {
|
|
1409
1412
|
dateRange.forEach(function (n) {
|
|
1410
|
-
resources.push.apply(resources, _toConsumableArray(
|
|
1413
|
+
if (n.resource) resources.push.apply(resources, _toConsumableArray(n.resource));
|
|
1411
1414
|
});
|
|
1412
1415
|
}
|
|
1413
1416
|
var cartItems = this.store.cart.getItems().filter(function (n) {
|
|
@@ -504,7 +504,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
504
504
|
return n.id === id;
|
|
505
505
|
});
|
|
506
506
|
var product = (_this3$hooks2 = _this3.hooks) === null || _this3$hooks2 === void 0 ? void 0 : _this3$hooks2.getProduct(targetProduct);
|
|
507
|
-
return Number(product === null || product === void 0 ? void 0 : product.
|
|
507
|
+
return Number(product === null || product === void 0 ? void 0 : product.total) === 0;
|
|
508
508
|
};
|
|
509
509
|
var isAllProductUsedOrFree = (_item$applicableProdu = item.applicableProductIds) === null || _item$applicableProdu === void 0 ? void 0 : _item$applicableProdu.every(function (id) {
|
|
510
510
|
var _item$applicableProdu2;
|
|
@@ -195,7 +195,7 @@ var AccountListModule = class extends import_BaseModule.BaseModule {
|
|
|
195
195
|
this.store.accountList = this.store.accountList.filter(
|
|
196
196
|
(account) => account.id !== id
|
|
197
197
|
);
|
|
198
|
-
if (((_a = this.getActiveAccount()) == null ? void 0 : _a.getId()) === id) {
|
|
198
|
+
if (!this.getActiveAccount() || ((_a = this.getActiveAccount()) == null ? void 0 : _a.getId()) === id || this.store.accounts.length === 1) {
|
|
199
199
|
this.setActiveAccount(this.store.accounts[0].getId());
|
|
200
200
|
}
|
|
201
201
|
await this.core.effects.emit(
|
|
@@ -70,18 +70,20 @@ var DateModule = class extends import_BaseModule.BaseModule {
|
|
|
70
70
|
}
|
|
71
71
|
async getResourceDates(params) {
|
|
72
72
|
var _a;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
if (params.useCache) {
|
|
74
|
+
const currentDateList = this.getDateList() || [];
|
|
75
|
+
const currentDateListMap = new Map(
|
|
76
|
+
currentDateList.map((item) => [item.date, item])
|
|
77
|
+
);
|
|
78
|
+
const resourceIds = ((_a = params.query) == null ? void 0 : _a.resource_ids) || [];
|
|
79
|
+
const hasResource = resourceIds.every((id) => {
|
|
80
|
+
var _a2;
|
|
81
|
+
const currentItem = currentDateListMap.get(id.toString());
|
|
82
|
+
return (_a2 = currentItem == null ? void 0 : currentItem.resource) == null ? void 0 : _a2.some((n) => n.id === id);
|
|
83
|
+
});
|
|
84
|
+
if (hasResource) {
|
|
85
|
+
return currentDateList;
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
const dates = await this.getResourceAvailableTimeList(params);
|
|
87
89
|
this.setDateList(dates);
|
|
@@ -93,7 +95,7 @@ var DateModule = class extends import_BaseModule.BaseModule {
|
|
|
93
95
|
setDateList(dateList) {
|
|
94
96
|
const currentDateList = (0, import_cloneDeep.default)(this.store.dateList) || [];
|
|
95
97
|
dateList.forEach((item) => {
|
|
96
|
-
var _a;
|
|
98
|
+
var _a, _b;
|
|
97
99
|
const currentItemIndex = currentDateList.findIndex(
|
|
98
100
|
(n) => n.date === item.date
|
|
99
101
|
);
|
|
@@ -105,6 +107,13 @@ var DateModule = class extends import_BaseModule.BaseModule {
|
|
|
105
107
|
return !((_a2 = currentItem.resource) == null ? void 0 : _a2.some((m) => m.id === n.id));
|
|
106
108
|
}
|
|
107
109
|
);
|
|
110
|
+
(_b = currentItem.resource) == null ? void 0 : _b.forEach((n) => {
|
|
111
|
+
var _a2;
|
|
112
|
+
const newResource2 = (_a2 = item.resource) == null ? void 0 : _a2.find((m) => m.id === n.id);
|
|
113
|
+
if (newResource2) {
|
|
114
|
+
n.times = newResource2.times;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
108
117
|
currentItem.resource = [
|
|
109
118
|
...currentItem.resource || [],
|
|
110
119
|
...newResource || []
|
|
@@ -117,22 +126,18 @@ var DateModule = class extends import_BaseModule.BaseModule {
|
|
|
117
126
|
this.store.dateList = currentDateList;
|
|
118
127
|
}
|
|
119
128
|
async fetchResourceDates(params) {
|
|
120
|
-
const { url, query } = params;
|
|
129
|
+
const { url, query, useCache = true } = params;
|
|
121
130
|
const fetchUrl = url || "/schedule/resource/list";
|
|
122
131
|
const { start_date, end_date, resource_ids } = query || {};
|
|
123
132
|
try {
|
|
124
|
-
const res = await this.request.get(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
useCache: true
|
|
134
|
-
}
|
|
135
|
-
);
|
|
133
|
+
const res = await this.request.get(fetchUrl, {
|
|
134
|
+
start_date,
|
|
135
|
+
end_date,
|
|
136
|
+
resource_ids,
|
|
137
|
+
front_end_cache_id: useCache && this.cacheId
|
|
138
|
+
}, {
|
|
139
|
+
useCache
|
|
140
|
+
});
|
|
136
141
|
return res;
|
|
137
142
|
} catch (error) {
|
|
138
143
|
console.error(error);
|
|
@@ -213,7 +213,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
const applicableDiscounts = sortedDiscountList.filter((discount) => {
|
|
216
|
-
if (Number(product.price) === 0 || !product.price)
|
|
216
|
+
if (Number(product.price) === 0 && discount.tag === "good_pass" || Number(product.total) === 0 && discount.tag !== "good_pass" || !product.price)
|
|
217
217
|
return false;
|
|
218
218
|
const targetUsedDiscounts = usedDiscounts.get(discount.id);
|
|
219
219
|
if (targetUsedDiscounts && (discount.tag || discount.type) === "good_pass")
|
|
@@ -293,14 +293,15 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
293
293
|
const selectedDiscount2 = applicableDiscounts[i2];
|
|
294
294
|
usedDiscounts.set(selectedDiscount2.id, true);
|
|
295
295
|
const appliedProducts = appliedDiscountProducts.get(selectedDiscount2.id) || [];
|
|
296
|
-
const
|
|
296
|
+
const productOriginTotal = product.origin_total || product.total || 0;
|
|
297
|
+
const targetProductTotal = selectedDiscount2.tag === "good_pass" ? new import_decimal.default(productOriginTotal).minus(new import_decimal.default(product.price || 0)).toNumber() : new import_decimal.default(100).minus(selectedDiscount2.par_value || 0).div(100).mul(new import_decimal.default(productOriginTotal)).toNumber();
|
|
297
298
|
const discountDetail = {
|
|
298
|
-
amount: new import_decimal.default(
|
|
299
|
+
amount: new import_decimal.default(productOriginTotal).minus(new import_decimal.default(targetProductTotal)).toNumber(),
|
|
299
300
|
type: selectedDiscount2.tag === "product_discount_card" ? "discount_card" : selectedDiscount2.tag,
|
|
300
301
|
discount: {
|
|
301
302
|
resource_id: selectedDiscount2.id,
|
|
302
303
|
title: selectedDiscount2.format_title,
|
|
303
|
-
original_amount:
|
|
304
|
+
original_amount: productOriginTotal,
|
|
304
305
|
product_id: originProduct.id,
|
|
305
306
|
percent: selectedDiscount2.par_value
|
|
306
307
|
},
|
|
@@ -331,7 +332,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
331
332
|
price: selectedDiscount2.tag === "good_pass" ? 0 : product.price,
|
|
332
333
|
quantity: isNeedSplit ? 1 : product.quantity,
|
|
333
334
|
total: targetProductTotal,
|
|
334
|
-
origin_total:
|
|
335
|
+
origin_total: productOriginTotal
|
|
335
336
|
}));
|
|
336
337
|
}
|
|
337
338
|
}
|
|
@@ -131,6 +131,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
131
131
|
getCart(): CartItem[];
|
|
132
132
|
getAvailableDate(params?: {
|
|
133
133
|
url?: string;
|
|
134
|
+
useCache?: boolean;
|
|
134
135
|
products?: ProductData[];
|
|
135
136
|
startDate?: string;
|
|
136
137
|
endDate?: string;
|
|
@@ -388,7 +388,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
388
388
|
// 获取商品/服务的可用日期
|
|
389
389
|
async getAvailableDate(params = {}) {
|
|
390
390
|
var _a, _b, _c;
|
|
391
|
-
let { products, startDate, endDate, type } = params;
|
|
391
|
+
let { products, startDate, endDate, type, useCache = true } = params;
|
|
392
392
|
if ((0, import_dayjs.default)(startDate).isBefore((0, import_dayjs.default)(), "day") && ((0, import_dayjs.default)(endDate).isAfter((0, import_dayjs.default)(), "day") || (0, import_dayjs.default)(endDate).isSame((0, import_dayjs.default)(), "day"))) {
|
|
393
393
|
startDate = (0, import_dayjs.default)().format("YYYY-MM-DD");
|
|
394
394
|
}
|
|
@@ -425,7 +425,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
425
425
|
resource_ids: resourceIds
|
|
426
426
|
},
|
|
427
427
|
rules,
|
|
428
|
-
type
|
|
428
|
+
type,
|
|
429
|
+
useCache
|
|
429
430
|
});
|
|
430
431
|
return res;
|
|
431
432
|
}
|
|
@@ -817,7 +818,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
817
818
|
const resources = [];
|
|
818
819
|
if (dateRange == null ? void 0 : dateRange.length) {
|
|
819
820
|
dateRange.forEach((n) => {
|
|
820
|
-
|
|
821
|
+
if (n.resource)
|
|
822
|
+
resources.push(...n.resource);
|
|
821
823
|
});
|
|
822
824
|
}
|
|
823
825
|
const cartItems = this.store.cart.getItems().filter((n) => !(0, import_utils4.isNormalProduct)(n._productOrigin));
|
|
@@ -346,7 +346,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
|
|
|
346
346
|
var _a3;
|
|
347
347
|
const targetProduct = productList.find((n) => n.id === id);
|
|
348
348
|
const product = (_a3 = this.hooks) == null ? void 0 : _a3.getProduct(targetProduct);
|
|
349
|
-
return Number(product == null ? void 0 : product.
|
|
349
|
+
return Number(product == null ? void 0 : product.total) === 0;
|
|
350
350
|
};
|
|
351
351
|
const isAllProductUsedOrFree = (_a2 = item.applicableProductIds) == null ? void 0 : _a2.every((id) => {
|
|
352
352
|
var _a3;
|