@pisell/private-materials 6.7.1 → 6.7.2
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/es/plus/webPosLogin/WebPosLogin.d.ts +11 -0
- package/es/plus/webPosLogin/WebPosLogin.js +552 -0
- package/es/plus/webPosLogin/WebPosLoginCpt.d.ts +9 -0
- package/es/plus/webPosLogin/WebPosLoginCpt.js +170 -0
- package/es/plus/webPosLogin/WebPosLoginCpt.less +171 -0
- package/es/plus/webPosLogin/components/BrandPanel/index.d.ts +9 -0
- package/es/plus/webPosLogin/components/BrandPanel/index.js +52 -0
- package/es/plus/webPosLogin/components/BrandPanel/index.less +58 -0
- package/es/plus/webPosLogin/components/LoginPanel/index.d.ts +21 -0
- package/es/plus/webPosLogin/components/LoginPanel/index.js +73 -0
- package/es/plus/webPosLogin/components/LoginPanel/index.less +43 -0
- package/es/plus/webPosLogin/components/SelectDevice/index.d.ts +28 -0
- package/es/plus/webPosLogin/components/SelectDevice/index.js +258 -0
- package/es/plus/webPosLogin/components/SelectDevice/index.less +167 -0
- package/es/plus/webPosLogin/components/SelectStore/index.d.ts +24 -0
- package/es/plus/webPosLogin/components/SelectStore/index.js +198 -0
- package/es/plus/webPosLogin/components/SelectStore/index.less +157 -0
- package/es/plus/webPosLogin/components/UserFooter/index.d.ts +28 -0
- package/es/plus/webPosLogin/components/UserFooter/index.js +110 -0
- package/es/plus/webPosLogin/components/UserFooter/index.less +70 -0
- package/es/plus/webPosLogin/index.d.ts +12 -0
- package/es/plus/webPosLogin/index.js +15 -0
- package/es/plus/webPosLogin/locales.d.ts +49 -0
- package/es/plus/webPosLogin/locales.js +57 -0
- package/es/plus/webPosLogin/service.d.ts +44 -0
- package/es/plus/webPosLogin/service.js +198 -0
- package/es/plus/webPosLogin/types.d.ts +286 -0
- package/es/plus/webPosLogin/types.js +1 -0
- package/es/pro/pisellPaymentList/example.d.ts +1 -0
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/lib/plus/webPosLogin/WebPosLogin.d.ts +11 -0
- package/lib/plus/webPosLogin/WebPosLogin.js +334 -0
- package/lib/plus/webPosLogin/WebPosLoginCpt.d.ts +9 -0
- package/lib/plus/webPosLogin/WebPosLoginCpt.js +170 -0
- package/lib/plus/webPosLogin/WebPosLoginCpt.less +171 -0
- package/lib/plus/webPosLogin/components/BrandPanel/index.d.ts +9 -0
- package/lib/plus/webPosLogin/components/BrandPanel/index.js +63 -0
- package/lib/plus/webPosLogin/components/BrandPanel/index.less +58 -0
- package/lib/plus/webPosLogin/components/LoginPanel/index.d.ts +21 -0
- package/lib/plus/webPosLogin/components/LoginPanel/index.js +98 -0
- package/lib/plus/webPosLogin/components/LoginPanel/index.less +43 -0
- package/lib/plus/webPosLogin/components/SelectDevice/index.d.ts +28 -0
- package/lib/plus/webPosLogin/components/SelectDevice/index.js +158 -0
- package/lib/plus/webPosLogin/components/SelectDevice/index.less +167 -0
- package/lib/plus/webPosLogin/components/SelectStore/index.d.ts +24 -0
- package/lib/plus/webPosLogin/components/SelectStore/index.js +123 -0
- package/lib/plus/webPosLogin/components/SelectStore/index.less +157 -0
- package/lib/plus/webPosLogin/components/UserFooter/index.d.ts +28 -0
- package/lib/plus/webPosLogin/components/UserFooter/index.js +91 -0
- package/lib/plus/webPosLogin/components/UserFooter/index.less +70 -0
- package/lib/plus/webPosLogin/index.d.ts +12 -0
- package/lib/plus/webPosLogin/index.js +56 -0
- package/lib/plus/webPosLogin/locales.d.ts +49 -0
- package/lib/plus/webPosLogin/locales.js +77 -0
- package/lib/plus/webPosLogin/service.d.ts +44 -0
- package/lib/plus/webPosLogin/service.js +94 -0
- package/lib/plus/webPosLogin/types.d.ts +286 -0
- package/lib/plus/webPosLogin/types.js +17 -0
- package/lib/pro/pisellPaymentList/example.d.ts +1 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +1 -0
- package/lowcode/web-pos-login/meta.ts +71 -0
- package/package.json +4 -4
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import React, { useState } from 'react';
|
|
17
|
+
import { PisellToast } from '@pisell/materials';
|
|
18
|
+
import { locales } from '@pisell/utils';
|
|
19
|
+
import WebPosLoginCpt from "./WebPosLoginCpt";
|
|
20
|
+
import useEngineContext from "../../hooks/useEngineContext";
|
|
21
|
+
import { dissociateDevice, getDeviceList, getTenant, getTenantDetail, selectDevice } from "./service";
|
|
22
|
+
import { request } from "../../utils";
|
|
23
|
+
var useSearchParams = function useSearchParams() {
|
|
24
|
+
return new URLSearchParams(window.location.search);
|
|
25
|
+
};
|
|
26
|
+
var WebPosLogin = function WebPosLogin(props) {
|
|
27
|
+
var _context$appHelper, _context$engine;
|
|
28
|
+
var context = useEngineContext();
|
|
29
|
+
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
30
|
+
_context$appHelper$ut2 = _context$appHelper$ut.getApp,
|
|
31
|
+
getApp = _context$appHelper$ut2 === void 0 ? function () {
|
|
32
|
+
return {};
|
|
33
|
+
} : _context$appHelper$ut2;
|
|
34
|
+
var backgroundImage = props.backgroundImage,
|
|
35
|
+
_props$step = props.step,
|
|
36
|
+
propsStep = _props$step === void 0 ? 'login' : _props$step,
|
|
37
|
+
config = props.config;
|
|
38
|
+
var _useState = useState(function () {
|
|
39
|
+
var _app$storage;
|
|
40
|
+
var app = getApp();
|
|
41
|
+
var storeList = app === null || app === void 0 || (_app$storage = app.storage) === null || _app$storage === void 0 ? void 0 : _app$storage.getStorage('storeList');
|
|
42
|
+
if (!storeList) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
return JSON.parse(storeList);
|
|
46
|
+
}),
|
|
47
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48
|
+
storeList = _useState2[0],
|
|
49
|
+
setStoreList = _useState2[1];
|
|
50
|
+
// 优先取url 参数中的step,否则取props.step
|
|
51
|
+
var urlStep = useSearchParams().get('step');
|
|
52
|
+
// 当前步骤
|
|
53
|
+
var _useState3 = useState(function () {
|
|
54
|
+
if (urlStep && urlStep !== 'undefined') {
|
|
55
|
+
return urlStep;
|
|
56
|
+
}
|
|
57
|
+
return props.step || 'login';
|
|
58
|
+
}),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
step = _useState4[0],
|
|
61
|
+
setStep = _useState4[1];
|
|
62
|
+
|
|
63
|
+
// 当前用户信息
|
|
64
|
+
var _useState5 = useState(function () {
|
|
65
|
+
var _app$storage2;
|
|
66
|
+
var app = getApp();
|
|
67
|
+
var userInfo = (app === null || app === void 0 || (_app$storage2 = app.storage) === null || _app$storage2 === void 0 ? void 0 : _app$storage2.getStorage('userInfo')) || '{}';
|
|
68
|
+
var userInfoObj = JSON.parse(userInfo);
|
|
69
|
+
return {
|
|
70
|
+
name: (userInfoObj === null || userInfoObj === void 0 ? void 0 : userInfoObj.name) || '',
|
|
71
|
+
avatar: (userInfoObj === null || userInfoObj === void 0 ? void 0 : userInfoObj.avatar) || ''
|
|
72
|
+
};
|
|
73
|
+
}),
|
|
74
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
75
|
+
userInfo = _useState6[0],
|
|
76
|
+
setUserInfo = _useState6[1];
|
|
77
|
+
|
|
78
|
+
// 当前选中的店铺
|
|
79
|
+
var _useState7 = useState(function () {
|
|
80
|
+
var _app$storage3;
|
|
81
|
+
var app = getApp();
|
|
82
|
+
var selectedStore = (app === null || app === void 0 || (_app$storage3 = app.storage) === null || _app$storage3 === void 0 ? void 0 : _app$storage3.getStorage('selectedStore')) || '{}';
|
|
83
|
+
return JSON.parse(selectedStore);
|
|
84
|
+
}),
|
|
85
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
86
|
+
selectedStore = _useState8[0],
|
|
87
|
+
setSelectedStore = _useState8[1];
|
|
88
|
+
|
|
89
|
+
// 设备列表
|
|
90
|
+
var _useState9 = useState(function () {
|
|
91
|
+
var _app$storage4;
|
|
92
|
+
var app = getApp();
|
|
93
|
+
var deviceList = (app === null || app === void 0 || (_app$storage4 = app.storage) === null || _app$storage4 === void 0 ? void 0 : _app$storage4.getStorage('deviceList')) || '[]';
|
|
94
|
+
return JSON.parse(deviceList);
|
|
95
|
+
}),
|
|
96
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
97
|
+
deviceList = _useState10[0],
|
|
98
|
+
setDeviceList = _useState10[1];
|
|
99
|
+
|
|
100
|
+
// 上次使用的店铺ID
|
|
101
|
+
var _useState11 = useState(function () {
|
|
102
|
+
var _app$storage5, _JSON$parse;
|
|
103
|
+
var app = getApp();
|
|
104
|
+
var lastUsedStore = (app === null || app === void 0 || (_app$storage5 = app.storage) === null || _app$storage5 === void 0 ? void 0 : _app$storage5.getStorage('selectedStore')) || '{}';
|
|
105
|
+
var lastUsedStoreId = ((_JSON$parse = JSON.parse(lastUsedStore)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.id) || 0;
|
|
106
|
+
return parseInt(lastUsedStoreId);
|
|
107
|
+
}),
|
|
108
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
109
|
+
lastUsedStoreId = _useState12[0],
|
|
110
|
+
setLastUsedStoreId = _useState12[1];
|
|
111
|
+
|
|
112
|
+
// 上次使用的设备ID
|
|
113
|
+
var _useState13 = useState(function () {
|
|
114
|
+
var _app$storage6, _JSON$parse2;
|
|
115
|
+
var app = getApp();
|
|
116
|
+
var lastUsedDevice = (app === null || app === void 0 || (_app$storage6 = app.storage) === null || _app$storage6 === void 0 ? void 0 : _app$storage6.getStorage('lastUsedDevice')) || '{}';
|
|
117
|
+
var lastUsedDeviceId = ((_JSON$parse2 = JSON.parse(lastUsedDevice)) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.id) || 0;
|
|
118
|
+
return parseInt(lastUsedDeviceId);
|
|
119
|
+
}),
|
|
120
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
121
|
+
lastUsedDeviceId = _useState14[0],
|
|
122
|
+
setLastUsedDeviceId = _useState14[1];
|
|
123
|
+
|
|
124
|
+
// 是否显示返回按钮
|
|
125
|
+
var _useState15 = useState(true),
|
|
126
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
127
|
+
isShowGoBack = _useState16[0],
|
|
128
|
+
setIsShowGoBack = _useState16[1];
|
|
129
|
+
request.setRequest(context.appHelper.utils.request);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 登录成功
|
|
133
|
+
* @param res 登录信息
|
|
134
|
+
*/
|
|
135
|
+
var onLoginSuccess = /*#__PURE__*/function () {
|
|
136
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
|
|
137
|
+
var _app$getPlugin, _app$storage7, _res$account, _res$account2, _app$storage8;
|
|
138
|
+
var app, tenant, lastUsedStore;
|
|
139
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
140
|
+
while (1) switch (_context.prev = _context.next) {
|
|
141
|
+
case 0:
|
|
142
|
+
app = getApp();
|
|
143
|
+
if (res) {
|
|
144
|
+
_context.next = 3;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
return _context.abrupt("return");
|
|
148
|
+
case 3:
|
|
149
|
+
// 保存登录信息,如果用户选择了店铺需要更新token
|
|
150
|
+
app === null || app === void 0 || (_app$getPlugin = app.getPlugin('token')) === null || _app$getPlugin === void 0 || _app$getPlugin.set(res === null || res === void 0 ? void 0 : res.authorization);
|
|
151
|
+
app === null || app === void 0 || (_app$storage7 = app.storage) === null || _app$storage7 === void 0 || _app$storage7.setStorage('account', JSON.stringify(_objectSpread(_objectSpread({}, res === null || res === void 0 ? void 0 : res.account), res)));
|
|
152
|
+
setUserInfo({
|
|
153
|
+
name: (res === null || res === void 0 || (_res$account = res.account) === null || _res$account === void 0 ? void 0 : _res$account.name) || '',
|
|
154
|
+
avatar: (res === null || res === void 0 || (_res$account2 = res.account) === null || _res$account2 === void 0 ? void 0 : _res$account2.avatar) || ''
|
|
155
|
+
});
|
|
156
|
+
_context.next = 8;
|
|
157
|
+
return getTenant();
|
|
158
|
+
case 8:
|
|
159
|
+
tenant = _context.sent;
|
|
160
|
+
app === null || app === void 0 || (_app$storage8 = app.storage) === null || _app$storage8 === void 0 || _app$storage8.setStorage('storeList', JSON.stringify(tenant || {}));
|
|
161
|
+
|
|
162
|
+
// 上次使用的店铺
|
|
163
|
+
lastUsedStore = tenant === null || tenant === void 0 ? void 0 : tenant.find(function (item) {
|
|
164
|
+
return item.id == lastUsedStoreId;
|
|
165
|
+
}); // 如果只有一个店铺,直接选择该店铺并进入下一步,否则进入选择店铺页面
|
|
166
|
+
if (!((tenant === null || tenant === void 0 ? void 0 : tenant.length) === 1)) {
|
|
167
|
+
_context.next = 16;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
_context.next = 14;
|
|
171
|
+
return handleStoreSelect(tenant[0], false);
|
|
172
|
+
case 14:
|
|
173
|
+
_context.next = 22;
|
|
174
|
+
break;
|
|
175
|
+
case 16:
|
|
176
|
+
if (!lastUsedStore) {
|
|
177
|
+
_context.next = 21;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
_context.next = 19;
|
|
181
|
+
return handleStoreSelect(lastUsedStore, false);
|
|
182
|
+
case 19:
|
|
183
|
+
_context.next = 22;
|
|
184
|
+
break;
|
|
185
|
+
case 21:
|
|
186
|
+
setStep('store');
|
|
187
|
+
case 22:
|
|
188
|
+
setStoreList(tenant);
|
|
189
|
+
case 23:
|
|
190
|
+
case "end":
|
|
191
|
+
return _context.stop();
|
|
192
|
+
}
|
|
193
|
+
}, _callee);
|
|
194
|
+
}));
|
|
195
|
+
return function onLoginSuccess(_x) {
|
|
196
|
+
return _ref.apply(this, arguments);
|
|
197
|
+
};
|
|
198
|
+
}();
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 返回
|
|
202
|
+
*/
|
|
203
|
+
var onBack = function onBack() {
|
|
204
|
+
if (step === 'store') {
|
|
205
|
+
setStep('login');
|
|
206
|
+
} else if (step === 'device') {
|
|
207
|
+
setStep('store');
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* 选择店铺
|
|
213
|
+
* @param shopInfo 店铺信息
|
|
214
|
+
*/
|
|
215
|
+
var handleStoreSelect = /*#__PURE__*/function () {
|
|
216
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(shopInfo) {
|
|
217
|
+
var _shopInfo$tenant, _app$logger;
|
|
218
|
+
var isShowGoBack,
|
|
219
|
+
app,
|
|
220
|
+
_res$mypisell_data,
|
|
221
|
+
_app$getPlugin2,
|
|
222
|
+
_res$mypisell_data2,
|
|
223
|
+
_app$logger2,
|
|
224
|
+
res,
|
|
225
|
+
_app$getPlugin3,
|
|
226
|
+
_app$logger3,
|
|
227
|
+
_args2 = arguments;
|
|
228
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
229
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
230
|
+
case 0:
|
|
231
|
+
isShowGoBack = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : true;
|
|
232
|
+
app = getApp();
|
|
233
|
+
app.storage.setStorage('tenant_domain', shopInfo === null || shopInfo === void 0 || (_shopInfo$tenant = shopInfo.tenant) === null || _shopInfo$tenant === void 0 ? void 0 : _shopInfo$tenant.default_domain);
|
|
234
|
+
app.storage.setStorage('selectedStore', JSON.stringify(shopInfo));
|
|
235
|
+
setLastUsedStoreId(shopInfo.id);
|
|
236
|
+
setSelectedStore(shopInfo);
|
|
237
|
+
app === null || app === void 0 || (_app$logger = app.logger) === null || _app$logger === void 0 || _app$logger.addLog({
|
|
238
|
+
type: 'info',
|
|
239
|
+
title: '选择店铺页-点击店铺',
|
|
240
|
+
metadata: shopInfo || {}
|
|
241
|
+
});
|
|
242
|
+
_context2.prev = 7;
|
|
243
|
+
_context2.next = 10;
|
|
244
|
+
return getTenantDetail();
|
|
245
|
+
case 10:
|
|
246
|
+
res = _context2.sent;
|
|
247
|
+
if (res) {
|
|
248
|
+
_context2.next = 13;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
return _context2.abrupt("return");
|
|
252
|
+
case 13:
|
|
253
|
+
if (res !== null && res !== void 0 && (_res$mypisell_data = res.mypisell_data) !== null && _res$mypisell_data !== void 0 && _res$mypisell_data.account_token) {
|
|
254
|
+
_context2.next = 16;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
PisellToast({
|
|
258
|
+
content: locales.getText('webpos-login-store-data-missing')
|
|
259
|
+
});
|
|
260
|
+
return _context2.abrupt("return");
|
|
261
|
+
case 16:
|
|
262
|
+
app === null || app === void 0 || (_app$getPlugin2 = app.getPlugin('token')) === null || _app$getPlugin2 === void 0 || _app$getPlugin2.set(res === null || res === void 0 || (_res$mypisell_data2 = res.mypisell_data) === null || _res$mypisell_data2 === void 0 ? void 0 : _res$mypisell_data2.account_token, 'pisellV1Token');
|
|
263
|
+
if (res.nocobase_tenant_token) {
|
|
264
|
+
app === null || app === void 0 || (_app$getPlugin3 = app.getPlugin('token')) === null || _app$getPlugin3 === void 0 || _app$getPlugin3.set(res.nocobase_tenant_token, 'nocobaseToken');
|
|
265
|
+
}
|
|
266
|
+
_context2.next = 20;
|
|
267
|
+
return getDeviceListFunction();
|
|
268
|
+
case 20:
|
|
269
|
+
setIsShowGoBack(isShowGoBack);
|
|
270
|
+
// 保存店铺信息
|
|
271
|
+
// app?.storage.setStorage("shopInfo", JSON.stringify(res || {}));
|
|
272
|
+
app === null || app === void 0 || (_app$logger2 = app.logger) === null || _app$logger2 === void 0 || _app$logger2.addLog({
|
|
273
|
+
type: 'info',
|
|
274
|
+
title: '选择店铺页-选择店铺成功',
|
|
275
|
+
metadata: res || {}
|
|
276
|
+
});
|
|
277
|
+
_context2.next = 27;
|
|
278
|
+
break;
|
|
279
|
+
case 24:
|
|
280
|
+
_context2.prev = 24;
|
|
281
|
+
_context2.t0 = _context2["catch"](7);
|
|
282
|
+
app === null || app === void 0 || (_app$logger3 = app.logger) === null || _app$logger3 === void 0 || _app$logger3.addLog({
|
|
283
|
+
type: 'error',
|
|
284
|
+
title: '登录页-选择店铺失败',
|
|
285
|
+
metadata: _context2.t0 || {}
|
|
286
|
+
});
|
|
287
|
+
case 27:
|
|
288
|
+
case "end":
|
|
289
|
+
return _context2.stop();
|
|
290
|
+
}
|
|
291
|
+
}, _callee2, null, [[7, 24]]);
|
|
292
|
+
}));
|
|
293
|
+
return function handleStoreSelect(_x2) {
|
|
294
|
+
return _ref2.apply(this, arguments);
|
|
295
|
+
};
|
|
296
|
+
}();
|
|
297
|
+
var getDeviceListFunction = /*#__PURE__*/function () {
|
|
298
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
299
|
+
var app, type, res, _app$logger4, _app$history, _app$logger5;
|
|
300
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
301
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
302
|
+
case 0:
|
|
303
|
+
app = getApp();
|
|
304
|
+
type = 'terminal';
|
|
305
|
+
_context3.next = 4;
|
|
306
|
+
return getDeviceList({
|
|
307
|
+
type: type,
|
|
308
|
+
with: ['client']
|
|
309
|
+
});
|
|
310
|
+
case 4:
|
|
311
|
+
res = _context3.sent;
|
|
312
|
+
if (res) {
|
|
313
|
+
_context3.next = 7;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
return _context3.abrupt("return");
|
|
317
|
+
case 7:
|
|
318
|
+
if ((res === null || res === void 0 ? void 0 : res.length) > 0) {
|
|
319
|
+
// const boundCloudDevice = JSON.parse(
|
|
320
|
+
// app.storage.getStorage('boundCloudDevice') || '{}'
|
|
321
|
+
// );
|
|
322
|
+
// const available = boundCloudDevice?.number
|
|
323
|
+
// ? !!res?.find((item) => item?.number === boundCloudDevice?.number)
|
|
324
|
+
// : false;
|
|
325
|
+
// 如果云端有设备信息,保存设备信息,并进入选择设备页面
|
|
326
|
+
app === null || app === void 0 || app.storage.setStorage('deviceList', JSON.stringify(res || []));
|
|
327
|
+
setDeviceList(res);
|
|
328
|
+
|
|
329
|
+
// if (available) {
|
|
330
|
+
// app.storage.setStorage('isLogin', true);
|
|
331
|
+
// app.history.reloadTo('/');
|
|
332
|
+
// } else {
|
|
333
|
+
// setStep('device');
|
|
334
|
+
// }
|
|
335
|
+
setStep('device');
|
|
336
|
+
app === null || app === void 0 || (_app$logger4 = app.logger) === null || _app$logger4 === void 0 || _app$logger4.addLog({
|
|
337
|
+
type: 'info',
|
|
338
|
+
title: '选择店铺页-获取设备列表成功-有云端设备',
|
|
339
|
+
metadata: res || {}
|
|
340
|
+
});
|
|
341
|
+
} else {
|
|
342
|
+
app.storage.setStorage('isLogin', true);
|
|
343
|
+
// 如果云端没有设备信息,直接进入打印机列表
|
|
344
|
+
app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 || _app$history.reloadTo('/');
|
|
345
|
+
app === null || app === void 0 || (_app$logger5 = app.logger) === null || _app$logger5 === void 0 || _app$logger5.addLog({
|
|
346
|
+
type: 'info',
|
|
347
|
+
title: '选择店铺页-获取设备列表成功-没有云端设备',
|
|
348
|
+
metadata: res || {}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
case 8:
|
|
352
|
+
case "end":
|
|
353
|
+
return _context3.stop();
|
|
354
|
+
}
|
|
355
|
+
}, _callee3);
|
|
356
|
+
}));
|
|
357
|
+
return function getDeviceListFunction() {
|
|
358
|
+
return _ref3.apply(this, arguments);
|
|
359
|
+
};
|
|
360
|
+
}();
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* 解除设备绑定
|
|
364
|
+
*/
|
|
365
|
+
var handleDissociateDevice = /*#__PURE__*/function () {
|
|
366
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
367
|
+
var _app$storage9, _boundCloudDevice$cli;
|
|
368
|
+
var app, boundCloudDevice, _boundCloudDevice$cli2, res, _app$logger6, _app$logger7;
|
|
369
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
370
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
371
|
+
case 0:
|
|
372
|
+
app = getApp();
|
|
373
|
+
boundCloudDevice = JSON.parse((app === null || app === void 0 || (_app$storage9 = app.storage) === null || _app$storage9 === void 0 ? void 0 : _app$storage9.getStorage('boundCloudDevice')) || '{}');
|
|
374
|
+
if (!(boundCloudDevice !== null && boundCloudDevice !== void 0 && boundCloudDevice.number && boundCloudDevice !== null && boundCloudDevice !== void 0 && (_boundCloudDevice$cli = boundCloudDevice.client) !== null && _boundCloudDevice$cli !== void 0 && _boundCloudDevice$cli.number)) {
|
|
375
|
+
_context4.next = 13;
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
_context4.next = 5;
|
|
379
|
+
return dissociateDevice({
|
|
380
|
+
number: boundCloudDevice === null || boundCloudDevice === void 0 || (_boundCloudDevice$cli2 = boundCloudDevice.client) === null || _boundCloudDevice$cli2 === void 0 ? void 0 : _boundCloudDevice$cli2.number,
|
|
381
|
+
dissociateDeviceNumber: boundCloudDevice === null || boundCloudDevice === void 0 ? void 0 : boundCloudDevice.number
|
|
382
|
+
});
|
|
383
|
+
case 5:
|
|
384
|
+
res = _context4.sent;
|
|
385
|
+
if (res) {
|
|
386
|
+
_context4.next = 11;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
app === null || app === void 0 || (_app$logger6 = app.logger) === null || _app$logger6 === void 0 || _app$logger6.addLog({
|
|
390
|
+
type: 'error',
|
|
391
|
+
title: '选择设备页-解除设备绑定失败'
|
|
392
|
+
});
|
|
393
|
+
return _context4.abrupt("return", false);
|
|
394
|
+
case 11:
|
|
395
|
+
app === null || app === void 0 || (_app$logger7 = app.logger) === null || _app$logger7 === void 0 || _app$logger7.addLog({
|
|
396
|
+
type: 'info',
|
|
397
|
+
title: '选择设备页-解除设备绑定成功',
|
|
398
|
+
metadata: res || {}
|
|
399
|
+
});
|
|
400
|
+
return _context4.abrupt("return", true);
|
|
401
|
+
case 13:
|
|
402
|
+
return _context4.abrupt("return", true);
|
|
403
|
+
case 14:
|
|
404
|
+
case "end":
|
|
405
|
+
return _context4.stop();
|
|
406
|
+
}
|
|
407
|
+
}, _callee4);
|
|
408
|
+
}));
|
|
409
|
+
return function handleDissociateDevice() {
|
|
410
|
+
return _ref4.apply(this, arguments);
|
|
411
|
+
};
|
|
412
|
+
}();
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* 选择设备
|
|
416
|
+
* @param device 设备信息
|
|
417
|
+
*/
|
|
418
|
+
var handleDeviceSelect = /*#__PURE__*/function () {
|
|
419
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(device) {
|
|
420
|
+
var _app$locales, _app$logger11;
|
|
421
|
+
var app, deviceNumber, language, _device, _deviceOrigin, _app$logger8, _app$logger9, _app$logger10, dissociateRes, res;
|
|
422
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
423
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
424
|
+
case 0:
|
|
425
|
+
app = getApp();
|
|
426
|
+
app.storage.setStorage('lastUsedDevice', JSON.stringify(device));
|
|
427
|
+
setLastUsedDeviceId(device.id);
|
|
428
|
+
deviceNumber = device === null || device === void 0 ? void 0 : device.number;
|
|
429
|
+
language = (app === null || app === void 0 || (_app$locales = app.locales) === null || _app$locales === void 0 ? void 0 : _app$locales.getLocale()) || 'en';
|
|
430
|
+
_device = null;
|
|
431
|
+
_context5.prev = 6;
|
|
432
|
+
_context5.next = 9;
|
|
433
|
+
return app.plugins.get('device').getDeviceInfo({
|
|
434
|
+
language: language
|
|
435
|
+
});
|
|
436
|
+
case 9:
|
|
437
|
+
_deviceOrigin = _context5.sent;
|
|
438
|
+
_device = (_deviceOrigin === null || _deviceOrigin === void 0 ? void 0 : _deviceOrigin.data) || null;
|
|
439
|
+
app === null || app === void 0 || app.storage.setStorage('localDevice', JSON.stringify(_device || {}));
|
|
440
|
+
_context5.next = 17;
|
|
441
|
+
break;
|
|
442
|
+
case 14:
|
|
443
|
+
_context5.prev = 14;
|
|
444
|
+
_context5.t0 = _context5["catch"](6);
|
|
445
|
+
app === null || app === void 0 || (_app$logger8 = app.logger) === null || _app$logger8 === void 0 || _app$logger8.addLog({
|
|
446
|
+
type: 'error',
|
|
447
|
+
title: '选择设备页-获取本机设备信息获取失败'
|
|
448
|
+
});
|
|
449
|
+
case 17:
|
|
450
|
+
if (_device) {
|
|
451
|
+
_context5.next = 22;
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
app === null || app === void 0 || (_app$logger9 = app.logger) === null || _app$logger9 === void 0 || _app$logger9.addLog({
|
|
455
|
+
type: 'error',
|
|
456
|
+
title: '选择设备页-绑定设备失败-本机设备信息获取失败'
|
|
457
|
+
});
|
|
458
|
+
return _context5.abrupt("return");
|
|
459
|
+
case 22:
|
|
460
|
+
app === null || app === void 0 || (_app$logger10 = app.logger) === null || _app$logger10 === void 0 || _app$logger10.addLog({
|
|
461
|
+
type: 'info',
|
|
462
|
+
title: '选择设备页-绑定设备-本机设备信息获取成功',
|
|
463
|
+
metadata: _device || {}
|
|
464
|
+
});
|
|
465
|
+
case 23:
|
|
466
|
+
_context5.next = 25;
|
|
467
|
+
return handleDissociateDevice();
|
|
468
|
+
case 25:
|
|
469
|
+
dissociateRes = _context5.sent;
|
|
470
|
+
if (dissociateRes) {
|
|
471
|
+
_context5.next = 28;
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
return _context5.abrupt("return");
|
|
475
|
+
case 28:
|
|
476
|
+
_context5.next = 30;
|
|
477
|
+
return selectDevice(_objectSpread({
|
|
478
|
+
deviceNumber: deviceNumber
|
|
479
|
+
}, _device || {}));
|
|
480
|
+
case 30:
|
|
481
|
+
res = _context5.sent;
|
|
482
|
+
if (res) {
|
|
483
|
+
_context5.next = 33;
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
return _context5.abrupt("return");
|
|
487
|
+
case 33:
|
|
488
|
+
app.storage.setStorage('loginStatus', 'success');
|
|
489
|
+
app.storage.setStorage('isLogin', true);
|
|
490
|
+
setTimeout(function () {
|
|
491
|
+
var _app$history2;
|
|
492
|
+
app === null || app === void 0 || (_app$history2 = app.history) === null || _app$history2 === void 0 || _app$history2.reloadTo('/');
|
|
493
|
+
}, 500);
|
|
494
|
+
|
|
495
|
+
// 保存设备信息
|
|
496
|
+
app === null || app === void 0 || app.storage.setStorage('boundCloudDevice', JSON.stringify(res || {}));
|
|
497
|
+
app.pubsub.publish('dataManager', {
|
|
498
|
+
type: 'get',
|
|
499
|
+
key: 'DEVICE_NUMBER',
|
|
500
|
+
metadata: {
|
|
501
|
+
msg: 'webpo主动推送'
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
app === null || app === void 0 || (_app$logger11 = app.logger) === null || _app$logger11 === void 0 || _app$logger11.addLog({
|
|
505
|
+
type: 'info',
|
|
506
|
+
title: '选择设备页-绑定设备成功',
|
|
507
|
+
metadata: res || {}
|
|
508
|
+
});
|
|
509
|
+
case 39:
|
|
510
|
+
case "end":
|
|
511
|
+
return _context5.stop();
|
|
512
|
+
}
|
|
513
|
+
}, _callee5, null, [[6, 14]]);
|
|
514
|
+
}));
|
|
515
|
+
return function handleDeviceSelect(_x3) {
|
|
516
|
+
return _ref5.apply(this, arguments);
|
|
517
|
+
};
|
|
518
|
+
}();
|
|
519
|
+
var handleChangeAccount = function handleChangeAccount() {
|
|
520
|
+
setStep('login');
|
|
521
|
+
};
|
|
522
|
+
var handleChangeStore = function handleChangeStore() {
|
|
523
|
+
setStep('store');
|
|
524
|
+
};
|
|
525
|
+
return /*#__PURE__*/React.createElement(WebPosLoginCpt, {
|
|
526
|
+
loginConfig: config,
|
|
527
|
+
backgroundImage: backgroundImage,
|
|
528
|
+
brandConfig: {
|
|
529
|
+
carouselItems: [{
|
|
530
|
+
type: 'image',
|
|
531
|
+
url: 'https://static.pisellcdn.com/defaultLogo.png'
|
|
532
|
+
}]
|
|
533
|
+
},
|
|
534
|
+
step: step,
|
|
535
|
+
showBackButton: isShowGoBack,
|
|
536
|
+
storeList: storeList,
|
|
537
|
+
deviceList: deviceList,
|
|
538
|
+
userInfo: userInfo,
|
|
539
|
+
selectedStore: selectedStore,
|
|
540
|
+
lastUsedStoreId: lastUsedStoreId,
|
|
541
|
+
lastUsedDeviceId: lastUsedDeviceId,
|
|
542
|
+
locale: (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en',
|
|
543
|
+
loading: false,
|
|
544
|
+
onStoreSelect: handleStoreSelect,
|
|
545
|
+
onDeviceSelect: handleDeviceSelect,
|
|
546
|
+
onChangeAccount: handleChangeAccount,
|
|
547
|
+
onChangeStore: handleChangeStore,
|
|
548
|
+
onBack: onBack,
|
|
549
|
+
onLoginSuccess: onLoginSuccess
|
|
550
|
+
});
|
|
551
|
+
};
|
|
552
|
+
export default WebPosLogin;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WebPosLoginCptProps } from './types';
|
|
3
|
+
import './WebPosLoginCpt.less';
|
|
4
|
+
/**
|
|
5
|
+
* WebPosLoginCpt 主组件
|
|
6
|
+
* @description WebPOS 登录流程组件,包含登录、店铺选择、设备选择三个步骤
|
|
7
|
+
*/
|
|
8
|
+
declare const WebPosLoginCpt: React.FC<WebPosLoginCptProps>;
|
|
9
|
+
export default WebPosLoginCpt;
|