@pisell/private-materials 3.0.199 → 3.0.200

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 (193) hide show
  1. package/build/lowcode/index.js +1 -1
  2. package/build/lowcode/meta.js +1 -1
  3. package/build/lowcode/preview.js +7 -7
  4. package/build/lowcode/render/default/view.css +1 -1
  5. package/build/lowcode/render/default/view.js +10 -10
  6. package/build/lowcode/view.css +1 -1
  7. package/build/lowcode/view.js +11 -11
  8. package/es/components/booking/components/customSelect/index.d.ts +1 -0
  9. package/es/components/booking/components/customSelect/index.js +6 -2
  10. package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
  11. package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
  12. package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  13. package/es/components/booking/components/footer/amount.js +45 -22
  14. package/es/components/booking/components/footer/index.js +84 -40
  15. package/es/components/booking/components/footer/utils.js +243 -32
  16. package/es/components/booking/info/addServiceVariant/index.js +8 -1
  17. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  18. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
  19. package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
  20. package/es/components/booking/info/dateRange/index.d.ts +5 -0
  21. package/es/components/booking/info/dateRange/index.js +98 -0
  22. package/es/components/booking/info/dateRange/index.less +21 -0
  23. package/es/components/booking/info/main.js +20 -8
  24. package/es/components/booking/info/model.js +3 -0
  25. package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
  26. package/es/components/booking/info/pet/ChangePetModal/index.js +119 -0
  27. package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
  28. package/es/components/booking/info/pet/index.js +54 -5
  29. package/es/components/booking/info/service/addService/index.js +142 -22
  30. package/es/components/booking/info/service/addService/index.less +13 -3
  31. package/es/components/booking/info/service/addService/utils.d.ts +11 -2
  32. package/es/components/booking/info/service/addService/utils.js +49 -24
  33. package/es/components/booking/info/service/editService/index.js +246 -44
  34. package/es/components/booking/info/service/editService/index.less +18 -13
  35. package/es/components/booking/info/service2/Lists.d.ts +3 -0
  36. package/es/components/booking/info/service2/Lists.js +158 -0
  37. package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
  38. package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
  39. package/es/components/booking/info/service2/index.d.ts +3 -0
  40. package/es/components/booking/info/service2/index.js +58 -0
  41. package/es/components/booking/info/service2/status.d.ts +31 -0
  42. package/es/components/booking/info/service2/status.js +78 -0
  43. package/es/components/booking/info/service2/utils.d.ts +145 -0
  44. package/es/components/booking/info/service2/utils.js +438 -0
  45. package/es/components/booking/info/utils.d.ts +9 -0
  46. package/es/components/booking/info/utils.js +13 -0
  47. package/es/components/booking/locales.d.ts +60 -0
  48. package/es/components/booking/locales.js +75 -3
  49. package/es/components/booking/materiels/holder/index.d.ts +7 -0
  50. package/es/components/booking/materiels/holder/index.js +51 -0
  51. package/es/components/booking/model.d.ts +4 -1
  52. package/es/components/booking/model.js +4 -2
  53. package/es/components/booking/utils.d.ts +12 -3
  54. package/es/components/booking/utils.js +139 -23
  55. package/es/components/eftpos/form/index.js +6 -12
  56. package/es/components/eftpos/group/index.d.ts +2 -1
  57. package/es/components/eftpos/group/index.js +2 -1
  58. package/es/components/eftpos/index.js +2 -2
  59. package/es/components/eftposPay/helper.d.ts +0 -1
  60. package/es/components/eftposPay/helper.js +0 -14
  61. package/es/components/eftposPay/tyro/index.js +20 -51
  62. package/es/components/shoppingCart/Provider.d.ts +3 -0
  63. package/es/components/shoppingCart/Provider.js +86 -0
  64. package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
  65. package/es/components/shoppingCart/components/Cart/Product.js +96 -0
  66. package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
  67. package/es/components/shoppingCart/components/Cart/index.js +72 -0
  68. package/es/components/shoppingCart/components/Cart/index.less +68 -0
  69. package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
  70. package/es/components/shoppingCart/components/Empty/index.js +14 -0
  71. package/es/components/shoppingCart/components/Empty/index.less +19 -0
  72. package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
  73. package/es/components/shoppingCart/components/Render/index.js +68 -0
  74. package/es/components/shoppingCart/components/Render/index.less +2 -0
  75. package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
  76. package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
  77. package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
  78. package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
  79. package/es/components/shoppingCart/hooks/useAddService.js +23 -0
  80. package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
  81. package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
  82. package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
  83. package/es/components/shoppingCart/hooks/useContext.js +5 -0
  84. package/es/components/shoppingCart/index.d.ts +4 -0
  85. package/es/components/shoppingCart/index.js +24 -0
  86. package/es/components/shoppingCart/locales.d.ts +33 -0
  87. package/es/components/shoppingCart/locales.js +38 -0
  88. package/es/components/shoppingCart/mock.d.ts +40 -0
  89. package/es/components/shoppingCart/mock.js +40 -0
  90. package/es/components/shoppingCart/status.d.ts +2 -0
  91. package/es/components/shoppingCart/status.js +22 -0
  92. package/es/components/shoppingCart/type.d.ts +39 -0
  93. package/es/components/shoppingCart/type.js +1 -0
  94. package/es/components/shoppingCart/utils.d.ts +63 -0
  95. package/es/components/shoppingCart/utils.js +119 -0
  96. package/es/index.d.ts +1 -0
  97. package/es/index.js +2 -1
  98. package/lib/components/booking/components/customSelect/index.d.ts +1 -0
  99. package/lib/components/booking/components/customSelect/index.js +6 -2
  100. package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
  101. package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
  102. package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  103. package/lib/components/booking/components/footer/amount.js +26 -8
  104. package/lib/components/booking/components/footer/index.js +25 -4
  105. package/lib/components/booking/components/footer/utils.js +157 -31
  106. package/lib/components/booking/info/addServiceVariant/index.js +5 -0
  107. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  108. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
  109. package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
  110. package/lib/components/booking/info/dateRange/index.d.ts +5 -0
  111. package/lib/components/booking/info/dateRange/index.js +111 -0
  112. package/lib/components/booking/info/dateRange/index.less +21 -0
  113. package/lib/components/booking/info/main.js +11 -4
  114. package/lib/components/booking/info/model.js +3 -0
  115. package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
  116. package/lib/components/booking/info/pet/ChangePetModal/index.js +111 -0
  117. package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
  118. package/lib/components/booking/info/pet/index.js +61 -25
  119. package/lib/components/booking/info/service/addService/index.js +107 -34
  120. package/lib/components/booking/info/service/addService/index.less +13 -3
  121. package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
  122. package/lib/components/booking/info/service/addService/utils.js +31 -10
  123. package/lib/components/booking/info/service/editService/index.js +283 -125
  124. package/lib/components/booking/info/service/editService/index.less +18 -13
  125. package/lib/components/booking/info/service2/Lists.d.ts +3 -0
  126. package/lib/components/booking/info/service2/Lists.js +113 -0
  127. package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
  128. package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
  129. package/lib/components/booking/info/service2/index.d.ts +3 -0
  130. package/lib/components/booking/info/service2/index.js +75 -0
  131. package/lib/components/booking/info/service2/status.d.ts +31 -0
  132. package/lib/components/booking/info/service2/status.js +81 -0
  133. package/lib/components/booking/info/service2/utils.d.ts +145 -0
  134. package/lib/components/booking/info/service2/utils.js +322 -0
  135. package/lib/components/booking/info/utils.d.ts +9 -0
  136. package/lib/components/booking/info/utils.js +6 -0
  137. package/lib/components/booking/locales.d.ts +60 -0
  138. package/lib/components/booking/locales.js +63 -3
  139. package/lib/components/booking/materiels/holder/index.d.ts +7 -0
  140. package/lib/components/booking/materiels/holder/index.js +65 -0
  141. package/lib/components/booking/model.d.ts +4 -1
  142. package/lib/components/booking/model.js +4 -2
  143. package/lib/components/booking/utils.d.ts +12 -3
  144. package/lib/components/booking/utils.js +87 -15
  145. package/lib/components/eftpos/form/index.js +6 -12
  146. package/lib/components/eftpos/group/index.d.ts +2 -1
  147. package/lib/components/eftpos/group/index.js +1 -0
  148. package/lib/components/eftpos/index.js +2 -2
  149. package/lib/components/eftposPay/helper.d.ts +0 -1
  150. package/lib/components/eftposPay/helper.js +0 -21
  151. package/lib/components/eftposPay/tyro/index.js +7 -36
  152. package/lib/components/shoppingCart/Provider.d.ts +3 -0
  153. package/lib/components/shoppingCart/Provider.js +110 -0
  154. package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
  155. package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
  156. package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
  157. package/lib/components/shoppingCart/components/Cart/index.js +77 -0
  158. package/lib/components/shoppingCart/components/Cart/index.less +68 -0
  159. package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
  160. package/lib/components/shoppingCart/components/Empty/index.js +43 -0
  161. package/lib/components/shoppingCart/components/Empty/index.less +19 -0
  162. package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
  163. package/lib/components/shoppingCart/components/Render/index.js +79 -0
  164. package/lib/components/shoppingCart/components/Render/index.less +2 -0
  165. package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
  166. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
  167. package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
  168. package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
  169. package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
  170. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
  171. package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
  172. package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
  173. package/lib/components/shoppingCart/hooks/useContext.js +31 -0
  174. package/lib/components/shoppingCart/index.d.ts +4 -0
  175. package/lib/components/shoppingCart/index.js +60 -0
  176. package/lib/components/shoppingCart/locales.d.ts +33 -0
  177. package/lib/components/shoppingCart/locales.js +56 -0
  178. package/lib/components/shoppingCart/mock.d.ts +40 -0
  179. package/lib/components/shoppingCart/mock.js +76 -0
  180. package/lib/components/shoppingCart/status.d.ts +2 -0
  181. package/lib/components/shoppingCart/status.js +60 -0
  182. package/lib/components/shoppingCart/type.d.ts +39 -0
  183. package/lib/components/shoppingCart/type.js +17 -0
  184. package/lib/components/shoppingCart/utils.d.ts +63 -0
  185. package/lib/components/shoppingCart/utils.js +92 -0
  186. package/lib/index.d.ts +1 -0
  187. package/lib/index.js +3 -0
  188. package/lowcode/shopping-cart/meta.ts +98 -0
  189. package/package.json +4 -4
  190. package/es/components/eftpos/receipt/index.d.ts +0 -24
  191. package/es/components/eftpos/receipt/index.js +0 -96
  192. package/lib/components/eftpos/receipt/index.d.ts +0 -24
  193. package/lib/components/eftpos/receipt/index.js +0 -88
@@ -0,0 +1,65 @@
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/materiels/holder/index.tsx
30
+ var holder_exports = {};
31
+ __export(holder_exports, {
32
+ default: () => holder_default
33
+ });
34
+ module.exports = __toCommonJS(holder_exports);
35
+ var import_antd = require("antd");
36
+ var import_model = require("../../info/model");
37
+ var import_react = __toESM(require("react"));
38
+ var import_useSelectPet = __toESM(require("../../info/service2/hooks/useSelectPet"));
39
+ var Holder = (props) => {
40
+ var _a;
41
+ const { selectProps, ...resetProps } = props;
42
+ const { state } = (0, import_react.useContext)(import_model.Context);
43
+ const { holderLists } = (0, import_useSelectPet.default)(state);
44
+ const holders = (0, import_react.useMemo)(() => {
45
+ const lists = holderLists == null ? void 0 : holderLists.filter((d) => (d == null ? void 0 : d.id) > 0);
46
+ if (!(lists == null ? void 0 : lists.length))
47
+ return [];
48
+ return lists.map((d) => {
49
+ return {
50
+ value: d == null ? void 0 : d.id,
51
+ label: d == null ? void 0 : d.main_field
52
+ };
53
+ });
54
+ }, [(_a = state == null ? void 0 : state.pet) == null ? void 0 : _a.value]);
55
+ const renderOptions = (0, import_react.useCallback)(
56
+ (array, value = "value", label = "label") => {
57
+ return array.map((d) => {
58
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d[value], key: d[value], disabled: d.disabled }, d[label]);
59
+ });
60
+ },
61
+ []
62
+ );
63
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Select, { ...selectProps, ...resetProps }, renderOptions(holders));
64
+ };
65
+ var holder_default = Holder;
@@ -29,6 +29,7 @@ export interface FormState {
29
29
  };
30
30
  date: {
31
31
  value: any;
32
+ end_date: any;
32
33
  edit: boolean;
33
34
  };
34
35
  service: {
@@ -75,7 +76,7 @@ export interface FormState {
75
76
  bookingId: string | number;
76
77
  bookingDetail: any;
77
78
  channelDisabledEdit: boolean;
78
- renderType?: 'eventBooking';
79
+ renderType?: 'eventBooking' | 'dayBooking';
79
80
  modalOpen?: boolean;
80
81
  isTerminal?: boolean;
81
82
  isFranchisee?: boolean;
@@ -96,6 +97,8 @@ export interface FormState {
96
97
  /** 是否terminal创建booking页面 */
97
98
  isBookingCreatePage?: boolean;
98
99
  loading: boolean;
100
+ isTerminalDayBookingPage?: boolean;
101
+ activeCartId?: any[];
99
102
  }
100
103
  export declare const walkInData: {
101
104
  id: number;
@@ -72,7 +72,8 @@ var defaultState = {
72
72
  value: walkInData
73
73
  },
74
74
  date: {
75
- value: (0, import_dayjs.default)()
75
+ value: (0, import_dayjs.default)(),
76
+ end_date: (0, import_dayjs.default)().add(1, "days")
76
77
  },
77
78
  service: {
78
79
  addModal: false,
@@ -123,7 +124,8 @@ var defaultState = {
123
124
  action: (props) => {
124
125
  console.log(props);
125
126
  },
126
- bookingId: 0
127
+ bookingId: 0,
128
+ activeCartId: [0]
127
129
  };
128
130
  var { Provider, Context } = (0, import_utils.miniRedux)({
129
131
  namespace: "state",
@@ -21,7 +21,7 @@ export declare const request: Request;
21
21
  * @Author: zhiwei.Wang
22
22
  * @Date: 2024-04-26 14:00
23
23
  */
24
- export declare const getDiscountTime: (service_times: number) => string;
24
+ export declare const getDiscountTime: (service_times: number, isDay?: boolean) => string;
25
25
  /**
26
26
  * @title: 时间切片
27
27
  * @description:
@@ -31,7 +31,7 @@ export declare const getDiscountTime: (service_times: number) => string;
31
31
  * @Author: zhiwei.Wang
32
32
  * @Date: 2024-04-26 13:59
33
33
  */
34
- export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
34
+ export declare const sliceDayIntoFiveMinutes: (config: any, locale: string, isDay?: boolean) => {
35
35
  timeSlices: {
36
36
  label: string;
37
37
  value: string;
@@ -115,7 +115,7 @@ export declare const getServiceTimes: (service: any) => {
115
115
  startDate: dayjs.Dayjs;
116
116
  endDate: dayjs.Dayjs;
117
117
  };
118
- export declare const getErrorList: (resource: any, cacheItem: any) => {
118
+ export declare const getErrorList: (resource: any, cacheItem: any, isDay?: boolean) => {
119
119
  label: any;
120
120
  type: string;
121
121
  }[];
@@ -131,6 +131,15 @@ export declare const formatResource: (resourceItem: any, cacheItem?: any, format
131
131
  export declare const getLastServer: (list: any) => any;
132
132
  export declare const getCacheParams: () => any;
133
133
  export declare const deleteCacheParams: () => void;
134
+ /**
135
+ * @title: 获取跨日预约的时长
136
+ * @description:
137
+ * @param {any} cacheItem
138
+ * @return {*}
139
+ * @Author: WangHan
140
+ * @Date: 2024-12-01 22:43
141
+ */
142
+ export declare const getDays: (cacheItem: any, type: 'minutes' | 'days') => any;
134
143
  /**
135
144
  * @title: 创建一个服务商品
136
145
  * @description:
@@ -37,6 +37,7 @@ __export(utils_exports, {
37
37
  formatResource: () => formatResource,
38
38
  formatTimes: () => formatTimes,
39
39
  getCacheParams: () => getCacheParams,
40
+ getDays: () => getDays,
40
41
  getDiscountTime: () => getDiscountTime,
41
42
  getDuration: () => getDuration,
42
43
  getEndDate: () => getEndDate,
@@ -59,6 +60,7 @@ __export(utils_exports, {
59
60
  module.exports = __toCommonJS(utils_exports);
60
61
  var import_dayjs = __toESM(require("dayjs"));
61
62
  var import_utils = require("@pisell/utils");
63
+ var import_utils2 = require("./info/service2/utils");
62
64
  var import_lodash = require("lodash");
63
65
  var Request = class {
64
66
  constructor() {
@@ -72,10 +74,13 @@ var Request = class {
72
74
  }
73
75
  };
74
76
  var request = new Request();
75
- var getDiscountTime = (service_times) => {
76
- if (!service_times) {
77
+ var getDiscountTime = (service_times, isDay) => {
78
+ if (!service_times || service_times < 0) {
77
79
  return "";
78
80
  }
81
+ if (isDay) {
82
+ return `${service_times} ${import_utils.locales.getText("pisell2.text.day")(service_times)}`;
83
+ }
79
84
  if (service_times < 60) {
80
85
  return `${service_times} ${import_utils.locales.getText("pisell2.text.min")}`;
81
86
  } else {
@@ -89,7 +94,7 @@ var getDiscountTime = (service_times) => {
89
94
  return str;
90
95
  }
91
96
  };
92
- var sliceDayIntoFiveMinutes = (config, locale) => {
97
+ var sliceDayIntoFiveMinutes = (config, locale, isDay) => {
93
98
  let _locale = locale;
94
99
  let dayjsLocale = _locale === "en-US" || _locale === "en" ? "en" : "zh-cn";
95
100
  import_dayjs.default.locale(dayjsLocale);
@@ -99,6 +104,20 @@ var sliceDayIntoFiveMinutes = (config, locale) => {
99
104
  let timeSlices = [];
100
105
  let durationSlicesBasedOnTime = [];
101
106
  let currentTime = startTime;
107
+ if (isDay) {
108
+ let currentDay = 1;
109
+ while (currentDay <= 30) {
110
+ const timeLabel = currentTime.format("hh:mm A");
111
+ const timeValue = currentTime.format("HH:mm");
112
+ timeSlices.push({ label: timeLabel, value: timeValue });
113
+ durationSlicesBasedOnTime.push({
114
+ label: `${currentDay} ${import_utils.locales.getText("pisell2.text.day")(currentDay)}`,
115
+ value: currentDay
116
+ });
117
+ currentDay++;
118
+ }
119
+ return { timeSlices, durationSlicesBasedOnTime };
120
+ }
102
121
  while (currentTime.isBefore(endTime)) {
103
122
  const timeLabel = currentTime.format("hh:mm A");
104
123
  const timeValue = currentTime.format("HH:mm");
@@ -251,6 +270,23 @@ var getResourceTimeIsUsable = (item, cacheItem) => {
251
270
  return time;
252
271
  };
253
272
  var formatTimes = (resourceItem, cacheItem) => {
273
+ var _a;
274
+ if (((_a = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a.sub_type) === "days") {
275
+ const isResourceItem = (resourceItem == null ? void 0 : resourceItem.form_record_id) > 0;
276
+ let isMaxLimitRange = (resourceItem == null ? void 0 : resourceItem.sold_out) === 1;
277
+ let isDateRange = (resourceItem == null ? void 0 : resourceItem.available_status) === 1;
278
+ const isUsable = isDateRange && !isMaxLimitRange;
279
+ const usableTime = {
280
+ isMaxLimitRange,
281
+ isDateRange,
282
+ isUsable: isResourceItem ? isUsable : true
283
+ };
284
+ resourceItem._extend = {
285
+ ...resourceItem._extend,
286
+ usableTime
287
+ };
288
+ return resourceItem;
289
+ }
254
290
  let usableTimes = [];
255
291
  let _resourceItem = { ...resourceItem };
256
292
  _resourceItem.times = _resourceItem.times.map((time) => {
@@ -371,8 +407,8 @@ var getServiceTimes = (service) => {
371
407
  endDate
372
408
  };
373
409
  };
374
- var getErrorList = (resource, cacheItem) => {
375
- var _a, _b, _c;
410
+ var getErrorList = (resource, cacheItem, isDay) => {
411
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
376
412
  if (!(cacheItem == null ? void 0 : cacheItem.id)) {
377
413
  return [
378
414
  {
@@ -395,13 +431,21 @@ var getErrorList = (resource, cacheItem) => {
395
431
  type: "product"
396
432
  });
397
433
  }
398
- const { startDate, endDate } = getServiceTimes(cacheItem);
399
- const startText = startDate.format("hh:mm A");
400
- let endText = endDate.format("hh:mm A");
401
- if ((0, import_dayjs.default)(endDate).isAfter(startDate, "day")) {
402
- endText = import_utils.locales.getText("pisell1.text.tomorrow") + endText;
434
+ let startText = "";
435
+ let endText = "";
436
+ if (isDay) {
437
+ const { start_date, end_date } = cacheItem == null ? void 0 : cacheItem._extend;
438
+ startText = start_date == null ? void 0 : start_date.format("YYYY-MM-DD");
439
+ endText = end_date ? end_date == null ? void 0 : end_date.format("YYYY-MM-DD") : "";
440
+ } else {
441
+ const { startDate, endDate } = getServiceTimes(cacheItem);
442
+ startText = startDate.format("hh:mm A");
443
+ endText = endDate.format("hh:mm A");
444
+ if ((0, import_dayjs.default)(endDate).isAfter(startDate, "day")) {
445
+ endText = import_utils.locales.getText("pisell1.text.tomorrow") + endText;
446
+ }
403
447
  }
404
- if (!((_b = resource._extend) == null ? void 0 : _b.usableTime)) {
448
+ if (isDay ? !((_c = (_b = resource._extend) == null ? void 0 : _b.usableTime) == null ? void 0 : _c.isDateRange) : !((_d = resource._extend) == null ? void 0 : _d.usableTime)) {
405
449
  list.push({
406
450
  label: import_utils.locales.getText("pisell1.text.resource-error-message-2")(
407
451
  resource.labelText,
@@ -411,7 +455,7 @@ var getErrorList = (resource, cacheItem) => {
411
455
  type: "time"
412
456
  });
413
457
  } else {
414
- if (!((_c = resource._extend) == null ? void 0 : _c.usableTime._extend.isMaxLimitRange)) {
458
+ if (isDay ? (_f = (_e = resource._extend) == null ? void 0 : _e.usableTime) == null ? void 0 : _f.isMaxLimitRange : !((_i = (_h = (_g = resource._extend) == null ? void 0 : _g.usableTime) == null ? void 0 : _h._extend) == null ? void 0 : _i.isMaxLimitRange)) {
415
459
  list.push({
416
460
  label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(
417
461
  resource.labelText,
@@ -426,11 +470,15 @@ var getErrorList = (resource, cacheItem) => {
426
470
  return list;
427
471
  };
428
472
  var formatResource = (resourceItem, cacheItem, formatLabel) => {
473
+ var _a, _b, _c, _d;
429
474
  let _resourceItem = { ...resourceItem };
430
475
  _resourceItem = formatTimes(_resourceItem, cacheItem);
431
476
  _resourceItem = formatResourceProducts(_resourceItem, cacheItem);
432
477
  _resourceItem.labelText = _resourceItem.room_name || _resourceItem.name;
433
- const usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
478
+ let usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
479
+ if (((_a = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _a.sub_type) === "days") {
480
+ usable = ((_c = (_b = _resourceItem._extend) == null ? void 0 : _b.usableTime) == null ? void 0 : _c.isUsable) && ((_d = _resourceItem._extend) == null ? void 0 : _d.usableProduct);
481
+ }
434
482
  _resourceItem.usable = usable;
435
483
  if (formatLabel) {
436
484
  _resourceItem.label = formatLabel(_resourceItem);
@@ -448,14 +496,25 @@ var getCacheParams = () => {
448
496
  var deleteCacheParams = () => {
449
497
  sessionStorage.removeItem("pisell2.booking.serviceParams");
450
498
  };
499
+ var getDays = (cacheItem, type) => {
500
+ var _a, _b;
501
+ if (type === "days") {
502
+ const { start_date, end_date } = (0, import_utils2.formatDayDate)(cacheItem._extend);
503
+ return end_date.diff(start_date, "day");
504
+ }
505
+ let startDate = (0, import_dayjs.default)((_a = cacheItem._extend) == null ? void 0 : _a.start_date);
506
+ let endDate = (0, import_dayjs.default)((_b = cacheItem._extend) == null ? void 0 : _b.end_date);
507
+ return endDate.diff(startDate, type);
508
+ };
451
509
  var getServerItemExtend = (state, cacheItem, timeObj) => {
452
510
  var _a;
453
511
  if (!cacheItem.new && cacheItem._extend.endDate) {
454
512
  return cacheItem._extend;
455
513
  }
456
- let lastServer = getLastServer(state.service.value);
514
+ const isDay = (0, import_utils2.isDayBooking)(state);
515
+ let lastServer = isDay ? false : getLastServer(state.service.value);
457
516
  let _extend = {
458
- duration: findNextDuration(
517
+ duration: isDay ? getDays(cacheItem, "days") : findNextDuration(
459
518
  cacheItem.duration,
460
519
  timeObj.durationSlicesBasedOnTime,
461
520
  (_a = cacheItem == null ? void 0 : cacheItem.duration) == null ? void 0 : _a.value
@@ -501,6 +560,10 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
501
560
  ..._extend,
502
561
  ...cacheItem._extend
503
562
  };
563
+ if (isDay) {
564
+ const { start_date, end_date } = (0, import_utils2.formatDayDate)(_extend);
565
+ _extend = { ..._extend, start_date, end_date };
566
+ }
504
567
  return _extend;
505
568
  };
506
569
  var getProductTotalPrice = (item) => {
@@ -508,11 +571,19 @@ var getProductTotalPrice = (item) => {
508
571
  let price = 0;
509
572
  price += Number(item._extend.price);
510
573
  let other = (_a = item._extend) == null ? void 0 : _a.other;
574
+ if (other == null ? void 0 : other.product_variant_id) {
575
+ price = Number(other == null ? void 0 : other.price);
576
+ }
511
577
  if (other == null ? void 0 : other.bundle) {
512
578
  price = other == null ? void 0 : other.bundle.reduce((accumulator, currentValue) => {
513
579
  return accumulator + Number(currentValue.price) * Number(currentValue.num);
514
580
  }, price);
515
581
  }
582
+ if (other == null ? void 0 : other.option) {
583
+ price = other == null ? void 0 : other.option.reduce((accumulator, currentValue) => {
584
+ return accumulator + Number(currentValue.price) * Number(currentValue.num);
585
+ }, price);
586
+ }
516
587
  price = price;
517
588
  return price;
518
589
  };
@@ -577,6 +648,7 @@ var getIsEdit = (state) => {
577
648
  formatResource,
578
649
  formatTimes,
579
650
  getCacheParams,
651
+ getDays,
580
652
  getDiscountTime,
581
653
  getDuration,
582
654
  getEndDate,
@@ -37,7 +37,6 @@ var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_group = require("../group");
39
39
  var import_surcharge = __toESM(require("../surcharge"));
40
- var import_receipt = __toESM(require("../receipt"));
41
40
  var import_deviceList = __toESM(require("../deviceList"));
42
41
  var Mapping = {
43
42
  Input: import_antd.Input,
@@ -59,8 +58,7 @@ var Mapping = {
59
58
  };
60
59
  var CustomMapping = {
61
60
  Surcharge: import_surcharge.default,
62
- DeviceList: import_deviceList.default,
63
- Receipt: import_receipt.default
61
+ DeviceList: import_deviceList.default
64
62
  };
65
63
  var CustomFormItem = ({
66
64
  formItemList,
@@ -74,27 +72,27 @@ var CustomFormItem = ({
74
72
  {
75
73
  formItemList: item.children,
76
74
  onChange,
77
- key: item.name ? `${item.name}${level}` : `${Component}${index}${level}`,
75
+ key: item.name ? item.name + level : Component + index + level,
78
76
  level: level + 1
79
77
  }
80
78
  );
81
79
  }
82
80
  if (typeof Component === "object") {
83
- return /* @__PURE__ */ import_react.default.createElement(Component, { ...item, key: `${item.name}${level}` });
81
+ return /* @__PURE__ */ import_react.default.createElement(Component, { ...item, key: item.name + level });
84
82
  }
85
83
  if (Mapping[Component]) {
86
84
  const Comm = Mapping[Component];
87
85
  const { input, ...formItemProps } = item;
88
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: `${item.name}${level}` }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
86
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: item.name + level }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
89
87
  }
90
88
  if (Mapping[Component]) {
91
89
  const Comm = Mapping[Component];
92
90
  const { input, ...formItemProps } = item;
93
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: `${item.name}${level}` }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
91
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: item.name + level }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
94
92
  }
95
93
  if (CustomMapping[Component]) {
96
94
  const Comm = CustomMapping[Component];
97
- return /* @__PURE__ */ import_react.default.createElement(Comm, { ...item, key: `${item.name}${level}` });
95
+ return /* @__PURE__ */ import_react.default.createElement(Comm, { ...item, key: item.name + level });
98
96
  }
99
97
  throw TypeError(
100
98
  `pos物料库 输入组件类型 ${Component} 无法映射,请正确传入组件类型`
@@ -106,10 +104,6 @@ var helpMapping = {
106
104
  Surcharge: {
107
105
  getCommName: import_surcharge.getCommName,
108
106
  getCommDefaultVal: import_surcharge.getCommDefaultVal
109
- },
110
- Receipt: {
111
- getCommName: import_receipt.getCommName,
112
- getCommDefaultVal: import_receipt.getCommDefaultVal
113
107
  }
114
108
  };
115
109
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from 'antd';
3
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
4
- export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
4
+ export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
5
5
  direction?: "vertical" | undefined;
6
+ component: string;
6
7
  }) => React.JSX.Element;
@@ -54,6 +54,7 @@ var CheckboxGroup = ({
54
54
  var RadioGroup = ({
55
55
  direction,
56
56
  options,
57
+ component,
57
58
  ...props
58
59
  }) => {
59
60
  if (direction === "vertical") {
@@ -73,7 +73,7 @@ var PosTabs = (0, import_react.forwardRef)(
73
73
  {
74
74
  className: `pisell-lowcode__pos_circle ${active2 ? "active" : ""}`
75
75
  },
76
- /* @__PURE__ */ import_react.default.createElement(import_apiKey.default, { color: active2 ? "#fff" : "#98A2B3" })
76
+ /* @__PURE__ */ import_react.default.createElement(import_device2.default, { color: active2 ? "#fff" : "#98A2B3" })
77
77
  ), /* @__PURE__ */ import_react.default.createElement(
78
78
  "span",
79
79
  {
@@ -90,7 +90,7 @@ var PosTabs = (0, import_react.forwardRef)(
90
90
  {
91
91
  className: `pisell-lowcode__pos_circle ${active2 ? "active" : ""}`
92
92
  },
93
- /* @__PURE__ */ import_react.default.createElement(import_device2.default, { color: active2 ? "#fff" : "#98A2B3" })
93
+ /* @__PURE__ */ import_react.default.createElement(import_apiKey.default, { color: active2 ? "#fff" : "#98A2B3" })
94
94
  ), /* @__PURE__ */ import_react.default.createElement(
95
95
  "span",
96
96
  {
@@ -74,5 +74,4 @@ export declare function getPayAmonunt({ money, amount, surRate, surMoney }: Amou
74
74
  surRateMoney: string;
75
75
  totalUnit: string;
76
76
  };
77
- export declare function getBrowserVersion(): string;
78
77
  export {};
@@ -21,7 +21,6 @@ var helper_exports = {};
21
21
  __export(helper_exports, {
22
22
  cloneDeep: () => cloneDeep,
23
23
  getAmonunt: () => getAmonunt,
24
- getBrowserVersion: () => getBrowserVersion,
25
24
  getPayAmonunt: () => getPayAmonunt,
26
25
  getPayParams: () => getPayParams,
27
26
  getUuid: () => getUuid,
@@ -186,30 +185,10 @@ function getPayAmonunt({ money, amount, surRate, surMoney }, formatAmount) {
186
185
  totalUnit: formatAmount(total)
187
186
  };
188
187
  }
189
- function getBrowserVersion() {
190
- const Sys = {};
191
- const ua = navigator.userAgent.toLowerCase();
192
- let s;
193
- (s = ua.match(/rv:([\d.]+)\) like gecko/)) ? Sys.ie = s[1] : (s = ua.match(/msie ([\d\.]+)/)) ? Sys.ie = s[1] : (s = ua.match(/edge\/([\d\.]+)/)) ? Sys.edge = s[1] : (s = ua.match(/firefox\/([\d\.]+)/)) ? Sys.firefox = s[1] : (s = ua.match(/(?:opera|opr).([\d\.]+)/)) ? Sys.opera = s[1] : (s = ua.match(/chrome\/([\d\.]+)/)) ? Sys.chrome = s[1] : (s = ua.match(/version\/([\d\.]+).*safari/)) ? Sys.safari = s[1] : 0;
194
- if (Sys.ie)
195
- return "IE: " + Sys.ie;
196
- if (Sys.edge)
197
- return "EDGE: " + Sys.edge;
198
- if (Sys.firefox)
199
- return "Firefox: " + Sys.firefox;
200
- if (Sys.chrome)
201
- return "Chrome: " + Sys.chrome;
202
- if (Sys.opera)
203
- return "Opera: " + Sys.opera;
204
- if (Sys.safari)
205
- return "Safari: " + Sys.safari;
206
- return "Unkonwn";
207
- }
208
188
  // Annotate the CommonJS export names for ESM import in node:
209
189
  0 && (module.exports = {
210
190
  cloneDeep,
211
191
  getAmonunt,
212
- getBrowserVersion,
213
192
  getPayAmonunt,
214
193
  getPayParams,
215
194
  getUuid,
@@ -64,20 +64,6 @@ var tyro_default = ({
64
64
  const requestIdRef = (0, import_react.useRef)((custom == null ? void 0 : custom.requestId) || "");
65
65
  const unloadRef = (0, import_react.useRef)(false);
66
66
  const clearRef = (0, import_react.useRef)();
67
- const isPrint = (key) => {
68
- var _a, _b, _c, _d;
69
- if ((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts) {
70
- return false;
71
- }
72
- const receiptList = (_d = (_c = deviceRef.current) == null ? void 0 : _c.setting) == null ? void 0 : _d.receiptList;
73
- if (!Array.isArray(receiptList)) {
74
- return true;
75
- }
76
- if (Array.isArray(receiptList) && receiptList.some((item) => item === key)) {
77
- return true;
78
- }
79
- return false;
80
- };
81
67
  (0, import_react.useEffect)(() => {
82
68
  listRef.current = (custom == null ? void 0 : custom.list) || [];
83
69
  }, [custom == null ? void 0 : custom.list]);
@@ -128,16 +114,12 @@ var tyro_default = ({
128
114
  );
129
115
  requestParams.current = {
130
116
  amount: new import_decimal.Decimal(amountRef.current || 0).mul(100).toFixed(0, import_decimal.Decimal.ROUND_HALF_UP),
131
- // 打印小票 true 打印到Pisell系统上 false 打印到pos机上
117
+ // 打印小票 true 打印到系统上 false 打印到pos机上
132
118
  integratedReceipt: !((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts),
133
119
  integrationKey,
134
120
  transactionId: numRef.current,
135
121
  mid,
136
- tid,
137
- device: JSON.stringify(deviceRef.current),
138
- isPrintMerchant: isPrint("merchant"),
139
- isPrintCustomer: isPrint("customer"),
140
- browserVersion: (0, import_helper.getBrowserVersion)()
122
+ tid
141
123
  };
142
124
  dispatch(
143
125
  (0, import_store.updateCustom)({
@@ -204,11 +186,7 @@ var tyro_default = ({
204
186
  integrationKey,
205
187
  transactionId: numRef.current,
206
188
  mid,
207
- tid,
208
- device: JSON.stringify(deviceRef.current),
209
- isPrintMerchant: isPrint("merchant"),
210
- isPrintCustomer: isPrint("customer"),
211
- browserVersion: (0, import_helper.getBrowserVersion)()
189
+ tid
212
190
  };
213
191
  dispatch(
214
192
  (0, import_store.updateCustom)({
@@ -266,14 +244,8 @@ var tyro_default = ({
266
244
  console.log("商家小票 客户端是否打印小票 = ", signatureRequired);
267
245
  console.log("商家小票 小票内容 = \n", merchantReceipt);
268
246
  const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
247
+ onChange("print", receipt);
269
248
  merchantReceiptRef.current = { signatureRequired, merchantReceipt };
270
- if (signatureRequired) {
271
- onChange("print", receipt);
272
- return;
273
- }
274
- if (isPrint("merchant")) {
275
- onChange("print", receipt);
276
- }
277
249
  };
278
250
  const statusMessageCallbackImpl = (message) => {
279
251
  var _a;
@@ -409,6 +381,7 @@ var tyro_default = ({
409
381
  })
410
382
  );
411
383
  clearRef.current = setTimeout(() => {
384
+ var _a2;
412
385
  const params = (0, import_helper.getPayParams)(
413
386
  {
414
387
  mode: modeRef.current,
@@ -425,16 +398,14 @@ var tyro_default = ({
425
398
  );
426
399
  onChange("success", {
427
400
  ...params,
428
- receipt: isPrint("customer") ? receipt : []
401
+ receipt: ((_a2 = deviceRef.current) == null ? void 0 : _a2.setting.receipts) ? [] : receipt
429
402
  });
430
403
  }, 1e3);
431
404
  return;
432
405
  } else {
433
406
  const current = ((_b = deviceRef.current) == null ? void 0 : _b.setting.receipts) ? [] : receipt;
434
407
  if (current.length > 0) {
435
- if (isPrint("customer")) {
436
- onChange("print", receipt);
437
- }
408
+ onChange("print", current);
438
409
  }
439
410
  }
440
411
  if (response.result === "UNKNOWN") {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const CartContext: React.Context<any>;
3
+ export declare const CartProvider: ({ children, props, onCard, onChange, onAddProduct, onActiveKey, }: any) => React.JSX.Element;