@pisell/private-materials 3.0.151-gray → 3.0.151

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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +12 -12
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/components/footer/index.js +3 -3
  13. package/es/components/booking/forms/forms.d.ts +0 -1
  14. package/es/components/booking/forms/forms.js +2 -4
  15. package/es/components/booking/forms/model.d.ts +1 -2
  16. package/es/components/booking/forms/single/index.d.ts +1 -1
  17. package/es/components/booking/forms/single/index.js +3 -4
  18. package/es/components/booking/info/index.js +1 -2
  19. package/es/components/booking/info/index.less +0 -9
  20. package/es/components/booking/info/pet/index.js +1 -1
  21. package/es/components/booking/info/service/addService/index.d.ts +2 -8
  22. package/es/components/booking/info/service/addService/index.js +36 -82
  23. package/es/components/booking/info/service/addService/index.less +1 -27
  24. package/es/components/booking/info/service/editService/index.js +9 -7
  25. package/es/components/booking/locales.d.ts +0 -48
  26. package/es/components/booking/locales.js +3 -51
  27. package/es/components/booking/model.d.ts +0 -2
  28. package/es/components/booking/notes/index.d.ts +1 -1
  29. package/es/components/booking/notes/model.d.ts +1 -2
  30. package/es/components/booking/payments/model.d.ts +1 -2
  31. package/es/components/booking/utils.d.ts +1 -1
  32. package/es/components/booking/utils.js +51 -54
  33. package/es/components/eftposPay/index.js +2 -0
  34. package/es/components/eftposPay/tyro/index.js +11 -8
  35. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +2 -1
  36. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +5 -4
  37. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +2 -1
  38. package/es/components/pay/toC/utils.d.ts +11 -0
  39. package/es/components/pay/toC/utils.js +27 -0
  40. package/es/components/schedules/index.d.ts +1 -1
  41. package/es/components/schedules/model.d.ts +1 -2
  42. package/es/index.d.ts +0 -2
  43. package/es/index.js +1 -3
  44. package/lib/components/booking/addons/model.d.ts +1 -2
  45. package/lib/components/booking/components/footer/index.js +3 -3
  46. package/lib/components/booking/forms/forms.d.ts +0 -1
  47. package/lib/components/booking/forms/forms.js +2 -5
  48. package/lib/components/booking/forms/model.d.ts +1 -2
  49. package/lib/components/booking/forms/single/index.d.ts +1 -1
  50. package/lib/components/booking/forms/single/index.js +2 -4
  51. package/lib/components/booking/info/client/index.js +8 -1
  52. package/lib/components/booking/info/index.js +1 -4
  53. package/lib/components/booking/info/index.less +0 -9
  54. package/lib/components/booking/info/pet/index.js +1 -2
  55. package/lib/components/booking/info/service/addService/index.d.ts +2 -8
  56. package/lib/components/booking/info/service/addService/index.js +29 -67
  57. package/lib/components/booking/info/service/addService/index.less +1 -27
  58. package/lib/components/booking/info/service/editService/index.js +3 -6
  59. package/lib/components/booking/locales.d.ts +0 -48
  60. package/lib/components/booking/locales.js +3 -51
  61. package/lib/components/booking/model.d.ts +0 -2
  62. package/lib/components/booking/notes/index.d.ts +1 -1
  63. package/lib/components/booking/notes/model.d.ts +1 -2
  64. package/lib/components/booking/payments/model.d.ts +1 -2
  65. package/lib/components/booking/utils.d.ts +1 -1
  66. package/lib/components/booking/utils.js +22 -57
  67. package/lib/components/eftposPay/index.js +2 -0
  68. package/lib/components/eftposPay/tyro/index.js +7 -6
  69. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +5 -1
  70. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +6 -3
  71. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +5 -1
  72. package/lib/components/pay/toC/utils.d.ts +11 -0
  73. package/lib/components/pay/toC/utils.js +26 -2
  74. package/lib/components/schedules/index.d.ts +1 -1
  75. package/lib/components/schedules/model.d.ts +1 -2
  76. package/lib/index.d.ts +0 -2
  77. package/lib/index.js +0 -6
  78. package/package.json +4 -4
  79. package/es/components/booking/dashboard/index.d.ts +0 -10
  80. package/es/components/booking/dashboard/index.js +0 -242
  81. package/es/components/booking/dashboard/serve.d.ts +0 -1
  82. package/es/components/booking/dashboard/serve.js +0 -27
  83. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
  84. package/es/components/booking/info/addServiceVariant/index.js +0 -33
  85. package/lib/components/booking/dashboard/index.d.ts +0 -10
  86. package/lib/components/booking/dashboard/index.js +0 -225
  87. package/lib/components/booking/dashboard/serve.d.ts +0 -1
  88. package/lib/components/booking/dashboard/serve.js +0 -33
  89. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
  90. package/lib/components/booking/info/addServiceVariant/index.js +0 -58
  91. package/lowcode/booking-dashboard/meta.ts +0 -130
  92. package/lowcode/booking-vertical-add-service/meta.ts +0 -124
  93. package/lowcode/vertical-add-service/meta.ts +0 -71
@@ -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: {
@@ -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: {
@@ -62,7 +62,7 @@ export declare const getServeStartTime: (start_time: string) => string;
62
62
  * @Date: 2024-04-26 14:04
63
63
  */
64
64
  export declare const getServiceTime: (item: any, currentDate: any) => string;
65
- export declare const findNextSlice: ({ timeSlices, index, date, }: {
65
+ export declare const findNextSlice: ({ timeSlices, index, date }: {
66
66
  timeSlices: any[];
67
67
  index?: number | undefined;
68
68
  date?: string | undefined;
@@ -14,7 +14,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
14
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import dayjs from 'dayjs';
17
- import { locales } from '@pisell/utils';
17
+ import { locales } from "@pisell/utils";
18
18
  import { intersectionBy } from 'lodash';
19
19
  var Request = /*#__PURE__*/function () {
20
20
  function Request() {
@@ -38,7 +38,7 @@ export var request = new Request();
38
38
 
39
39
  /**
40
40
  * @title: 格式化持续时长用于展示
41
- * @description:
41
+ * @description:
42
42
  * @param {number} service_times
43
43
  * @return {*}
44
44
  * @Author: zhiwei.Wang
@@ -46,12 +46,12 @@ export var request = new Request();
46
46
  */
47
47
  export var getDiscountTime = function getDiscountTime(service_times) {
48
48
  if (!service_times) {
49
- return '';
49
+ return "";
50
50
  }
51
51
  if (service_times < 60) {
52
52
  return "".concat(service_times, " ").concat(locales.getText('pisell2.text.min'));
53
53
  } else {
54
- var str = '';
54
+ var str = "";
55
55
  var hours = Math.floor(service_times / 60);
56
56
  var minutes = service_times % 60;
57
57
  str += "".concat(hours).concat(locales.getText('pisell2.text.h'));
@@ -64,7 +64,7 @@ export var getDiscountTime = function getDiscountTime(service_times) {
64
64
 
65
65
  /**
66
66
  * @title: 时间切片
67
- * @description:
67
+ * @description:
68
68
  * @param {any} config
69
69
  * @param {string} locale
70
70
  * @return {*}
@@ -75,22 +75,22 @@ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, lo
75
75
  var _locale = locale;
76
76
  var dayjsLocale = _locale === 'en-US' || _locale === 'en' ? 'en' : 'zh-cn';
77
77
  dayjs.locale(dayjsLocale);
78
- var startTime = dayjs().startOf('day');
79
- var endTime = dayjs().endOf('day');
78
+ var startTime = dayjs().startOf("day");
79
+ var endTime = dayjs().endOf("day");
80
80
  var timeSlice = (config === null || config === void 0 ? void 0 : config.value) || 5; // 切片时间间隔(分钟)
81
81
 
82
82
  var timeSlices = [];
83
83
  var durationSlicesBasedOnTime = [];
84
84
  var currentTime = startTime;
85
85
  while (currentTime.isBefore(endTime)) {
86
- var timeLabel = currentTime.format('hh:mm A');
87
- var timeValue = currentTime.format('HH:mm');
86
+ var timeLabel = currentTime.format("hh:mm A");
87
+ var timeValue = currentTime.format("HH:mm");
88
88
  timeSlices.push({
89
89
  label: timeLabel,
90
90
  value: timeValue
91
91
  });
92
- var nextTime = currentTime.add(timeSlice, 'minute');
93
- var durationValue = nextTime.diff(startTime, 'minute');
92
+ var nextTime = currentTime.add(timeSlice, "minute");
93
+ var durationValue = nextTime.diff(startTime, "minute");
94
94
  if (durationValue > 60) {
95
95
  var durationLabel = getDiscountTime(durationValue);
96
96
  durationSlicesBasedOnTime.push({
@@ -114,7 +114,7 @@ export var sliceDayIntoFiveMinutes = function sliceDayIntoFiveMinutes(config, lo
114
114
 
115
115
  // 获取当前时间
116
116
  export var getNowTime = function getNowTime() {
117
- return dayjs().format('HH:mm');
117
+ return dayjs().format("HH:mm");
118
118
  };
119
119
  export var isNowTime = function isNowTime(time) {
120
120
  return time === 'now';
@@ -122,7 +122,7 @@ export var isNowTime = function isNowTime(time) {
122
122
 
123
123
  /**
124
124
  * @title: 获取服务的开始时间, 如果是now 转换为当前的时间
125
- * @description:
125
+ * @description:
126
126
  * @param {string} start_time
127
127
  * @return {*}
128
128
  * @Author: zhiwei.Wang
@@ -137,7 +137,7 @@ export var getServeStartTime = function getServeStartTime(start_time) {
137
137
 
138
138
  /**
139
139
  * @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
140
- * @description:
140
+ * @description:
141
141
  * @param {any} item
142
142
  * @param {any} currentDate
143
143
  * @return {*}
@@ -146,8 +146,8 @@ export var getServeStartTime = function getServeStartTime(start_time) {
146
146
  */
147
147
  export var getServiceTime = function getServiceTime(item, currentDate) {
148
148
  var startDate = dayjs(currentDate.format('YYYY-MM-DD') + ' ' + getServeStartTime(item._extend.start_time));
149
- var startTime = startDate.format('HH:mm');
150
- var endTime = startDate.add(flexibleObj.getValue(item._extend.duration), 'minute').format('HH:mm');
149
+ var startTime = startDate.format("HH:mm");
150
+ var endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
151
151
  var duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
152
152
  return "".concat(startTime, " - ").concat(endTime, " ( ").concat(duration, " )");
153
153
  };
@@ -203,17 +203,17 @@ export var formatProductListByCategory = function formatProductListByCategory(li
203
203
  });
204
204
  }
205
205
  } else {
206
- if (!categoryObject['other']) {
207
- categoryObject['other'] = {
206
+ if (!categoryObject["other"]) {
207
+ categoryObject["other"] = {
208
208
  id: 0,
209
209
  title: locales.getText('pisell2.text.other'),
210
210
  name: locales.getText('pisell2.text.other'),
211
- cover: '',
211
+ cover: "",
212
212
  products: []
213
213
  };
214
214
  }
215
- categoryObject['other'] = _objectSpread(_objectSpread({}, categoryObject['other']), {}, {
216
- products: [].concat(_toConsumableArray(categoryObject['other'].products), [productItem])
215
+ categoryObject["other"] = _objectSpread(_objectSpread({}, categoryObject["other"]), {}, {
216
+ products: [].concat(_toConsumableArray(categoryObject["other"].products), [productItem])
217
217
  });
218
218
  }
219
219
  }
@@ -222,7 +222,7 @@ export var formatProductListByCategory = function formatProductListByCategory(li
222
222
  });
223
223
  };
224
224
  export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cacheItem) {
225
- var startDate = dayjs(cacheItem._extend.start_date.format('YYYY-MM-DD') + ' ' + getServeStartTime(cacheItem._extend.start_time));
225
+ var startDate = dayjs(cacheItem._extend.start_date.format("YYYY-MM-DD") + ' ' + getServeStartTime(cacheItem._extend.start_time));
226
226
  var isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
227
227
 
228
228
  // 是否在最大预约数量的区间内
@@ -236,10 +236,10 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
236
236
  isMaxLimitRange = true;
237
237
  } else {
238
238
  // unknown 为 未知的, 需要掉接口确认是否可用
239
- isMaxLimitRange = 'unknown';
239
+ isMaxLimitRange = "unknown";
240
240
  }
241
- var timeStartDate = dayjs(time.start_date + ' ' + time.start_time).subtract(1, 'second');
242
- var timeEndDate = dayjs(time.end_date + ' ' + time.end_time).add(1, 'second');
241
+ var timeStartDate = dayjs(time.start_date + " " + time.start_time).subtract(1, "second");
242
+ var timeEndDate = dayjs(time.end_date + " " + time.end_time).add(1, "second");
243
243
  var bol;
244
244
 
245
245
  // 灵活时长的 只判断开始时间是否在范围内
@@ -247,7 +247,7 @@ export var getResourceTimeIsUsable = function getResourceTimeIsUsable(item, cach
247
247
  bol = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
248
248
  } else {
249
249
  // 其余判断 开始时间 和 结束时间 是否都在范围内
250
- var endDate = startDate.add(flexibleObj.getValue(cacheItem._extend.duration), 'minute');
250
+ var endDate = startDate.add(flexibleObj.getValue(cacheItem._extend.duration), "minute");
251
251
  bol = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
252
252
  }
253
253
 
@@ -291,8 +291,8 @@ export var formatTimes = function formatTimes(resourceItem, cacheItem) {
291
291
 
292
292
  // 获取第一个最佳的time
293
293
  var _time = (usableTimes || []).sort(function (a, b) {
294
- var aEndDate = dayjs(a.end_date + ' ' + a.end_time).valueOf();
295
- var bEndDate = dayjs(b.end_date + ' ' + b.end_time).valueOf();
294
+ var aEndDate = dayjs(a.end_date + " " + a.end_time).valueOf();
295
+ var bEndDate = dayjs(b.end_date + " " + b.end_time).valueOf();
296
296
  return aEndDate - bEndDate;
297
297
  })[0];
298
298
  resourceItem._extend = _objectSpread(_objectSpread({}, resourceItem._extend), {}, {
@@ -317,21 +317,21 @@ var formatResourceProducts = function formatResourceProducts(resourceItem, curre
317
317
  var type = _resourceItem.partyroom_package.type;
318
318
 
319
319
  // 全部商品
320
- if (type === 'product_all') {
320
+ if (type === "product_all") {
321
321
  usableProduct = true;
322
322
  } else {
323
- if (type === 'product_collection') {
323
+ if (type === "product_collection") {
324
324
  var _resourceItem$partyro;
325
325
  // 取交集 intersectionBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); // => [{ 'x': 2 }]
326
326
  usableProduct = !!intersectionBy(((_resourceItem$partyro = _resourceItem.partyroom_package) === null || _resourceItem$partyro === void 0 ? void 0 : _resourceItem$partyro.products.map(function (item) {
327
327
  return _objectSpread(_objectSpread({}, item), {}, {
328
328
  id: item.product_collection_id
329
329
  });
330
- })) || [], currentItem.collection || [], 'id').length;
330
+ })) || [], currentItem.collection || [], "id").length;
331
331
  } else {
332
332
  usableProduct = _resourceItem.partyroom_package.products.some(function (item) {
333
333
  // 判断商品
334
- if (type === 'products') {
334
+ if (type === "products") {
335
335
  if (item.product_id == currentItem.product_id) {
336
336
  return true;
337
337
  }
@@ -348,7 +348,7 @@ var formatResourceProducts = function formatResourceProducts(resourceItem, curre
348
348
 
349
349
  /**
350
350
  * @title: 获取店铺的营业结束时间
351
- * @description:
351
+ * @description:
352
352
  * @return {*}
353
353
  * @Author: zhiwei.Wang
354
354
  * @Date: 2024-02-23 10:00
@@ -359,7 +359,7 @@ export var getShopOpeningHours = function getShopOpeningHours() {
359
359
 
360
360
  /**
361
361
  * @title: 对灵活时长进行处理
362
- * @description:
362
+ * @description:
363
363
  * @return {*}
364
364
  * @Author: zhiwei.Wang
365
365
  * @Date: 2024-02-23 10:00
@@ -405,7 +405,7 @@ export var flexibleObj = {
405
405
  export var getEndDate = function getEndDate(startDate, duration, endDate) {
406
406
  if (duration === 'flexible') {
407
407
  // 店铺营业结束时间
408
- var openingDate = dayjs(startDate.format('YYYY-MM-DD') + ' ' + getShopOpeningHours());
408
+ var openingDate = dayjs(startDate.format("YYYY-MM-DD") + ' ' + getShopOpeningHours());
409
409
 
410
410
  // 如果选择的开始时间 > 店铺的营业时间, 店铺营业时间向后推一天
411
411
  if (dayjs(startDate).isAfter(openingDate)) {
@@ -421,14 +421,14 @@ export var getEndDate = function getEndDate(startDate, duration, endDate) {
421
421
  }
422
422
  return endDate;
423
423
  }
424
- return startDate.add(duration, 'minute');
424
+ return startDate.add(duration, "minute");
425
425
  };
426
426
 
427
427
  // export const get
428
428
 
429
429
  export var getServiceTimes = function getServiceTimes(service) {
430
- var startDate = dayjs(dayjs(service._extend.start_date).format('YYYY-MM-DD ') + getServeStartTime(service._extend.start_time));
431
- var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), 'minute');
430
+ var startDate = dayjs(dayjs(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time));
431
+ var endDate = startDate.add(flexibleObj.getValue(service._extend.duration), "minute");
432
432
  return {
433
433
  startDate: startDate,
434
434
  endDate: endDate
@@ -438,7 +438,7 @@ export var getErrorList = function getErrorList(resource, cacheItem) {
438
438
  if (!(cacheItem !== null && cacheItem !== void 0 && cacheItem.id)) {
439
439
  return [{
440
440
  label: locales.getText('pisell2.text.no-product-added'),
441
- type: 'products'
441
+ type: "products"
442
442
  }];
443
443
  }
444
444
  if (!resource || !resource._extend || !cacheItem) {
@@ -452,29 +452,29 @@ export var getErrorList = function getErrorList(resource, cacheItem) {
452
452
  if (!(resource !== null && resource !== void 0 && (_resource$_extend = resource._extend) !== null && _resource$_extend !== void 0 && _resource$_extend.usableProduct)) {
453
453
  list.push({
454
454
  label: locales.getText('pisell1.text.resource-error-message-1')(resource.labelText, cacheItem === null || cacheItem === void 0 ? void 0 : cacheItem.title),
455
- type: 'product'
455
+ type: "product"
456
456
  });
457
457
  }
458
458
  var _getServiceTimes = getServiceTimes(cacheItem),
459
459
  startDate = _getServiceTimes.startDate,
460
460
  endDate = _getServiceTimes.endDate;
461
461
  // 如果跨天 结束时间前面加一个明天
462
- var startText = startDate.format('hh:mm A');
463
- var endText = endDate.format('hh:mm A');
464
- if (dayjs(endDate).isAfter(startDate, 'day')) {
462
+ var startText = startDate.format("hh:mm A");
463
+ var endText = endDate.format("hh:mm A");
464
+ if (dayjs(endDate).isAfter(startDate, "day")) {
465
465
  endText = locales.getText('pisell1.text.tomorrow') + endText;
466
466
  }
467
467
  if (!((_resource$_extend2 = resource._extend) !== null && _resource$_extend2 !== void 0 && _resource$_extend2.usableTime)) {
468
468
  list.push({
469
469
  label: locales.getText('pisell1.text.resource-error-message-2')(resource.labelText, startText, endText),
470
- type: 'time'
470
+ type: "time"
471
471
  });
472
472
  } else {
473
473
  var _resource$_extend3;
474
474
  if (!((_resource$_extend3 = resource._extend) !== null && _resource$_extend3 !== void 0 && _resource$_extend3.usableTime._extend.isMaxLimitRange)) {
475
475
  list.push({
476
476
  label: locales.getText('pisell1.text.resource-error-message-3')(resource.labelText, startText, endText),
477
- type: 'limit'
477
+ type: "limit"
478
478
  });
479
479
  }
480
480
  }
@@ -526,7 +526,7 @@ export var deleteCacheParams = function deleteCacheParams() {
526
526
 
527
527
  /**
528
528
  * @title: 创建一个服务商品
529
- * @description:
529
+ * @description:
530
530
  * @param {any} state
531
531
  * @param {any} item
532
532
  * @return {*}
@@ -555,10 +555,10 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
555
555
  var lastServerStartDate = lastServer._extend.startDate;
556
556
  var lastServerEndDate = lastServer._extend.endDate;
557
557
  // 如果上个服务商品的结束时间跨天, 那么设置为最后一个时间段, 不跨天则取上一个的结束时间
558
- if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, 'day')) {
558
+ if (dayjs(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
559
559
  _extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
560
560
  } else {
561
- _extend.start_time = lastServerEndDate.format('HH:mm');
561
+ _extend.start_time = lastServerEndDate.format("HH:mm");
562
562
  }
563
563
  } else {
564
564
  // 没有上一个商品 资源为 0
@@ -584,17 +584,14 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
584
584
  _extend.resource = resourceId;
585
585
  }
586
586
  }
587
+ console.log("_extend", findNextSliceProps);
587
588
 
588
589
  // 只有选择了带 HH:mm的日期才选中, 否则使用当前日期
589
590
  if (findNextSliceProps.date && findNextSliceProps.date !== '00:00') {
590
591
  _extend.start_time = findNextSlice(findNextSliceProps);
591
592
  } else {
592
- if (cacheItem.currentDefaultTime) {
593
- _extend.start_time = cacheItem.currentDefaultTime;
594
- } else {
595
- // 没有预设日期, 则使用当前 https://www.yuque.com/feg4xm/manual/tzvrnt05ifihkndg
596
- _extend.start_time = dayjs().format('HH:mm');
597
- }
593
+ // 没有预设日期, 则使用当前 https://www.yuque.com/feg4xm/manual/tzvrnt05ifihkndg
594
+ _extend.start_time = dayjs().format('HH:mm');
598
595
  }
599
596
  }
600
597
  _extend = _objectSpread(_objectSpread({}, _extend), cacheItem._extend);
@@ -277,6 +277,8 @@ export default (function (props) {
277
277
  onChangeParams: props.onChangeParams,
278
278
  action: action,
279
279
  source: props.source,
280
+ tyroUrl: props.tyroUrl,
281
+ tyroVersion: props.tyroVersion,
280
282
  device_number: props === null || props === void 0 ? void 0 : (_props$params2 = props.params) === null || _props$params2 === void 0 ? void 0 : _props$params2.device_number
281
283
  }));
282
284
  });
@@ -235,12 +235,12 @@ export default (function (_ref) {
235
235
  merchantReceipt = _ref3.merchantReceipt;
236
236
  console.log('商家小票 客户端是否打印小票 = ', signatureRequired);
237
237
  console.log('商家小票 小票内容 = \n', merchantReceipt);
238
- if (signatureRequired) {
239
- var receipt = [merchantReceipt].filter(function (item) {
240
- return typeof item === 'string';
241
- }).filter(Boolean);
242
- onChange('print', receipt);
243
- }
238
+ // if (signatureRequired) {
239
+ var receipt = [merchantReceipt].filter(function (item) {
240
+ return typeof item === 'string';
241
+ }).filter(Boolean);
242
+ onChange('print', receipt);
243
+ // }
244
244
  merchantReceiptRef.current = {
245
245
  signatureRequired: signatureRequired,
246
246
  merchantReceipt: merchantReceipt
@@ -344,7 +344,7 @@ export default (function (_ref) {
344
344
  card_reader_id: (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : _deviceRef$current5.id,
345
345
  card_reader_type: eftpos,
346
346
  amount: requestParams.current.amount,
347
- action: modeRef.current,
347
+ action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
348
348
  status: response.result === 'APPROVED' ? 'succeed' : 'failed',
349
349
  request: requestParams.current,
350
350
  response: _objectSpread(_objectSpread({}, response), {}, {
@@ -413,7 +413,8 @@ export default (function (_ref) {
413
413
  failCustom: {
414
414
  isPosNetworkError: false,
415
415
  status: 'fail',
416
- fail: locales.getText('page.eftpos-pay.text.transaction.fail'),
416
+ fail: response.result,
417
+ //locales.getText('page.eftpos-pay.text.transaction.fail'),
417
418
  warn: null,
418
419
  title: locales.getText('page.eftpos-pay.text.failed')(modeRef.current)
419
420
  }
@@ -427,7 +428,9 @@ export default (function (_ref) {
427
428
  if (load && TyroRef.current) {
428
429
  var _IClient = TyroRef.current.IClient;
429
430
  if (_IClient) {
431
+ console.log('apiKey = ', apiKey, 'posProductData = ', posProductData);
430
432
  var iclient = new _IClient(apiKey, posProductData);
433
+ console.log(iclient.posProductData);
431
434
  iClientRef.current = iclient;
432
435
  if (isCancelRef.current) {
433
436
  return;
@@ -16,6 +16,7 @@ import { locales } from '@pisell/utils';
16
16
  import { getPayGroupParamsFromStorage } from "../../payGroup";
17
17
  import useEngineContext from "../../../../../hooks/useEngineContext";
18
18
  import "./index.less";
19
+ import { formatFranchiseeRoute } from "../../utils";
19
20
  /**
20
21
  * @title: Apple 支付
21
22
  * @description:
@@ -75,7 +76,7 @@ var ApplePay = function ApplePay(props, ref) {
75
76
 
76
77
  // 提取域名
77
78
  shop_domain = linkElement.hostname;
78
- _href = "".concat(config.pay, "/apple-pay?order_id=").concat((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id);
79
+ _href = "".concat(config.pay).concat(formatFranchiseeRoute("/apple-pay?order_id=".concat((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id), state.history));
79
80
  window.location.href = _href;
80
81
  } catch (err) {
81
82
  setOpen(false);
@@ -5,6 +5,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
5
5
  import { useImperativeHandle, forwardRef, useContext } from 'react';
6
6
  import { Context } from "../../model";
7
7
  import useEngineContext from "../../../../../hooks/useEngineContext";
8
+ import { formatFranchiseeRoute } from "../../utils";
8
9
  import "./index.less";
9
10
  /**
10
11
  * @title: 银行转账
@@ -31,7 +32,7 @@ var BankDeposit = function BankDeposit(props, ref) {
31
32
  var init = /*#__PURE__*/function () {
32
33
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
33
34
  var _context$appHelper, _context$appHelper$co;
34
- var payGroup, platform, _item;
35
+ var payGroup, platform, _item, _href;
35
36
  return _regeneratorRuntime().wrap(function _callee$(_context) {
36
37
  while (1) switch (_context.prev = _context.next) {
37
38
  case 0:
@@ -52,9 +53,9 @@ var BankDeposit = function BankDeposit(props, ref) {
52
53
  });
53
54
  return _context.abrupt("return");
54
55
  case 6:
55
- // h5打开银行转账页面
56
- state.history.push("/pay/manual-transfer?id=".concat((payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id)));
57
- case 7:
56
+ _href = "".concat(formatFranchiseeRoute("/pay/manual-transfer?id=".concat((payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id)), state.history)); // h5打开银行转账页面
57
+ state.history.push(_href);
58
+ case 8:
58
59
  case "end":
59
60
  return _context.stop();
60
61
  }
@@ -15,6 +15,7 @@ import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
15
15
  import { Context } from "../../model";
16
16
  import { getPayGroupParamsFromStorage } from "../../payGroup";
17
17
  import useEngineContext from "../../../../../hooks/useEngineContext";
18
+ import { formatFranchiseeRoute } from "../../utils";
18
19
  /**
19
20
  * @title: 谷歌支付
20
21
  * @description:
@@ -72,7 +73,7 @@ var GooglePay = function GooglePay(props, ref) {
72
73
 
73
74
  // 提取域名
74
75
  shop_domain = linkElement.hostname;
75
- _href = "".concat(config.pay, "/google-pay?order_id=").concat((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id);
76
+ _href = "".concat(config.pay).concat(formatFranchiseeRoute("/google-pay?order_id=".concat((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id), state.history));
76
77
  window.location.href = _href;
77
78
  } catch (err) {
78
79
  setOpen(false);
@@ -36,3 +36,14 @@ export declare const formatWalletPassParams: (payGroup: PayGroup) => {
36
36
  * @Date: 2024-08-30 10:06:17
37
37
  */
38
38
  export declare const getIsWalletPassAndTripartitePayment: (payGroup: PayGroup) => boolean | 0 | undefined;
39
+ export declare const isFranchiseeShop: (path?: any, history?: any) => any;
40
+ /**
41
+ * @title: 获取当前连锁加盟店铺shopid
42
+ * @description:
43
+ * @param {any} param1
44
+ * @return {*}
45
+ * @Author: chensheng.gu
46
+ * @Date: 2024-08-07 10:04
47
+ */
48
+ export declare const getFranchiseeShopId: (path?: any, history?: any) => number;
49
+ export declare const formatFranchiseeRoute: (url: string, history?: any) => string;
@@ -58,4 +58,31 @@ export var formatWalletPassParams = function formatWalletPassParams(payGroup) {
58
58
  export var getIsWalletPassAndTripartitePayment = function getIsWalletPassAndTripartitePayment(payGroup) {
59
59
  var _payGroup$walletPass, _payGroup$walletPass$, _payGroup$otherPaymen;
60
60
  return (payGroup === null || payGroup === void 0 ? void 0 : (_payGroup$walletPass = payGroup.walletPass) === null || _payGroup$walletPass === void 0 ? void 0 : (_payGroup$walletPass$ = _payGroup$walletPass.cards) === null || _payGroup$walletPass$ === void 0 ? void 0 : _payGroup$walletPass$.length) && isTripartitePayment(payGroup === null || payGroup === void 0 ? void 0 : (_payGroup$otherPaymen = payGroup.otherPayment) === null || _payGroup$otherPaymen === void 0 ? void 0 : _payGroup$otherPaymen.service);
61
+ };
62
+ export var isFranchiseeShop = function isFranchiseeShop(path, history) {
63
+ var pathname = history.location.pathname;
64
+ var _pathname = path || pathname;
65
+ return _pathname && _pathname.includes('/franchisee');
66
+ };
67
+
68
+ /**
69
+ * @title: 获取当前连锁加盟店铺shopid
70
+ * @description:
71
+ * @param {any} param1
72
+ * @return {*}
73
+ * @Author: chensheng.gu
74
+ * @Date: 2024-08-07 10:04
75
+ */
76
+ export var getFranchiseeShopId = function getFranchiseeShopId(path, history) {
77
+ var pathname = history.location.pathname;
78
+ var _pathname = path || pathname;
79
+ var match = _pathname.match(/\/shop_(\d+)\//);
80
+ var shopNumber = match ? match[1] : null;
81
+ return Number(shopNumber);
82
+ };
83
+ export var formatFranchiseeRoute = function formatFranchiseeRoute(url, history) {
84
+ if (isFranchiseeShop(null, history)) {
85
+ return "/franchisee/shop/shop_".concat(getFranchiseeShopId(null, history)).concat(url);
86
+ }
87
+ return url;
61
88
  };
@@ -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/es/index.d.ts CHANGED
@@ -12,7 +12,6 @@ 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 { VerticalClient } from './components/booking/info/clientVariant';
15
- export { default as VerticalAddService } from './components/booking/info/addServiceVariant';
16
15
  export { default as ProductExtension } from './components/productExtension';
17
16
  export { default as BookingDeposit } from './components/booking/deposit';
18
17
  export { default as RuleSetting } from './components/ruleSetting';
@@ -20,4 +19,3 @@ export { default as TaxSelect } from './components/taxSelect';
20
19
  export { default as ToCPay } from './components/pay/toC';
21
20
  export { default as Eftpos } from './components/eftpos';
22
21
  export { default as EftposPay } from './components/eftposPay';
23
- export { default as BookingDashboard } from './components/booking/dashboard';
package/es/index.js CHANGED
@@ -16,12 +16,10 @@ export { default as BookingStartTime } from "./components/booking/materiels/star
16
16
  export { default as BookingDuration } from "./components/booking/materiels/duration";
17
17
  export { default as BookingContacts } from "./components/booking/materiels/contacts";
18
18
  export { VerticalClient } from "./components/booking/info/clientVariant";
19
- export { default as VerticalAddService } from "./components/booking/info/addServiceVariant";
20
19
  export { default as ProductExtension } from "./components/productExtension";
21
20
  export { default as BookingDeposit } from "./components/booking/deposit";
22
21
  export { default as RuleSetting } from "./components/ruleSetting";
23
22
  export { default as TaxSelect } from "./components/taxSelect";
24
23
  export { default as ToCPay } from "./components/pay/toC";
25
24
  export { default as Eftpos } from "./components/eftpos";
26
- export { default as EftposPay } from "./components/eftposPay";
27
- export { default as BookingDashboard } from "./components/booking/dashboard";
25
+ export { default as EftposPay } from "./components/eftposPay";
@@ -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: {
@@ -595,7 +595,7 @@ var Footer = (props) => {
595
595
  }
596
596
  if (transaction_habit_selection.button_rows == 1) {
597
597
  if (state.appointment_status !== "cancelled") {
598
- if (!state.disabledEdit && !state.isBookingCreatePage) {
598
+ if (!state.disabledEdit) {
599
599
  arr.push(actionMap.sale);
600
600
  }
601
601
  }
@@ -695,7 +695,7 @@ var Footer = (props) => {
695
695
  if (!state.bookingDetail) {
696
696
  return true;
697
697
  }
698
- if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking" && !state.isBookingCreatePage) {
698
+ if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking") {
699
699
  return true;
700
700
  }
701
701
  }
@@ -809,7 +809,7 @@ var Footer = (props) => {
809
809
  className: "pisell-lowcode__booking-footer-buttons",
810
810
  style: { marginTop: 12 }
811
811
  },
812
- state.appointment_status !== "cancelled" && !state.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(
812
+ state.appointment_status !== "cancelled" ? /* @__PURE__ */ import_react.default.createElement(
813
813
  import_antd2.Button,
814
814
  {
815
815
  onClick: () => handleSale(),
@@ -12,7 +12,6 @@ export interface InfoProps {
12
12
  client: any;
13
13
  loading?: boolean;
14
14
  addButtonProps?: any;
15
- drawerProps?: any;
16
15
  }
17
16
  /**
18
17
  * @title: 表单模块