@pisell/private-materials 6.3.33 → 6.3.35
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/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +23 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -8
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/customSelect/index.js +18 -3
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -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/es/components/walletList/index.d.ts +0 -25
- package/es/components/walletList/index.js +98 -66
- package/es/components/walletList/serve.d.ts +4 -0
- package/es/components/walletList/serve.js +46 -13
- package/es/components/walletList/types/index.d.ts +12 -12
- package/es/components/walletList/types/index.js +2 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/es/plus/productSelect/CategoryTabs/index.js +6 -3
- package/es/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/es/plus/productSelect/utils.js +0 -1
- package/es/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/es/plus/walletEditor/WalletEditor.js +316 -0
- package/es/plus/walletEditor/WalletEditor.less +129 -0
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/es/plus/walletEditor/components/ImageUpload/index.js +223 -0
- package/es/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/es/plus/walletEditor/components/JsonEditor/index.js +68 -0
- package/es/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.js +222 -0
- package/es/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/es/plus/walletEditor/components/relationProduct/index.js +49 -0
- package/es/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.js +193 -0
- package/es/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/es/plus/walletEditor/index.d.ts +3 -0
- package/es/plus/walletEditor/index.js +3 -0
- package/es/plus/walletEditor/locales.d.ts +126 -0
- package/es/plus/walletEditor/locales.js +143 -0
- package/es/plus/walletEditor/types.d.ts +52 -0
- package/es/plus/walletEditor/types.js +1 -0
- package/es/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/es/plus/walletPassGallery/components/footerButton/index.js +247 -0
- package/es/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +274 -0
- package/es/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +11 -0
- package/es/plus/walletPassGallery/components/passList/index.js +115 -0
- package/es/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +134 -0
- package/es/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.js +176 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/es/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/es/plus/walletPassGallery/components/usageRule/index.js +248 -0
- package/es/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/es/plus/walletPassGallery/index.d.ts +6 -0
- package/es/plus/walletPassGallery/index.js +602 -0
- package/es/plus/walletPassGallery/index.less +115 -0
- package/es/plus/walletPassGallery/locales.d.ts +270 -0
- package/es/plus/walletPassGallery/locales.js +279 -0
- package/es/plus/walletPassGallery/serve.d.ts +218 -0
- package/es/plus/walletPassGallery/serve.js +289 -0
- package/es/pro/Login2.0/Login2.js +8 -1
- package/es/pro/Login2.0/locales.js +93 -93
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/customSelect/index.js +22 -3
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -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/lib/components/walletList/index.d.ts +0 -25
- package/lib/components/walletList/index.js +90 -51
- package/lib/components/walletList/serve.d.ts +4 -0
- package/lib/components/walletList/serve.js +12 -0
- package/lib/components/walletList/types/index.d.ts +12 -12
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +2 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +84 -69
- package/lib/plus/productSelect/components/TabsStructure/TabsStructure.less +0 -11
- package/lib/plus/productSelect/utils.js +0 -1
- package/lib/plus/walletEditor/WalletEditor.d.ts +5 -0
- package/lib/plus/walletEditor/WalletEditor.js +354 -0
- package/lib/plus/walletEditor/WalletEditor.less +129 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +8 -0
- package/lib/plus/walletEditor/components/ImageUpload/index.js +201 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.d.ts +11 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.js +89 -0
- package/lib/plus/walletEditor/components/JsonEditor/index.less +4 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.d.ts +20 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.js +176 -0
- package/lib/plus/walletEditor/components/ValidityPeriodSelector/index.less +4 -0
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +6 -0
- package/lib/plus/walletEditor/components/relationProduct/index.js +73 -0
- package/lib/plus/walletEditor/components/relationProduct/index.less +15 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.d.ts +37 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.js +211 -0
- package/lib/plus/walletEditor/components/sortableWalletPassTypes/index.less +110 -0
- package/lib/plus/walletEditor/index.d.ts +3 -0
- package/lib/plus/walletEditor/index.js +42 -0
- package/lib/plus/walletEditor/locales.d.ts +126 -0
- package/lib/plus/walletEditor/locales.js +167 -0
- package/lib/plus/walletEditor/types.d.ts +52 -0
- package/lib/plus/walletEditor/types.js +17 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.d.ts +14 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.js +187 -0
- package/lib/plus/walletPassGallery/components/footerButton/index.less +93 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +8 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +287 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.less +57 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +11 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +136 -0
- package/lib/plus/walletPassGallery/components/recharge/index.d.ts +11 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +146 -0
- package/lib/plus/walletPassGallery/components/recharge/index.less +16 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +8 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.js +212 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.less +67 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.d.ts +9 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.js +209 -0
- package/lib/plus/walletPassGallery/components/usageRule/index.less +157 -0
- package/lib/plus/walletPassGallery/index.d.ts +6 -0
- package/lib/plus/walletPassGallery/index.js +498 -0
- package/lib/plus/walletPassGallery/index.less +115 -0
- package/lib/plus/walletPassGallery/locales.d.ts +270 -0
- package/lib/plus/walletPassGallery/locales.js +299 -0
- package/lib/plus/walletPassGallery/serve.d.ts +218 -0
- package/lib/plus/walletPassGallery/serve.js +98 -0
- package/lib/pro/Login2.0/Login2.js +6 -0
- package/lib/pro/Login2.0/locales.js +93 -93
- package/lowcode/sortable-wallet-pass-types/meta.ts +267 -0
- package/lowcode/wallet-editor/meta.ts +57 -0
- package/lowcode/wallet-editor/snippets.ts +13 -0
- package/lowcode/wallet-pass-gallery/meta.ts +35 -0
- package/package.json +3 -3
- package/lowcode/wallet/meta.ts +0 -79
|
@@ -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
|
+
}>;
|
|
@@ -270,15 +270,30 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
270
270
|
var renderList = useMemo(function () {
|
|
271
271
|
var _list = _toConsumableArray(options);
|
|
272
272
|
if (search) {
|
|
273
|
-
var isIncludes = function isIncludes(
|
|
274
|
-
|
|
273
|
+
var isIncludes = function isIncludes(item) {
|
|
274
|
+
try {
|
|
275
|
+
var q = search.toLowerCase();
|
|
276
|
+
var numericKeys = Object.keys(item).filter(function (k) {
|
|
277
|
+
return /^\d+$/.test(k);
|
|
278
|
+
});
|
|
279
|
+
var customerKeys = ['customer_nickname', 'customer_first_name', 'customer_last_name', 'customer_phone', 'customer_email'];
|
|
280
|
+
var allKeys = [].concat(_toConsumableArray(numericKeys), customerKeys);
|
|
281
|
+
return allKeys.some(function (k) {
|
|
282
|
+
var val = item[k];
|
|
283
|
+
if (val === null || val === undefined) return false;
|
|
284
|
+
var str = String(val).toLowerCase();
|
|
285
|
+
return str.includes(q);
|
|
286
|
+
});
|
|
287
|
+
} catch (e) {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
275
290
|
};
|
|
276
291
|
_list = _list.filter(function (d) {
|
|
277
292
|
// 自定义搜索
|
|
278
293
|
if (filterItem) {
|
|
279
294
|
return filterItem(d, search);
|
|
280
295
|
}
|
|
281
|
-
return isIncludes(d
|
|
296
|
+
return isIncludes(d);
|
|
282
297
|
});
|
|
283
298
|
}
|
|
284
299
|
return _list;
|
|
@@ -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
|
+
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -109,4 +110,11 @@ export declare const walkInData: {
|
|
|
109
110
|
id: number;
|
|
110
111
|
nickname: string;
|
|
111
112
|
};
|
|
112
|
-
export declare const Provider: any, Context:
|
|
113
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
114
|
+
state: FormState;
|
|
115
|
+
} & {
|
|
116
|
+
dispatch: (params: {
|
|
117
|
+
type: string;
|
|
118
|
+
payload: any;
|
|
119
|
+
}) => void;
|
|
120
|
+
}>;
|
|
@@ -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
|
+
}>;
|
package/es/components/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ import ProductExtension from './productExtension';
|
|
|
9
9
|
import RuleSetting from './ruleSetting';
|
|
10
10
|
import TaxSelect from './taxSelect';
|
|
11
11
|
import ToCPay from './pay/toC';
|
|
12
|
-
import Wallet from './wallet';
|
|
13
12
|
import WalletList from './walletList';
|
|
14
13
|
import WorkspaceListDetail from './workSpaceListDetail/';
|
|
15
14
|
import WorkspaceList from './workSpaceList';
|
|
@@ -19,4 +18,4 @@ import EditBookingModal from './booking/editBookingModal';
|
|
|
19
18
|
import StepController from './stepController';
|
|
20
19
|
import PinModal from './pinModal';
|
|
21
20
|
import PinVerifyModal from './pinVerifyModal';
|
|
22
|
-
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal,
|
|
21
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
|
package/es/components/index.js
CHANGED
|
@@ -9,7 +9,6 @@ import ProductExtension from "./productExtension";
|
|
|
9
9
|
import RuleSetting from "./ruleSetting";
|
|
10
10
|
import TaxSelect from "./taxSelect";
|
|
11
11
|
import ToCPay from "./pay/toC";
|
|
12
|
-
import Wallet from "./wallet";
|
|
13
12
|
import WalletList from "./walletList";
|
|
14
13
|
import WorkspaceListDetail from "./workSpaceListDetail/";
|
|
15
14
|
import WorkspaceList from "./workSpaceList";
|
|
@@ -19,4 +18,4 @@ import EditBookingModal from "./booking/editBookingModal";
|
|
|
19
18
|
import StepController from "./stepController";
|
|
20
19
|
import PinModal from "./pinModal";
|
|
21
20
|
import PinVerifyModal from "./pinVerifyModal";
|
|
22
|
-
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal,
|
|
21
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
3
4
|
order: any;
|
|
@@ -29,4 +30,11 @@ export interface PayGroup {
|
|
|
29
30
|
_order: any;
|
|
30
31
|
front_order_uuid?: string;
|
|
31
32
|
}
|
|
32
|
-
export declare const Provider: any, Context:
|
|
33
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
34
|
+
state: FormState;
|
|
35
|
+
} & {
|
|
36
|
+
dispatch: (params: {
|
|
37
|
+
type: string;
|
|
38
|
+
payload: any;
|
|
39
|
+
}) => void;
|
|
40
|
+
}>;
|
|
@@ -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
|
+
}>;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
addWalletCard: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
walletDetailState: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
setup?: 'menu' | 'list' | 'detail' | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
7
|
+
state: RechargeState;
|
|
8
|
+
} & {
|
|
9
|
+
dispatch: (params: {
|
|
10
|
+
type: string;
|
|
11
|
+
payload: any;
|
|
12
|
+
}) => void;
|
|
13
|
+
}>;
|
|
14
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
selectedGiftOptionId: string | null;
|
|
4
|
+
cardList: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
}>;
|
|
9
|
+
selectedItem: {
|
|
10
|
+
id?: string;
|
|
11
|
+
gift_price?: number;
|
|
12
|
+
price?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
variant_id?: string;
|
|
15
|
+
};
|
|
16
|
+
productId?: string;
|
|
17
|
+
detailId?: string;
|
|
18
|
+
total: string | number;
|
|
19
|
+
rechargeModalOpen: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
22
|
+
state: RechargeState;
|
|
23
|
+
} & {
|
|
24
|
+
dispatch: (params: {
|
|
25
|
+
type: string;
|
|
26
|
+
payload: any;
|
|
27
|
+
}) => void;
|
|
28
|
+
}>;
|
|
29
|
+
export {};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RechargeState {
|
|
3
|
+
total: 0;
|
|
4
|
+
}
|
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
+
state: RechargeState;
|
|
7
|
+
} & {
|
|
8
|
+
dispatch: (params: {
|
|
9
|
+
type: string;
|
|
10
|
+
payload: any;
|
|
11
|
+
}) => void;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IWalletListItemProps } from './serve';
|
|
2
3
|
export interface WalletCardItemProps {
|
|
3
4
|
id: string;
|
|
@@ -26,4 +27,11 @@ export interface WalletListProps {
|
|
|
26
27
|
currentSearchListItemCode?: string;
|
|
27
28
|
[key: string]: any;
|
|
28
29
|
}
|
|
29
|
-
export declare const Provider: any, Context:
|
|
30
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
31
|
+
global_wallet: WalletListProps;
|
|
32
|
+
} & {
|
|
33
|
+
dispatch: (params: {
|
|
34
|
+
type: string;
|
|
35
|
+
payload: any;
|
|
36
|
+
}) => void;
|
|
37
|
+
}>;
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import './index.less';
|
|
3
|
-
declare module 'react' {
|
|
4
|
-
interface HTMLAttributes<T> {
|
|
5
|
-
role?: string;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
declare global {
|
|
9
|
-
namespace JSX {
|
|
10
|
-
interface IntrinsicElements {
|
|
11
|
-
div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
14
|
-
onMouseDown?: React.MouseEventHandler<HTMLDivElement>;
|
|
15
|
-
onMouseUp?: React.MouseEventHandler<HTMLDivElement>;
|
|
16
|
-
onTouchStart?: React.TouchEventHandler<HTMLDivElement>;
|
|
17
|
-
onTouchEnd?: React.TouchEventHandler<HTMLDivElement>;
|
|
18
|
-
role?: string;
|
|
19
|
-
};
|
|
20
|
-
img: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
21
|
-
span: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> & {
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
2
|
declare const WalletList: (props: any) => JSX.Element;
|
|
28
3
|
export default WalletList;
|
|
@@ -21,7 +21,7 @@ import { Provider, Context } from "./model";
|
|
|
21
21
|
import { WalletCard, Carousel } from '@pisell/materials';
|
|
22
22
|
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
|
|
23
23
|
import useEngineContext from "./../../hooks/useEngineContext";
|
|
24
|
-
import { getWalletList,
|
|
24
|
+
import { getWalletList, batchGetWalletBalance, getWalletShopList } from "./serve";
|
|
25
25
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
26
26
|
import { request } from "./../../utils";
|
|
27
27
|
import { defaultWalletGuideConfig } from "./status";
|
|
@@ -29,7 +29,7 @@ import localeTexts from "./locales";
|
|
|
29
29
|
import "./index.less";
|
|
30
30
|
import classNames from 'classnames';
|
|
31
31
|
// 导入所有类型
|
|
32
|
-
import {
|
|
32
|
+
import { DEFAULT_CARD_CONFIG } from "./types";
|
|
33
33
|
import PinModal from "../pinModal";
|
|
34
34
|
|
|
35
35
|
// 添加 localStorage 相关的操作函数
|
|
@@ -73,10 +73,6 @@ var getFromLocalStorage = function getFromLocalStorage(key) {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
// @ts-ignore
|
|
77
|
-
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
|
|
80
76
|
// 定义轮播图配置
|
|
81
77
|
var CAROUSEL_CONFIG = {
|
|
82
78
|
className: 'pisell-lowcode__walletList',
|
|
@@ -126,8 +122,43 @@ var DEFAULT_WALLET_CARD = {
|
|
|
126
122
|
en: 'Level'
|
|
127
123
|
},
|
|
128
124
|
metadata: {
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
showcaseWalletPassNew: [{
|
|
126
|
+
type: 'rechargeable',
|
|
127
|
+
display: 1,
|
|
128
|
+
custom_title: {
|
|
129
|
+
original: 'Balance',
|
|
130
|
+
'zh-CN': '充值卡',
|
|
131
|
+
'zh-HK': '充值卡',
|
|
132
|
+
en: 'Balance'
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
type: 'point',
|
|
136
|
+
display: 1,
|
|
137
|
+
custom_title: {
|
|
138
|
+
original: 'Points',
|
|
139
|
+
'zh-CN': '积分卡',
|
|
140
|
+
'zh-HK': '積分卡',
|
|
141
|
+
en: 'Points'
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
type: 'voucher',
|
|
145
|
+
display: 1,
|
|
146
|
+
custom_title: {
|
|
147
|
+
original: 'Voucher',
|
|
148
|
+
'zh-CN': '代金券',
|
|
149
|
+
'zh-HK': '代金券',
|
|
150
|
+
en: 'Voucher'
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
type: 'discount',
|
|
154
|
+
display: 1,
|
|
155
|
+
custom_title: {
|
|
156
|
+
original: 'Discount',
|
|
157
|
+
'zh-CN': '折扣卡',
|
|
158
|
+
'zh-HK': '折扣卡',
|
|
159
|
+
en: 'Discount'
|
|
160
|
+
}
|
|
161
|
+
}],
|
|
131
162
|
coverImage: '',
|
|
132
163
|
icon: ''
|
|
133
164
|
}
|
|
@@ -243,7 +274,7 @@ var WalletList = Provider(function (props) {
|
|
|
243
274
|
if (isMountedRef.current) {
|
|
244
275
|
setState({
|
|
245
276
|
list: [DEFAULT_WALLET_CARD],
|
|
246
|
-
balance:
|
|
277
|
+
balance: [],
|
|
247
278
|
hasAttempted: true,
|
|
248
279
|
isLoggedIn: false
|
|
249
280
|
});
|
|
@@ -392,7 +423,7 @@ var WalletList = Provider(function (props) {
|
|
|
392
423
|
};
|
|
393
424
|
var initData = /*#__PURE__*/function () {
|
|
394
425
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(requestId) {
|
|
395
|
-
var cachedList, cachedBalance,
|
|
426
|
+
var cachedList, cachedBalance, walletListData, walletBalanceData, _message, _data, isAuthError;
|
|
396
427
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
397
428
|
while (1) switch (_context3.prev = _context3.next) {
|
|
398
429
|
case 0:
|
|
@@ -415,7 +446,7 @@ var WalletList = Provider(function (props) {
|
|
|
415
446
|
// 设置状态为已尝试请求,提供默认数据而不是空列表
|
|
416
447
|
setState({
|
|
417
448
|
list: [DEFAULT_WALLET_CARD],
|
|
418
|
-
balance:
|
|
449
|
+
balance: [],
|
|
419
450
|
hasAttempted: true,
|
|
420
451
|
isLoggedIn: false
|
|
421
452
|
});
|
|
@@ -433,6 +464,13 @@ var WalletList = Provider(function (props) {
|
|
|
433
464
|
try {
|
|
434
465
|
cachedList = getFromLocalStorage(STORAGE_KEY);
|
|
435
466
|
cachedBalance = getFromLocalStorage(STORAGE_KEY_BALANCE);
|
|
467
|
+
// 避免使用旧版数据
|
|
468
|
+
if (!Array.isArray(cachedBalance) || !cachedBalance.some(function () {
|
|
469
|
+
var _items, _items$hasOwnProperty;
|
|
470
|
+
return (_items = items) === null || _items === void 0 || (_items$hasOwnProperty = _items.hasOwnProperty) === null || _items$hasOwnProperty === void 0 ? void 0 : _items$hasOwnProperty.call(_items, 'gift_card_balance');
|
|
471
|
+
})) {
|
|
472
|
+
cachedBalance = null;
|
|
473
|
+
}
|
|
436
474
|
} catch (e) {
|
|
437
475
|
console.error('Error fetching from localStorage:', e);
|
|
438
476
|
}
|
|
@@ -453,12 +491,15 @@ var WalletList = Provider(function (props) {
|
|
|
453
491
|
return _context3.abrupt("return");
|
|
454
492
|
case 16:
|
|
455
493
|
_context3.next = 18;
|
|
456
|
-
return
|
|
494
|
+
return getWalletList();
|
|
457
495
|
case 18:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
walletListData
|
|
461
|
-
|
|
496
|
+
walletListData = _context3.sent;
|
|
497
|
+
_context3.next = 21;
|
|
498
|
+
return batchGetWalletBalance(walletListData.map(function (item) {
|
|
499
|
+
return item.wallet_id;
|
|
500
|
+
}));
|
|
501
|
+
case 21:
|
|
502
|
+
walletBalanceData = _context3.sent;
|
|
462
503
|
if (!(!isMountedRef.current || requestIdRef.current !== requestId)) {
|
|
463
504
|
_context3.next = 24;
|
|
464
505
|
break;
|
|
@@ -498,36 +539,38 @@ var WalletList = Provider(function (props) {
|
|
|
498
539
|
_context2.prev = 2;
|
|
499
540
|
// 准备重试请求
|
|
500
541
|
retryBalanceData = walletBalanceData;
|
|
501
|
-
retryListData = walletListData; //
|
|
502
|
-
if (
|
|
542
|
+
retryListData = walletListData; // 如果列表数据为空,重试请求列表
|
|
543
|
+
if (!(Array.isArray(walletListData) && walletListData.length === 0)) {
|
|
503
544
|
_context2.next = 10;
|
|
504
545
|
break;
|
|
505
546
|
}
|
|
506
547
|
_context2.next = 8;
|
|
507
|
-
return
|
|
548
|
+
return getWalletList();
|
|
508
549
|
case 8:
|
|
509
|
-
|
|
510
|
-
if (
|
|
550
|
+
retryListData = _context2.sent;
|
|
551
|
+
if (retryListData && retryListData.length > 0) {
|
|
511
552
|
try {
|
|
512
|
-
saveToLocalStorage(
|
|
553
|
+
saveToLocalStorage(STORAGE_KEY, retryListData);
|
|
513
554
|
} catch (e) {
|
|
514
|
-
console.error('Error saving retry
|
|
555
|
+
console.error('Error saving retry list to localStorage:', e);
|
|
515
556
|
}
|
|
516
557
|
}
|
|
517
558
|
case 10:
|
|
518
|
-
if (
|
|
559
|
+
if (walletBalanceData) {
|
|
519
560
|
_context2.next = 15;
|
|
520
561
|
break;
|
|
521
562
|
}
|
|
522
563
|
_context2.next = 13;
|
|
523
|
-
return
|
|
564
|
+
return batchGetWalletBalance(retryListData.map(function (item) {
|
|
565
|
+
return item.wallet_id;
|
|
566
|
+
}));
|
|
524
567
|
case 13:
|
|
525
|
-
|
|
526
|
-
if (
|
|
568
|
+
retryBalanceData = _context2.sent;
|
|
569
|
+
if (retryBalanceData) {
|
|
527
570
|
try {
|
|
528
|
-
saveToLocalStorage(
|
|
571
|
+
saveToLocalStorage(STORAGE_KEY_BALANCE, retryBalanceData);
|
|
529
572
|
} catch (e) {
|
|
530
|
-
console.error('Error saving retry
|
|
573
|
+
console.error('Error saving retry balance to localStorage:', e);
|
|
531
574
|
}
|
|
532
575
|
}
|
|
533
576
|
case 15:
|
|
@@ -598,67 +641,56 @@ var WalletList = Provider(function (props) {
|
|
|
598
641
|
console.error('onViewPinClick方法需要传入wallet_detail_id');
|
|
599
642
|
}
|
|
600
643
|
};
|
|
601
|
-
var renderWalletCard = function renderWalletCard(
|
|
644
|
+
var renderWalletCard = function renderWalletCard(_walletItem) {
|
|
602
645
|
var _dvaStore$core;
|
|
603
|
-
var code =
|
|
604
|
-
shop =
|
|
605
|
-
wallet =
|
|
606
|
-
id =
|
|
646
|
+
var code = _walletItem.code,
|
|
647
|
+
shop = _walletItem.shop,
|
|
648
|
+
wallet = _walletItem.wallet,
|
|
649
|
+
id = _walletItem.id;
|
|
607
650
|
var _ref5 = wallet || {},
|
|
608
651
|
metadata = _ref5.metadata,
|
|
609
652
|
name = _ref5.name;
|
|
610
653
|
var _ref6 = metadata || {},
|
|
611
|
-
_ref6$
|
|
612
|
-
|
|
613
|
-
_ref6$showcaseWalletP = _ref6.showcaseWalletPass,
|
|
614
|
-
showcaseWalletPass = _ref6$showcaseWalletP === void 0 ? [] : _ref6$showcaseWalletP,
|
|
654
|
+
_ref6$showcaseWalletP = _ref6.showcaseWalletPassNew,
|
|
655
|
+
showcaseWalletPassNew = _ref6$showcaseWalletP === void 0 ? [] : _ref6$showcaseWalletP,
|
|
615
656
|
_ref6$coverImage = _ref6.coverImage,
|
|
616
657
|
coverImage = _ref6$coverImage === void 0 ? '' : _ref6$coverImage,
|
|
617
658
|
_ref6$icon = _ref6.icon,
|
|
618
659
|
icon = _ref6$icon === void 0 ? '' : _ref6$icon;
|
|
619
660
|
var shopName = shop.name;
|
|
620
|
-
var balance = state.balance
|
|
661
|
+
var _state$balance = state.balance,
|
|
662
|
+
balance = _state$balance === void 0 ? [] : _state$balance;
|
|
663
|
+
var balanceItem = balance.find(function (bi) {
|
|
664
|
+
return bi.wallet_id == _walletItem.wallet_id;
|
|
665
|
+
}) || DEFAULT_BALANCE;
|
|
621
666
|
|
|
622
667
|
// 字段映射关系
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
668
|
+
var _balanceKeyMap = {
|
|
669
|
+
rechargeable: 'gift_card_balance',
|
|
670
|
+
point: 'point_card_balance',
|
|
671
|
+
voucher: 'voucher_count',
|
|
672
|
+
discount: 'discount_card_count'
|
|
628
673
|
};
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
// 找到对应的balance字段
|
|
634
|
-
var balanceKey = (_Object$entries$find = Object.entries(balanceKeyMap).find(function (_ref7) {
|
|
635
|
-
var _ref8 = _slicedToArray(_ref7, 2),
|
|
636
|
-
_ = _ref8[0],
|
|
637
|
-
value = _ref8[1];
|
|
638
|
-
return value === key;
|
|
639
|
-
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0];
|
|
640
|
-
var value = balanceKey ? balance[balanceKey] || 0 : 0;
|
|
641
|
-
if (balanceKey === 'voucher_count') {
|
|
642
|
-
value += balance.good_pass_count;
|
|
643
|
-
}
|
|
644
|
-
return {
|
|
645
|
-
key: key,
|
|
646
|
-
label: key,
|
|
647
|
-
hidden: false,
|
|
674
|
+
var cardItems = showcaseWalletPassNew.map(function (item) {
|
|
675
|
+
var balanceKey = _balanceKeyMap[item.type];
|
|
676
|
+
var value = balanceKey ? balanceItem[balanceKey] || 0 : 0;
|
|
677
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
648
678
|
value: value
|
|
649
|
-
};
|
|
679
|
+
});
|
|
650
680
|
});
|
|
681
|
+
|
|
651
682
|
// 构建WalletCard的props
|
|
652
683
|
// 优先级:接口返回值 > globalState > DEFAULT_CARD_CONFIG
|
|
653
684
|
var cardProps = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CARD_CONFIG), globalState), {}, {
|
|
654
685
|
// 最后应用API返回的数据,这些拥有最高优先级
|
|
686
|
+
id: wallet.id,
|
|
655
687
|
iconImg: icon,
|
|
656
688
|
symbol: symbol,
|
|
657
689
|
cardNo: code,
|
|
658
690
|
walletName: getLocalizedName(name, dvaStore === null || dvaStore === void 0 || (_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale),
|
|
659
691
|
shopName: shopName,
|
|
660
|
-
codeType: barcodetype,
|
|
661
|
-
items: cardItems,
|
|
692
|
+
// codeType: barcodetype,
|
|
693
|
+
items: cardItems.slice(0, 4),
|
|
662
694
|
customBackgroundImage: coverImage,
|
|
663
695
|
isLogin: isUserLoggedIn // 添加登录状态
|
|
664
696
|
});
|
|
@@ -10,6 +10,10 @@ export declare const getWalletList: () => Promise<WalletPass[]>;
|
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
export declare const getWalletBalance: () => Promise<WalletBalance | null>;
|
|
13
|
+
/**
|
|
14
|
+
* 批量获取钱包余额信息
|
|
15
|
+
*/
|
|
16
|
+
export declare const batchGetWalletBalance: (walletIds: string[]) => Promise<Record<string, WalletBalance> | null>;
|
|
13
17
|
/**
|
|
14
18
|
* @title: 获取钱包店铺列表
|
|
15
19
|
* @description:
|