@pisell/private-materials 3.0.28 → 3.0.30
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/components/collapsibleList/index.js +1 -1
- package/es/components/booking/components/footer/utils.js +5 -1
- package/es/components/booking/deposit/ClientItem/index.d.ts +18 -0
- package/es/components/booking/deposit/ClientItem/index.js +43 -0
- package/es/components/booking/deposit/ClientItem/index.less +37 -0
- package/es/components/booking/deposit/DepositItem/index.d.ts +20 -0
- package/es/components/booking/deposit/DepositItem/index.js +105 -0
- package/es/components/booking/deposit/DepositItem/index.less +88 -0
- package/es/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
- package/es/components/booking/deposit/EditDepositModal/index.js +126 -0
- package/es/components/booking/deposit/EditDepositModal/index.less +24 -0
- package/es/components/booking/deposit/index.d.ts +3 -0
- package/es/components/booking/deposit/index.js +164 -0
- package/es/components/booking/deposit/index.less +3 -0
- package/es/components/booking/deposit/serve.d.ts +8 -0
- package/es/components/booking/deposit/serve.js +27 -0
- package/es/components/booking/forms/index.js +2 -1
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/editService/index.js +50 -21
- package/es/components/booking/locales.d.ts +54 -0
- package/es/components/booking/locales.js +57 -3
- package/es/components/booking/utils.d.ts +37 -0
- package/es/components/booking/utils.js +71 -8
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/components/collapsibleList/index.js +1 -1
- package/lib/components/booking/components/footer/utils.js +4 -1
- package/lib/components/booking/deposit/ClientItem/index.d.ts +18 -0
- package/lib/components/booking/deposit/ClientItem/index.js +71 -0
- package/lib/components/booking/deposit/ClientItem/index.less +37 -0
- package/lib/components/booking/deposit/DepositItem/index.d.ts +20 -0
- package/lib/components/booking/deposit/DepositItem/index.js +112 -0
- package/lib/components/booking/deposit/DepositItem/index.less +88 -0
- package/lib/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
- package/lib/components/booking/deposit/EditDepositModal/index.js +131 -0
- package/lib/components/booking/deposit/EditDepositModal/index.less +24 -0
- package/lib/components/booking/deposit/index.d.ts +3 -0
- package/lib/components/booking/deposit/index.js +186 -0
- package/lib/components/booking/deposit/index.less +3 -0
- package/lib/components/booking/deposit/serve.d.ts +8 -0
- package/lib/components/booking/deposit/serve.js +30 -0
- package/lib/components/booking/forms/index.js +1 -1
- package/lib/components/booking/info/service/addService/index.js +2 -2
- package/lib/components/booking/info/service/editService/index.js +33 -11
- package/lib/components/booking/locales.d.ts +54 -0
- package/lib/components/booking/locales.js +57 -3
- package/lib/components/booking/utils.d.ts +37 -0
- package/lib/components/booking/utils.js +33 -10
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/booking-deposit/meta.ts +93 -0
- package/package.json +3 -3
|
@@ -13,7 +13,24 @@ declare class Request {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export declare const request: Request;
|
|
16
|
+
/**
|
|
17
|
+
* @title: 格式化持续时长用于展示
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {number} service_times
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: zhiwei.Wang
|
|
22
|
+
* @Date: 2024-04-26 14:00
|
|
23
|
+
*/
|
|
16
24
|
export declare const getDiscountTime: (service_times: number) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 时间切片
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {any} config
|
|
29
|
+
* @param {string} locale
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: zhiwei.Wang
|
|
32
|
+
* @Date: 2024-04-26 13:59
|
|
33
|
+
*/
|
|
17
34
|
export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
|
|
18
35
|
timeSlices: {
|
|
19
36
|
label: string;
|
|
@@ -24,6 +41,26 @@ export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
|
|
|
24
41
|
value: number;
|
|
25
42
|
}[];
|
|
26
43
|
};
|
|
44
|
+
export declare const getNowTime: () => string;
|
|
45
|
+
export declare const isNowTime: (time: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @title: 获取服务的开始时间, 如果是now 转换为当前的时间
|
|
48
|
+
* @description:
|
|
49
|
+
* @param {string} start_time
|
|
50
|
+
* @return {*}
|
|
51
|
+
* @Author: zhiwei.Wang
|
|
52
|
+
* @Date: 2024-04-26 14:03
|
|
53
|
+
*/
|
|
54
|
+
export declare const getServeStartTime: (start_time: string) => string;
|
|
55
|
+
/**
|
|
56
|
+
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
57
|
+
* @description:
|
|
58
|
+
* @param {any} item
|
|
59
|
+
* @param {any} currentDate
|
|
60
|
+
* @return {*}
|
|
61
|
+
* @Author: zhiwei.Wang
|
|
62
|
+
* @Date: 2024-04-26 14:04
|
|
63
|
+
*/
|
|
27
64
|
export declare const getServiceTime: (item: any, currentDate: any) => string;
|
|
28
65
|
export declare const findNextSlice: ({ timeSlices, index, date }: {
|
|
29
66
|
timeSlices: any[];
|
|
@@ -35,6 +35,15 @@ var Request = /*#__PURE__*/function () {
|
|
|
35
35
|
return Request;
|
|
36
36
|
}();
|
|
37
37
|
export var request = new Request();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @title: 格式化持续时长用于展示
|
|
41
|
+
* @description:
|
|
42
|
+
* @param {number} service_times
|
|
43
|
+
* @return {*}
|
|
44
|
+
* @Author: zhiwei.Wang
|
|
45
|
+
* @Date: 2024-04-26 14:00
|
|
46
|
+
*/
|
|
38
47
|
export var getDiscountTime = function getDiscountTime(service_times) {
|
|
39
48
|
if (!service_times) {
|
|
40
49
|
return "";
|
|
@@ -52,6 +61,16 @@ export var getDiscountTime = function getDiscountTime(service_times) {
|
|
|
52
61
|
return str;
|
|
53
62
|
}
|
|
54
63
|
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @title: 时间切片
|
|
67
|
+
* @description:
|
|
68
|
+
* @param {any} config
|
|
69
|
+
* @param {string} locale
|
|
70
|
+
* @return {*}
|
|
71
|
+
* @Author: zhiwei.Wang
|
|
72
|
+
* @Date: 2024-04-26 13:59
|
|
73
|
+
*/
|
|
55
74
|
export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, locale) {
|
|
56
75
|
var _locale = locale;
|
|
57
76
|
var dayjsLocale = _locale === 'en-US' || _locale === 'en' ? 'en' : 'zh-cn';
|
|
@@ -92,8 +111,41 @@ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, lo
|
|
|
92
111
|
durationSlicesBasedOnTime: durationSlicesBasedOnTime
|
|
93
112
|
};
|
|
94
113
|
};
|
|
114
|
+
|
|
115
|
+
// 获取当前时间
|
|
116
|
+
export var getNowTime = function getNowTime() {
|
|
117
|
+
return dayjs().format("HH:mm");
|
|
118
|
+
};
|
|
119
|
+
export var isNowTime = function isNowTime(time) {
|
|
120
|
+
return time === 'now';
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @title: 获取服务的开始时间, 如果是now 转换为当前的时间
|
|
125
|
+
* @description:
|
|
126
|
+
* @param {string} start_time
|
|
127
|
+
* @return {*}
|
|
128
|
+
* @Author: zhiwei.Wang
|
|
129
|
+
* @Date: 2024-04-26 14:03
|
|
130
|
+
*/
|
|
131
|
+
export var getServeStartTime = function getServeStartTime(start_time) {
|
|
132
|
+
if (isNowTime(start_time)) {
|
|
133
|
+
return getNowTime();
|
|
134
|
+
}
|
|
135
|
+
return start_time;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
140
|
+
* @description:
|
|
141
|
+
* @param {any} item
|
|
142
|
+
* @param {any} currentDate
|
|
143
|
+
* @return {*}
|
|
144
|
+
* @Author: zhiwei.Wang
|
|
145
|
+
* @Date: 2024-04-26 14:04
|
|
146
|
+
*/
|
|
95
147
|
export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
96
|
-
var startDate = dayjs(currentDate.format('YYYY-MM-DD') + ' ' + item._extend.start_time);
|
|
148
|
+
var startDate = dayjs(currentDate.format('YYYY-MM-DD') + ' ' + getServeStartTime(item._extend.start_time));
|
|
97
149
|
var startTime = startDate.format("HH:mm");
|
|
98
150
|
var endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
99
151
|
var duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
@@ -110,8 +162,11 @@ export var findNextSlice = function findNextSlice(_ref) {
|
|
|
110
162
|
|
|
111
163
|
// 遍历时间切片数组,找到最接近的下一个切片时间
|
|
112
164
|
for (var i = 0; i < timeSlices.length; i++) {
|
|
113
|
-
|
|
114
|
-
|
|
165
|
+
// 排除掉当前时间
|
|
166
|
+
if (timeSlices[i].value !== 'now') {
|
|
167
|
+
if (timeSlices[i].value >= currentTimeValue) {
|
|
168
|
+
return timeSlices[i].value;
|
|
169
|
+
}
|
|
115
170
|
}
|
|
116
171
|
}
|
|
117
172
|
|
|
@@ -177,7 +232,7 @@ var formatTimes = function formatTimes(resourceItem, cacheItem) {
|
|
|
177
232
|
// 可用的time列表
|
|
178
233
|
var usableTimes = [];
|
|
179
234
|
var _resourceItem = _objectSpread({}, resourceItem);
|
|
180
|
-
var startDate = dayjs(cacheItem._extend.start_date.format("YYYY-MM-DD") + ' ' + cacheItem._extend.start_time);
|
|
235
|
+
var startDate = dayjs(cacheItem._extend.start_date.format("YYYY-MM-DD") + ' ' + getServeStartTime(cacheItem._extend.start_time));
|
|
181
236
|
var isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
182
237
|
// 循环times 区分可用和不可用的 并打上标记
|
|
183
238
|
_resourceItem.times = _resourceItem.times.map(function (d) {
|
|
@@ -359,7 +414,7 @@ export var getEndDate = function getEndDate(startDate, duration, endDate) {
|
|
|
359
414
|
// export const get
|
|
360
415
|
|
|
361
416
|
export var getServiceTimes = function getServiceTimes(service) {
|
|
362
|
-
var startDate = dayjs(dayjs(service._extend.start_date).format("YYYY-MM-DD ") + service._extend.start_time);
|
|
417
|
+
var startDate = dayjs(dayjs(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time));
|
|
363
418
|
var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), "minute");
|
|
364
419
|
return {
|
|
365
420
|
startDate: startDate,
|
|
@@ -411,7 +466,6 @@ export var getErrorList = function getErrorList(resource, cacheItem) {
|
|
|
411
466
|
}
|
|
412
467
|
}
|
|
413
468
|
}
|
|
414
|
-
console.log(cacheItem, "cacheItem");
|
|
415
469
|
return list;
|
|
416
470
|
};
|
|
417
471
|
|
|
@@ -493,7 +547,8 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
493
547
|
}
|
|
494
548
|
} else {
|
|
495
549
|
// 没有上一个商品 资源为 0
|
|
496
|
-
_extend.resource = 0;
|
|
550
|
+
// _extend.resource = 0;
|
|
551
|
+
|
|
497
552
|
var findNextSliceProps = {
|
|
498
553
|
timeSlices: timeObj.timeSlices,
|
|
499
554
|
index: 0,
|
|
@@ -514,7 +569,15 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
|
|
|
514
569
|
_extend.resource = Number(resourceId);
|
|
515
570
|
}
|
|
516
571
|
}
|
|
517
|
-
_extend
|
|
572
|
+
console.log("_extend", findNextSliceProps);
|
|
573
|
+
|
|
574
|
+
// 只有选择了带 HH:mm的日期才选中, 否则使用当前日期
|
|
575
|
+
if (findNextSliceProps.date && findNextSliceProps.date !== '00:00') {
|
|
576
|
+
_extend.start_time = findNextSlice(findNextSliceProps);
|
|
577
|
+
} else {
|
|
578
|
+
// 没有预设日期, 则使用当前 https://www.yuque.com/feg4xm/manual/tzvrnt05ifihkndg
|
|
579
|
+
_extend.start_time = 'now';
|
|
580
|
+
}
|
|
518
581
|
}
|
|
519
582
|
_extend = _objectSpread(_objectSpread({}, _extend), cacheItem._extend);
|
|
520
583
|
return _extend;
|
package/es/index.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export { default as BookingStartTime } from './components/booking/materiels/star
|
|
|
12
12
|
export { default as BookingDuration } from './components/booking/materiels/duration';
|
|
13
13
|
export { default as BookingContacts } from './components/booking/materiels/contacts';
|
|
14
14
|
export { default as ProductExtension } from './components/productExtension';
|
|
15
|
+
export { default as BookingDeposit } from './components/booking/deposit';
|
package/es/index.js
CHANGED
|
@@ -15,4 +15,5 @@ export { default as BookingResources } from "./components/booking/materiels/reso
|
|
|
15
15
|
export { default as BookingStartTime } from "./components/booking/materiels/startTime";
|
|
16
16
|
export { default as BookingDuration } from "./components/booking/materiels/duration";
|
|
17
17
|
export { default as BookingContacts } from "./components/booking/materiels/contacts";
|
|
18
|
-
export { default as ProductExtension } from "./components/productExtension";
|
|
18
|
+
export { default as ProductExtension } from "./components/productExtension";
|
|
19
|
+
export { default as BookingDeposit } from "./components/booking/deposit";
|
|
@@ -82,7 +82,10 @@ var formatBookings = (data) => {
|
|
|
82
82
|
const start_date = item._extend.startDate.format("YYYY-MM-DD");
|
|
83
83
|
const end_date = item._extend.endDate.format("YYYY-MM-DD");
|
|
84
84
|
const end_time = item._extend.endDate.format("HH:mm");
|
|
85
|
-
|
|
85
|
+
let start_time = item._extend.startDate.format("HH:mm");
|
|
86
|
+
if ((0, import_utils.isNowTime)(item._extend.start_time)) {
|
|
87
|
+
start_time = (0, import_utils.getNowTime)();
|
|
88
|
+
}
|
|
86
89
|
const total = Number(item._extend.total);
|
|
87
90
|
const origin_total = Number(item._extend.origin_total);
|
|
88
91
|
const discount_amount = origin_total - total;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
declare type ClientItemProps = {
|
|
4
|
+
data: {
|
|
5
|
+
cover: string;
|
|
6
|
+
name: string;
|
|
7
|
+
display_name: string;
|
|
8
|
+
nickname: string;
|
|
9
|
+
email: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
};
|
|
12
|
+
coverSize?: number;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
className?: string;
|
|
15
|
+
walkInName?: string;
|
|
16
|
+
};
|
|
17
|
+
declare const ClientItem: (props: ClientItemProps) => React.JSX.Element;
|
|
18
|
+
export default ClientItem;
|
|
@@ -0,0 +1,71 @@
|
|
|
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/booking/deposit/ClientItem/index.tsx
|
|
30
|
+
var ClientItem_exports = {};
|
|
31
|
+
__export(ClientItem_exports, {
|
|
32
|
+
default: () => ClientItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ClientItem_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_User01 = __toESM(require("@pisell/icon/src/User01"));
|
|
40
|
+
var import_utils2 = require("../../utils");
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var ClientItem = (props) => {
|
|
43
|
+
const { data, coverSize = 48, style, className, walkInName } = props;
|
|
44
|
+
const getNickname = (0, import_react.useCallback)(
|
|
45
|
+
(item) => {
|
|
46
|
+
if ((0, import_utils2.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
47
|
+
return walkInName || import_utils.locales.getText("pisell2.text.select-a-customer");
|
|
48
|
+
}
|
|
49
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
|
|
50
|
+
},
|
|
51
|
+
[import_utils.locales.localeMap]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
style,
|
|
57
|
+
className: (0, import_classnames.default)("pisell-lowcode__client-item", className)
|
|
58
|
+
},
|
|
59
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
60
|
+
import_antd.Avatar,
|
|
61
|
+
{
|
|
62
|
+
className: "pisell-lowcode__client-item-avatar",
|
|
63
|
+
src: import_utils.image.ali(data == null ? void 0 : data.cover, 100) || void 0,
|
|
64
|
+
size: coverSize,
|
|
65
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__client-item-avatar-icon" })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__client-item-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__client-item-info-name" }, getNickname(data)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__client-item-info-desc" }, (data == null ? void 0 : data.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, data == null ? void 0 : data.email) : null, (data == null ? void 0 : data.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, data == null ? void 0 : data.phone) : null))
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
var ClientItem_default = ClientItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.pisell-lowcode__client-item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
position: relative;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 0 20px;
|
|
8
|
+
.pisell-lowcode__client-item-avatar {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
background: var(--gray-100, #F2F4F7);
|
|
13
|
+
.pisell-lowcode__client-item-avatar-icon {
|
|
14
|
+
font-size: 24px;
|
|
15
|
+
color: #475467;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.pisell-lowcode__client-item-info {
|
|
19
|
+
flex: 1;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
.pisell-lowcode__client-item-info-name {
|
|
23
|
+
color: var(--text-text-1, #1B1B1B);
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
line-height: 22px;
|
|
28
|
+
}
|
|
29
|
+
.pisell-lowcode__client-item-info-desc {
|
|
30
|
+
color: var(--text-text-2, #777);
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
line-height: 20px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
declare type DepositItemProps = {
|
|
4
|
+
status: "paid" | "unpaid";
|
|
5
|
+
onEdit: React.MouseEventHandler<HTMLSpanElement>;
|
|
6
|
+
customer: any;
|
|
7
|
+
totalAmountStr: string;
|
|
8
|
+
totalAmount: number;
|
|
9
|
+
orderId: number;
|
|
10
|
+
orderNumber: number;
|
|
11
|
+
handleGoOrderDetail: () => void;
|
|
12
|
+
generatePaymentLink: (orderId: number) => void;
|
|
13
|
+
depositAmount: number;
|
|
14
|
+
amountSymbol: string;
|
|
15
|
+
createdTime: string;
|
|
16
|
+
isPaid: boolean;
|
|
17
|
+
isBookingCancelled: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const DepositItem: (props: DepositItemProps) => React.JSX.Element;
|
|
20
|
+
export default DepositItem;
|
|
@@ -0,0 +1,112 @@
|
|
|
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/booking/deposit/DepositItem/index.tsx
|
|
30
|
+
var DepositItem_exports = {};
|
|
31
|
+
__export(DepositItem_exports, {
|
|
32
|
+
default: () => DepositItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DepositItem_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icons = require("@ant-design/icons");
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_ClientItem = __toESM(require("../ClientItem"));
|
|
40
|
+
var import_Edit05 = __toESM(require("@pisell/icon/src/Edit05"));
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var statusTagColor = {
|
|
43
|
+
unpaid: "#B2DDFF",
|
|
44
|
+
paid: "#ABEFC6"
|
|
45
|
+
};
|
|
46
|
+
var statusBgColor = {
|
|
47
|
+
unpaid: "#EFF8FF",
|
|
48
|
+
paid: "#ECFDF3"
|
|
49
|
+
};
|
|
50
|
+
var DepositItem = (props) => {
|
|
51
|
+
const {
|
|
52
|
+
status,
|
|
53
|
+
customer,
|
|
54
|
+
totalAmountStr,
|
|
55
|
+
onEdit,
|
|
56
|
+
orderId,
|
|
57
|
+
orderNumber,
|
|
58
|
+
handleGoOrderDetail,
|
|
59
|
+
generatePaymentLink,
|
|
60
|
+
depositAmount,
|
|
61
|
+
amountSymbol,
|
|
62
|
+
createdTime,
|
|
63
|
+
isPaid,
|
|
64
|
+
isBookingCancelled
|
|
65
|
+
} = props;
|
|
66
|
+
const statusText = {
|
|
67
|
+
unpaid: import_utils.locales.getText("pisell2.text.deposit-item-status-unpaid"),
|
|
68
|
+
paid: import_utils.locales.getText("pisell2.text.deposit-item-status-paid")
|
|
69
|
+
};
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
document.body.id = "body";
|
|
72
|
+
}, []);
|
|
73
|
+
const items = [
|
|
74
|
+
{
|
|
75
|
+
key: "1",
|
|
76
|
+
disabled: isPaid || isBookingCancelled,
|
|
77
|
+
label: /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.deposit-generate-payment-link"))
|
|
78
|
+
}
|
|
79
|
+
// {
|
|
80
|
+
// key: "2",
|
|
81
|
+
// label: <div>发送邮件</div>,
|
|
82
|
+
// },
|
|
83
|
+
];
|
|
84
|
+
const onClick = ({ key }) => {
|
|
85
|
+
if (key === "1") {
|
|
86
|
+
generatePaymentLink == null ? void 0 : generatePaymentLink(orderId);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item" }, /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: "pisell-lowcode__deposit-item-header",
|
|
93
|
+
style: { backgroundColor: statusBgColor[status] }
|
|
94
|
+
},
|
|
95
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
className: "pisell-lowcode__deposit-status",
|
|
99
|
+
style: { backgroundColor: statusTagColor[status] }
|
|
100
|
+
},
|
|
101
|
+
statusText[status]
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-header-right" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__deposit-item-header-right-amount" }, (0, import_utils.formatAmount)(depositAmount, 2, amountSymbol)), !(isPaid || isBookingCancelled) && /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
import_Edit05.default,
|
|
105
|
+
{
|
|
106
|
+
className: "pisell-lowcode__deposit-item-header-right-edit",
|
|
107
|
+
onClick: onEdit
|
|
108
|
+
}
|
|
109
|
+
))
|
|
110
|
+
), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-content-line1" }, import_utils.locales.getText("pisell2.text.deposit-order-no"), " ", orderNumber), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-content-line2" }, createdTime), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_ClientItem.default, { data: customer, coverSize: 40, walkInName: "Walk-In" }))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-footer" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-footer-total" }, /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.text.deposit-order-total")), /* @__PURE__ */ import_react.default.createElement("div", null, totalAmountStr)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__deposit-item-footer-action" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { block: true, size: "large", onClick: handleGoOrderDetail }, import_utils.locales.getText("pisell2.text.deposit-order-detail")), /* @__PURE__ */ import_react.default.createElement(import_antd.Dropdown, { menu: { items, onClick }, placement: "bottom" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { block: true, type: "primary", size: "large" }, import_utils.locales.getText("pisell2.text.deposit-collect-deposit"), " ", /* @__PURE__ */ import_react.default.createElement(import_icons.DownOutlined, null))))));
|
|
111
|
+
};
|
|
112
|
+
var DepositItem_default = DepositItem;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.pisell-lowcode__deposit-item {
|
|
2
|
+
border-radius: 12px;
|
|
3
|
+
border: 1px solid var(--Gray-300, #D0D5DD);
|
|
4
|
+
background: var(--Base-White, #FFF);
|
|
5
|
+
box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
.pisell-lowcode__deposit-item-header {
|
|
8
|
+
background: var(--Blue-50, #EFF8FF);
|
|
9
|
+
display: flex;
|
|
10
|
+
padding: 20px;
|
|
11
|
+
.pisell-lowcode__deposit-status {
|
|
12
|
+
display: flex;
|
|
13
|
+
padding: 6px 16px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
border-radius: 16px;
|
|
16
|
+
color: var(--Base-Black, #000);
|
|
17
|
+
text-align: center;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
font-style: normal;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 20px; /* 142.857% */
|
|
22
|
+
}
|
|
23
|
+
.pisell-lowcode__deposit-item-header-right {
|
|
24
|
+
flex: 1;
|
|
25
|
+
text-align: right;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
.pisell-lowcode__deposit-item-header-right-amount {
|
|
30
|
+
color: var(--Warning-600, #DC6803);
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
line-height: 30px; /* 150% */
|
|
35
|
+
margin-right: 8px;
|
|
36
|
+
}
|
|
37
|
+
.pisell-lowcode__deposit-item-header-right-edit{
|
|
38
|
+
font-size: 24px;
|
|
39
|
+
color: #1570EF;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.pisell-lowcode__deposit-item-content {
|
|
45
|
+
border-top: 1px solid #EAECF0;
|
|
46
|
+
border-bottom: 1px solid #EAECF0;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 32px;
|
|
51
|
+
padding: 32px 0;
|
|
52
|
+
.pisell-lowcode__deposit-item-content-line1 {
|
|
53
|
+
color: var(--Gray-600, #475467);
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 20px; /* 142.857% */
|
|
58
|
+
}
|
|
59
|
+
.pisell-lowcode__deposit-item-content-line2 {
|
|
60
|
+
color: #000;
|
|
61
|
+
font-size: 16px;
|
|
62
|
+
font-style: normal;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
line-height: 24px; /* 150% */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
.pisell-lowcode__deposit-item-footer {
|
|
68
|
+
padding: 20px;
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
gap: 20px;
|
|
72
|
+
.pisell-lowcode__deposit-item-footer-total {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: space-between;
|
|
75
|
+
|
|
76
|
+
color: var(--Gray-900, #101828);
|
|
77
|
+
text-align: right;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
font-style: normal;
|
|
80
|
+
font-weight: 400;
|
|
81
|
+
line-height: 24px; /* 150% */
|
|
82
|
+
}
|
|
83
|
+
.pisell-lowcode__deposit-item-footer-action {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: 20px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
declare type EditDepositModalProps = {
|
|
4
|
+
amountSymbol: string;
|
|
5
|
+
onChange: (amount: number) => void;
|
|
6
|
+
totalAmount: number;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<EditDepositModalProps & React.RefAttributes<unknown>>;
|
|
9
|
+
export default _default;
|