@pisell/private-materials 6.3.20 → 6.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +12 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/hooks/useQuotation.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/locales.js +9 -9
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/addNote/index.d.ts +0 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/linkly/hooks/normal.js +2 -2
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/es/components/ruleSetting/locales.js +2 -2
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +61 -20
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +15 -2
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/hooks/useQuotation.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/locales.js +9 -9
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/addNote/index.d.ts +0 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/linkly/hooks/normal.js +2 -2
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
- package/lib/components/ruleSetting/locales.js +2 -2
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +43 -8
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/package.json +2 -2
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -424,7 +424,7 @@ var Footer = function Footer(props) {
|
|
424
424
|
*/
|
425
425
|
var handleSave = /*#__PURE__*/function () {
|
426
426
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
|
427
|
-
var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
|
427
|
+
var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window, callbackData, values, api;
|
428
428
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
429
429
|
while (1) switch (_context4.prev = _context4.next) {
|
430
430
|
case 0:
|
@@ -481,6 +481,17 @@ var Footer = function Footer(props) {
|
|
481
481
|
}, {
|
482
482
|
key: '日期',
|
483
483
|
value: dayjs().format('YYYY-MM-DD HH:mm')
|
484
|
+
}, {
|
485
|
+
key: '店铺id',
|
486
|
+
value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
|
487
|
+
}, {
|
488
|
+
key: 'shopApi',
|
489
|
+
value: JSON.stringify((_window = window) === null || _window === void 0 ? void 0 : _window.shopApi, function (key, value) {
|
490
|
+
if (typeof value === 'function') {
|
491
|
+
return 'function';
|
492
|
+
}
|
493
|
+
return value;
|
494
|
+
})
|
484
495
|
}]
|
485
496
|
});
|
486
497
|
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -1,5 +1,14 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from '../model';
|
1
3
|
export declare const walkInData: {
|
2
4
|
id: number;
|
3
5
|
nickname: string;
|
4
6
|
};
|
5
|
-
export declare const Provider: any, Context:
|
7
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
8
|
+
state: FormState;
|
9
|
+
} & {
|
10
|
+
dispatch: (params: {
|
11
|
+
type: string;
|
12
|
+
payload: any;
|
13
|
+
}) => void;
|
14
|
+
}>;
|
@@ -102,7 +102,7 @@ export default {
|
|
102
102
|
var obj = {
|
103
103
|
shop: 'Paid from Merchant Portal',
|
104
104
|
'mini-program': 'Paid from WeChat Mini-program',
|
105
|
-
pos: 'Paid from
|
105
|
+
pos: 'Paid from Terminal',
|
106
106
|
PC: 'Paid from Website',
|
107
107
|
app: 'Paid from APP'
|
108
108
|
};
|
@@ -145,7 +145,7 @@ export default {
|
|
145
145
|
'pisell2.text.edit-profile': 'Edit profile',
|
146
146
|
'pisell2.text.remove-contact': 'Remove contact',
|
147
147
|
'pisell2.text.order.sales.channel.online': "Online store",
|
148
|
-
'pisell2.text.order.sales.channel.pos-terminal': "
|
148
|
+
'pisell2.text.order.sales.channel.pos-terminal': "Terminal",
|
149
149
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
150
150
|
'pisell2.text.order.sales.channel.tableorder': "Table order",
|
151
151
|
'pisell2.text.order.sales.channel.reserve': "Google reservation",
|
@@ -191,7 +191,7 @@ export default {
|
|
191
191
|
'page.booking.text.available': 'Available',
|
192
192
|
'page.booking.text.fully-booked': 'Fully booked',
|
193
193
|
'page.booking.text.unlimited': 'Unlimited',
|
194
|
-
'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the
|
194
|
+
'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the Terminal.",
|
195
195
|
"pisell2.text.actions": "Actions",
|
196
196
|
"pisell2.text.add-client": "Add customer",
|
197
197
|
// 日称tab
|
@@ -434,7 +434,7 @@ export default {
|
|
434
434
|
var obj = {
|
435
435
|
shop: '在 管理后台 支付',
|
436
436
|
'mini-program': '在 微信小程序 支付',
|
437
|
-
pos: '在
|
437
|
+
pos: '在 终端 支付',
|
438
438
|
PC: '在 网站 支付',
|
439
439
|
app: '在 手机应用程序 支付'
|
440
440
|
};
|
@@ -472,7 +472,7 @@ export default {
|
|
472
472
|
'pisell2.text.edit-profile': '编辑个人资料',
|
473
473
|
'pisell2.text.remove-contact': '删除联系人',
|
474
474
|
'pisell2.text.order.sales.channel.online': "在线店铺",
|
475
|
-
'pisell2.text.order.sales.channel.pos-terminal': "
|
475
|
+
'pisell2.text.order.sales.channel.pos-terminal': "终端",
|
476
476
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
477
477
|
'pisell2.text.order.sales.channel.tableorder': "扫码点餐",
|
478
478
|
'pisell2.text.order.sales.channel.reserve': "谷歌预约",
|
@@ -509,7 +509,7 @@ export default {
|
|
509
509
|
'pisell2.text.send-mail': "发送邮件",
|
510
510
|
'pisell2.text.copy-to-clipboard': "复制到剪切板",
|
511
511
|
'pisell2.text.ok': "好的",
|
512
|
-
'pisell2.text.terminal-edit-message': "
|
512
|
+
'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用请至终端设备操作。",
|
513
513
|
'page.booking.text.add-time': '加时',
|
514
514
|
'page.booking.text.quantity': '数量',
|
515
515
|
'page.booking.text.sales': '销售',
|
@@ -761,7 +761,7 @@ export default {
|
|
761
761
|
var obj = {
|
762
762
|
shop: '在 管理後臺 支付',
|
763
763
|
'mini-program': '在 微信小程序 支付',
|
764
|
-
pos: '在
|
764
|
+
pos: '在 終端 支付',
|
765
765
|
PC: '在 網站 支付',
|
766
766
|
app: '在 手機應用程序 支付'
|
767
767
|
};
|
@@ -799,7 +799,7 @@ export default {
|
|
799
799
|
'pisell2.text.edit-profile': '編輯個人資料',
|
800
800
|
'pisell2.text.remove-contact': '删除聯系人',
|
801
801
|
'pisell2.text.order.sales.channel.online': "在線店鋪",
|
802
|
-
'pisell2.text.order.sales.channel.pos-terminal': "
|
802
|
+
'pisell2.text.order.sales.channel.pos-terminal': "终端",
|
803
803
|
'pisell2.text.order.sales.channel.boxcocal': "Boxlocal",
|
804
804
|
'pisell2.text.order.sales.channel.tableorder': "掃碼點餐",
|
805
805
|
'pisell2.text.order.sales.channel.reserve': "谷歌預約",
|
@@ -836,7 +836,7 @@ export default {
|
|
836
836
|
'pisell2.text.send-mail': "發送郵件",
|
837
837
|
'pisell2.text.copy-to-clipboard': "複製到剪切板",
|
838
838
|
'pisell2.text.ok': "好的",
|
839
|
-
'pisell2.text.terminal-edit-message': "
|
839
|
+
'pisell2.text.terminal-edit-message': "此操作不可使用,如需使用請至終端設備操作。",
|
840
840
|
'page.booking.text.add-time': '加時',
|
841
841
|
'page.booking.text.quantity': '數量',
|
842
842
|
'page.booking.text.sales': '銷售',
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
export interface FormState {
|
2
3
|
amountSymbol: string;
|
3
4
|
apis: {
|
@@ -105,4 +106,11 @@ export declare const walkInData: {
|
|
105
106
|
id: number;
|
106
107
|
nickname: string;
|
107
108
|
};
|
108
|
-
export declare const Provider: any, Context:
|
109
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
110
|
+
state: FormState;
|
111
|
+
} & {
|
112
|
+
dispatch: (params: {
|
113
|
+
type: string;
|
114
|
+
payload: any;
|
115
|
+
}) => void;
|
116
|
+
}>;
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { FormState } from "../model";
|
3
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
+
state: FormState;
|
5
|
+
} & {
|
6
|
+
dispatch: (params: {
|
7
|
+
type: string;
|
8
|
+
payload: any;
|
9
|
+
}) => void;
|
10
|
+
}>;
|
@@ -74,7 +74,7 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
74
74
|
var status = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.status;
|
75
75
|
|
76
76
|
// 继续查询交易状态
|
77
|
-
if (status
|
77
|
+
if (status == 0) {
|
78
78
|
var _res$data2;
|
79
79
|
// 交易流水号
|
80
80
|
numRef.current = res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.session_id;
|
@@ -99,7 +99,7 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
99
99
|
}));
|
100
100
|
|
101
101
|
// 交易成功
|
102
|
-
if (status
|
102
|
+
if (status == 1) {
|
103
103
|
var _handleLinklySuccessR;
|
104
104
|
(_handleLinklySuccessR = handleLinklySuccessRef.current) === null || _handleLinklySuccessR === void 0 || _handleLinklySuccessR.call(handleLinklySuccessRef, res);
|
105
105
|
return;
|
@@ -86,15 +86,22 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
86
86
|
isQueryFinishedRef.current = true;
|
87
87
|
var data = (result === null || result === void 0 ? void 0 : result.data) || {};
|
88
88
|
// 交易成功,终止查询
|
89
|
-
if (data.status
|
89
|
+
if (data.status == 1) {
|
90
90
|
console.log('交易成功,终止查询');
|
91
|
+
sendWarningLog({
|
92
|
+
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u6210\u529F"),
|
93
|
+
content: [{
|
94
|
+
key: 'response',
|
95
|
+
value: JSON.stringify(result)
|
96
|
+
}]
|
97
|
+
});
|
91
98
|
reset();
|
92
99
|
handleLinklySuccess(result);
|
93
100
|
return;
|
94
101
|
}
|
95
102
|
|
96
103
|
// 交易状态为0,且不需要签名,则继续查询
|
97
|
-
if (data.status
|
104
|
+
if ((data === null || data === void 0 ? void 0 : data.status) == 0 && (data === null || data === void 0 ? void 0 : data.signature_flag) != 1) {
|
98
105
|
console.log('交易状态为0需要继续查询');
|
99
106
|
isQueryFinishedRef.current = false;
|
100
107
|
_resultQuery();
|
@@ -105,6 +112,13 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
105
112
|
if (data.status < 0) {
|
106
113
|
var _failRef$current;
|
107
114
|
console.log('交易失败,终止查询');
|
115
|
+
sendWarningLog({
|
116
|
+
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u5931\u8D25"),
|
117
|
+
content: [{
|
118
|
+
key: 'response',
|
119
|
+
value: JSON.stringify(result)
|
120
|
+
}]
|
121
|
+
});
|
108
122
|
reset();
|
109
123
|
// 交易失败,code码转换为支付失败code码
|
110
124
|
result.code = PayStatus.Unknown;
|
@@ -113,8 +127,15 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
113
127
|
}
|
114
128
|
|
115
129
|
// 需要签名
|
116
|
-
if (data.signature_flag
|
130
|
+
if (data.signature_flag == 1) {
|
117
131
|
console.log('交易需要签名,终止查询');
|
132
|
+
sendWarningLog({
|
133
|
+
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u9700\u8981\u7B7E\u540D"),
|
134
|
+
content: [{
|
135
|
+
key: 'response',
|
136
|
+
value: JSON.stringify(result)
|
137
|
+
}]
|
138
|
+
});
|
118
139
|
reset();
|
119
140
|
gotoSignature();
|
120
141
|
return;
|
@@ -240,7 +261,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
240
261
|
});
|
241
262
|
}
|
242
263
|
sendWarningLog({
|
243
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7ED3\u679C\
|
264
|
+
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u7ED3\u679C\u8F6E\u8BE2"),
|
244
265
|
content: content
|
245
266
|
});
|
246
267
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
export interface FormState {
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
3
4
|
order: any;
|
@@ -28,4 +29,11 @@ export interface PayGroup {
|
|
28
29
|
pay_number?: string;
|
29
30
|
_order: any;
|
30
31
|
}
|
31
|
-
export declare const Provider: any, Context:
|
32
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
33
|
+
state: FormState;
|
34
|
+
} & {
|
35
|
+
dispatch: (params: {
|
36
|
+
type: string;
|
37
|
+
payload: any;
|
38
|
+
}) => void;
|
39
|
+
}>;
|
@@ -11,7 +11,7 @@ export default {
|
|
11
11
|
'pisell2.text.rule-setting.sales_channel': "Operation platform",
|
12
12
|
'pisell2.text.rule-setting.staff': "Staff",
|
13
13
|
'pisell2.text.rule-setting.payment_method': "Payment method",
|
14
|
-
'pisell2.text.rule-setting.pisell_terminal_device': "
|
14
|
+
'pisell2.text.rule-setting.pisell_terminal_device': "Terminal device",
|
15
15
|
'pisell2.text.rule-setting.current_device': "Current device"
|
16
16
|
},
|
17
17
|
'zh-CN': {
|
@@ -41,7 +41,7 @@ export default {
|
|
41
41
|
'pisell2.text.rule-setting.sales_channel': "操作平台",
|
42
42
|
'pisell2.text.rule-setting.staff': "員工",
|
43
43
|
'pisell2.text.rule-setting.payment_method': "支付方式",
|
44
|
-
'pisell2.text.rule-setting.pisell_terminal_device': "
|
44
|
+
'pisell2.text.rule-setting.pisell_terminal_device': "終端",
|
45
45
|
'pisell2.text.rule-setting.current_device': "當前設備"
|
46
46
|
}
|
47
47
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
2
3
|
import dayjs from "dayjs";
|
3
4
|
export interface FormState {
|
@@ -68,4 +69,11 @@ export interface FormState {
|
|
68
69
|
};
|
69
70
|
setGlobalState: Function | null;
|
70
71
|
}
|
71
|
-
export declare const Provider: any, Context:
|
72
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
73
|
+
state: FormState;
|
74
|
+
} & {
|
75
|
+
dispatch: (params: {
|
76
|
+
type: string;
|
77
|
+
payload: any;
|
78
|
+
}) => void;
|
79
|
+
}>;
|
@@ -19,7 +19,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
19
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
20
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
21
21
|
import React, { useEffect, useRef } from 'react';
|
22
|
-
import { locales } from '@pisell/utils';
|
22
|
+
import { locales, sendWarningLog } from '@pisell/utils';
|
23
23
|
import { message } from 'antd';
|
24
24
|
import { getOrderInfoByCode, getBookingDetail, getEventBookingDetail, getBookingConfig, getServices, voidAppointment } from "../../serve";
|
25
25
|
import * as apis from "../../serve";
|
@@ -34,6 +34,7 @@ import "./index.less";
|
|
34
34
|
import { formatProducts } from "../../../booking/info/service2/utils";
|
35
35
|
import { getSumTotal } from "../../../booking/components/footer/amount";
|
36
36
|
import formatProductMessage from "../../utils/formatProductMessage";
|
37
|
+
import { useDebounceFn } from "ahooks";
|
37
38
|
export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
38
39
|
var _bookings$list, _bookings$list2;
|
39
40
|
var customer_id = data.customer_id,
|
@@ -186,8 +187,54 @@ var TicketBooking = function TicketBooking() {
|
|
186
187
|
var _listTimerRef = useRef();
|
187
188
|
var _timerRef = useRef();
|
188
189
|
var _callbackFnRef = useRef();
|
190
|
+
var _useDebounceFn = useDebounceFn(function (type, orderId) {
|
191
|
+
// 支付成功后清空状态
|
192
|
+
try {
|
193
|
+
var _store$getState;
|
194
|
+
_initFn(function () {});
|
195
|
+
setState({
|
196
|
+
createCount: state.createCount + 1
|
197
|
+
});
|
198
|
+
sendWarningLog({
|
199
|
+
title: '清空购物车',
|
200
|
+
content: [{
|
201
|
+
key: '店铺id',
|
202
|
+
value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
|
203
|
+
}, {
|
204
|
+
key: '订单id',
|
205
|
+
value: orderId
|
206
|
+
}, {
|
207
|
+
key: '类型',
|
208
|
+
value: type
|
209
|
+
}]
|
210
|
+
});
|
211
|
+
} catch (err) {
|
212
|
+
var _store$getState2;
|
213
|
+
sendWarningLog({
|
214
|
+
title: '清空购物车失败',
|
215
|
+
content: [{
|
216
|
+
key: '店铺id',
|
217
|
+
value: store === null || store === void 0 || (_store$getState2 = store.getState) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.call(store)) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.global) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.globalConfig) === null || _store$getState2 === void 0 ? void 0 : _store$getState2.id
|
218
|
+
}, {
|
219
|
+
key: '订单id',
|
220
|
+
value: orderId
|
221
|
+
}, {
|
222
|
+
key: '类型',
|
223
|
+
value: type
|
224
|
+
}, {
|
225
|
+
key: 'error',
|
226
|
+
value: err === null || err === void 0 ? void 0 : err.message
|
227
|
+
}]
|
228
|
+
});
|
229
|
+
}
|
230
|
+
}, {
|
231
|
+
wait: 500,
|
232
|
+
leading: true,
|
233
|
+
trailing: false
|
234
|
+
}),
|
235
|
+
clearAllCart = _useDebounceFn.run;
|
189
236
|
useEffect(function () {
|
190
|
-
var _interaction$utils, _store$
|
237
|
+
var _interaction$utils, _store$getState3, _interaction$utils2, _interaction$utils3, _interaction$utils4;
|
191
238
|
// bellaswonderland.mypisell.com localStorage可能满了
|
192
239
|
localStorage.removeItem('bookingResourceList');
|
193
240
|
_persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
|
@@ -209,24 +256,18 @@ var TicketBooking = function TicketBooking() {
|
|
209
256
|
});
|
210
257
|
});
|
211
258
|
setState({
|
212
|
-
amountSymbol: (store === null || store === void 0 || (_store$
|
259
|
+
amountSymbol: (store === null || store === void 0 || (_store$getState3 = store.getState) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.call(store)) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.global) === null || _store$getState3 === void 0 ? void 0 : _store$getState3.symbol) || '$'
|
213
260
|
}, function () {
|
214
261
|
_initStateRef.current = JSON.parse(JSON.stringify(state));
|
215
262
|
_getBoardConfig();
|
216
263
|
});
|
217
264
|
_setShopOpeningHours();
|
218
265
|
_setIntervalTime(true);
|
219
|
-
interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || _interaction$utils2.mountFunction('booking', 'refreshBookingDetail',
|
220
|
-
|
221
|
-
// 支付成功后清空状态
|
222
|
-
_initFn(function () {});
|
223
|
-
setState({
|
224
|
-
createCount: state.createCount + 1
|
225
|
-
});
|
226
|
-
});
|
266
|
+
interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || _interaction$utils2.mountFunction('booking', 'refreshBookingDetail', clearAllCart);
|
267
|
+
interaction === null || interaction === void 0 || (_interaction$utils3 = interaction.utils) === null || _interaction$utils3 === void 0 || _interaction$utils3.mountFunction('bookingTicket', 'clearAllCart', clearAllCart);
|
227
268
|
|
228
269
|
// 作废预约
|
229
|
-
interaction === null || interaction === void 0 || (_interaction$
|
270
|
+
interaction === null || interaction === void 0 || (_interaction$utils4 = interaction.utils) === null || _interaction$utils4 === void 0 || _interaction$utils4.mountFunction('booking', 'voidBooking', function (orderId) {
|
230
271
|
voidAppointment(orderId);
|
231
272
|
});
|
232
273
|
return function () {
|
@@ -267,11 +308,11 @@ var TicketBooking = function TicketBooking() {
|
|
267
308
|
|
268
309
|
// 商品加购信息发生变化时,需要发送至native端
|
269
310
|
useEffect(function () {
|
270
|
-
var _state$modalState, _locales$getText, _interaction$
|
311
|
+
var _state$modalState, _locales$getText, _interaction$utils6, _interaction$utils6$p;
|
271
312
|
var cartItems = state === null || state === void 0 || (_state$modalState = state.modalState) === null || _state$modalState === void 0 || (_state$modalState = _state$modalState.service) === null || _state$modalState === void 0 ? void 0 : _state$modalState.value;
|
272
313
|
if (!Array.isArray(cartItems) || cartItems.length === 0) {
|
273
|
-
var _interaction$
|
274
|
-
interaction === null || interaction === void 0 || (_interaction$
|
314
|
+
var _interaction$utils5, _interaction$utils5$p;
|
315
|
+
interaction === null || interaction === void 0 || (_interaction$utils5 = interaction.utils) === null || _interaction$utils5 === void 0 || (_interaction$utils5$p = _interaction$utils5.postMessageToApp) === null || _interaction$utils5$p === void 0 || _interaction$utils5$p.call(_interaction$utils5, {
|
275
316
|
module: 'cds',
|
276
317
|
key: 'cartUpdate',
|
277
318
|
data: {
|
@@ -365,7 +406,7 @@ var TicketBooking = function TicketBooking() {
|
|
365
406
|
fees: fees
|
366
407
|
}
|
367
408
|
});
|
368
|
-
interaction === null || interaction === void 0 || (_interaction$
|
409
|
+
interaction === null || interaction === void 0 || (_interaction$utils6 = interaction.utils) === null || _interaction$utils6 === void 0 || (_interaction$utils6$p = _interaction$utils6.postMessageToApp) === null || _interaction$utils6$p === void 0 || _interaction$utils6$p.call(_interaction$utils6, {
|
369
410
|
module: 'cds',
|
370
411
|
key: 'cartUpdate',
|
371
412
|
data: {
|
@@ -422,8 +463,8 @@ var TicketBooking = function TicketBooking() {
|
|
422
463
|
}, 100);
|
423
464
|
};
|
424
465
|
var _setShopOpeningHours = function _setShopOpeningHours() {
|
425
|
-
var _store$
|
426
|
-
var time = store === null || store === void 0 || (_store$
|
466
|
+
var _store$getState4;
|
467
|
+
var time = store === null || store === void 0 || (_store$getState4 = store.getState) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.call(store)) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.global) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.shopDetail) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.operating_day_boundary) === null || _store$getState4 === void 0 ? void 0 : _store$getState4.time;
|
427
468
|
if (time) {
|
428
469
|
localStorage.setItem('shopOpeningHours', time);
|
429
470
|
}
|
@@ -610,9 +651,9 @@ var TicketBooking = function TicketBooking() {
|
|
610
651
|
// 储存参数, 添加服务商品时使用
|
611
652
|
sessionStorage.setItem('pisell2.booking.serviceParams', JSON.stringify(data));
|
612
653
|
} else {
|
613
|
-
var _store$
|
654
|
+
var _store$getState5;
|
614
655
|
// 当前时区的时间
|
615
|
-
var timezone = store === null || store === void 0 || (_store$
|
656
|
+
var timezone = store === null || store === void 0 || (_store$getState5 = store.getState) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.call(store)) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.global) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.globalConfig) === null || _store$getState5 === void 0 ? void 0 : _store$getState5.timezone;
|
616
657
|
initState.modalState.date.value = dayjs.tz(new Date(), timezone);
|
617
658
|
// 兜底, 没有传递则清空下
|
618
659
|
sessionStorage.removeItem('pisell2.booking.serviceParams');
|