@pisell/private-materials 3.3.71 → 3.3.73
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/appointmentBooking/components/Date/index.js +24 -14
- package/es/components/booking/info/client/index.js +12 -3
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- 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/ticketBooking/utils/index.js +8 -1
- package/lib/components/appointmentBooking/components/Date/index.js +12 -5
- package/lib/components/booking/info/client/index.js +10 -3
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- 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/ticketBooking/utils/index.js +4 -1
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
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
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
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
-
import React, { useState, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
16
|
+
import React, { useState, useEffect, useMemo, forwardRef, useImperativeHandle, useRef } from 'react';
|
|
17
17
|
import { Skeleton } from 'antd';
|
|
18
18
|
import Dayjs from 'dayjs';
|
|
19
19
|
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
|
|
@@ -29,6 +29,7 @@ import { localeTypes } from "./state";
|
|
|
29
29
|
import "./index.less";
|
|
30
30
|
var Date = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
31
31
|
var _context$engine2, _Dayjs$locale;
|
|
32
|
+
var isFetchingDates = useRef(false);
|
|
32
33
|
var _useState = useState(false),
|
|
33
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
35
|
loading = _useState2[0],
|
|
@@ -223,7 +224,7 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
223
224
|
}();
|
|
224
225
|
var getDates = /*#__PURE__*/function () {
|
|
225
226
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(date) {
|
|
226
|
-
var startDate, endDate, params, data, selected, _selected$,
|
|
227
|
+
var startDate, endDate, params, data, firstAvailableDate, nextMonthDate, selected, _selected$, baseMonthData, updatedDates;
|
|
227
228
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
228
229
|
while (1) switch (_context4.prev = _context4.next) {
|
|
229
230
|
case 0:
|
|
@@ -238,19 +239,29 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
238
239
|
return getDateData(params);
|
|
239
240
|
case 6:
|
|
240
241
|
data = _context4.sent;
|
|
241
|
-
|
|
242
|
+
firstAvailableDate = (data || []).find(function (d) {
|
|
243
|
+
return d.status === 'available';
|
|
244
|
+
}); // 如果当前月没有可用日期,并且这是第一次尝试,则自动查询下一个月
|
|
245
|
+
if (!(!firstAvailableDate && !isFetchingDates.current)) {
|
|
246
|
+
_context4.next = 14;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
isFetchingDates.current = true;
|
|
250
|
+
nextMonthDate = Dayjs(date).add(1, 'month');
|
|
251
|
+
setCurrentMonth(nextMonthDate);
|
|
252
|
+
setLoading(true);
|
|
253
|
+
return _context4.abrupt("return");
|
|
254
|
+
case 14:
|
|
255
|
+
_context4.next = 16;
|
|
242
256
|
return appointmentBooking.getDateRange();
|
|
243
|
-
case
|
|
257
|
+
case 16:
|
|
244
258
|
selected = _context4.sent;
|
|
245
259
|
console.log(data, selected, customPageId, 'getDates');
|
|
246
260
|
if ((selected === null || selected === void 0 ? void 0 : selected.length) > 0) {
|
|
247
261
|
setCurrentDate(selected === null || selected === void 0 || (_selected$ = selected[0]) === null || _selected$ === void 0 ? void 0 : _selected$.date);
|
|
248
262
|
} else if (!isDateSelectedFirst) {
|
|
249
263
|
// 当前月则默认选中当前第一个可用的
|
|
250
|
-
if (date.format('YYYY-MM') === Dayjs().format('YYYY-MM')) {
|
|
251
|
-
firstAvailableDate = (data || []).find(function (d) {
|
|
252
|
-
return d.status === 'available';
|
|
253
|
-
});
|
|
264
|
+
if (date.format('YYYY-MM') === Dayjs().format('YYYY-MM') || isFetchingDates.current) {
|
|
254
265
|
if (firstAvailableDate) {
|
|
255
266
|
setCurrentDate(firstAvailableDate === null || firstAvailableDate === void 0 ? void 0 : firstAvailableDate.date);
|
|
256
267
|
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
@@ -273,19 +284,18 @@ var Date = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
273
284
|
});
|
|
274
285
|
setLoading(false);
|
|
275
286
|
setDateMonthList(updatedDates);
|
|
276
|
-
_context4.next =
|
|
287
|
+
_context4.next = 29;
|
|
277
288
|
break;
|
|
278
|
-
case
|
|
279
|
-
_context4.prev =
|
|
289
|
+
case 25:
|
|
290
|
+
_context4.prev = 25;
|
|
280
291
|
_context4.t0 = _context4["catch"](0);
|
|
281
292
|
setLoading(false);
|
|
282
293
|
setDateMonthList([]);
|
|
283
|
-
|
|
284
|
-
case 23:
|
|
294
|
+
case 29:
|
|
285
295
|
case "end":
|
|
286
296
|
return _context4.stop();
|
|
287
297
|
}
|
|
288
|
-
}, _callee4, null, [[0,
|
|
298
|
+
}, _callee4, null, [[0, 25]]);
|
|
289
299
|
}));
|
|
290
300
|
return function getDates(_x2) {
|
|
291
301
|
return _ref4.apply(this, arguments);
|
|
@@ -33,6 +33,7 @@ import { isWalkIn as getIsWalkIn } from "../../utils";
|
|
|
33
33
|
import { getFranchiseeCustomerInfo, getFranchiseeCustomerList } from "./serve";
|
|
34
34
|
import { useMemoizedFn } from 'ahooks';
|
|
35
35
|
import { getWaiverTitle } from "../clientVariant/utils";
|
|
36
|
+
import useGetHolderList from "../hooks/useGetHolderList";
|
|
36
37
|
var isLoadClient = false;
|
|
37
38
|
var Client = function Client() {
|
|
38
39
|
var _state$client$value2, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
|
|
@@ -52,6 +53,7 @@ var Client = function Client() {
|
|
|
52
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
54
|
franchiseeLoading = _useState6[0],
|
|
54
55
|
setFranchiseeLoading = _useState6[1];
|
|
56
|
+
var getHolders = useGetHolderList(state, dispatch);
|
|
55
57
|
var _useState7 = useState({
|
|
56
58
|
skip: 1,
|
|
57
59
|
num: 10,
|
|
@@ -281,6 +283,7 @@ var Client = function Client() {
|
|
|
281
283
|
if (data) {
|
|
282
284
|
handleSelectClient([data]);
|
|
283
285
|
}
|
|
286
|
+
getHolders();
|
|
284
287
|
getClients(_objectSpread(_objectSpread({}, state.client.clientsParams), {}, {
|
|
285
288
|
search: '',
|
|
286
289
|
customer_id: data === null || data === void 0 ? void 0 : data.id,
|
|
@@ -298,14 +301,20 @@ var Client = function Client() {
|
|
|
298
301
|
showAcceptsMarketing: false
|
|
299
302
|
},
|
|
300
303
|
callback: function callback(customer_id, params) {
|
|
301
|
-
var _params$, _params$2, _state$
|
|
304
|
+
var _state$client2, _state$client2$map, _params$, _params$2, _state$client3;
|
|
305
|
+
var waiverForm = ((_state$client2 = state.client) === null || _state$client2 === void 0 || (_state$client2 = _state$client2.clients) === null || _state$client2 === void 0 || (_state$client2 = _state$client2[0].waiver_form) === null || _state$client2 === void 0 || (_state$client2$map = _state$client2.map) === null || _state$client2$map === void 0 ? void 0 : _state$client2$map.call(_state$client2, function (item) {
|
|
306
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
307
|
+
is_filled: 0
|
|
308
|
+
});
|
|
309
|
+
})) || [];
|
|
302
310
|
// 创建后本地数据处理到数组
|
|
303
311
|
dispatch({
|
|
304
312
|
type: 'setClient',
|
|
305
313
|
payload: {
|
|
306
314
|
clients: [].concat(_toConsumableArray(params !== null && params !== void 0 && (_params$ = params[0]) !== null && _params$ !== void 0 && _params$.customer ? [_objectSpread(_objectSpread({}, params === null || params === void 0 || (_params$2 = params[0]) === null || _params$2 === void 0 ? void 0 : _params$2.customer), {}, {
|
|
307
|
-
id: customer_id
|
|
308
|
-
|
|
315
|
+
id: customer_id,
|
|
316
|
+
waiver_form: waiverForm
|
|
317
|
+
})] : []), _toConsumableArray(((_state$client3 = state.client) === null || _state$client3 === void 0 ? void 0 : _state$client3.clients) || []))
|
|
309
318
|
}
|
|
310
319
|
});
|
|
311
320
|
}
|
|
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
244
244
|
* @Author: WangHan
|
|
245
245
|
* @Date: 2024-12-24 11:32
|
|
246
246
|
*/
|
|
247
|
-
export declare const updateServicePrice: (state: any) => never[]
|
|
247
|
+
export declare const updateServicePrice: (state: any) => Promise<any> | never[];
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "
|
|
11
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "
|
|
177
|
+
status: "success" | "loading" | "warn" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "tyro" | "windcave" | "stripe" | "payo" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "
|
|
311
|
+
status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -121,12 +121,19 @@ export var addService = function addService(list, addItem, state) {
|
|
|
121
121
|
} else {
|
|
122
122
|
// 非预约商品判断是否相同,相同合并
|
|
123
123
|
var isNotSame = true;
|
|
124
|
+
// 是否设置过 只追加到第一个中
|
|
125
|
+
var isSetCount = false;
|
|
124
126
|
value = list.map(function (item) {
|
|
125
|
-
|
|
127
|
+
// 是否商品券折扣的商品
|
|
128
|
+
var isGoodPassDiscountProduct = (item.discount_list || []).some(function (item) {
|
|
129
|
+
return item.type === 'good_pass';
|
|
130
|
+
});
|
|
131
|
+
if (isSameProduct(item, addItem) && !isSetCount && !isGoodPassDiscountProduct) {
|
|
126
132
|
var _item$_extend, _addItem$_extend, _item$_extend2;
|
|
127
133
|
isNotSame = false;
|
|
128
134
|
var quantity = ((item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.quantity) || 1) + ((addItem === null || addItem === void 0 || (_addItem$_extend = addItem._extend) === null || _addItem$_extend === void 0 ? void 0 : _addItem$_extend.quantity) || 1);
|
|
129
135
|
count = quantity;
|
|
136
|
+
isSetCount = true;
|
|
130
137
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
131
138
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
132
139
|
quantity: quantity,
|
|
@@ -48,6 +48,7 @@ var import_index = require("./index.less");
|
|
|
48
48
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
49
49
|
var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
50
50
|
var _a, _b, _c;
|
|
51
|
+
const isFetchingDates = (0, import_react.useRef)(false);
|
|
51
52
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
52
53
|
const [currentDate, setCurrentDate] = (0, import_react.useState)();
|
|
53
54
|
const [dateMonthList, setDateMonthList] = (0, import_react.useState)([]);
|
|
@@ -139,15 +140,22 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
|
139
140
|
endDate
|
|
140
141
|
};
|
|
141
142
|
const data = await getDateData(params);
|
|
143
|
+
const firstAvailableDate = (data || []).find(
|
|
144
|
+
(d) => d.status === "available"
|
|
145
|
+
);
|
|
146
|
+
if (!firstAvailableDate && !isFetchingDates.current) {
|
|
147
|
+
isFetchingDates.current = true;
|
|
148
|
+
const nextMonthDate = (0, import_dayjs.default)(date).add(1, "month");
|
|
149
|
+
setCurrentMonth(nextMonthDate);
|
|
150
|
+
setLoading(true);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
142
153
|
const selected = await appointmentBooking.getDateRange();
|
|
143
154
|
console.log(data, selected, customPageId, "getDates");
|
|
144
155
|
if ((selected == null ? void 0 : selected.length) > 0) {
|
|
145
156
|
setCurrentDate((_a2 = selected == null ? void 0 : selected[0]) == null ? void 0 : _a2.date);
|
|
146
157
|
} else if (!isDateSelectedFirst) {
|
|
147
|
-
if (date.format("YYYY-MM") === (0, import_dayjs.default)().format("YYYY-MM")) {
|
|
148
|
-
const firstAvailableDate = (data || []).find(
|
|
149
|
-
(d) => d.status === "available"
|
|
150
|
-
);
|
|
158
|
+
if (date.format("YYYY-MM") === (0, import_dayjs.default)().format("YYYY-MM") || isFetchingDates.current) {
|
|
151
159
|
if (firstAvailableDate) {
|
|
152
160
|
setCurrentDate(firstAvailableDate == null ? void 0 : firstAvailableDate.date);
|
|
153
161
|
appointmentBooking.setDateRange([firstAvailableDate]);
|
|
@@ -171,7 +179,6 @@ var Date = (0, import_react.forwardRef)((props, ref) => {
|
|
|
171
179
|
} catch (error) {
|
|
172
180
|
setLoading(false);
|
|
173
181
|
setDateMonthList([]);
|
|
174
|
-
console.log(error, "wh978968234234");
|
|
175
182
|
}
|
|
176
183
|
};
|
|
177
184
|
(0, import_react.useEffect)(() => {
|
|
@@ -45,6 +45,7 @@ var import_utils2 = require("../../utils");
|
|
|
45
45
|
var import_serve = require("./serve");
|
|
46
46
|
var import_ahooks = require("ahooks");
|
|
47
47
|
var import_utils3 = require("../clientVariant/utils");
|
|
48
|
+
var import_useGetHolderList = __toESM(require("../hooks/useGetHolderList"));
|
|
48
49
|
var isLoadClient = false;
|
|
49
50
|
var Client = () => {
|
|
50
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
@@ -53,6 +54,7 @@ var Client = () => {
|
|
|
53
54
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
54
55
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
55
56
|
const [franchiseeLoading, setFranchiseeLoading] = (0, import_react.useState)(0);
|
|
57
|
+
const getHolders = (0, import_useGetHolderList.default)(state, dispatch);
|
|
56
58
|
const [params, setParams] = (0, import_react.useState)({
|
|
57
59
|
skip: 1,
|
|
58
60
|
num: 10,
|
|
@@ -202,6 +204,7 @@ var Client = () => {
|
|
|
202
204
|
if (data) {
|
|
203
205
|
handleSelectClient([data]);
|
|
204
206
|
}
|
|
207
|
+
getHolders();
|
|
205
208
|
getClients({
|
|
206
209
|
...state.client.clientsParams,
|
|
207
210
|
search: "",
|
|
@@ -220,13 +223,17 @@ var Client = () => {
|
|
|
220
223
|
showAcceptsMarketing: false
|
|
221
224
|
},
|
|
222
225
|
callback: (customer_id, params2) => {
|
|
223
|
-
var _a2, _b2, _c2;
|
|
226
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
227
|
+
const waiverForm = ((_d2 = (_c2 = (_b2 = (_a2 = state.client) == null ? void 0 : _a2.clients) == null ? void 0 : _b2[0].waiver_form) == null ? void 0 : _c2.map) == null ? void 0 : _d2.call(_c2, (item) => ({
|
|
228
|
+
...item,
|
|
229
|
+
is_filled: 0
|
|
230
|
+
}))) || [];
|
|
224
231
|
dispatch({
|
|
225
232
|
type: "setClient",
|
|
226
233
|
payload: {
|
|
227
234
|
clients: [
|
|
228
|
-
...((
|
|
229
|
-
...((
|
|
235
|
+
...((_e2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _e2.customer) ? [{ ...(_f2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _f2.customer, id: customer_id, waiver_form: waiverForm }] : [],
|
|
236
|
+
...((_g2 = state.client) == null ? void 0 : _g2.clients) || []
|
|
230
237
|
]
|
|
231
238
|
}
|
|
232
239
|
});
|
|
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
244
244
|
* @Author: WangHan
|
|
245
245
|
* @Date: 2024-12-24 11:32
|
|
246
246
|
*/
|
|
247
|
-
export declare const updateServicePrice: (state: any) => never[]
|
|
247
|
+
export declare const updateServicePrice: (state: any) => Promise<any> | never[];
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "
|
|
11
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "
|
|
177
|
+
status: "success" | "loading" | "warn" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "
|
|
300
|
+
eftpos?: "tyro" | "windcave" | "stripe" | "payo" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "
|
|
311
|
+
status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -142,12 +142,15 @@ var addService = (list, addItem, state) => {
|
|
|
142
142
|
count = addItem._extend.quantity;
|
|
143
143
|
} else {
|
|
144
144
|
let isNotSame = true;
|
|
145
|
+
let isSetCount = false;
|
|
145
146
|
value = list.map((item) => {
|
|
146
147
|
var _a, _b, _c;
|
|
147
|
-
|
|
148
|
+
const isGoodPassDiscountProduct = (item.discount_list || []).some((item2) => item2.type === "good_pass");
|
|
149
|
+
if (isSameProduct(item, addItem) && !isSetCount && !isGoodPassDiscountProduct) {
|
|
148
150
|
isNotSame = false;
|
|
149
151
|
const quantity = (((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.quantity) || 1) + (((_b = addItem == null ? void 0 : addItem._extend) == null ? void 0 : _b.quantity) || 1);
|
|
150
152
|
count = quantity;
|
|
153
|
+
isSetCount = true;
|
|
151
154
|
return {
|
|
152
155
|
...item,
|
|
153
156
|
_extend: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.73",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
62
|
"@pisell/utils": "1.0.42",
|
|
63
|
-
"@pisell/materials": "3.3.
|
|
63
|
+
"@pisell/materials": "3.3.29",
|
|
64
64
|
"@pisell/icon": "0.0.11",
|
|
65
65
|
"@pisell/date-picker": "3.0.2"
|
|
66
66
|
},
|