@pisell/private-materials 3.0.16 → 3.0.17

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.
Files changed (93) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/index.js +148 -32
  13. package/es/components/booking/addons/model.d.ts +1 -2
  14. package/es/components/booking/components/TabProduct/selectProductItem/index.js +21 -8
  15. package/es/components/booking/components/TabProduct/selectProductItem/index.less +34 -27
  16. package/es/components/booking/components/collapsibleList/index.d.ts +11 -0
  17. package/es/components/booking/components/collapsibleList/index.js +99 -0
  18. package/es/components/booking/components/collapsibleList/index.less +61 -0
  19. package/es/components/booking/components/collapsibleList/utils.d.ts +2 -0
  20. package/es/components/booking/components/collapsibleList/utils.js +21 -0
  21. package/es/components/booking/components/footer/amount.js +9 -10
  22. package/es/components/booking/components/footer/utils.d.ts +18 -0
  23. package/es/components/booking/components/footer/utils.js +76 -4
  24. package/es/components/booking/forms/forms.d.ts +1 -1
  25. package/es/components/booking/forms/index.d.ts +1 -1
  26. package/es/components/booking/forms/model.d.ts +1 -2
  27. package/es/components/booking/forms/single/index.js +16 -82
  28. package/es/components/booking/index.d.ts +1 -1
  29. package/es/components/booking/info/index.d.ts +1 -1
  30. package/es/components/booking/info/model.d.ts +1 -2
  31. package/es/components/booking/info/service/addService/index.js +47 -24
  32. package/es/components/booking/info/service/editService/index.js +49 -24
  33. package/es/components/booking/info/service/editService/index.less +21 -0
  34. package/es/components/booking/info/service/index.d.ts +2 -2
  35. package/es/components/booking/info/service/index.js +5 -129
  36. package/es/components/booking/info/service/index.less +0 -100
  37. package/es/components/booking/info/service/serviceItem/index.d.ts +4 -0
  38. package/es/components/booking/info/service/serviceItem/index.js +63 -0
  39. package/es/components/booking/info/service/serviceItem/index.less +97 -0
  40. package/es/components/booking/info/service/serviceList/index.d.ts +4 -0
  41. package/es/components/booking/info/service/serviceList/index.js +105 -0
  42. package/es/components/booking/info/service/serviceList/index.less +0 -0
  43. package/es/components/booking/model.d.ts +1 -2
  44. package/es/components/booking/notes/index.d.ts +1 -1
  45. package/es/components/booking/notes/model.d.ts +1 -2
  46. package/es/components/booking/payments/index.d.ts +1 -1
  47. package/es/components/booking/payments/model.d.ts +1 -2
  48. package/es/components/booking/utils.d.ts +1 -0
  49. package/es/components/booking/utils.js +15 -0
  50. package/es/components/schedules/index.d.ts +1 -1
  51. package/es/components/schedules/model.d.ts +1 -2
  52. package/lib/components/booking/addons/index.d.ts +1 -1
  53. package/lib/components/booking/addons/index.js +159 -35
  54. package/lib/components/booking/addons/model.d.ts +1 -2
  55. package/lib/components/booking/components/TabProduct/selectProductItem/index.js +33 -8
  56. package/lib/components/booking/components/TabProduct/selectProductItem/index.less +34 -27
  57. package/lib/components/booking/components/collapsibleList/index.d.ts +11 -0
  58. package/lib/components/booking/components/collapsibleList/index.js +94 -0
  59. package/lib/components/booking/components/collapsibleList/index.less +61 -0
  60. package/lib/components/booking/components/collapsibleList/utils.d.ts +2 -0
  61. package/lib/components/booking/components/collapsibleList/utils.js +46 -0
  62. package/lib/components/booking/components/footer/amount.js +9 -10
  63. package/lib/components/booking/components/footer/utils.d.ts +18 -0
  64. package/lib/components/booking/components/footer/utils.js +46 -7
  65. package/lib/components/booking/forms/forms.d.ts +1 -1
  66. package/lib/components/booking/forms/index.d.ts +1 -1
  67. package/lib/components/booking/forms/model.d.ts +1 -2
  68. package/lib/components/booking/forms/single/index.js +12 -48
  69. package/lib/components/booking/index.d.ts +1 -1
  70. package/lib/components/booking/info/index.d.ts +1 -1
  71. package/lib/components/booking/info/model.d.ts +1 -2
  72. package/lib/components/booking/info/service/addService/index.js +57 -36
  73. package/lib/components/booking/info/service/editService/index.js +76 -56
  74. package/lib/components/booking/info/service/editService/index.less +21 -0
  75. package/lib/components/booking/info/service/index.d.ts +2 -2
  76. package/lib/components/booking/info/service/index.js +4 -112
  77. package/lib/components/booking/info/service/index.less +0 -100
  78. package/lib/components/booking/info/service/serviceItem/index.d.ts +4 -0
  79. package/lib/components/booking/info/service/serviceItem/index.js +98 -0
  80. package/lib/components/booking/info/service/serviceItem/index.less +97 -0
  81. package/lib/components/booking/info/service/serviceList/index.d.ts +4 -0
  82. package/lib/components/booking/info/service/serviceList/index.js +129 -0
  83. package/lib/components/booking/info/service/serviceList/index.less +0 -0
  84. package/lib/components/booking/model.d.ts +1 -2
  85. package/lib/components/booking/notes/index.d.ts +1 -1
  86. package/lib/components/booking/notes/model.d.ts +1 -2
  87. package/lib/components/booking/payments/index.d.ts +1 -1
  88. package/lib/components/booking/payments/model.d.ts +1 -2
  89. package/lib/components/booking/utils.d.ts +1 -0
  90. package/lib/components/booking/utils.js +15 -0
  91. package/lib/components/schedules/index.d.ts +1 -1
  92. package/lib/components/schedules/model.d.ts +1 -2
  93. package/package.json +1 -1
@@ -0,0 +1,97 @@
1
+ .pisell-lowcode__booking-service-item {
2
+ width: 100%;
3
+ border-radius: 8px;
4
+ border: 1px solid #D5D7DA;
5
+ margin-bottom: 16px;
6
+ position: relative;
7
+ overflow: hidden;
8
+ padding: 16px 20px;
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ gap: 4px;
13
+ cursor: pointer;
14
+ background-color: #fff;
15
+
16
+ &:last-child {
17
+ margin-bottom: 0;
18
+ }
19
+
20
+ &::before {
21
+ content: '';
22
+ position: absolute;
23
+ left: 0;
24
+ top: 0;
25
+ width: 6px;
26
+ height: 100%;
27
+ background: #80BCFE;
28
+ z-index: 2;
29
+ }
30
+
31
+ .pisell-lowcode__booking-service-item-title {
32
+ color: var(--gray-900, #101828);
33
+
34
+ font-size: 16px;
35
+ font-style: normal;
36
+ font-weight: 600;
37
+ line-height: 24px;
38
+ }
39
+
40
+ .pisell-lowcode__booking-service-item-date {
41
+ color: var(--gray-500, #667085);
42
+
43
+ font-size: 14px;
44
+ font-style: normal;
45
+ font-weight: 400;
46
+ line-height: 20px;
47
+ }
48
+
49
+ .pisell-lowcode__booking-service-item-technician {
50
+ color: var(--gray-500, #667085);
51
+
52
+ font-size: 14px;
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ line-height: 20px;
56
+ }
57
+
58
+ .pisell-lowcode__booking-service-item-price-wrap {
59
+ .pisell-lowcode__booking-service-item-price {
60
+ color: var(--gray-500, #667085);
61
+
62
+ font-size: 14px;
63
+ font-style: normal;
64
+ font-weight: 400;
65
+ line-height: 20px;
66
+ }
67
+
68
+ .pisell-lowcode__booking-service-item-original-price {
69
+ color: var(--gray-500, #667085);
70
+
71
+ font-size: 14px;
72
+ font-style: normal;
73
+ font-weight: 400;
74
+ line-height: 20px;
75
+ margin-left: 8px;
76
+ text-decoration: line-through;
77
+ }
78
+
79
+
80
+ }
81
+
82
+ .pisell-lowcode__booking-service-item-discount-reason {
83
+ color: var(--gray-500, #667085);
84
+
85
+ font-size: 14px;
86
+ font-style: normal;
87
+ font-weight: 400;
88
+ line-height: 20px;
89
+ white-space: break-spaces;
90
+ }
91
+
92
+ .pisell-lowcode__booking-service-item-error {
93
+ border: none;
94
+ margin: 0 -20px -16px;
95
+ border-radius: 0 0 8px 8px;
96
+ }
97
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ declare const ServiceList: () => React.JSX.Element;
4
+ export default ServiceList;
@@ -0,0 +1,129 @@
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/info/service/serviceList/index.tsx
30
+ var serviceList_exports = {};
31
+ __export(serviceList_exports, {
32
+ default: () => serviceList_default
33
+ });
34
+ module.exports = __toCommonJS(serviceList_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_index = require("./index.less");
38
+ var import_model = require("../../model");
39
+ var import_mock = require("../../../mock");
40
+ var import_utils2 = require("../../../utils");
41
+ var import_serviceItem = __toESM(require("../serviceItem"));
42
+ var ServiceList = () => {
43
+ const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
44
+ const errorTypes = {
45
+ product: import_utils.locales.getText("pisell2.text.status.service-error-1"),
46
+ time: import_utils.locales.getText("pisell2.text.status.service-error-2"),
47
+ maxLimit: import_utils.locales.getText("pisell2.text.status.service-error-3")
48
+ };
49
+ const handleEditService = (item) => {
50
+ if (state.disabledEdit) {
51
+ return;
52
+ }
53
+ dispatch({
54
+ type: "setService",
55
+ payload: {
56
+ editModal: true,
57
+ cacheItem: { ...item, new: 0 }
58
+ }
59
+ });
60
+ };
61
+ const getResourceItem = (0, import_react.useCallback)(
62
+ (id) => {
63
+ if (id === 0) {
64
+ return (0, import_mock.getNoResource)();
65
+ }
66
+ return state.service.resources.find((d) => d.form_record_id === id);
67
+ },
68
+ [state.service.resources]
69
+ );
70
+ const getErrorMessage = (0, import_react.useCallback)((service, resourceItem) => {
71
+ const errorList = (0, import_utils2.getErrorList)(resourceItem, service);
72
+ let errorMessage = "";
73
+ if (!service.id) {
74
+ return errorList[0].label;
75
+ }
76
+ if (errorList.length) {
77
+ if (errorList.length > 1) {
78
+ errorMessage = `${errorList.length} ${import_utils.locales.getText(
79
+ "pisell2.text.warnings"
80
+ )}`;
81
+ } else {
82
+ errorMessage = (resourceItem == null ? void 0 : resourceItem.labelText) + " " + errorTypes[errorList[0].type];
83
+ }
84
+ }
85
+ return errorMessage;
86
+ }, []);
87
+ const handleLike = (status, item) => {
88
+ if (state.disabledEdit) {
89
+ return;
90
+ }
91
+ let _list = [...state.service.value];
92
+ let _id = item == null ? void 0 : item._id;
93
+ _list = _list.map(
94
+ (d) => d._id === _id ? {
95
+ ...d,
96
+ _extend: {
97
+ ...d._extend,
98
+ like_status: status
99
+ }
100
+ } : d
101
+ );
102
+ dispatch({
103
+ type: "setService",
104
+ payload: {
105
+ value: _list,
106
+ edit: true
107
+ }
108
+ });
109
+ };
110
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, state.service.value.map((d) => {
111
+ var _a;
112
+ const resourceItem = getResourceItem((_a = d._extend) == null ? void 0 : _a.resource);
113
+ let errorMessage = getErrorMessage(d, resourceItem);
114
+ return /* @__PURE__ */ import_react.default.createElement(
115
+ import_serviceItem.default,
116
+ {
117
+ key: d._id,
118
+ getResourceItem,
119
+ errorMessage,
120
+ resourceItem,
121
+ d,
122
+ handleEditService,
123
+ state,
124
+ handleLike
125
+ }
126
+ );
127
+ }));
128
+ };
129
+ var serviceList_default = ServiceList;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -87,7 +86,7 @@ export declare const walkInData: {
87
86
  id: number;
88
87
  nickname: string;
89
88
  };
90
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
89
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
91
90
  state: FormState;
92
91
  } & {
93
92
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: (props: any) => JSX.Element;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Payments: (props: any) => any;
8
+ declare const Payments: (props: any) => JSX.Element;
9
9
  export default Payments;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -93,6 +93,7 @@ export declare const deleteCacheParams: () => void;
93
93
  * @Date: 2024-01-26 14:09
94
94
  */
95
95
  export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
96
+ export declare const getProductTotalPrice: (item: any) => number;
96
97
  /**
97
98
  * @title: 判断 duration
98
99
  * @description: 用于处理不同格式的duration
@@ -41,6 +41,7 @@ __export(utils_exports, {
41
41
  getEndDate: () => getEndDate,
42
42
  getErrorList: () => getErrorList,
43
43
  getLastServer: () => getLastServer,
44
+ getProductTotalPrice: () => getProductTotalPrice,
44
45
  getServerItemExtend: () => getServerItemExtend,
45
46
  getServiceTime: () => getServiceTime,
46
47
  getServiceTimes: () => getServiceTimes,
@@ -428,6 +429,19 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
428
429
  };
429
430
  return _extend;
430
431
  };
432
+ var getProductTotalPrice = (item) => {
433
+ var _a;
434
+ let price = 0;
435
+ price += Number(item._extend.price);
436
+ let other = (_a = item._extend) == null ? void 0 : _a.other;
437
+ if (other == null ? void 0 : other.bundle) {
438
+ price = other == null ? void 0 : other.bundle.reduce((accumulator, currentValue) => {
439
+ return accumulator + Number(currentValue.price) * Number(currentValue.num);
440
+ }, price);
441
+ }
442
+ price = price;
443
+ return price;
444
+ };
431
445
  var getDuration = (duration) => {
432
446
  if (typeof duration === "number") {
433
447
  return duration;
@@ -465,6 +479,7 @@ var isWalkIn = (customer_id) => {
465
479
  getEndDate,
466
480
  getErrorList,
467
481
  getLastServer,
482
+ getProductTotalPrice,
468
483
  getServerItemExtend,
469
484
  getServiceTime,
470
485
  getServiceTimes,
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.16",
3
+ "version": "3.0.17",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",