@pisell/private-materials 3.3.107 → 3.4.1
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/index.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/Sales/Cart/index.js +9 -8
- package/es/components/Sales/Cart/utils.d.ts +0 -40
- package/es/components/Sales/Cart/utils.js +0 -167
- package/es/components/Sales/Checkout/index.d.ts +0 -4
- package/es/components/Sales/Checkout/index.js +8 -52
- package/es/components/Sales/Checkout/serve.d.ts +0 -13
- package/es/components/Sales/Checkout/serve.js +2 -16
- package/es/components/Sales/Checkout/utils.d.ts +6 -1
- package/es/components/Sales/Checkout/utils.js +8 -9
- package/es/components/Sales/Customer/index.d.ts +1 -0
- package/es/components/Sales/Customer/index.js +1 -0
- package/es/components/Sales/Summary/index.d.ts +0 -10
- package/es/components/Sales/Summary/index.js +2 -17
- package/es/components/Sales/Summary/serve.d.ts +0 -1
- package/es/components/Sales/Summary/serve.js +0 -6
- package/es/components/Sales/Summary/utils.d.ts +0 -15
- package/es/components/Sales/Summary/utils.js +1 -43
- package/es/components/appointmentBooking/components/Cart/Item/index.js +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.js +1 -15
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
- package/es/components/appointmentBooking/components/Form/index.js +1 -1
- package/es/components/appointmentBooking/components/Form/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Form/utils.js +17 -15
- package/es/components/appointmentBooking/components/Header/index.js +2 -1
- package/es/components/appointmentBooking/components/Resource/index.js +0 -1
- package/es/components/appointmentBooking/components/Services/index.js +27 -23
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
- package/es/components/appointmentBooking/deposit/index.js +2 -4
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceManager/index.js +4 -4
- package/es/components/booking/info2/utils.d.ts +4 -0
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/const.d.ts +1 -4
- package/es/components/eftposPay/const.js +1 -3
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/hooks.js +1 -3
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +0 -1
- package/es/components/eftposPay/manufacturer.js +0 -4
- package/es/components/eftposPay/pay.d.ts +1 -1
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +28 -31
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +1 -3
- package/es/components/eventBooking/locales.d.ts +0 -24
- package/es/components/eventBooking/locales.js +3 -27
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/es/components/ticketBooking/locales.d.ts +146 -164
- package/es/components/ticketBooking/locales.js +147 -195
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.js +8 -5
- package/lib/components/Sales/Cart/utils.d.ts +0 -40
- package/lib/components/Sales/Cart/utils.js +0 -117
- package/lib/components/Sales/Checkout/index.d.ts +0 -4
- package/lib/components/Sales/Checkout/index.js +7 -39
- package/lib/components/Sales/Checkout/serve.d.ts +0 -13
- package/lib/components/Sales/Checkout/serve.js +2 -7
- package/lib/components/Sales/Checkout/utils.d.ts +6 -1
- package/lib/components/Sales/Checkout/utils.js +5 -5
- package/lib/components/Sales/Customer/index.d.ts +1 -0
- package/lib/components/Sales/Customer/index.js +1 -0
- package/lib/components/Sales/Summary/index.d.ts +0 -10
- package/lib/components/Sales/Summary/index.js +1 -7
- package/lib/components/Sales/Summary/serve.d.ts +0 -1
- package/lib/components/Sales/Summary/serve.js +0 -32
- package/lib/components/Sales/Summary/utils.d.ts +0 -15
- package/lib/components/Sales/Summary/utils.js +1 -30
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.js +1 -6
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
- package/lib/components/appointmentBooking/components/Form/index.js +6 -1
- package/lib/components/appointmentBooking/components/Form/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Form/utils.js +9 -12
- package/lib/components/appointmentBooking/components/Header/index.js +1 -0
- package/lib/components/appointmentBooking/components/Resource/index.js +0 -1
- package/lib/components/appointmentBooking/components/Services/index.js +11 -6
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
- package/lib/components/appointmentBooking/deposit/index.js +2 -4
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceManager/index.js +3 -3
- package/lib/components/booking/info2/utils.d.ts +4 -0
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/const.d.ts +1 -4
- package/lib/components/eftposPay/const.js +0 -2
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/hooks.js +4 -11
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +0 -1
- package/lib/components/eftposPay/manufacturer.js +0 -6
- package/lib/components/eftposPay/pay.d.ts +1 -1
- package/lib/components/eftposPay/pay.js +2 -13
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -21
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
- package/lib/components/eventBooking/locales.d.ts +0 -24
- package/lib/components/eventBooking/locales.js +3 -27
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/lib/components/ticketBooking/locales.d.ts +146 -164
- package/lib/components/ticketBooking/locales.js +4 -22
- package/package.json +4 -4
- package/es/components/eftposPay/linkly/const.d.ts +0 -23
- package/es/components/eftposPay/linkly/const.js +0 -82
- package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/hooks/index.js +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/hooks/normal.js +0 -321
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
- package/es/components/eftposPay/linkly/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/index.js +0 -197
- package/es/components/eftposPay/linkly/service.d.ts +0 -32
- package/es/components/eftposPay/linkly/service.js +0 -81
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/lib/components/eftposPay/linkly/const.d.ts +0 -23
- package/lib/components/eftposPay/linkly/const.js +0 -102
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/hooks/normal.js +0 -242
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
- package/lib/components/eftposPay/linkly/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/index.js +0 -208
- package/lib/components/eftposPay/linkly/service.d.ts +0 -32
- package/lib/components/eftposPay/linkly/service.js +0 -55
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
|
@@ -1,197 +0,0 @@
|
|
|
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 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; }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
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); }
|
|
7
|
-
import React, { useEffect, useRef } from 'react';
|
|
8
|
-
import { Button } from 'antd';
|
|
9
|
-
import { locales } from '@pisell/utils';
|
|
10
|
-
import { useContextData, useDispatch, updateCustom, updateState, updateNextStep } from "../store";
|
|
11
|
-
import { useFail, useStoreRef } from "../hooks";
|
|
12
|
-
import useEngineContext from "../../../hooks/useEngineContext";
|
|
13
|
-
import { request } from "../../../utils";
|
|
14
|
-
import Step from "../component/step/step";
|
|
15
|
-
import { StatusEnum } from "../const";
|
|
16
|
-
import { useLinklyCancel, useLinklyPayOrRefund, useTimeResultQuery, useLinklySignature } from "./hooks";
|
|
17
|
-
import { LinklyActionStatus } from "./const";
|
|
18
|
-
import { getPayParams } from "../helper";
|
|
19
|
-
var Linkly = function Linkly(_ref) {
|
|
20
|
-
var api = _ref.api,
|
|
21
|
-
onChange = _ref.onChange;
|
|
22
|
-
// 设置request
|
|
23
|
-
var context = useEngineContext();
|
|
24
|
-
var utils = context.appHelper.utils || {};
|
|
25
|
-
request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
|
|
26
|
-
var _useContextData = useContextData(),
|
|
27
|
-
custom = _useContextData.custom,
|
|
28
|
-
status = _useContextData.status;
|
|
29
|
-
var _useStoreRef = useStoreRef(),
|
|
30
|
-
statusRef = _useStoreRef.statusRef,
|
|
31
|
-
netRef = _useStoreRef.netRef,
|
|
32
|
-
modeRef = _useStoreRef.modeRef,
|
|
33
|
-
amountRef = _useStoreRef.amountRef,
|
|
34
|
-
orderIdRef = _useStoreRef.orderIdRef,
|
|
35
|
-
numRef = _useStoreRef.numRef,
|
|
36
|
-
deviceRef = _useStoreRef.deviceRef,
|
|
37
|
-
payRef = _useStoreRef.payRef;
|
|
38
|
-
var dispatch = useDispatch();
|
|
39
|
-
var stepRef = useRef(custom === null || custom === void 0 ? void 0 : custom.step);
|
|
40
|
-
var fail = useFail(0);
|
|
41
|
-
var failRef = useRef(fail);
|
|
42
|
-
var initRef = useRef(false);
|
|
43
|
-
var controllerRef = useRef();
|
|
44
|
-
var unloadRef = useRef(false);
|
|
45
|
-
var clearRef = useRef();
|
|
46
|
-
|
|
47
|
-
// 检查是否可以继续处理接口返回结果,无网 或 已卸载 则不进行处理
|
|
48
|
-
var handleCheck = function handleCheck() {
|
|
49
|
-
return !(unloadRef.current || !netRef.current);
|
|
50
|
-
};
|
|
51
|
-
var handleLinklySuccess = function handleLinklySuccess(res) {
|
|
52
|
-
var resData = (res === null || res === void 0 ? void 0 : res.data) || {};
|
|
53
|
-
var receipt = Array.isArray(resData === null || resData === void 0 ? void 0 : resData.receipt) ? resData.receipt : [resData.receipt];
|
|
54
|
-
receipt = receipt.filter(function (item) {
|
|
55
|
-
return typeof item === 'string';
|
|
56
|
-
}).filter(Boolean);
|
|
57
|
-
dispatch(updateNextStep());
|
|
58
|
-
// 将所有步骤状态设为完成 resolve
|
|
59
|
-
dispatch(updateCustom({
|
|
60
|
-
card_reader_surcharge: (resData === null || resData === void 0 ? void 0 : resData.card_reader_surcharge) || 0,
|
|
61
|
-
receipt: receipt
|
|
62
|
-
}));
|
|
63
|
-
|
|
64
|
-
// 更新支付状态与文案
|
|
65
|
-
dispatch(updateState({
|
|
66
|
-
status: 'success',
|
|
67
|
-
title: locales.getText('page.eftpos-pay.text.successful')(modeRef.current)
|
|
68
|
-
}));
|
|
69
|
-
clearRef.current = setTimeout(function () {
|
|
70
|
-
var _deviceRef$current;
|
|
71
|
-
var params = getPayParams({
|
|
72
|
-
mode: modeRef.current,
|
|
73
|
-
amount: amountRef.current,
|
|
74
|
-
order_id: orderIdRef.current,
|
|
75
|
-
number: numRef.current,
|
|
76
|
-
device: deviceRef.current,
|
|
77
|
-
pay: payRef.current,
|
|
78
|
-
custom: {
|
|
79
|
-
card_reader_surcharge: (resData === null || resData === void 0 ? void 0 : resData.card_reader_surcharge) || 0,
|
|
80
|
-
receipt: receipt
|
|
81
|
-
}
|
|
82
|
-
}, 'success');
|
|
83
|
-
onChange('success', _objectSpread(_objectSpread({}, params), {}, {
|
|
84
|
-
receipt: (_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current = _deviceRef$current.setting) !== null && _deviceRef$current !== void 0 && _deviceRef$current.receipts ? [] : receipt
|
|
85
|
-
}));
|
|
86
|
-
}, 1000);
|
|
87
|
-
};
|
|
88
|
-
var _useLinklyPayOrRefund = useLinklyPayOrRefund(handleCheck),
|
|
89
|
-
payOrRefund = _useLinklyPayOrRefund.payOrRefund;
|
|
90
|
-
var _useLinklyCancel = useLinklyCancel(handleCheck),
|
|
91
|
-
linklyCancel = _useLinklyCancel.linklyCancel;
|
|
92
|
-
var _useTimeResultQuery = useTimeResultQuery(api, handleCheck, handleLinklySuccess),
|
|
93
|
-
resultQuery = _useTimeResultQuery.run,
|
|
94
|
-
stopResultQuery = _useTimeResultQuery.stop;
|
|
95
|
-
var _useLinklySignature = useLinklySignature(handleCheck),
|
|
96
|
-
linklySignature = _useLinklySignature.linklySignature;
|
|
97
|
-
useEffect(function () {
|
|
98
|
-
stepRef.current = custom === null || custom === void 0 ? void 0 : custom.step;
|
|
99
|
-
}, [custom === null || custom === void 0 ? void 0 : custom.step]);
|
|
100
|
-
useEffect(function () {
|
|
101
|
-
failRef.current = fail;
|
|
102
|
-
}, [fail]);
|
|
103
|
-
useEffect(function () {
|
|
104
|
-
if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (initRef.current) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
initRef.current = true;
|
|
111
|
-
|
|
112
|
-
// 存在支付流水号
|
|
113
|
-
if (numRef.current) {
|
|
114
|
-
resultQuery();
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
payOrRefund(resultQuery, handleLinklySuccess);
|
|
118
|
-
}, []);
|
|
119
|
-
useEffect(function () {
|
|
120
|
-
return function () {
|
|
121
|
-
var _controllerRef$curren;
|
|
122
|
-
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 || _controllerRef$curren.abort();
|
|
123
|
-
unloadRef.current = true;
|
|
124
|
-
if (clearRef.current) {
|
|
125
|
-
clearTimeout(clearRef.current);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}, []);
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 取消支付
|
|
132
|
-
*/
|
|
133
|
-
var onCancel = function onCancel() {
|
|
134
|
-
stopResultQuery();
|
|
135
|
-
linklyCancel(resultQuery);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 拒绝签名
|
|
140
|
-
*/
|
|
141
|
-
var onDecline = function onDecline() {
|
|
142
|
-
stopResultQuery();
|
|
143
|
-
linklySignature(2, resultQuery);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* 接受签名
|
|
148
|
-
*/
|
|
149
|
-
var onAccept = function onAccept() {
|
|
150
|
-
stopResultQuery();
|
|
151
|
-
linklySignature(3, resultQuery);
|
|
152
|
-
};
|
|
153
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
154
|
-
className: "pisell-lowcode__eft-pay-body"
|
|
155
|
-
}, ((custom === null || custom === void 0 ? void 0 : custom.list) || []).map(function (item) {
|
|
156
|
-
return /*#__PURE__*/React.createElement(Step, {
|
|
157
|
-
key: item.index,
|
|
158
|
-
pedding: item.pedding,
|
|
159
|
-
resolve: item.resolve,
|
|
160
|
-
reject: item.reject,
|
|
161
|
-
status: item.status
|
|
162
|
-
});
|
|
163
|
-
}), status === StatusEnum.Loading ? /*#__PURE__*/React.createElement("div", {
|
|
164
|
-
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
165
|
-
}, locales.getText('page.eftpos-pay.text.processing')) : null, status === StatusEnum.Question ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
166
|
-
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
167
|
-
}, locales.getText('page.eftpos-pay.text.receipt.again.title')), /*#__PURE__*/React.createElement("div", {
|
|
168
|
-
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
169
|
-
}, locales.getText('page.eftpos-pay.text.receipt.again.text'))) : null, status === StatusEnum.Success ? /*#__PURE__*/React.createElement("div", {
|
|
170
|
-
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
171
|
-
}, locales.getText('page.eftpos-pay.text.transaction.end')) : null), (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.Cancel ? /*#__PURE__*/React.createElement("div", {
|
|
172
|
-
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
173
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
174
|
-
block: true,
|
|
175
|
-
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
176
|
-
onClick: onCancel,
|
|
177
|
-
disabled: !!(custom !== null && custom !== void 0 && custom.buttonDisabled)
|
|
178
|
-
}, locales.getText('page.eftpos-pay.text.cancel'))) : null, (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.CancelWaiting || (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.SignatureWaiting ? /*#__PURE__*/React.createElement("div", {
|
|
179
|
-
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
180
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
181
|
-
block: true,
|
|
182
|
-
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
183
|
-
disabled: true
|
|
184
|
-
}, locales.getText('page.eftpos-pay.text.leave'))) : null, (custom === null || custom === void 0 ? void 0 : custom.actionStatus) === LinklyActionStatus.Signature ? /*#__PURE__*/React.createElement("div", {
|
|
185
|
-
className: "pisell-lowcode__eft-pay-step-item-btns"
|
|
186
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
187
|
-
block: true,
|
|
188
|
-
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
189
|
-
onClick: onDecline
|
|
190
|
-
}, locales.getText('page.eftpos-pay.text.decline')), /*#__PURE__*/React.createElement(Button, {
|
|
191
|
-
block: true,
|
|
192
|
-
type: "primary",
|
|
193
|
-
className: "pisell-lowcode__eft-pay-step-item-btn",
|
|
194
|
-
onClick: onAccept
|
|
195
|
-
}, locales.getText('page.eftpos-pay.text.accept'))) : null);
|
|
196
|
-
};
|
|
197
|
-
export default Linkly;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* linkly支付接口
|
|
3
|
-
*/
|
|
4
|
-
export declare const linklyPayApi: (data: any) => Promise<any>;
|
|
5
|
-
/**
|
|
6
|
-
* 查询linkly支付结果
|
|
7
|
-
*/
|
|
8
|
-
export declare const linklyPayQueryApi: (param: any) => Promise<any>;
|
|
9
|
-
/**
|
|
10
|
-
* 取消linkly支付
|
|
11
|
-
*/
|
|
12
|
-
export declare const linklyPayCancelApi: (param: any) => Promise<any>;
|
|
13
|
-
/**
|
|
14
|
-
* linkly支付签名结果处理
|
|
15
|
-
*/
|
|
16
|
-
export declare const linklyPaySignatureApi: (param: any) => Promise<any>;
|
|
17
|
-
/**
|
|
18
|
-
* linkly退款接口
|
|
19
|
-
*/
|
|
20
|
-
export declare const linklyRefundApi: (data: any) => Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* 查询linkly退款结果
|
|
23
|
-
*/
|
|
24
|
-
export declare const linklyRefundQueryApi: (param: any) => Promise<any>;
|
|
25
|
-
/**
|
|
26
|
-
* 取消linkly退款
|
|
27
|
-
*/
|
|
28
|
-
export declare const linklyRefundCancelApi: (param: any) => Promise<any>;
|
|
29
|
-
/**
|
|
30
|
-
* linkly退款签名结果处理
|
|
31
|
-
*/
|
|
32
|
-
export declare const linklyRefundSignatureApi: (param: any) => Promise<any>;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { request } from "../../../utils";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* linkly支付接口
|
|
5
|
-
*/
|
|
6
|
-
export var linklyPayApi = function linklyPayApi(data) {
|
|
7
|
-
return request.getRequest().post('/shop/linkly/pay/apply', data, {
|
|
8
|
-
customMessage: true,
|
|
9
|
-
fullResult: true
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 查询linkly支付结果
|
|
15
|
-
*/
|
|
16
|
-
export var linklyPayQueryApi = function linklyPayQueryApi(param) {
|
|
17
|
-
return request.getRequest().get('/shop/linkly/pay/query', param, {
|
|
18
|
-
customMessage: true,
|
|
19
|
-
fullResult: true
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 取消linkly支付
|
|
25
|
-
*/
|
|
26
|
-
export var linklyPayCancelApi = function linklyPayCancelApi(param) {
|
|
27
|
-
return request.getRequest().post('/shop/linkly/pay/cancel', param, {
|
|
28
|
-
customMessage: true,
|
|
29
|
-
fullResult: true
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* linkly支付签名结果处理
|
|
35
|
-
*/
|
|
36
|
-
export var linklyPaySignatureApi = function linklyPaySignatureApi(param) {
|
|
37
|
-
return request.getRequest().post('/shop/linkly/pay/signature', param, {
|
|
38
|
-
customMessage: true,
|
|
39
|
-
fullResult: true
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* linkly退款接口
|
|
45
|
-
*/
|
|
46
|
-
export var linklyRefundApi = function linklyRefundApi(data) {
|
|
47
|
-
return request.getRequest().post('/shop/linkly/refund/apply', data, {
|
|
48
|
-
customMessage: true,
|
|
49
|
-
fullResult: true
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* 查询linkly退款结果
|
|
55
|
-
*/
|
|
56
|
-
export var linklyRefundQueryApi = function linklyRefundQueryApi(param) {
|
|
57
|
-
return request.getRequest().get('/shop/linkly/refund/query', param, {
|
|
58
|
-
customMessage: true,
|
|
59
|
-
fullResult: true
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 取消linkly退款
|
|
65
|
-
*/
|
|
66
|
-
export var linklyRefundCancelApi = function linklyRefundCancelApi(param) {
|
|
67
|
-
return request.getRequest().post('/shop/linkly/refund/cancel', param, {
|
|
68
|
-
customMessage: true,
|
|
69
|
-
fullResult: true
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* linkly退款签名结果处理
|
|
75
|
-
*/
|
|
76
|
-
export var linklyRefundSignatureApi = function linklyRefundSignatureApi(param) {
|
|
77
|
-
return request.getRequest().post('/shop/linkly/refund/signature', param, {
|
|
78
|
-
customMessage: true,
|
|
79
|
-
fullResult: true
|
|
80
|
-
});
|
|
81
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useSummary } from "../../../../../Sales";
|
|
3
|
-
import { DepositContent } from "../../../../../appointmentBooking/components/Deposit";
|
|
4
|
-
var Deposit = function Deposit() {
|
|
5
|
-
var _useSummary = useSummary(),
|
|
6
|
-
deposit = _useSummary.deposit,
|
|
7
|
-
isAgreeDepositPolicy = _useSummary.isAgreeDepositPolicy,
|
|
8
|
-
setIsAgreeDepositPolicy = _useSummary.setIsAgreeDepositPolicy,
|
|
9
|
-
getDepositProtocol = _useSummary.getDepositProtocol;
|
|
10
|
-
return /*#__PURE__*/React.createElement(DepositContent, {
|
|
11
|
-
isAgreeDepositPolicy: !!isAgreeDepositPolicy,
|
|
12
|
-
setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
|
|
13
|
-
deposit: deposit,
|
|
14
|
-
depositProtocolRequest: getDepositProtocol
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
export default Deposit;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { formatAmount } from '@pisell/utils';
|
|
2
|
-
import { getServiceTime } from "./formatTime";
|
|
3
|
-
var formatProductMessage = function formatProductMessage(product, utils) {
|
|
4
|
-
var product_option_string = product.product_option_string,
|
|
5
|
-
options = product.options,
|
|
6
|
-
bundle = product.bundle,
|
|
7
|
-
currency_symbol = product.currency_symbol,
|
|
8
|
-
start_date = product.start_date,
|
|
9
|
-
end_date = product.end_date,
|
|
10
|
-
holder_id = product.holder_id,
|
|
11
|
-
holders = product.holders,
|
|
12
|
-
multiResources = product.multiResources;
|
|
13
|
-
var str = '';
|
|
14
|
-
if (start_date && end_date) {
|
|
15
|
-
str += "".concat(getServiceTime(product, start_date, utils), " \n");
|
|
16
|
-
}
|
|
17
|
-
if (holder_id && Array.isArray(holders)) {
|
|
18
|
-
var targetHolder = holders.find(function (holder) {
|
|
19
|
-
return holder.id === holder_id;
|
|
20
|
-
});
|
|
21
|
-
if (targetHolder !== null && targetHolder !== void 0 && targetHolder.label) {
|
|
22
|
-
str += "".concat(targetHolder.label, " \n");
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (Array.isArray(multiResources) && multiResources.length > 0) {
|
|
26
|
-
multiResources.forEach(function (resource) {
|
|
27
|
-
var ids = resource.id,
|
|
28
|
-
lists = resource.lists;
|
|
29
|
-
if (Array.isArray(ids)) {
|
|
30
|
-
ids.forEach(function (id) {
|
|
31
|
-
var targetRes = lists.find(function (l) {
|
|
32
|
-
return l.id === id;
|
|
33
|
-
});
|
|
34
|
-
if (targetRes !== null && targetRes !== void 0 && targetRes.label) str += "".concat(targetRes === null || targetRes === void 0 ? void 0 : targetRes.label, " \n");
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
var targetRes = lists.find(function (l) {
|
|
38
|
-
return l.id === ids;
|
|
39
|
-
});
|
|
40
|
-
if (targetRes !== null && targetRes !== void 0 && targetRes.label) str += "".concat(targetRes === null || targetRes === void 0 ? void 0 : targetRes.label, " \n");
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 组合规格 单规格
|
|
46
|
-
if (product_option_string) str += "".concat(product_option_string, "\n");
|
|
47
|
-
if (Array.isArray(options) && options.length) {
|
|
48
|
-
options.forEach(function (opt) {
|
|
49
|
-
str += "".concat(opt.name, " ").concat(formatAmount(opt === null || opt === void 0 ? void 0 : opt.price, 2, currency_symbol), " x ").concat(opt.num, "\n");
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 套餐
|
|
54
|
-
if (Array.isArray(bundle) && bundle.length) {
|
|
55
|
-
bundle.forEach(function (item) {
|
|
56
|
-
str += "".concat(item.title, " \n");
|
|
57
|
-
str += "".concat(formatAmount(item.price, 2, currency_symbol), " x ").concat(item.num);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return str;
|
|
61
|
-
};
|
|
62
|
-
export default formatProductMessage;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import 'dayjs/locale/zh-cn';
|
|
2
|
-
import 'dayjs/locale/en';
|
|
3
|
-
import 'dayjs/locale/zh-tw';
|
|
4
|
-
/**
|
|
5
|
-
* @title: 是否英文
|
|
6
|
-
* @description:
|
|
7
|
-
* @param {any} item
|
|
8
|
-
* @return {*}
|
|
9
|
-
* @Author: WangHan
|
|
10
|
-
* @Date: 2024-12-28 22:49
|
|
11
|
-
*/
|
|
12
|
-
export declare const isEn: (item: any) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @title: 跨日预约时间
|
|
15
|
-
* @description:
|
|
16
|
-
* @param {any} item
|
|
17
|
-
* @return {*}
|
|
18
|
-
* @Author: WangHan
|
|
19
|
-
* @Date: 2024-12-28 22:50
|
|
20
|
-
*/
|
|
21
|
-
export declare const formatMultiDayDate: (item: any) => string;
|
|
22
|
-
/**
|
|
23
|
-
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
24
|
-
* @description:
|
|
25
|
-
* @param {any} item
|
|
26
|
-
* @param {any} currentDate
|
|
27
|
-
* @return {*}
|
|
28
|
-
* @Author: zhiwei.Wang
|
|
29
|
-
* @Date: 2024-04-26 14:04
|
|
30
|
-
*/
|
|
31
|
-
export declare const getServiceTime: (item: any, currentDate: any, utils: any) => string;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { locales } from '@pisell/utils';
|
|
3
|
-
import 'dayjs/locale/zh-cn';
|
|
4
|
-
import 'dayjs/locale/en';
|
|
5
|
-
import 'dayjs/locale/zh-tw';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @title: 是否英文
|
|
9
|
-
* @description:
|
|
10
|
-
* @param {any} item
|
|
11
|
-
* @return {*}
|
|
12
|
-
* @Author: WangHan
|
|
13
|
-
* @Date: 2024-12-28 22:49
|
|
14
|
-
*/
|
|
15
|
-
export var isEn = function isEn(item) {
|
|
16
|
-
var locale = (item === null || item === void 0 ? void 0 : item.locale) || 'en-US';
|
|
17
|
-
var _isEn = locale === 'en-US' || locale === 'en';
|
|
18
|
-
var localeTypes = {
|
|
19
|
-
'en-US': 'en',
|
|
20
|
-
'zh-CN': 'zh-cn',
|
|
21
|
-
'zh-HK': 'zh-tw'
|
|
22
|
-
};
|
|
23
|
-
dayjs.locale(localeTypes[locale]);
|
|
24
|
-
return _isEn;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @title: 跨日预约时间
|
|
29
|
-
* @description:
|
|
30
|
-
* @param {any} item
|
|
31
|
-
* @return {*}
|
|
32
|
-
* @Author: WangHan
|
|
33
|
-
* @Date: 2024-12-28 22:50
|
|
34
|
-
*/
|
|
35
|
-
export var formatMultiDayDate = function formatMultiDayDate(item) {
|
|
36
|
-
var _isEn = isEn(item);
|
|
37
|
-
|
|
38
|
-
// 跨日
|
|
39
|
-
var startDate = dayjs(item === null || item === void 0 ? void 0 : item.start_date);
|
|
40
|
-
var endDate = dayjs(item === null || item === void 0 ? void 0 : item.end_date);
|
|
41
|
-
var _format = _isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
|
|
42
|
-
var date = "".concat(startDate.format(_format), " ~ ").concat(endDate.format(_format));
|
|
43
|
-
return date;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
48
|
-
* @description:
|
|
49
|
-
* @param {any} item
|
|
50
|
-
* @param {any} currentDate
|
|
51
|
-
* @return {*}
|
|
52
|
-
* @Author: zhiwei.Wang
|
|
53
|
-
* @Date: 2024-04-26 14:04
|
|
54
|
-
*/
|
|
55
|
-
export var getServiceTime = function getServiceTime(item, currentDate, utils) {
|
|
56
|
-
var _utils$storage, _item$format;
|
|
57
|
-
if (!dayjs(currentDate).isValid()) return '';
|
|
58
|
-
var locale = (item === null || item === void 0 ? void 0 : item.locale) || (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en-US';
|
|
59
|
-
var isEn = locale === 'en-US' || locale === 'en';
|
|
60
|
-
var localeTypes = {
|
|
61
|
-
'en-US': 'en',
|
|
62
|
-
'zh-CN': 'zh-cn',
|
|
63
|
-
'zh-HK': 'zh-tw'
|
|
64
|
-
};
|
|
65
|
-
dayjs.locale(localeTypes[locale]);
|
|
66
|
-
var startDate = dayjs(item === null || item === void 0 ? void 0 : item.start_date);
|
|
67
|
-
var endDate = dayjs(item === null || item === void 0 ? void 0 : item.end_date);
|
|
68
|
-
var diffInDays = (item === null || item === void 0 ? void 0 : item.custom_day_count) || endDate.diff(startDate, 'day');
|
|
69
|
-
|
|
70
|
-
// 1.2时间格式, 同天显示 年月日 开始 - 结束, 不同天 年月日 开始 - 年月日 结束
|
|
71
|
-
if (item !== null && item !== void 0 && item.duration_type) {
|
|
72
|
-
var sameDay = startDate.isSame(endDate, 'day');
|
|
73
|
-
var dateFormat = isEn ? 'DD/MM/YYYY' : 'YYYY-MM-DD';
|
|
74
|
-
var timeFormat = 'HH:mm';
|
|
75
|
-
var startTime = (item === null || item === void 0 ? void 0 : item.start_time) || startDate.format(timeFormat);
|
|
76
|
-
var endTime = (item === null || item === void 0 ? void 0 : item.end_time) || endDate.format(timeFormat);
|
|
77
|
-
var dateTime = '';
|
|
78
|
-
if (sameDay) {
|
|
79
|
-
if (isEn) {
|
|
80
|
-
// 英文:开始时间 - 结束时间 年月日
|
|
81
|
-
dateTime = "".concat(startTime, " ~ ").concat(endTime, " ").concat(startDate.format(dateFormat));
|
|
82
|
-
} else {
|
|
83
|
-
// 中文:年月日 开始时间 - 结束时间
|
|
84
|
-
dateTime = "".concat(startDate.format(dateFormat), " ").concat(startTime, " ~ ").concat(endTime);
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
// 不同天
|
|
88
|
-
if (isEn) {
|
|
89
|
-
// 英文:开始时间 年月日 - 结束时间 年月日
|
|
90
|
-
dateTime = "".concat(startTime, " ").concat(startDate.format(dateFormat), " ~ ").concat(endTime, " ").concat(endDate.format(dateFormat));
|
|
91
|
-
} else {
|
|
92
|
-
// 中文:年月日 开始时间 - 年月日 结束时间
|
|
93
|
-
dateTime = "".concat(startDate.format(dateFormat), " ").concat(startTime, " ~ ").concat(endDate.format(dateFormat), " ").concat(endTime);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
var startDateTime = "".concat(startDate.format('YYYY-MM-DD'), " ").concat(startTime);
|
|
97
|
-
var endDateTime = "".concat(endDate.format('YYYY-MM-DD'), " ").concat(endTime);
|
|
98
|
-
var _duration = dayjs(endDateTime).diff(dayjs(startDateTime), item === null || item === void 0 ? void 0 : item.duration_type);
|
|
99
|
-
var durationText = '';
|
|
100
|
-
if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'minutes') {
|
|
101
|
-
// 转为小时+分钟
|
|
102
|
-
var hours = Math.floor(_duration / 60);
|
|
103
|
-
var minutes = _duration % 60;
|
|
104
|
-
durationText = locales.getText('pisell2.product.card.hour.minute')(hours, minutes);
|
|
105
|
-
} else if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'days') {
|
|
106
|
-
durationText = locales.getText('pisell2.product.card.day')(_duration);
|
|
107
|
-
} else {
|
|
108
|
-
durationText = "".concat(_duration);
|
|
109
|
-
}
|
|
110
|
-
return "".concat(dateTime, " (").concat(durationText, ")");
|
|
111
|
-
}
|
|
112
|
-
var _format = isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
|
|
113
|
-
|
|
114
|
-
// 是否自定义格式
|
|
115
|
-
if (item !== null && item !== void 0 && item.hasOwnProperty('format') && (item === null || item === void 0 || (_item$format = item.format) === null || _item$format === void 0 ? void 0 : _item$format.length) > 0) {
|
|
116
|
-
var _item$format2, _item$format3;
|
|
117
|
-
_format = isEn ? item === null || item === void 0 || (_item$format2 = item.format) === null || _item$format2 === void 0 ? void 0 : _item$format2[0] : item === null || item === void 0 || (_item$format3 = item.format) === null || _item$format3 === void 0 ? void 0 : _item$format3[1];
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// 是否显示时间
|
|
121
|
-
if (item !== null && item !== void 0 && item.show_time) {
|
|
122
|
-
startDate = dayjs(item !== null && item !== void 0 && item.start_time ? "".concat(item === null || item === void 0 ? void 0 : item.start_date, " ").concat(item === null || item === void 0 ? void 0 : item.start_time) : startDate.format('YYYY-MM-DD HH:mm'));
|
|
123
|
-
endDate = dayjs(item !== null && item !== void 0 && item.end_time ? "".concat(item === null || item === void 0 ? void 0 : item.end_date, " ").concat(item === null || item === void 0 ? void 0 : item.end_time) : endDate.format('YYYY-MM-DD HH:mm'));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// 显示时长分钟
|
|
127
|
-
if ((item === null || item === void 0 ? void 0 : item.duration_type) === 'minutes') {
|
|
128
|
-
diffInDays = endDate.diff(startDate, 'minute');
|
|
129
|
-
}
|
|
130
|
-
var date = "".concat(startDate.format(_format), " ~ ").concat(endDate.format(_format));
|
|
131
|
-
|
|
132
|
-
// 自定义文案
|
|
133
|
-
var text = locales.getText('pisell2.product.card.day')(diffInDays);
|
|
134
|
-
if (item !== null && item !== void 0 && item.custom_day_count) {
|
|
135
|
-
text = locales.getText('pisell2.product.card.day.event')(diffInDays);
|
|
136
|
-
}
|
|
137
|
-
var textTypes = {
|
|
138
|
-
'minutes': locales.getText('pisell2.product.card.minute')(diffInDays),
|
|
139
|
-
'event': locales.getText('pisell2.product.card.day.event')(diffInDays)
|
|
140
|
-
};
|
|
141
|
-
text = (textTypes === null || textTypes === void 0 ? void 0 : textTypes[item === null || item === void 0 ? void 0 : item.duration_type]) || text;
|
|
142
|
-
var duration = "".concat(diffInDays).concat(text);
|
|
143
|
-
return "".concat(date, " (").concat(duration, ")");
|
|
144
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { State } from '../store';
|
|
2
|
-
import { ModeEnum } from '../const';
|
|
3
|
-
export declare const getStep: (mode?: ModeEnum) => State['steps'];
|
|
4
|
-
declare const _default: (params: any) => State;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare enum EVisibleButtonType {
|
|
7
|
-
/** 取消按钮 */
|
|
8
|
-
CancelButton = "CancelButton",
|
|
9
|
-
/** 等待按钮 */
|
|
10
|
-
WaitButton = "WaitButton"
|
|
11
|
-
}
|
|
12
|
-
export declare enum LinklyActionStatus {
|
|
13
|
-
/** 空 */
|
|
14
|
-
Empty = "Empty",
|
|
15
|
-
/** 取消 */
|
|
16
|
-
Cancel = "Cancel",
|
|
17
|
-
/** 取消中 */
|
|
18
|
-
CancelWaiting = "CancelWaiting",
|
|
19
|
-
/** 签名 */
|
|
20
|
-
Signature = "Signature",
|
|
21
|
-
/** 签名等待中 */
|
|
22
|
-
SignatureWaiting = "SignatureWaiting"
|
|
23
|
-
}
|