@pisell/private-materials 3.0.184 → 3.0.186
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 +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +10 -2
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +17 -1
- package/es/components/pay/toC/PaymentMethods/index.js +6 -1
- package/es/components/pay/toC/index.js +10 -2
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.d.ts +12 -0
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.js +71 -0
- package/es/components/pisellSelectCustomerModal/CustomerCard/index.less +83 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.js +277 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.js +17 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +57 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.d.ts +2 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.js +166 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +8 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.js +191 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.less +35 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +13 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.js +78 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.less +49 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +15 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.js +149 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.less +43 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/mock.d.ts +47 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/mock.js +115 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +3 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +56 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +16 -0
- package/es/components/pisellSelectCustomerModal/index.js +221 -0
- package/es/components/pisellSelectCustomerModal/index.less +16 -0
- package/es/components/pisellSelectCustomerModal/locales.d.ts +75 -0
- package/es/components/pisellSelectCustomerModal/locales.js +74 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +18 -3
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +24 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +6 -1
- package/lib/components/pay/toC/index.js +16 -2
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.d.ts +12 -0
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.js +99 -0
- package/lib/components/pisellSelectCustomerModal/CustomerCard/index.less +83 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.js +256 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.js +51 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +81 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.d.ts +2 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/serve.js +193 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +8 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.js +200 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.less +35 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +13 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.js +94 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.less +49 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +15 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.js +150 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.less +43 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/mock.d.ts +47 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/mock.js +150 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.d.ts +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +39 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +16 -0
- package/lib/components/pisellSelectCustomerModal/index.js +230 -0
- package/lib/components/pisellSelectCustomerModal/index.less +16 -0
- package/lib/components/pisellSelectCustomerModal/locales.d.ts +75 -0
- package/lib/components/pisellSelectCustomerModal/locales.js +98 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/pisell-select-customer-modal/meta.ts +80 -0
- package/package.json +3 -3
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/RightPanel/index.tsx
|
|
30
|
+
var RightPanel_exports = {};
|
|
31
|
+
__export(RightPanel_exports, {
|
|
32
|
+
default: () => RightPanel_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(RightPanel_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_index = require("./index.less");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_ahooks = require("ahooks");
|
|
39
|
+
var import_serve = require("./serve");
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
41
|
+
var import_utils = require("../../../utils");
|
|
42
|
+
var import_PlusCircle = __toESM(require("@pisell/icon/es/PlusCircle"));
|
|
43
|
+
var import_List = __toESM(require("./List"));
|
|
44
|
+
var import_Add = __toESM(require("./Add"));
|
|
45
|
+
var import_ChevronLeft = __toESM(require("@pisell/icon/es/ChevronLeft"));
|
|
46
|
+
var import_utils2 = require("@pisell/utils");
|
|
47
|
+
var defaultParams = {
|
|
48
|
+
skip: 1,
|
|
49
|
+
num: 10,
|
|
50
|
+
sort_by: "id",
|
|
51
|
+
search: ""
|
|
52
|
+
};
|
|
53
|
+
var RightPanel = (props) => {
|
|
54
|
+
const { value, onChange, phone } = props;
|
|
55
|
+
const [page, setPage] = (0, import_react.useState)("list");
|
|
56
|
+
const context = (0, import_useEngineContext.default)();
|
|
57
|
+
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
58
|
+
const [customerOrigin, setCustomerOrigin] = (0, import_react.useState)({
|
|
59
|
+
skip: 1,
|
|
60
|
+
count: 0,
|
|
61
|
+
list: []
|
|
62
|
+
});
|
|
63
|
+
const [params, setParams] = (0, import_react.useState)(defaultParams);
|
|
64
|
+
const _getCustomerList = (0, import_ahooks.useRequest)(import_serve.getCustomerList, {
|
|
65
|
+
manual: true,
|
|
66
|
+
onSuccess: (res, param) => {
|
|
67
|
+
const _params = param[0];
|
|
68
|
+
setParams(_params);
|
|
69
|
+
let list = [];
|
|
70
|
+
if (_params.skip === 1) {
|
|
71
|
+
list = res.list;
|
|
72
|
+
} else {
|
|
73
|
+
list = customerOrigin.list.concat(res.list);
|
|
74
|
+
}
|
|
75
|
+
setCustomerOrigin({ ...res, list });
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
(0, import_react.useEffect)(() => {
|
|
79
|
+
if (page !== "list") {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
_getCustomerList.run({
|
|
83
|
+
...defaultParams,
|
|
84
|
+
search: phone
|
|
85
|
+
});
|
|
86
|
+
}, [phone, page]);
|
|
87
|
+
const header = (0, import_react.useMemo)(() => {
|
|
88
|
+
if (page === "list") {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-header" }, /* @__PURE__ */ import_react.default.createElement("span", null, phone ? import_utils2.locales.getText("pisell2.text.result-found") : import_utils2.locales.getText("pisell2.text.personnel-list")), /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
import_PlusCircle.default,
|
|
91
|
+
{
|
|
92
|
+
className: "select-customer-right-panel-header-icon",
|
|
93
|
+
onClick: () => {
|
|
94
|
+
setPage("create");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
));
|
|
98
|
+
}
|
|
99
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: (0, import_classnames.default)("select-customer-right-panel-header", {
|
|
103
|
+
"select-customer-right-panel-header-create": page === "create"
|
|
104
|
+
})
|
|
105
|
+
},
|
|
106
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
107
|
+
import_ChevronLeft.default,
|
|
108
|
+
{
|
|
109
|
+
className: "select-customer-right-panel-header-icon select-customer-right-panel-header-icon-back",
|
|
110
|
+
onClick: () => {
|
|
111
|
+
setPage("list");
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
import_utils2.locales.getText("pisell2.text.create-new-client")
|
|
116
|
+
);
|
|
117
|
+
}, [phone, page]);
|
|
118
|
+
const addChange = (values) => {
|
|
119
|
+
setPage("list");
|
|
120
|
+
if (values == null ? void 0 : values.is_checked) {
|
|
121
|
+
onChange == null ? void 0 : onChange(values);
|
|
122
|
+
}
|
|
123
|
+
setCustomerOrigin({
|
|
124
|
+
...customerOrigin,
|
|
125
|
+
count: customerOrigin.count + 1,
|
|
126
|
+
list: [values].concat(customerOrigin.list)
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "select-customer-right-panel-header" }, header), page === "list" ? /* @__PURE__ */ import_react.default.createElement(
|
|
130
|
+
import_List.default,
|
|
131
|
+
{
|
|
132
|
+
loading: _getCustomerList.loading,
|
|
133
|
+
phone,
|
|
134
|
+
customerOrigin,
|
|
135
|
+
value,
|
|
136
|
+
onChange,
|
|
137
|
+
onLoadMore: () => {
|
|
138
|
+
if (customerOrigin.list.length >= customerOrigin.count) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
_getCustomerList.run({
|
|
142
|
+
...params,
|
|
143
|
+
skip: params.skip + 1
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
setPage
|
|
147
|
+
}
|
|
148
|
+
) : null, page === "create" ? /* @__PURE__ */ import_react.default.createElement(import_Add.default, { phone, onChange: addChange }) : null);
|
|
149
|
+
};
|
|
150
|
+
var RightPanel_default = RightPanel;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.select-customer-right-panel {
|
|
2
|
+
width: 348px;
|
|
3
|
+
height: 511px;
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
.select-customer-right-panel-header {
|
|
9
|
+
color: var(--Gray-900, #101828);
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
line-height: 44px;
|
|
14
|
+
position: sticky;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
|
|
24
|
+
.select-customer-right-panel-header-create {
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.select-customer-right-panel-header-icon {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
width: 44px;
|
|
33
|
+
height: 44px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
font-size: 24px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.select-customer-right-panel-header-icon-back {
|
|
39
|
+
justify-content: flex-start;
|
|
40
|
+
width: 24px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
status: boolean;
|
|
3
|
+
code: number;
|
|
4
|
+
message: string;
|
|
5
|
+
data: {
|
|
6
|
+
list: ({
|
|
7
|
+
phone: string;
|
|
8
|
+
email: string;
|
|
9
|
+
country_calling_code: string;
|
|
10
|
+
channel: string;
|
|
11
|
+
shop_id: number;
|
|
12
|
+
display_name: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
created_at: string;
|
|
15
|
+
id: number;
|
|
16
|
+
nickname?: undefined;
|
|
17
|
+
is_deleted?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
id: number;
|
|
20
|
+
shop_id: number;
|
|
21
|
+
country_calling_code: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
display_name: string;
|
|
24
|
+
nickname: string;
|
|
25
|
+
email: string;
|
|
26
|
+
channel: string;
|
|
27
|
+
is_deleted: number;
|
|
28
|
+
created_at: string;
|
|
29
|
+
updated_at: string;
|
|
30
|
+
} | {
|
|
31
|
+
shop_id: string;
|
|
32
|
+
nickname: string;
|
|
33
|
+
channel: string;
|
|
34
|
+
updated_at: string;
|
|
35
|
+
created_at: string;
|
|
36
|
+
id: number;
|
|
37
|
+
phone?: undefined;
|
|
38
|
+
email?: undefined;
|
|
39
|
+
country_calling_code?: undefined;
|
|
40
|
+
display_name?: undefined;
|
|
41
|
+
is_deleted?: undefined;
|
|
42
|
+
})[];
|
|
43
|
+
count: number;
|
|
44
|
+
skip: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellSelectCustomerModal/RightPanel/mock.ts
|
|
20
|
+
var mock_exports = {};
|
|
21
|
+
__export(mock_exports, {
|
|
22
|
+
default: () => mock_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(mock_exports);
|
|
25
|
+
var mock_default = {
|
|
26
|
+
"status": true,
|
|
27
|
+
"code": 200,
|
|
28
|
+
"message": "",
|
|
29
|
+
"data": {
|
|
30
|
+
"list": [
|
|
31
|
+
{
|
|
32
|
+
"phone": "",
|
|
33
|
+
"email": "",
|
|
34
|
+
"country_calling_code": "+61",
|
|
35
|
+
"channel": "online_store",
|
|
36
|
+
"shop_id": 9,
|
|
37
|
+
"display_name": "佳10.30 贾",
|
|
38
|
+
"updated_at": "2024-10-30 15:52:49",
|
|
39
|
+
"created_at": "2024-10-30 15:52:49",
|
|
40
|
+
"id": 12886
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": 12885,
|
|
44
|
+
"shop_id": 9,
|
|
45
|
+
"country_calling_code": "61",
|
|
46
|
+
"phone": "0457843688",
|
|
47
|
+
"display_name": "儿 子",
|
|
48
|
+
"nickname": "",
|
|
49
|
+
"email": "",
|
|
50
|
+
"channel": "online_store",
|
|
51
|
+
"is_deleted": 0,
|
|
52
|
+
"created_at": "2024-10-30 15:14:59",
|
|
53
|
+
"updated_at": "2024-10-30 15:15:41"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"shop_id": "9",
|
|
57
|
+
"nickname": "Guest",
|
|
58
|
+
"channel": "online_store",
|
|
59
|
+
"updated_at": "2024-10-29 10:37:46",
|
|
60
|
+
"created_at": "2024-10-29 10:37:46",
|
|
61
|
+
"id": 12882
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": 12881,
|
|
65
|
+
"shop_id": 9,
|
|
66
|
+
"country_calling_code": "",
|
|
67
|
+
"phone": "",
|
|
68
|
+
"display_name": "123 123",
|
|
69
|
+
"nickname": "Guest",
|
|
70
|
+
"email": "",
|
|
71
|
+
"channel": "online_store",
|
|
72
|
+
"is_deleted": 0,
|
|
73
|
+
"created_at": "2024-10-29 10:37:35",
|
|
74
|
+
"updated_at": "2024-10-30 15:13:33"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": 12878,
|
|
78
|
+
"shop_id": 9,
|
|
79
|
+
"country_calling_code": "61",
|
|
80
|
+
"phone": "0473261388",
|
|
81
|
+
"display_name": "子 儿",
|
|
82
|
+
"nickname": "",
|
|
83
|
+
"email": "66wwef@qq.com",
|
|
84
|
+
"channel": "online_store",
|
|
85
|
+
"is_deleted": 0,
|
|
86
|
+
"created_at": "2024-10-29 10:00:51",
|
|
87
|
+
"updated_at": "2024-10-30 15:12:17"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": 12877,
|
|
91
|
+
"shop_id": 9,
|
|
92
|
+
"country_calling_code": "61",
|
|
93
|
+
"phone": "0412121212",
|
|
94
|
+
"display_name": "321 123",
|
|
95
|
+
"nickname": "",
|
|
96
|
+
"email": "",
|
|
97
|
+
"channel": "online_store",
|
|
98
|
+
"is_deleted": 0,
|
|
99
|
+
"created_at": "2024-10-29 09:58:15",
|
|
100
|
+
"updated_at": "2024-10-30 15:15:21"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"phone": "5555",
|
|
104
|
+
"email": "260572440593331@qq.com",
|
|
105
|
+
"country_calling_code": "+61",
|
|
106
|
+
"channel": "online_store",
|
|
107
|
+
"shop_id": 9,
|
|
108
|
+
"display_name": "12334444 2213344",
|
|
109
|
+
"updated_at": "2024-10-29 09:57:48",
|
|
110
|
+
"created_at": "2024-10-29 09:57:48",
|
|
111
|
+
"id": 12876
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"phone": "41234445333",
|
|
115
|
+
"email": "2605720593331@qq.com",
|
|
116
|
+
"country_calling_code": "+61",
|
|
117
|
+
"channel": "online_store",
|
|
118
|
+
"shop_id": 9,
|
|
119
|
+
"display_name": "1233 22133",
|
|
120
|
+
"updated_at": "2024-10-29 09:56:46",
|
|
121
|
+
"created_at": "2024-10-29 09:56:46",
|
|
122
|
+
"id": 12875
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"phone": "333555",
|
|
126
|
+
"email": "3333@qq.cxom",
|
|
127
|
+
"country_calling_code": "+61",
|
|
128
|
+
"channel": "online_store",
|
|
129
|
+
"shop_id": 9,
|
|
130
|
+
"display_name": "003 003",
|
|
131
|
+
"updated_at": "2024-10-29 09:55:09",
|
|
132
|
+
"created_at": "2024-10-29 09:55:09",
|
|
133
|
+
"id": 12874
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"phone": "",
|
|
137
|
+
"email": "",
|
|
138
|
+
"country_calling_code": "+61",
|
|
139
|
+
"channel": "online_store",
|
|
140
|
+
"shop_id": 9,
|
|
141
|
+
"display_name": "002 009",
|
|
142
|
+
"updated_at": "2024-10-29 09:53:51",
|
|
143
|
+
"created_at": "2024-10-29 09:53:51",
|
|
144
|
+
"id": 12873
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"count": 3367,
|
|
148
|
+
"skip": 2
|
|
149
|
+
}
|
|
150
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellSelectCustomerModal/RightPanel/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
addCustomer: () => addCustomer,
|
|
23
|
+
getCustomerList: () => getCustomerList
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(serve_exports);
|
|
26
|
+
var import_utils = require("../../../utils");
|
|
27
|
+
var getCustomerList = async (params) => {
|
|
28
|
+
let { data } = await import_utils.request.getRequest().get(`/shop/customer/select-list`, params, { abort: true, fullResult: true });
|
|
29
|
+
return data;
|
|
30
|
+
};
|
|
31
|
+
var addCustomer = async (params) => {
|
|
32
|
+
const res = await import_utils.request.getRequest().post(`/shop/customer`, params, { abort: true, fullResult: true });
|
|
33
|
+
return res == null ? void 0 : res.data;
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
addCustomer,
|
|
38
|
+
getCustomerList
|
|
39
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverProps } from 'antd';
|
|
3
|
+
import { CustomerCardProps } from './CustomerCard';
|
|
4
|
+
import './index.less';
|
|
5
|
+
declare type CustomerDetail = any;
|
|
6
|
+
interface PisellSelectCustomerModalProps {
|
|
7
|
+
value?: CustomerDetail;
|
|
8
|
+
onChange: (e: CustomerDetail) => void;
|
|
9
|
+
popoverProps: PopoverProps;
|
|
10
|
+
cardProps?: CustomerCardProps;
|
|
11
|
+
virtualKeyboardProps?: any;
|
|
12
|
+
keyboardProps?: any;
|
|
13
|
+
virtualKeyInputProps?: any;
|
|
14
|
+
}
|
|
15
|
+
declare const PisellSelectCustomerModal: (props: PisellSelectCustomerModalProps) => React.JSX.Element;
|
|
16
|
+
export default PisellSelectCustomerModal;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellSelectCustomerModal/index.tsx
|
|
30
|
+
var pisellSelectCustomerModal_exports = {};
|
|
31
|
+
__export(pisellSelectCustomerModal_exports, {
|
|
32
|
+
default: () => pisellSelectCustomerModal_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellSelectCustomerModal_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_RightPanel = __toESM(require("./RightPanel"));
|
|
39
|
+
var import_CustomerCard = __toESM(require("./CustomerCard"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var import_utils = require("@pisell/utils");
|
|
42
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
43
|
+
var import_locales = __toESM(require("./locales"));
|
|
44
|
+
var items = [
|
|
45
|
+
{
|
|
46
|
+
value: 1,
|
|
47
|
+
label: "1",
|
|
48
|
+
disabled: false,
|
|
49
|
+
type: "text"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 2,
|
|
53
|
+
label: "2",
|
|
54
|
+
disabled: false,
|
|
55
|
+
type: "text"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: 3,
|
|
59
|
+
label: "3",
|
|
60
|
+
disabled: false,
|
|
61
|
+
type: "text"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: 4,
|
|
65
|
+
label: "4",
|
|
66
|
+
disabled: false,
|
|
67
|
+
type: "text"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: 5,
|
|
71
|
+
label: "5",
|
|
72
|
+
disabled: false,
|
|
73
|
+
type: "text"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
value: 6,
|
|
77
|
+
label: "6",
|
|
78
|
+
disabled: false,
|
|
79
|
+
type: "text"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: 7,
|
|
83
|
+
label: "7",
|
|
84
|
+
disabled: false,
|
|
85
|
+
type: "text"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: 8,
|
|
89
|
+
label: "8",
|
|
90
|
+
disabled: false,
|
|
91
|
+
type: "text"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: 9,
|
|
95
|
+
label: "9",
|
|
96
|
+
disabled: false,
|
|
97
|
+
type: "text"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
value: "+",
|
|
101
|
+
label: "+",
|
|
102
|
+
disabled: false,
|
|
103
|
+
type: "text"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
value: "0",
|
|
107
|
+
label: "0",
|
|
108
|
+
disabled: false,
|
|
109
|
+
type: "text"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
value: "reset",
|
|
113
|
+
label: "Reset",
|
|
114
|
+
disabled: false,
|
|
115
|
+
type: "text"
|
|
116
|
+
}
|
|
117
|
+
];
|
|
118
|
+
var PisellSelectCustomerModal = (props) => {
|
|
119
|
+
const {
|
|
120
|
+
onChange,
|
|
121
|
+
value,
|
|
122
|
+
popoverProps,
|
|
123
|
+
virtualKeyboardProps,
|
|
124
|
+
keyboardProps,
|
|
125
|
+
virtualKeyInputProps,
|
|
126
|
+
cardProps
|
|
127
|
+
} = props;
|
|
128
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
129
|
+
const [_value, set_value] = (0, import_react.useState)();
|
|
130
|
+
const [phone, setPhone] = (0, import_react.useState)("");
|
|
131
|
+
const context = (0, import_useEngineContext.default)();
|
|
132
|
+
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
133
|
+
(0, import_react.useEffect)(() => {
|
|
134
|
+
set_value(value);
|
|
135
|
+
}, [value]);
|
|
136
|
+
const _onChange = (e) => {
|
|
137
|
+
set_value(e);
|
|
138
|
+
onChange == null ? void 0 : onChange(e);
|
|
139
|
+
setOpen(false);
|
|
140
|
+
};
|
|
141
|
+
const onOpenChange = (e) => {
|
|
142
|
+
setOpen(e);
|
|
143
|
+
};
|
|
144
|
+
(0, import_react.useEffect)(() => {
|
|
145
|
+
if (open) {
|
|
146
|
+
document.body.classList.add("hide-scroll");
|
|
147
|
+
} else {
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
document.body.classList.remove("hide-scroll");
|
|
150
|
+
}, 150);
|
|
151
|
+
}
|
|
152
|
+
}, [open]);
|
|
153
|
+
(0, import_react.useEffect)(() => {
|
|
154
|
+
document.body.id = "body";
|
|
155
|
+
}, []);
|
|
156
|
+
const adjustFontSize = (0, import_react.useMemo)(() => {
|
|
157
|
+
const maxFontSize = 60;
|
|
158
|
+
const minFontSize = 10;
|
|
159
|
+
const defaultFontSize = maxFontSize;
|
|
160
|
+
const inputWidth = 248;
|
|
161
|
+
const span = document.createElement("span");
|
|
162
|
+
span.style.position = "absolute";
|
|
163
|
+
span.style.whiteSpace = "nowrap";
|
|
164
|
+
span.style.visibility = "hidden";
|
|
165
|
+
span.style.fontSize = `${defaultFontSize}px`;
|
|
166
|
+
span.textContent = phone;
|
|
167
|
+
document.body.appendChild(span);
|
|
168
|
+
let fontSize = maxFontSize;
|
|
169
|
+
while (span.offsetWidth > inputWidth && fontSize > minFontSize) {
|
|
170
|
+
fontSize -= 0.5;
|
|
171
|
+
span.style.fontSize = `${fontSize}px`;
|
|
172
|
+
}
|
|
173
|
+
document.body.removeChild(span);
|
|
174
|
+
return fontSize;
|
|
175
|
+
}, [phone]);
|
|
176
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
177
|
+
import_antd.Popover,
|
|
178
|
+
{
|
|
179
|
+
content: /* @__PURE__ */ import_react.default.createElement(
|
|
180
|
+
import_materials.VirtualKeyboard,
|
|
181
|
+
{
|
|
182
|
+
style: { zoom: 0.8 },
|
|
183
|
+
keyboardProps: {
|
|
184
|
+
keydown: false,
|
|
185
|
+
items,
|
|
186
|
+
onChange: (e) => {
|
|
187
|
+
if (e === "reset") {
|
|
188
|
+
setPhone("");
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
setPhone(phone + String(e));
|
|
192
|
+
},
|
|
193
|
+
...keyboardProps
|
|
194
|
+
},
|
|
195
|
+
virtualKeyInputProps: {
|
|
196
|
+
value: phone,
|
|
197
|
+
onChange: (e) => {
|
|
198
|
+
setPhone(e.target.value);
|
|
199
|
+
},
|
|
200
|
+
style: {
|
|
201
|
+
textAlign: "left",
|
|
202
|
+
fontSize: adjustFontSize
|
|
203
|
+
},
|
|
204
|
+
...virtualKeyInputProps
|
|
205
|
+
},
|
|
206
|
+
rightPanel: /* @__PURE__ */ import_react.default.createElement(import_RightPanel.default, { value: _value, phone, onChange: _onChange }),
|
|
207
|
+
...virtualKeyboardProps
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
open,
|
|
211
|
+
placement: "bottom",
|
|
212
|
+
arrow: false,
|
|
213
|
+
onOpenChange,
|
|
214
|
+
trigger: ["click"],
|
|
215
|
+
...popoverProps
|
|
216
|
+
},
|
|
217
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
218
|
+
import_CustomerCard.default,
|
|
219
|
+
{
|
|
220
|
+
onClickItem: () => {
|
|
221
|
+
setOpen(true);
|
|
222
|
+
},
|
|
223
|
+
customer: _value,
|
|
224
|
+
onRemove: _onChange,
|
|
225
|
+
...cardProps
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
));
|
|
229
|
+
};
|
|
230
|
+
var pisellSelectCustomerModal_default = PisellSelectCustomerModal;
|