@pisell/pisellos 0.0.567 → 0.0.568
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/core/index.js +6 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +0 -3
- package/dist/model/strategy/strategy-example.js +5 -19
- package/dist/modules/Cart/index.js +0 -3
- package/dist/modules/Cart/utils/cartProduct.js +0 -1
- package/dist/modules/Date/index.js +1 -5
- package/dist/modules/Discount/index.js +1 -4
- package/dist/modules/OpenData/index.js +0 -2
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +14 -41
- package/dist/modules/Payment/index.js +142 -270
- package/dist/modules/Payment/walletpass.js +4 -5
- package/dist/modules/Rules/index.js +0 -7
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.js +88 -121
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/products/index.js +29 -49
- package/dist/server/modules/quotation/index.js +29 -38
- package/dist/server/modules/resource/index.js +3 -4
- package/dist/server/modules/schedule/index.js +32 -40
- package/dist/server/utils/product.js +0 -1
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +7 -59
- package/dist/solution/BookingByStep/utils/capacity.js +1 -11
- package/dist/solution/BookingByStep/utils/resources.js +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +5 -7
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
- package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
- package/dist/solution/BuyTickets/index.js +9 -12
- package/dist/solution/Checkout/index.js +177 -246
- package/dist/solution/Checkout/utils/index.js +4 -16
- package/dist/solution/RegisterAndLogin/index.js +30 -76
- package/dist/solution/ScanOrder/index.js +50 -60
- package/dist/solution/ShopDiscount/index.js +2 -7
- package/dist/solution/VenueBooking/index.d.ts +5 -0
- package/dist/solution/VenueBooking/index.js +364 -327
- package/dist/utils/task.js +15 -18
- package/dist/utils/watch.js +0 -1
- package/lib/apis/picoding.js +2 -0
- package/lib/core/index.js +130 -131
- package/lib/effects/index.js +46 -57
- package/lib/index.js +92 -53
- package/lib/model/index.js +14 -21
- package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
- package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
- package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
- package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
- package/lib/model/strategy/adapter/index.js +100 -64
- package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
- package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
- package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
- package/lib/model/strategy/adapter/itemRule/index.js +83 -57
- package/lib/model/strategy/adapter/itemRule/type.js +97 -36
- package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
- package/lib/model/strategy/adapter/promotion/evaluator.js +381 -231
- package/lib/model/strategy/adapter/promotion/examples.js +139 -159
- package/lib/model/strategy/adapter/promotion/index.js +1 -49
- package/lib/model/strategy/adapter/promotion/type.js +199 -35
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
- package/lib/model/strategy/adapter/walletPass/example.js +217 -190
- package/lib/model/strategy/adapter/walletPass/index.js +75 -51
- package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
- package/lib/model/strategy/adapter/walletPass/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/utils.js +652 -402
- package/lib/model/strategy/engine.js +270 -168
- package/lib/model/strategy/index.js +49 -34
- package/lib/model/strategy/strategy-example.js +243 -239
- package/lib/model/strategy/type.js +100 -40
- package/lib/modules/Account/index.js +39 -53
- package/lib/modules/Account/types.js +20 -33
- package/lib/modules/AccountList/index.js +116 -154
- package/lib/modules/AccountList/types.js +30 -31
- package/lib/modules/AccountList/utils.js +18 -30
- package/lib/modules/BaseModule.js +22 -45
- package/lib/modules/Cart/index.js +170 -124
- package/lib/modules/Cart/types.js +46 -51
- package/lib/modules/Cart/utils/cartAccount.js +40 -39
- package/lib/modules/Cart/utils/cartDate.js +56 -61
- package/lib/modules/Cart/utils/cartDiscount.js +28 -33
- package/lib/modules/Cart/utils/cartNote.js +27 -32
- package/lib/modules/Cart/utils/cartProduct.js +306 -241
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +72 -78
- package/lib/modules/Cart/utils/changePrice.js +26 -62
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.js +216 -153
- package/lib/modules/Customer/types.js +38 -35
- package/lib/modules/Date/index.js +116 -115
- package/lib/modules/Date/types.js +16 -28
- package/lib/modules/Date/utils.js +174 -123
- package/lib/modules/Discount/index.js +117 -113
- package/lib/modules/Discount/types.js +9 -31
- package/lib/modules/Guests/index.js +30 -56
- package/lib/modules/Guests/types.js +23 -33
- package/lib/modules/Holder/index.js +209 -189
- package/lib/modules/Holder/types.js +4 -16
- package/lib/modules/Holder/utils.js +20 -49
- package/lib/modules/OpenData/index.js +63 -74
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +332 -320
- package/lib/modules/Order/types.js +24 -33
- package/lib/modules/Order/utils.js +350 -284
- package/lib/modules/Payment/cash.js +20 -33
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
- package/lib/modules/Payment/eftpos.js +16 -30
- package/lib/modules/Payment/index.js +566 -432
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.js +216 -107
- package/lib/modules/Payment/utils.js +50 -47
- package/lib/modules/Payment/walletpass.js +221 -203
- package/lib/modules/Product/index.js +51 -46
- package/lib/modules/Product/types.js +4 -16
- package/lib/modules/Product/utils.js +32 -33
- package/lib/modules/ProductList/index.js +111 -110
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.js +60 -82
- package/lib/modules/Quotation/types.js +4 -16
- package/lib/modules/Resource/index.js +27 -59
- package/lib/modules/Resource/types.js +22 -32
- package/lib/modules/Resource/utils.js +30 -38
- package/lib/modules/Rules/index.js +1172 -872
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.js +59 -68
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.js +176 -193
- package/lib/modules/ScanOrderLogger/index.js +59 -79
- package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
- package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
- package/lib/modules/ScanOrderLogger/types.js +4 -16
- package/lib/modules/Schedule/getDateIsInSchedule.js +334 -167
- package/lib/modules/Schedule/index.js +97 -107
- package/lib/modules/Schedule/type.js +4 -16
- package/lib/modules/Schedule/types.js +4 -16
- package/lib/modules/Schedule/utils.js +433 -291
- package/lib/modules/Step/index.js +40 -52
- package/lib/modules/Step/tyeps.js +4 -16
- package/lib/modules/Summary/index.js +66 -70
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +782 -429
- package/lib/modules/index.js +212 -57
- package/lib/plugins/app.js +4 -16
- package/lib/plugins/index.js +36 -25
- package/lib/plugins/request.js +137 -126
- package/lib/plugins/shopStore.js +4 -16
- package/lib/plugins/user.js +4 -16
- package/lib/plugins/window.js +171 -179
- package/lib/server/index.js +882 -623
- package/lib/server/modules/index.js +85 -59
- package/lib/server/modules/menu/index.js +146 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.js +195 -231
- package/lib/server/modules/order/types.js +107 -32
- package/lib/server/modules/order/utils/filterBookings.js +174 -140
- package/lib/server/modules/order/utils/filterOrders.js +89 -60
- package/lib/server/modules/products/index.js +430 -335
- package/lib/server/modules/products/types.js +41 -34
- package/lib/server/modules/quotation/index.js +76 -77
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.js +216 -187
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.js +134 -119
- package/lib/server/modules/schedule/types.js +14 -21
- package/lib/server/modules/schedule/utils.js +334 -163
- package/lib/server/types.js +4 -16
- package/lib/server/utils/index.js +25 -23
- package/lib/server/utils/product.js +196 -139
- package/lib/server/utils/schedule.js +34 -41
- package/lib/server/utils/time.js +40 -49
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1530 -1343
- package/lib/solution/BookingByStep/types.js +40 -99
- package/lib/solution/BookingByStep/utils/capacity.js +192 -160
- package/lib/solution/BookingByStep/utils/products.js +42 -52
- package/lib/solution/BookingByStep/utils/resources.js +527 -330
- package/lib/solution/BookingByStep/utils/stock.js +65 -44
- package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +147 -122
- package/lib/solution/BookingTicket/types.js +38 -64
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +64 -80
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +82 -80
- package/lib/solution/BookingTicket/utils/scan/index.js +90 -94
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- package/lib/solution/BuyTickets/index.js +67 -70
- package/lib/solution/BuyTickets/types.js +22 -38
- package/lib/solution/Checkout/index.js +1451 -1158
- package/lib/solution/Checkout/types.js +91 -61
- package/lib/solution/Checkout/utils/index.js +227 -158
- package/lib/solution/PlaceOrder/index.js +55 -0
- package/lib/solution/RegisterAndLogin/config.js +493 -460
- package/lib/solution/RegisterAndLogin/index.js +633 -630
- package/lib/solution/RegisterAndLogin/types.js +189 -76
- package/lib/solution/RegisterAndLogin/utils.js +183 -125
- package/lib/solution/Sales/index.js +218 -200
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.js +803 -840
- package/lib/solution/ScanOrder/types.js +34 -34
- package/lib/solution/ScanOrder/utils.js +372 -331
- package/lib/solution/ShopDiscount/index.js +230 -236
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +309 -172
- package/lib/solution/VenueBooking/index.d.ts +5 -0
- package/lib/solution/VenueBooking/index.js +886 -929
- package/lib/solution/VenueBooking/types.js +20 -40
- package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.js +88 -106
- package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.js +102 -37
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.js +4 -16
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +81 -47
- package/package.json +2 -1
|
@@ -284,33 +284,29 @@ export function isProduction() {
|
|
|
284
284
|
*/
|
|
285
285
|
export var logger = {
|
|
286
286
|
info: function info(message) {
|
|
287
|
-
var _console;
|
|
288
287
|
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
289
288
|
args[_key3 - 1] = arguments[_key3];
|
|
290
289
|
}
|
|
291
|
-
(_console = console).log.apply(_console, ["[Checkout] ".concat(message)].concat(args));
|
|
292
290
|
},
|
|
293
291
|
warn: function warn(message) {
|
|
294
|
-
var
|
|
292
|
+
var _console;
|
|
295
293
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
296
294
|
args[_key4 - 1] = arguments[_key4];
|
|
297
295
|
}
|
|
298
|
-
(
|
|
296
|
+
(_console = console).warn.apply(_console, ["[Checkout] ".concat(message)].concat(args));
|
|
299
297
|
},
|
|
300
298
|
error: function error(message) {
|
|
301
|
-
var
|
|
299
|
+
var _console2;
|
|
302
300
|
for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
|
|
303
301
|
args[_key5 - 1] = arguments[_key5];
|
|
304
302
|
}
|
|
305
|
-
(
|
|
303
|
+
(_console2 = console).error.apply(_console2, ["[Checkout] ".concat(message)].concat(args));
|
|
306
304
|
},
|
|
307
305
|
debug: function debug(message) {
|
|
308
306
|
if (!isProduction()) {
|
|
309
|
-
var _console4;
|
|
310
307
|
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
311
308
|
args[_key6 - 1] = arguments[_key6];
|
|
312
309
|
}
|
|
313
|
-
(_console4 = console).debug.apply(_console4, ["[Checkout] ".concat(message)].concat(args));
|
|
314
310
|
}
|
|
315
311
|
}
|
|
316
312
|
};
|
|
@@ -424,14 +420,6 @@ export function extractAmountFromCartSummary(cartSummary) {
|
|
|
424
420
|
break;
|
|
425
421
|
}
|
|
426
422
|
});
|
|
427
|
-
console.log('[Checkout] 从购物车小计提取金额信息:', {
|
|
428
|
-
totalAmount: result.totalAmount,
|
|
429
|
-
subTotal: result.subTotal,
|
|
430
|
-
taxAmount: result.taxAmount,
|
|
431
|
-
discountAmount: result.discountAmount,
|
|
432
|
-
shopDiscountAmount: result.shopDiscountAmount,
|
|
433
|
-
roundingAmount: result.roundingAmount
|
|
434
|
-
});
|
|
435
423
|
return result;
|
|
436
424
|
}
|
|
437
425
|
|
|
@@ -331,10 +331,9 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
331
331
|
case 13:
|
|
332
332
|
// 预先调用获取区号的方法,初始内存缓存
|
|
333
333
|
this.getCountries();
|
|
334
|
-
|
|
335
|
-
_context4.next = 17;
|
|
334
|
+
_context4.next = 16;
|
|
336
335
|
return this.core.effects.emit(RegisterAndLoginHooks.onInited, {});
|
|
337
|
-
case
|
|
336
|
+
case 16:
|
|
338
337
|
case "end":
|
|
339
338
|
return _context4.stop();
|
|
340
339
|
}
|
|
@@ -2250,63 +2249,46 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2250
2249
|
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2251
2250
|
while (1) switch (_context35.prev = _context35.next) {
|
|
2252
2251
|
case 0:
|
|
2253
|
-
|
|
2254
|
-
tokenLength: (token === null || token === void 0 ? void 0 : token.length) || 0,
|
|
2255
|
-
timestamp: Date.now()
|
|
2256
|
-
});
|
|
2257
|
-
_context35.next = 3;
|
|
2252
|
+
_context35.next = 2;
|
|
2258
2253
|
return this.initFacebookSDK(token);
|
|
2259
|
-
case
|
|
2260
|
-
console.log('[RegisterAndLogin] Facebook SDK 初始化完成,准备调用 FB.login');
|
|
2254
|
+
case 2:
|
|
2261
2255
|
return _context35.abrupt("return", new Promise(function (resolve, reject) {
|
|
2262
|
-
console.log('[RegisterAndLogin] 调用 FB.login', {
|
|
2263
|
-
scope: 'email,public_profile'
|
|
2264
|
-
});
|
|
2265
2256
|
window.FB.login( /*#__PURE__*/function () {
|
|
2266
2257
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(response) {
|
|
2267
2258
|
var result;
|
|
2268
2259
|
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2269
2260
|
while (1) switch (_context34.prev = _context34.next) {
|
|
2270
2261
|
case 0:
|
|
2271
|
-
console.log('[RegisterAndLogin] FB.login 回调触发', {
|
|
2272
|
-
hasAuthResponse: Boolean(response === null || response === void 0 ? void 0 : response.authResponse),
|
|
2273
|
-
status: response === null || response === void 0 ? void 0 : response.status
|
|
2274
|
-
});
|
|
2275
2262
|
if (!response.authResponse) {
|
|
2276
|
-
_context34.next =
|
|
2263
|
+
_context34.next = 14;
|
|
2277
2264
|
break;
|
|
2278
2265
|
}
|
|
2279
|
-
_context34.prev =
|
|
2280
|
-
|
|
2281
|
-
console.log('[RegisterAndLogin] 调用后端 facebookLogin 接口');
|
|
2282
|
-
_context34.next = 6;
|
|
2266
|
+
_context34.prev = 1;
|
|
2267
|
+
_context34.next = 4;
|
|
2283
2268
|
return _this2.apiCaller.call('facebookLogin', {
|
|
2284
2269
|
token: response.authResponse.accessToken
|
|
2285
2270
|
});
|
|
2286
|
-
case
|
|
2271
|
+
case 4:
|
|
2287
2272
|
result = _context34.sent;
|
|
2288
|
-
console.log('[RegisterAndLogin] facebookLogin 接口返回成功', {
|
|
2289
|
-
hasResult: Boolean(result)
|
|
2290
|
-
});
|
|
2291
2273
|
resolve(result);
|
|
2292
|
-
_context34.next =
|
|
2274
|
+
_context34.next = 12;
|
|
2293
2275
|
break;
|
|
2294
|
-
case
|
|
2295
|
-
_context34.prev =
|
|
2296
|
-
_context34.t0 = _context34["catch"](
|
|
2276
|
+
case 8:
|
|
2277
|
+
_context34.prev = 8;
|
|
2278
|
+
_context34.t0 = _context34["catch"](1);
|
|
2297
2279
|
console.error('[RegisterAndLogin] facebookLogin 接口调用失败', _context34.t0);
|
|
2298
2280
|
reject(_context34.t0);
|
|
2299
|
-
case
|
|
2300
|
-
_context34.next =
|
|
2281
|
+
case 12:
|
|
2282
|
+
_context34.next = 16;
|
|
2301
2283
|
break;
|
|
2302
|
-
case
|
|
2284
|
+
case 14:
|
|
2303
2285
|
console.warn('[RegisterAndLogin] FB.login 用户取消授权或无 authResponse', response);
|
|
2304
2286
|
reject(new Error('facebook_login_cancel'));
|
|
2305
|
-
case
|
|
2287
|
+
case 16:
|
|
2306
2288
|
case "end":
|
|
2307
2289
|
return _context34.stop();
|
|
2308
2290
|
}
|
|
2309
|
-
}, _callee34, null, [[
|
|
2291
|
+
}, _callee34, null, [[1, 8]]);
|
|
2310
2292
|
}));
|
|
2311
2293
|
return function (_x31) {
|
|
2312
2294
|
return _ref.apply(this, arguments);
|
|
@@ -2315,7 +2297,7 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2315
2297
|
scope: 'email,public_profile'
|
|
2316
2298
|
});
|
|
2317
2299
|
}));
|
|
2318
|
-
case
|
|
2300
|
+
case 3:
|
|
2319
2301
|
case "end":
|
|
2320
2302
|
return _context35.stop();
|
|
2321
2303
|
}
|
|
@@ -2338,20 +2320,14 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2338
2320
|
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
2339
2321
|
while (1) switch (_context37.prev = _context37.next) {
|
|
2340
2322
|
case 0:
|
|
2341
|
-
|
|
2342
|
-
console.log('[RegisterAndLogin] Apple 登录开始', {
|
|
2343
|
-
tokenLength: (token === null || token === void 0 ? void 0 : token.length) || 0,
|
|
2344
|
-
timestamp: Date.now()
|
|
2345
|
-
});
|
|
2346
|
-
_context37.next = 3;
|
|
2323
|
+
_context37.next = 2;
|
|
2347
2324
|
return this.initAppleSDK();
|
|
2348
|
-
case
|
|
2349
|
-
console.log('[RegisterAndLogin] Apple SDK 初始化完成');
|
|
2325
|
+
case 2:
|
|
2350
2326
|
return _context37.abrupt("return", new Promise(function (resolve, reject) {
|
|
2351
2327
|
try {
|
|
2352
2328
|
var _AppleID, _AppleID2;
|
|
2353
2329
|
// 动态创建 Apple 登录按钮元素
|
|
2354
|
-
|
|
2330
|
+
|
|
2355
2331
|
var appleSignInDiv = document.createElement('div');
|
|
2356
2332
|
appleSignInDiv.id = 'appleid-signin-temp';
|
|
2357
2333
|
appleSignInDiv.setAttribute('data-color', 'black');
|
|
@@ -2368,11 +2344,8 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2368
2344
|
|
|
2369
2345
|
// 将元素添加到 body 中
|
|
2370
2346
|
document.body.appendChild(appleSignInDiv);
|
|
2371
|
-
console.log('[RegisterAndLogin] Apple SignIn 按钮已添加到文档');
|
|
2372
|
-
|
|
2373
2347
|
// 初始化 Apple ID 按钮
|
|
2374
2348
|
if ((_AppleID = window.AppleID) !== null && _AppleID !== void 0 && (_AppleID = _AppleID.auth) !== null && _AppleID !== void 0 && _AppleID.init) {
|
|
2375
|
-
console.log('[RegisterAndLogin] 调用 AppleID.auth.init');
|
|
2376
2349
|
window.AppleID.auth.init({
|
|
2377
2350
|
clientId: token,
|
|
2378
2351
|
// 使用传入的 token 作为 clientId
|
|
@@ -2387,7 +2360,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2387
2360
|
|
|
2388
2361
|
// 直接调用 Apple ID 登录,并处理 Promise
|
|
2389
2362
|
if ((_AppleID2 = window.AppleID) !== null && _AppleID2 !== void 0 && (_AppleID2 = _AppleID2.auth) !== null && _AppleID2 !== void 0 && _AppleID2.signIn) {
|
|
2390
|
-
console.log('[RegisterAndLogin] 调用 AppleID.auth.signIn');
|
|
2391
2363
|
window.AppleID.auth.signIn().then( /*#__PURE__*/function () {
|
|
2392
2364
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(authResult) {
|
|
2393
2365
|
var _authResult$authoriza, _authResult$authoriza2, authorizationCode, identityToken, result;
|
|
@@ -2399,44 +2371,29 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2399
2371
|
if (document.body.contains(appleSignInDiv)) {
|
|
2400
2372
|
document.body.removeChild(appleSignInDiv);
|
|
2401
2373
|
}
|
|
2402
|
-
console.log('[RegisterAndLogin] Apple SignIn 成功,临时节点已移除', {
|
|
2403
|
-
hasAuthorization: Boolean(authResult === null || authResult === void 0 ? void 0 : authResult.authorization),
|
|
2404
|
-
hasUser: Boolean(authResult === null || authResult === void 0 ? void 0 : authResult.user)
|
|
2405
|
-
});
|
|
2406
|
-
|
|
2407
2374
|
// 获取授权码或令牌
|
|
2408
2375
|
authorizationCode = (_authResult$authoriza = authResult.authorization) === null || _authResult$authoriza === void 0 ? void 0 : _authResult$authoriza.code;
|
|
2409
|
-
identityToken = (_authResult$authoriza2 = authResult.authorization) === null || _authResult$authoriza2 === void 0 ? void 0 : _authResult$authoriza2.id_token;
|
|
2410
|
-
|
|
2411
|
-
hasAuthorizationCode: Boolean(authorizationCode),
|
|
2412
|
-
hasIdentityToken: Boolean(identityToken)
|
|
2413
|
-
});
|
|
2414
|
-
|
|
2415
|
-
// 使用授权码或身份令牌调用后端接口
|
|
2416
|
-
console.log('[RegisterAndLogin] 调用后端 appleLogin 接口');
|
|
2417
|
-
_context36.next = 9;
|
|
2376
|
+
identityToken = (_authResult$authoriza2 = authResult.authorization) === null || _authResult$authoriza2 === void 0 ? void 0 : _authResult$authoriza2.id_token; // 使用授权码或身份令牌调用后端接口
|
|
2377
|
+
_context36.next = 6;
|
|
2418
2378
|
return _this3.apiCaller.call('appleLogin', {
|
|
2419
2379
|
code: identityToken || authorizationCode,
|
|
2420
2380
|
login_channel: _this3.channel
|
|
2421
2381
|
});
|
|
2422
|
-
case
|
|
2382
|
+
case 6:
|
|
2423
2383
|
result = _context36.sent;
|
|
2424
|
-
console.log('[RegisterAndLogin] appleLogin 接口返回成功', {
|
|
2425
|
-
hasResult: Boolean(result)
|
|
2426
|
-
});
|
|
2427
2384
|
resolve(result);
|
|
2428
|
-
_context36.next =
|
|
2385
|
+
_context36.next = 14;
|
|
2429
2386
|
break;
|
|
2430
|
-
case
|
|
2431
|
-
_context36.prev =
|
|
2387
|
+
case 10:
|
|
2388
|
+
_context36.prev = 10;
|
|
2432
2389
|
_context36.t0 = _context36["catch"](0);
|
|
2433
2390
|
console.error('[RegisterAndLogin] 处理 Apple 登录结果失败', _context36.t0);
|
|
2434
2391
|
reject(_context36.t0);
|
|
2435
|
-
case
|
|
2392
|
+
case 14:
|
|
2436
2393
|
case "end":
|
|
2437
2394
|
return _context36.stop();
|
|
2438
2395
|
}
|
|
2439
|
-
}, _callee36, null, [[0,
|
|
2396
|
+
}, _callee36, null, [[0, 10]]);
|
|
2440
2397
|
}));
|
|
2441
2398
|
return function (_x33) {
|
|
2442
2399
|
return _ref2.apply(this, arguments);
|
|
@@ -2458,7 +2415,7 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2458
2415
|
reject(error);
|
|
2459
2416
|
}
|
|
2460
2417
|
}));
|
|
2461
|
-
case
|
|
2418
|
+
case 3:
|
|
2462
2419
|
case "end":
|
|
2463
2420
|
return _context37.stop();
|
|
2464
2421
|
}
|
|
@@ -2620,7 +2577,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2620
2577
|
} catch (error) {
|
|
2621
2578
|
console.warn('[RegisterAndLogin] localStorage 更新失败:', error);
|
|
2622
2579
|
}
|
|
2623
|
-
console.log('[RegisterAndLogin] 国家数据已更新');
|
|
2624
2580
|
}
|
|
2625
2581
|
}
|
|
2626
2582
|
_context39.next = 10;
|
|
@@ -2650,8 +2606,6 @@ export var RegisterAndLoginImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2650
2606
|
_context40.next = 2;
|
|
2651
2607
|
return this.core.effects.emit(RegisterAndLoginHooks.onDestroy, {});
|
|
2652
2608
|
case 2:
|
|
2653
|
-
console.log('[RegisterAndLogin] 已销毁');
|
|
2654
|
-
case 3:
|
|
2655
2609
|
case "end":
|
|
2656
2610
|
return _context40.stop();
|
|
2657
2611
|
}
|
|
@@ -165,12 +165,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
165
165
|
payload: payload,
|
|
166
166
|
extra: extra
|
|
167
167
|
});
|
|
168
|
-
} else {
|
|
169
|
-
console.log('[ScanOrder][log-fallback]', params.title, {
|
|
170
|
-
payload: payload,
|
|
171
|
-
extra: extra
|
|
172
|
-
});
|
|
173
|
-
}
|
|
168
|
+
} else {}
|
|
174
169
|
return _context.abrupt("return");
|
|
175
170
|
case 6:
|
|
176
171
|
_context.next = 8;
|
|
@@ -574,50 +569,48 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
574
569
|
})
|
|
575
570
|
});
|
|
576
571
|
this.registerCustomerLoginListeners();
|
|
577
|
-
|
|
578
|
-
_context7.
|
|
579
|
-
_context7.next = 35;
|
|
572
|
+
_context7.prev = 31;
|
|
573
|
+
_context7.next = 34;
|
|
580
574
|
return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
|
|
581
575
|
createIfMissing: false
|
|
582
576
|
});
|
|
583
|
-
case
|
|
577
|
+
case 34:
|
|
584
578
|
(_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
|
|
585
|
-
_context7.next =
|
|
579
|
+
_context7.next = 37;
|
|
586
580
|
return this.loadRuntimeConfigs();
|
|
587
|
-
case
|
|
581
|
+
case 37:
|
|
588
582
|
if (!this.store.schedule) {
|
|
589
|
-
_context7.next =
|
|
583
|
+
_context7.next = 46;
|
|
590
584
|
break;
|
|
591
585
|
}
|
|
592
|
-
_context7.prev =
|
|
593
|
-
_context7.next =
|
|
586
|
+
_context7.prev = 38;
|
|
587
|
+
_context7.next = 41;
|
|
594
588
|
return this.store.schedule.loadAllSchedule();
|
|
595
|
-
case
|
|
596
|
-
_context7.next =
|
|
589
|
+
case 41:
|
|
590
|
+
_context7.next = 46;
|
|
597
591
|
break;
|
|
598
|
-
case
|
|
599
|
-
_context7.prev =
|
|
600
|
-
_context7.t0 = _context7["catch"](
|
|
592
|
+
case 43:
|
|
593
|
+
_context7.prev = 43;
|
|
594
|
+
_context7.t0 = _context7["catch"](38);
|
|
601
595
|
console.warn('[ScanOrder] loadAllSchedule 失败,operating_hours 判定将跳过', _context7.t0);
|
|
602
|
-
case
|
|
603
|
-
_context7.next =
|
|
596
|
+
case 46:
|
|
597
|
+
_context7.next = 48;
|
|
604
598
|
return this.refreshItemRuleQuantityLimits();
|
|
605
|
-
case
|
|
599
|
+
case 48:
|
|
606
600
|
this.store.status = 'ready';
|
|
607
|
-
|
|
608
|
-
_context7.next = 53;
|
|
601
|
+
_context7.next = 51;
|
|
609
602
|
return this.core.effects.emit(ScanOrderHooks.onInited, {
|
|
610
603
|
status: this.store.status
|
|
611
604
|
});
|
|
612
|
-
case
|
|
605
|
+
case 51:
|
|
613
606
|
this.logMethodSuccess('initialize', {
|
|
614
607
|
status: this.store.status
|
|
615
608
|
});
|
|
616
|
-
_context7.next =
|
|
609
|
+
_context7.next = 61;
|
|
617
610
|
break;
|
|
618
|
-
case
|
|
619
|
-
_context7.prev =
|
|
620
|
-
_context7.t1 = _context7["catch"](
|
|
611
|
+
case 54:
|
|
612
|
+
_context7.prev = 54;
|
|
613
|
+
_context7.t1 = _context7["catch"](31);
|
|
621
614
|
this.store.status = 'error';
|
|
622
615
|
this.store.error = _context7.t1 instanceof Error ? _context7.t1.message : '初始化失败';
|
|
623
616
|
console.error('[ScanOrder] 初始化失败', _context7.t1);
|
|
@@ -625,11 +618,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
625
618
|
status: this.store.status
|
|
626
619
|
});
|
|
627
620
|
throw _context7.t1;
|
|
628
|
-
case
|
|
621
|
+
case 61:
|
|
629
622
|
case "end":
|
|
630
623
|
return _context7.stop();
|
|
631
624
|
}
|
|
632
|
-
}, _callee7, this, [[
|
|
625
|
+
}, _callee7, this, [[31, 54], [38, 43]]);
|
|
633
626
|
}));
|
|
634
627
|
function initialize(_x5) {
|
|
635
628
|
return _initialize.apply(this, arguments);
|
|
@@ -652,9 +645,8 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
652
645
|
return this.destroyRegisteredChildModules();
|
|
653
646
|
case 6:
|
|
654
647
|
_get(_getPrototypeOf(ScanOrderImpl.prototype), "destroy", this).call(this);
|
|
655
|
-
console.log('[ScanOrder] 已销毁');
|
|
656
648
|
this.logMethodSuccess('destroy');
|
|
657
|
-
case
|
|
649
|
+
case 8:
|
|
658
650
|
case "end":
|
|
659
651
|
return _context8.stop();
|
|
660
652
|
}
|
|
@@ -674,27 +666,26 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
674
666
|
case 0:
|
|
675
667
|
this.logMethodStart('retryInit');
|
|
676
668
|
// TODO: 细化重试策略(指数退避、最大重试次数)后替换当前实现
|
|
677
|
-
|
|
678
|
-
_context9.next = 4;
|
|
669
|
+
_context9.next = 3;
|
|
679
670
|
return this.core.effects.emit(ScanOrderHooks.onRetryInit, {});
|
|
680
|
-
case
|
|
681
|
-
_context9.prev =
|
|
682
|
-
_context9.next =
|
|
671
|
+
case 3:
|
|
672
|
+
_context9.prev = 3;
|
|
673
|
+
_context9.next = 6;
|
|
683
674
|
return this.initialize(this.core, this.initializeOptions);
|
|
684
|
-
case
|
|
675
|
+
case 6:
|
|
685
676
|
this.logMethodSuccess('retryInit');
|
|
686
|
-
_context9.next =
|
|
677
|
+
_context9.next = 13;
|
|
687
678
|
break;
|
|
688
|
-
case
|
|
689
|
-
_context9.prev =
|
|
690
|
-
_context9.t0 = _context9["catch"](
|
|
679
|
+
case 9:
|
|
680
|
+
_context9.prev = 9;
|
|
681
|
+
_context9.t0 = _context9["catch"](3);
|
|
691
682
|
this.logMethodError('retryInit', _context9.t0);
|
|
692
683
|
throw _context9.t0;
|
|
693
|
-
case
|
|
684
|
+
case 13:
|
|
694
685
|
case "end":
|
|
695
686
|
return _context9.stop();
|
|
696
687
|
}
|
|
697
|
-
}, _callee9, this, [[
|
|
688
|
+
}, _callee9, this, [[3, 9]]);
|
|
698
689
|
}));
|
|
699
690
|
function retryInit() {
|
|
700
691
|
return _retryInit.apply(this, arguments);
|
|
@@ -710,36 +701,35 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
710
701
|
case 0:
|
|
711
702
|
this.logMethodStart('refresh');
|
|
712
703
|
// TODO: 接入真实刷新逻辑(资源重拉取、流程重建)后替换当前实现
|
|
713
|
-
|
|
714
|
-
_context10.prev = 2;
|
|
704
|
+
_context10.prev = 1;
|
|
715
705
|
this.store.status = 'initializing';
|
|
716
|
-
_context10.next =
|
|
706
|
+
_context10.next = 5;
|
|
717
707
|
return this.loadRuntimeConfigs();
|
|
718
|
-
case
|
|
719
|
-
_context10.next =
|
|
708
|
+
case 5:
|
|
709
|
+
_context10.next = 7;
|
|
720
710
|
return this.refreshItemRuleQuantityLimits();
|
|
721
|
-
case
|
|
711
|
+
case 7:
|
|
722
712
|
this.store.status = 'ready';
|
|
723
|
-
_context10.next =
|
|
713
|
+
_context10.next = 10;
|
|
724
714
|
return this.core.effects.emit(ScanOrderHooks.onRefresh, {
|
|
725
715
|
status: this.store.status
|
|
726
716
|
});
|
|
727
|
-
case
|
|
717
|
+
case 10:
|
|
728
718
|
this.logMethodSuccess('refresh', {
|
|
729
719
|
status: this.store.status
|
|
730
720
|
});
|
|
731
|
-
_context10.next =
|
|
721
|
+
_context10.next = 17;
|
|
732
722
|
break;
|
|
733
|
-
case
|
|
734
|
-
_context10.prev =
|
|
735
|
-
_context10.t0 = _context10["catch"](
|
|
723
|
+
case 13:
|
|
724
|
+
_context10.prev = 13;
|
|
725
|
+
_context10.t0 = _context10["catch"](1);
|
|
736
726
|
this.logMethodError('refresh', _context10.t0);
|
|
737
727
|
throw _context10.t0;
|
|
738
|
-
case
|
|
728
|
+
case 17:
|
|
739
729
|
case "end":
|
|
740
730
|
return _context10.stop();
|
|
741
731
|
}
|
|
742
|
-
}, _callee10, this, [[
|
|
732
|
+
}, _callee10, this, [[1, 13]]);
|
|
743
733
|
}));
|
|
744
734
|
function refresh() {
|
|
745
735
|
return _refresh.apply(this, arguments);
|
|
@@ -76,8 +76,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
76
76
|
this.options = options;
|
|
77
77
|
this.store = _objectSpread(_objectSpread({}, this.store), options.store || {});
|
|
78
78
|
this.hooks = (_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 || (_options$otherParams = _options$otherParams.rules) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.hooks;
|
|
79
|
-
console.log('[ShopDiscount] 初始化完成');
|
|
80
|
-
|
|
81
79
|
// 获取依赖的插件
|
|
82
80
|
this.initializePlugins();
|
|
83
81
|
|
|
@@ -86,7 +84,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
86
84
|
|
|
87
85
|
// 注册事件监听
|
|
88
86
|
this.registerEventListeners();
|
|
89
|
-
case
|
|
87
|
+
case 7:
|
|
90
88
|
case "end":
|
|
91
89
|
return _context.stop();
|
|
92
90
|
}
|
|
@@ -113,8 +111,6 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
113
111
|
_context2.next = 7;
|
|
114
112
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
115
113
|
case 7:
|
|
116
|
-
console.log('[ShopDiscount] 已销毁');
|
|
117
|
-
case 8:
|
|
118
114
|
case "end":
|
|
119
115
|
return _context2.stop();
|
|
120
116
|
}
|
|
@@ -137,8 +133,7 @@ export var ShopDiscountImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
137
133
|
this.store.customer = null;
|
|
138
134
|
(_this$store$discount2 = this.store.discount) === null || _this$store$discount2 === void 0 || _this$store$discount2.clear();
|
|
139
135
|
(_this$store$rules2 = this.store.rules) === null || _this$store$rules2 === void 0 || _this$store$rules2.clear();
|
|
140
|
-
|
|
141
|
-
case 5:
|
|
136
|
+
case 4:
|
|
142
137
|
case "end":
|
|
143
138
|
return _context3.stop();
|
|
144
139
|
}
|
|
@@ -198,6 +198,11 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
|
|
|
198
198
|
getOrderProducts(): ScanOrderOrderProduct[];
|
|
199
199
|
getSummary(): Promise<import("./types").ScanOrderSummary>;
|
|
200
200
|
submitOrder<T = any>(): Promise<T>;
|
|
201
|
+
/**
|
|
202
|
+
* 0 元订单免费领取(非定金场景)
|
|
203
|
+
* 与 appointment getFreeProduct 同接口:POST /pay/order/free-pay/:id
|
|
204
|
+
*/
|
|
205
|
+
submitFreeOrder(id: string | number): Promise<any>;
|
|
201
206
|
addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|
|
202
207
|
updateProductInOrder(params: UpdateProductInOrderParams): Promise<ScanOrderOrderProduct[]>;
|
|
203
208
|
removeProductFromOrder(identity: ScanOrderOrderProductIdentity): Promise<ScanOrderOrderProduct[]>;
|