@pisell/pisellos 3.0.42 → 3.0.44
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 +17 -12
- package/dist/modules/Cart/index.d.ts +14 -0
- package/dist/modules/Cart/index.js +38 -1
- package/dist/modules/Cart/utils/cartProduct.d.ts +3 -0
- package/dist/modules/Cart/utils/cartProduct.js +28 -8
- package/dist/modules/Date/index.js +70 -6
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +13 -6
- package/dist/modules/Discount/types.d.ts +10 -0
- package/dist/modules/ProductList/index.d.ts +7 -0
- package/dist/modules/ProductList/index.js +102 -39
- package/dist/modules/Rules/index.js +218 -80
- package/dist/modules/Rules/types.d.ts +7 -1
- package/dist/modules/Schedule/index.d.ts +9 -1
- package/dist/modules/Schedule/index.js +122 -2
- package/dist/modules/Schedule/types.d.ts +13 -0
- package/dist/solution/BookingByStep/index.d.ts +120 -30
- package/dist/solution/BookingByStep/index.js +755 -1078
- package/dist/solution/BookingByStep/utils/capacity.d.ts +47 -0
- package/dist/solution/BookingByStep/utils/capacity.js +132 -0
- package/dist/solution/BookingByStep/utils/resources.d.ts +21 -29
- package/dist/solution/BookingByStep/utils/resources.js +39 -95
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +11 -0
- package/dist/solution/BookingByStep/utils/timeslots.js +15 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -0
- package/dist/solution/ShopDiscount/index.js +119 -44
- package/lib/modules/AccountList/index.js +4 -0
- package/lib/modules/Cart/index.d.ts +14 -0
- package/lib/modules/Cart/index.js +34 -1
- package/lib/modules/Cart/utils/cartProduct.d.ts +3 -0
- package/lib/modules/Cart/utils/cartProduct.js +20 -8
- package/lib/modules/Date/index.js +59 -2
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +17 -6
- package/lib/modules/Discount/types.d.ts +10 -0
- package/lib/modules/ProductList/index.d.ts +7 -0
- package/lib/modules/ProductList/index.js +45 -0
- package/lib/modules/Rules/index.js +154 -63
- package/lib/modules/Rules/types.d.ts +7 -1
- package/lib/modules/Schedule/index.d.ts +9 -1
- package/lib/modules/Schedule/index.js +79 -1
- package/lib/modules/Schedule/types.d.ts +13 -0
- package/lib/solution/BookingByStep/index.d.ts +120 -30
- package/lib/solution/BookingByStep/index.js +391 -589
- package/lib/solution/BookingByStep/utils/capacity.d.ts +47 -0
- package/lib/solution/BookingByStep/utils/capacity.js +106 -0
- package/lib/solution/BookingByStep/utils/resources.d.ts +21 -29
- package/lib/solution/BookingByStep/utils/resources.js +21 -58
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +11 -0
- package/lib/solution/BookingByStep/utils/timeslots.js +7 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -0
- package/lib/solution/ShopDiscount/index.js +91 -19
- package/package.json +1 -1
|
@@ -97,15 +97,78 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
97
97
|
return storeChange;
|
|
98
98
|
}()
|
|
99
99
|
}, {
|
|
100
|
-
key: "
|
|
100
|
+
key: "loadProducts",
|
|
101
101
|
value: function () {
|
|
102
|
-
var
|
|
103
|
-
var _ref$
|
|
102
|
+
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
103
|
+
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, schedule_date, cacheId, userPlugin, customer_id, _userPlugin$get, productsData;
|
|
104
104
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
105
105
|
while (1) switch (_context3.prev = _context3.next) {
|
|
106
106
|
case 0:
|
|
107
|
-
_ref$
|
|
108
|
-
|
|
107
|
+
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId;
|
|
108
|
+
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
109
|
+
// if (!schedule_ids?.length) {
|
|
110
|
+
// const schedule_ids_data = this.store.schedule
|
|
111
|
+
// .getScheduleListByIds(schedule_ids)
|
|
112
|
+
// .map((n) => n.id);
|
|
113
|
+
// if (schedule_ids_data.length) {
|
|
114
|
+
// schedule_ids = schedule_ids_data;
|
|
115
|
+
// } else if (schedule_date) {
|
|
116
|
+
// // 后端说如果 schedule_ids 如果为空,需要给[0]
|
|
117
|
+
// schedule_ids = [0];
|
|
118
|
+
// }
|
|
119
|
+
// }
|
|
120
|
+
userPlugin = this.core.getPlugin('user');
|
|
121
|
+
customer_id = undefined;
|
|
122
|
+
try {
|
|
123
|
+
customer_id = userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error(error);
|
|
126
|
+
}
|
|
127
|
+
// 如果没传schedule_date,则从
|
|
128
|
+
_context3.next = 6;
|
|
129
|
+
return this.request.post("/product/query", {
|
|
130
|
+
open_quotation: 1,
|
|
131
|
+
open_bundle: 0,
|
|
132
|
+
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item'],
|
|
133
|
+
with: ['category', 'collection', 'resourceRelation'],
|
|
134
|
+
status: 'published',
|
|
135
|
+
num: 500,
|
|
136
|
+
skip: 1,
|
|
137
|
+
customer_id: customer_id,
|
|
138
|
+
category_ids: category_ids,
|
|
139
|
+
ids: product_ids,
|
|
140
|
+
collection: collection,
|
|
141
|
+
front_end_cache_id: cacheId,
|
|
142
|
+
// client_schedule_ids: schedule_ids,
|
|
143
|
+
schedule_date: schedule_date
|
|
144
|
+
}, {
|
|
145
|
+
useCache: true
|
|
146
|
+
});
|
|
147
|
+
case 6:
|
|
148
|
+
productsData = _context3.sent;
|
|
149
|
+
this.addProduct(productsData.data.list);
|
|
150
|
+
return _context3.abrupt("return", productsData.data.list);
|
|
151
|
+
case 9:
|
|
152
|
+
case "end":
|
|
153
|
+
return _context3.stop();
|
|
154
|
+
}
|
|
155
|
+
}, _callee3, this);
|
|
156
|
+
}));
|
|
157
|
+
function loadProducts(_x5) {
|
|
158
|
+
return _loadProducts.apply(this, arguments);
|
|
159
|
+
}
|
|
160
|
+
return loadProducts;
|
|
161
|
+
}()
|
|
162
|
+
}, {
|
|
163
|
+
key: "loadProductsPrice",
|
|
164
|
+
value: function () {
|
|
165
|
+
var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref2) {
|
|
166
|
+
var _ref2$ids, ids, customer_id, schedule_date, channel, productsData;
|
|
167
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
168
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
169
|
+
case 0:
|
|
170
|
+
_ref2$ids = _ref2.ids, ids = _ref2$ids === void 0 ? [] : _ref2$ids, customer_id = _ref2.customer_id, schedule_date = _ref2.schedule_date, channel = _ref2.channel;
|
|
171
|
+
_context4.next = 3;
|
|
109
172
|
return this.request.post("/product/query/price", {
|
|
110
173
|
ids: ids,
|
|
111
174
|
customer_id: customer_id,
|
|
@@ -115,15 +178,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
115
178
|
useCache: true
|
|
116
179
|
});
|
|
117
180
|
case 3:
|
|
118
|
-
productsData =
|
|
119
|
-
return
|
|
181
|
+
productsData = _context4.sent;
|
|
182
|
+
return _context4.abrupt("return", productsData.data);
|
|
120
183
|
case 5:
|
|
121
184
|
case "end":
|
|
122
|
-
return
|
|
185
|
+
return _context4.stop();
|
|
123
186
|
}
|
|
124
|
-
},
|
|
187
|
+
}, _callee4, this);
|
|
125
188
|
}));
|
|
126
|
-
function loadProductsPrice(
|
|
189
|
+
function loadProductsPrice(_x6) {
|
|
127
190
|
return _loadProductsPrice.apply(this, arguments);
|
|
128
191
|
}
|
|
129
192
|
return loadProductsPrice;
|
|
@@ -131,19 +194,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
131
194
|
}, {
|
|
132
195
|
key: "getProducts",
|
|
133
196
|
value: function () {
|
|
134
|
-
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
135
|
-
return _regeneratorRuntime().wrap(function
|
|
136
|
-
while (1) switch (
|
|
197
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
198
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
199
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
137
200
|
case 0:
|
|
138
|
-
|
|
201
|
+
_context5.next = 2;
|
|
139
202
|
return this.core.effects.emit(ProductListHooks.onGetProducts, this.store.list);
|
|
140
203
|
case 2:
|
|
141
|
-
return
|
|
204
|
+
return _context5.abrupt("return", cloneDeep(this.store.list));
|
|
142
205
|
case 3:
|
|
143
206
|
case "end":
|
|
144
|
-
return
|
|
207
|
+
return _context5.stop();
|
|
145
208
|
}
|
|
146
|
-
},
|
|
209
|
+
}, _callee5, this);
|
|
147
210
|
}));
|
|
148
211
|
function getProducts() {
|
|
149
212
|
return _getProducts.apply(this, arguments);
|
|
@@ -153,29 +216,29 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
153
216
|
}, {
|
|
154
217
|
key: "getProduct",
|
|
155
218
|
value: function () {
|
|
156
|
-
var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
219
|
+
var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
|
|
157
220
|
var product;
|
|
158
|
-
return _regeneratorRuntime().wrap(function
|
|
159
|
-
while (1) switch (
|
|
221
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
222
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
160
223
|
case 0:
|
|
161
|
-
|
|
224
|
+
_context6.next = 2;
|
|
162
225
|
return this.core.effects.emit(ProductListHooks.onGetProduct, this.store.list);
|
|
163
226
|
case 2:
|
|
164
227
|
product = this.store.productMap.get("".concat(id));
|
|
165
228
|
if (!product) {
|
|
166
|
-
|
|
229
|
+
_context6.next = 5;
|
|
167
230
|
break;
|
|
168
231
|
}
|
|
169
|
-
return
|
|
232
|
+
return _context6.abrupt("return", product);
|
|
170
233
|
case 5:
|
|
171
|
-
return
|
|
234
|
+
return _context6.abrupt("return", undefined);
|
|
172
235
|
case 6:
|
|
173
236
|
case "end":
|
|
174
|
-
return
|
|
237
|
+
return _context6.stop();
|
|
175
238
|
}
|
|
176
|
-
},
|
|
239
|
+
}, _callee6, this);
|
|
177
240
|
}));
|
|
178
|
-
function getProduct(
|
|
241
|
+
function getProduct(_x7) {
|
|
179
242
|
return _getProduct.apply(this, arguments);
|
|
180
243
|
}
|
|
181
244
|
return getProduct;
|
|
@@ -183,10 +246,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
183
246
|
}, {
|
|
184
247
|
key: "addProduct",
|
|
185
248
|
value: function () {
|
|
186
|
-
var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
249
|
+
var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(products) {
|
|
187
250
|
var _this3 = this;
|
|
188
|
-
return _regeneratorRuntime().wrap(function
|
|
189
|
-
while (1) switch (
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
252
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
190
253
|
case 0:
|
|
191
254
|
// 加到 list 以后上面的storeChange 会自动初始化商品详情的 module 实例
|
|
192
255
|
// list 需要根据 id 去重
|
|
@@ -206,11 +269,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
206
269
|
this.storeChange();
|
|
207
270
|
case 3:
|
|
208
271
|
case "end":
|
|
209
|
-
return
|
|
272
|
+
return _context7.stop();
|
|
210
273
|
}
|
|
211
|
-
},
|
|
274
|
+
}, _callee7, this);
|
|
212
275
|
}));
|
|
213
|
-
function addProduct(
|
|
276
|
+
function addProduct(_x8) {
|
|
214
277
|
return _addProduct.apply(this, arguments);
|
|
215
278
|
}
|
|
216
279
|
return addProduct;
|
|
@@ -218,18 +281,18 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
218
281
|
}, {
|
|
219
282
|
key: "selectProducts",
|
|
220
283
|
value: function () {
|
|
221
|
-
var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
222
|
-
return _regeneratorRuntime().wrap(function
|
|
223
|
-
while (1) switch (
|
|
284
|
+
var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(products) {
|
|
285
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
286
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
224
287
|
case 0:
|
|
225
288
|
this.store.selectProducts = products;
|
|
226
289
|
case 1:
|
|
227
290
|
case "end":
|
|
228
|
-
return
|
|
291
|
+
return _context8.stop();
|
|
229
292
|
}
|
|
230
|
-
},
|
|
293
|
+
}, _callee8, this);
|
|
231
294
|
}));
|
|
232
|
-
function selectProducts(
|
|
295
|
+
function selectProducts(_x9) {
|
|
233
296
|
return _selectProducts.apply(this, arguments);
|
|
234
297
|
}
|
|
235
298
|
return selectProducts;
|