@pisell/private-materials 6.3.98 → 6.3.100
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 +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/index.js +26 -20
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- 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/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- 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/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passDetail/index.js +2 -26
- package/es/plus/walletPassGallery/components/passList/index.js +8 -1
- package/es/plus/walletPassGallery/index.js +0 -31
- package/lib/components/booking/components/footer/index.js +5 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- 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/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- 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/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.js +1 -16
- package/lib/plus/walletPassGallery/components/passList/index.js +9 -3
- package/lib/plus/walletPassGallery/index.js +0 -29
- package/lowcode/eco-cup-list/meta.ts +1 -1
- package/lowcode/eco-customer-list/meta.ts +1 -1
- package/package.json +3 -3
|
@@ -427,7 +427,7 @@ var Footer = function Footer(props) {
|
|
|
427
427
|
*/
|
|
428
428
|
var handleSave = /*#__PURE__*/function () {
|
|
429
429
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
|
|
430
|
-
var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window, callbackData, values, api;
|
|
430
|
+
var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, loadingTimer, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window, callbackData, values, api;
|
|
431
431
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
432
432
|
while (1) switch (_context4.prev = _context4.next) {
|
|
433
433
|
case 0:
|
|
@@ -452,27 +452,31 @@ var Footer = function Footer(props) {
|
|
|
452
452
|
// 区分loading, 是点击的checkout 还是save
|
|
453
453
|
_setLoading = type === 'checkout' ? setCheckoutLoading : setLoading;
|
|
454
454
|
_setLoading(true);
|
|
455
|
+
// 超时保护: 超过20秒自动关闭loading
|
|
456
|
+
loadingTimer = setTimeout(function () {
|
|
457
|
+
_setLoading(false);
|
|
458
|
+
}, 20000);
|
|
455
459
|
_getApis = getApis(), createBooking = _getApis.createBooking, editBooking = _getApis.editBooking;
|
|
456
460
|
editApi = state.renderType === 'eventBooking' ? editEventBooking : editBooking;
|
|
457
461
|
createApi = state.renderType === 'eventBooking' ? createEventBooking : createBooking;
|
|
458
462
|
saveOtherValue = {};
|
|
459
463
|
if (!(type === 'save')) {
|
|
460
|
-
_context4.next =
|
|
464
|
+
_context4.next = 21;
|
|
461
465
|
break;
|
|
462
466
|
}
|
|
463
|
-
_context4.next =
|
|
467
|
+
_context4.next = 17;
|
|
464
468
|
return state === null || state === void 0 || (_state$onSave = state.onSave) === null || _state$onSave === void 0 ? void 0 : _state$onSave.call(state, state.client);
|
|
465
|
-
case
|
|
469
|
+
case 17:
|
|
466
470
|
_context4.t0 = _context4.sent;
|
|
467
471
|
if (_context4.t0) {
|
|
468
|
-
_context4.next =
|
|
472
|
+
_context4.next = 20;
|
|
469
473
|
break;
|
|
470
474
|
}
|
|
471
475
|
_context4.t0 = {};
|
|
472
|
-
case 19:
|
|
473
|
-
saveOtherValue = _context4.t0;
|
|
474
476
|
case 20:
|
|
475
|
-
|
|
477
|
+
saveOtherValue = _context4.t0;
|
|
478
|
+
case 21:
|
|
479
|
+
_context4.prev = 21;
|
|
476
480
|
callbackData = null; // 格式化提交的参数
|
|
477
481
|
values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // 区分是新增还是编辑
|
|
478
482
|
api = state.bookingId ? editApi : createApi; // 增加日志记录
|
|
@@ -528,43 +532,45 @@ var Footer = function Footer(props) {
|
|
|
528
532
|
|
|
529
533
|
// 如果有addons改动, 则先保存
|
|
530
534
|
if (!addonsEdit) {
|
|
531
|
-
_context4.next =
|
|
535
|
+
_context4.next = 29;
|
|
532
536
|
break;
|
|
533
537
|
}
|
|
534
|
-
_context4.next =
|
|
538
|
+
_context4.next = 29;
|
|
535
539
|
return handleSaveAddons();
|
|
536
|
-
case
|
|
540
|
+
case 29:
|
|
537
541
|
if (!infoEdit) {
|
|
538
|
-
_context4.next =
|
|
542
|
+
_context4.next = 34;
|
|
539
543
|
break;
|
|
540
544
|
}
|
|
541
|
-
_context4.next =
|
|
545
|
+
_context4.next = 32;
|
|
542
546
|
return api(values, state.bookingId);
|
|
543
|
-
case
|
|
547
|
+
case 32:
|
|
544
548
|
callbackData = _context4.sent;
|
|
545
549
|
if (messageShow) {
|
|
546
550
|
message.success(locales.getText(state.bookingId ? 'pisell2.text.appointment-updated' : 'pisell2.text.created-successfully'));
|
|
547
551
|
}
|
|
548
|
-
case
|
|
552
|
+
case 34:
|
|
549
553
|
// 回调关闭弹窗
|
|
550
554
|
state === null || state === void 0 || state.callback(callbackData, type);
|
|
555
|
+
clearTimeout(loadingTimer);
|
|
551
556
|
_setLoading(false);
|
|
552
557
|
|
|
553
558
|
// return数据 checkout时需要
|
|
554
559
|
return _context4.abrupt("return", callbackData || values);
|
|
555
|
-
case
|
|
556
|
-
_context4.prev =
|
|
557
|
-
_context4.t1 = _context4["catch"](
|
|
560
|
+
case 40:
|
|
561
|
+
_context4.prev = 40;
|
|
562
|
+
_context4.t1 = _context4["catch"](21);
|
|
558
563
|
console.log(_context4.t1);
|
|
559
564
|
if ((_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.code) === 70101) {
|
|
560
565
|
message.error(_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.message);
|
|
561
566
|
}
|
|
567
|
+
clearTimeout(loadingTimer);
|
|
562
568
|
_setLoading(false);
|
|
563
|
-
case
|
|
569
|
+
case 46:
|
|
564
570
|
case "end":
|
|
565
571
|
return _context4.stop();
|
|
566
572
|
}
|
|
567
|
-
}, _callee4, null, [[
|
|
573
|
+
}, _callee4, null, [[21, 40]]);
|
|
568
574
|
}));
|
|
569
575
|
return function handleSave(_x2) {
|
|
570
576
|
return _ref5.apply(this, arguments);
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
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<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -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?: "stripe" | "
|
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -5,7 +5,6 @@ interface PassDetailProps {
|
|
|
5
5
|
platform?: 'pc' | 'h5';
|
|
6
6
|
buttonGroupList?: any[][];
|
|
7
7
|
showTimeLine?: boolean;
|
|
8
|
-
onDetailRefresh?: (passId: number | string, patch: any) => void;
|
|
9
8
|
onListRefresh?: () => void;
|
|
10
9
|
}
|
|
11
10
|
declare const PassDetail: (props: PassDetailProps) => React.JSX.Element | null;
|
|
@@ -41,7 +41,6 @@ var PassDetail = function PassDetail(props) {
|
|
|
41
41
|
platform = _props$platform === void 0 ? 'pc' : _props$platform,
|
|
42
42
|
_props$showTimeLine = props.showTimeLine,
|
|
43
43
|
showTimeLine = _props$showTimeLine === void 0 ? true : _props$showTimeLine,
|
|
44
|
-
onDetailRefresh = props.onDetailRefresh,
|
|
45
44
|
onListRefresh = props.onListRefresh;
|
|
46
45
|
var _useState = useState('detail'),
|
|
47
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -111,38 +110,15 @@ var PassDetail = function PassDetail(props) {
|
|
|
111
110
|
var _interaction$utils, _interaction$utils$mo;
|
|
112
111
|
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$mo = _interaction$utils.mountFunction) === null || _interaction$utils$mo === void 0 || _interaction$utils$mo.call(_interaction$utils, 'customer', 'recharge', /*#__PURE__*/function () {
|
|
113
112
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(strVal) {
|
|
114
|
-
var _getDetail$refreshAsy, latest, patch;
|
|
115
113
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
116
114
|
while (1) switch (_context.prev = _context.next) {
|
|
117
115
|
case 0:
|
|
118
|
-
if (strVal) {
|
|
119
|
-
_context.next = 2;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
116
|
return _context.abrupt("return", onListRefresh === null || onListRefresh === void 0 ? void 0 : onListRefresh());
|
|
123
|
-
case
|
|
124
|
-
_context.prev = 2;
|
|
125
|
-
_context.next = 5;
|
|
126
|
-
return (_getDetail$refreshAsy = _getDetail.refreshAsync) === null || _getDetail$refreshAsy === void 0 ? void 0 : _getDetail$refreshAsy.call(_getDetail);
|
|
127
|
-
case 5:
|
|
128
|
-
latest = _context.sent;
|
|
129
|
-
patch = {
|
|
130
|
-
balance: (latest === null || latest === void 0 ? void 0 : latest.balance) !== undefined ? latest.balance : balance !== null && balance !== void 0 ? balance : undefined,
|
|
131
|
-
expire_date: (latest === null || latest === void 0 ? void 0 : latest.expire_date) !== undefined ? latest.expire_date : expire_date !== null && expire_date !== void 0 ? expire_date : undefined,
|
|
132
|
-
unified_available_status: latest === null || latest === void 0 ? void 0 : latest.unified_available_status
|
|
133
|
-
};
|
|
134
|
-
onDetailRefresh === null || onDetailRefresh === void 0 || onDetailRefresh(id, patch);
|
|
135
|
-
_context.next = 13;
|
|
136
|
-
break;
|
|
137
|
-
case 10:
|
|
138
|
-
_context.prev = 10;
|
|
139
|
-
_context.t0 = _context["catch"](2);
|
|
140
|
-
console.error(_context.t0);
|
|
141
|
-
case 13:
|
|
117
|
+
case 1:
|
|
142
118
|
case "end":
|
|
143
119
|
return _context.stop();
|
|
144
120
|
}
|
|
145
|
-
}, _callee
|
|
121
|
+
}, _callee);
|
|
146
122
|
}));
|
|
147
123
|
return function (_x) {
|
|
148
124
|
return _ref4.apply(this, arguments);
|
|
@@ -6,7 +6,9 @@ import React from 'react';
|
|
|
6
6
|
import { Button, List } from 'antd';
|
|
7
7
|
import { PisellWalletPassCard } from '@pisell/materials';
|
|
8
8
|
import { locales } from '@pisell/utils';
|
|
9
|
+
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
9
10
|
var PassList = function PassList(props) {
|
|
11
|
+
var _context$appHelper;
|
|
10
12
|
var _props$dataSource = props.dataSource,
|
|
11
13
|
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
12
14
|
value = props.value,
|
|
@@ -17,6 +19,11 @@ var PassList = function PassList(props) {
|
|
|
17
19
|
onLoadMore = props.onLoadMore,
|
|
18
20
|
loading = props.loading,
|
|
19
21
|
onEditHolder = props.onEditHolder;
|
|
22
|
+
var context = useEngineContext();
|
|
23
|
+
var utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
24
|
+
var isTerminal = utils.isTerminal,
|
|
25
|
+
isApp = utils.isApp;
|
|
26
|
+
var isTerminalEnv = (typeof isTerminal === 'function' ? isTerminal() : !!isTerminal) || (isApp === null || isApp === void 0 ? void 0 : isApp());
|
|
20
27
|
var _loadMore = /*#__PURE__*/React.createElement("div", {
|
|
21
28
|
style: {
|
|
22
29
|
textAlign: 'center',
|
|
@@ -112,7 +119,7 @@ var PassList = function PassList(props) {
|
|
|
112
119
|
code: encoded,
|
|
113
120
|
validDate: expire_date,
|
|
114
121
|
holder: holder,
|
|
115
|
-
onSetHolder: function
|
|
122
|
+
onSetHolder: isTerminalEnv ? undefined : function () {
|
|
116
123
|
var _holder$metadata;
|
|
117
124
|
onEditHolder === null || onEditHolder === void 0 || onEditHolder({
|
|
118
125
|
wallet_pass_detail_id: id,
|
|
@@ -498,34 +498,6 @@ var WalletPassGallery = function WalletPassGallery(props) {
|
|
|
498
498
|
console.log('pass not found', passId);
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
|
-
var _handleDetailRefresh = function _handleDetailRefresh(passId, patch) {
|
|
502
|
-
if (_avaliable.find(function (item) {
|
|
503
|
-
return item.id === passId;
|
|
504
|
-
})) {
|
|
505
|
-
_getAvailableList.mutate(function (data) {
|
|
506
|
-
var newList = data.list.map(function (item) {
|
|
507
|
-
return item.id === passId ? _objectSpread(_objectSpread({}, item), patch) : item;
|
|
508
|
-
});
|
|
509
|
-
return _objectSpread(_objectSpread({}, data), {}, {
|
|
510
|
-
list: newList
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (_unavailable.find(function (item) {
|
|
516
|
-
return item.id === passId;
|
|
517
|
-
})) {
|
|
518
|
-
_getUnavailableList.mutate(function (data) {
|
|
519
|
-
var newList = data.list.map(function (item) {
|
|
520
|
-
return item.id === passId ? _objectSpread(_objectSpread({}, item), patch) : item;
|
|
521
|
-
});
|
|
522
|
-
return _objectSpread(_objectSpread({}, data), {}, {
|
|
523
|
-
list: newList
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
return;
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
501
|
var _handleBindHolder = /*#__PURE__*/function () {
|
|
530
502
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(holderId) {
|
|
531
503
|
var passId, res;
|
|
@@ -618,7 +590,6 @@ var WalletPassGallery = function WalletPassGallery(props) {
|
|
|
618
590
|
}, /*#__PURE__*/React.createElement(PassDetail, {
|
|
619
591
|
dataSource: _currentItem,
|
|
620
592
|
platform: platform,
|
|
621
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
622
593
|
onListRefresh: listReload
|
|
623
594
|
})));
|
|
624
595
|
};
|
|
@@ -656,7 +627,6 @@ var WalletPassGallery = function WalletPassGallery(props) {
|
|
|
656
627
|
}, /*#__PURE__*/React.createElement(PassDetail, {
|
|
657
628
|
dataSource: _currentItem,
|
|
658
629
|
platform: platform,
|
|
659
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
660
630
|
onListRefresh: listReload
|
|
661
631
|
})));
|
|
662
632
|
};
|
|
@@ -815,7 +785,6 @@ var WalletPassGallery = function WalletPassGallery(props) {
|
|
|
815
785
|
}, /*#__PURE__*/React.createElement(PassDetail, {
|
|
816
786
|
dataSource: _currentItem,
|
|
817
787
|
platform: platform,
|
|
818
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
819
788
|
onListRefresh: listReload
|
|
820
789
|
})));
|
|
821
790
|
};
|
|
@@ -286,6 +286,9 @@ var Footer = (props) => {
|
|
|
286
286
|
}
|
|
287
287
|
let _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
|
|
288
288
|
_setLoading(true);
|
|
289
|
+
const loadingTimer = setTimeout(() => {
|
|
290
|
+
_setLoading(false);
|
|
291
|
+
}, 2e4);
|
|
289
292
|
const { createBooking, editBooking } = getApis();
|
|
290
293
|
const editApi = state.renderType === "eventBooking" ? import_serve2.editEventBooking : editBooking;
|
|
291
294
|
const createApi = state.renderType === "eventBooking" ? import_serve2.createEventBooking : createBooking;
|
|
@@ -331,6 +334,7 @@ var Footer = (props) => {
|
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
state == null ? void 0 : state.callback(callbackData, type);
|
|
337
|
+
clearTimeout(loadingTimer);
|
|
334
338
|
_setLoading(false);
|
|
335
339
|
return callbackData || values;
|
|
336
340
|
} catch (err) {
|
|
@@ -338,6 +342,7 @@ var Footer = (props) => {
|
|
|
338
342
|
if ((err == null ? void 0 : err.code) === 70101) {
|
|
339
343
|
import_antd.message.error(err == null ? void 0 : err.message);
|
|
340
344
|
}
|
|
345
|
+
clearTimeout(loadingTimer);
|
|
341
346
|
_setLoading(false);
|
|
342
347
|
}
|
|
343
348
|
};
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
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<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -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?: "stripe" | "
|
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -5,7 +5,6 @@ interface PassDetailProps {
|
|
|
5
5
|
platform?: 'pc' | 'h5';
|
|
6
6
|
buttonGroupList?: any[][];
|
|
7
7
|
showTimeLine?: boolean;
|
|
8
|
-
onDetailRefresh?: (passId: number | string, patch: any) => void;
|
|
9
8
|
onListRefresh?: () => void;
|
|
10
9
|
}
|
|
11
10
|
declare const PassDetail: (props: PassDetailProps) => React.JSX.Element | null;
|
|
@@ -59,7 +59,6 @@ var PassDetail = (props) => {
|
|
|
59
59
|
dataSource,
|
|
60
60
|
platform = "pc",
|
|
61
61
|
showTimeLine = true,
|
|
62
|
-
onDetailRefresh,
|
|
63
62
|
onListRefresh
|
|
64
63
|
} = props;
|
|
65
64
|
const [activeKey, setActiveKey] = (0, import_react.useState)("detail");
|
|
@@ -110,21 +109,7 @@ var PassDetail = (props) => {
|
|
|
110
109
|
"customer",
|
|
111
110
|
"recharge",
|
|
112
111
|
async (strVal) => {
|
|
113
|
-
|
|
114
|
-
if (!strVal) {
|
|
115
|
-
return onListRefresh == null ? void 0 : onListRefresh();
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
const latest = await ((_a3 = _getDetail.refreshAsync) == null ? void 0 : _a3.call(_getDetail));
|
|
119
|
-
const patch = {
|
|
120
|
-
balance: (latest == null ? void 0 : latest.balance) !== void 0 ? latest.balance : balance ?? void 0,
|
|
121
|
-
expire_date: (latest == null ? void 0 : latest.expire_date) !== void 0 ? latest.expire_date : expire_date ?? void 0,
|
|
122
|
-
unified_available_status: latest == null ? void 0 : latest.unified_available_status
|
|
123
|
-
};
|
|
124
|
-
onDetailRefresh == null ? void 0 : onDetailRefresh(id, patch);
|
|
125
|
-
} catch (err) {
|
|
126
|
-
console.error(err);
|
|
127
|
-
}
|
|
112
|
+
return onListRefresh == null ? void 0 : onListRefresh();
|
|
128
113
|
}
|
|
129
114
|
);
|
|
130
115
|
}, [id]);
|
|
@@ -36,7 +36,9 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
39
40
|
var PassList = (props) => {
|
|
41
|
+
var _a;
|
|
40
42
|
const {
|
|
41
43
|
dataSource = [],
|
|
42
44
|
value,
|
|
@@ -47,6 +49,10 @@ var PassList = (props) => {
|
|
|
47
49
|
loading,
|
|
48
50
|
onEditHolder
|
|
49
51
|
} = props;
|
|
52
|
+
const context = (0, import_useEngineContext.default)();
|
|
53
|
+
const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
54
|
+
const { isTerminal, isApp } = utils;
|
|
55
|
+
const isTerminalEnv = (typeof isTerminal === "function" ? isTerminal() : !!isTerminal) || (isApp == null ? void 0 : isApp());
|
|
50
56
|
const _loadMore = /* @__PURE__ */ import_react.default.createElement(
|
|
51
57
|
"div",
|
|
52
58
|
{
|
|
@@ -130,12 +136,12 @@ var PassList = (props) => {
|
|
|
130
136
|
code: encoded,
|
|
131
137
|
validDate: expire_date,
|
|
132
138
|
holder,
|
|
133
|
-
onSetHolder: () => {
|
|
134
|
-
var
|
|
139
|
+
onSetHolder: isTerminalEnv ? void 0 : () => {
|
|
140
|
+
var _a2;
|
|
135
141
|
onEditHolder == null ? void 0 : onEditHolder({
|
|
136
142
|
wallet_pass_detail_id: id,
|
|
137
143
|
customer_id: holder == null ? void 0 : holder.customer_id,
|
|
138
|
-
form_id: (
|
|
144
|
+
form_id: (_a2 = holder == null ? void 0 : holder.metadata) == null ? void 0 : _a2.custom_id
|
|
139
145
|
});
|
|
140
146
|
}
|
|
141
147
|
}
|
|
@@ -385,32 +385,6 @@ var WalletPassGallery = (props) => {
|
|
|
385
385
|
console.log("pass not found", passId);
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
|
-
const _handleDetailRefresh = (passId, patch) => {
|
|
389
|
-
if (_avaliable.find((item) => item.id === passId)) {
|
|
390
|
-
_getAvailableList.mutate((data) => {
|
|
391
|
-
const newList = data.list.map(
|
|
392
|
-
(item) => item.id === passId ? { ...item, ...patch } : item
|
|
393
|
-
);
|
|
394
|
-
return {
|
|
395
|
-
...data,
|
|
396
|
-
list: newList
|
|
397
|
-
};
|
|
398
|
-
});
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
if (_unavailable.find((item) => item.id === passId)) {
|
|
402
|
-
_getUnavailableList.mutate((data) => {
|
|
403
|
-
const newList = data.list.map(
|
|
404
|
-
(item) => item.id === passId ? { ...item, ...patch } : item
|
|
405
|
-
);
|
|
406
|
-
return {
|
|
407
|
-
...data,
|
|
408
|
-
list: newList
|
|
409
|
-
};
|
|
410
|
-
});
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
388
|
const _handleBindHolder = async (holderId) => {
|
|
415
389
|
setUpdateHolderLoading(true);
|
|
416
390
|
const { wallet_pass_detail_id: passId } = editHolderData;
|
|
@@ -476,7 +450,6 @@ var WalletPassGallery = (props) => {
|
|
|
476
450
|
{
|
|
477
451
|
dataSource: _currentItem,
|
|
478
452
|
platform,
|
|
479
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
480
453
|
onListRefresh: listReload
|
|
481
454
|
}
|
|
482
455
|
)));
|
|
@@ -512,7 +485,6 @@ var WalletPassGallery = (props) => {
|
|
|
512
485
|
{
|
|
513
486
|
dataSource: _currentItem,
|
|
514
487
|
platform,
|
|
515
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
516
488
|
onListRefresh: listReload
|
|
517
489
|
}
|
|
518
490
|
)));
|
|
@@ -660,7 +632,6 @@ var WalletPassGallery = (props) => {
|
|
|
660
632
|
{
|
|
661
633
|
dataSource: _currentItem,
|
|
662
634
|
platform,
|
|
663
|
-
onDetailRefresh: _handleDetailRefresh,
|
|
664
635
|
onListRefresh: listReload
|
|
665
636
|
}
|
|
666
637
|
)
|
|
@@ -9,7 +9,7 @@ const EcoCustomerListMeta: ComponentMetadata = {
|
|
|
9
9
|
"devMode": "proCode",
|
|
10
10
|
"npm": {
|
|
11
11
|
"package": "@pisell/private-materials",
|
|
12
|
-
"version": "
|
|
12
|
+
"version": "1.1.2037",
|
|
13
13
|
"exportName": "EcoCustomerList",
|
|
14
14
|
"main": "src/index.ts",
|
|
15
15
|
"destructuring": true,
|