@pisell/private-materials 3.0.170 → 3.0.172

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.
@@ -35,7 +35,7 @@ var translationOriginal = function translationOriginal(text) {
35
35
  var formatCapacityToChildrenData = function formatCapacityToChildrenData(data) {
36
36
  var map = {};
37
37
  data.forEach(function (item) {
38
- var name = translationOriginal(item.name) || "default";
38
+ var name = translationOriginal(item.name) || 'default';
39
39
  if (!map[name]) {
40
40
  map[name] = {
41
41
  label: !item.id ? locales.getText('pisell2.booking.dashboard.default') : translationOriginal(item.name) || '',
@@ -44,7 +44,9 @@ var formatCapacityToChildrenData = function formatCapacityToChildrenData(data) {
44
44
  }
45
45
  map[name].value = (map[name].value || 0) + (item.value || 0);
46
46
  });
47
- return Object.values(map).sort(function (a, b) {
47
+ return Object.values(map).filter(function (item) {
48
+ return !!item.value;
49
+ }).sort(function (a, b) {
48
50
  return b.label.localeCompare(a.label);
49
51
  });
50
52
  };
@@ -125,6 +125,9 @@ var Single = function Single(_ref) {
125
125
  disable: true
126
126
  }) : val;
127
127
  }
128
+ if (field.filed_type === 'agreement') {
129
+ return val === 1 ? locales.getText('pisell2.booking.info.text.form-agreement-yes') : locales.getText('pisell2.booking.info.text.form-agreement-no');
130
+ }
128
131
  if (queryValueById.includes(field === null || field === void 0 ? void 0 : field.filed_type)) {
129
132
  return /*#__PURE__*/React.createElement(RenderValueById, {
130
133
  field: field,
@@ -23,7 +23,7 @@ import { formatAmount, locales } from '@pisell/utils';
23
23
  import Duration from "../../../materiels/duration";
24
24
  import Capacity from "./Capacity";
25
25
  import Resources from "./Resources";
26
- import { Input, Button, Select, Row, Col, Form, InputNumber } from 'antd';
26
+ import { Input, Button, Row, Col, Form, InputNumber } from 'antd';
27
27
  import "./index.less";
28
28
  import CollapsibleList from "../../../components/collapsibleList";
29
29
  import { renderBundles } from "../../../components/collapsibleList/utils";
@@ -32,9 +32,10 @@ import { useUpdateEffect, useMemoizedFn } from 'ahooks';
32
32
  import { getServiceTimes, deleteCacheParams, getProductTotalPrice } from "../../../utils";
33
33
  import { getErrorList } from "../../utilsByBooking";
34
34
  import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
35
+ import { PisellAdjustPriceInputNumber } from "@pisell/materials";
35
36
  var submitLock = false;
36
37
  var Info = function Info(_, ref) {
37
- var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI6, _state$service$cacheI7, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI8, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI9, _state$service$cacheI10, _state$service$cacheI11, _state$service$cacheI12, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8, _state$service$resour;
38
+ var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI6, _state$service$cacheI7, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI8, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI9, _state$service$cacheI10, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$service$cacheI15, _state$service$cacheI16, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8, _state$service$resour;
38
39
  var _Form$useForm = Form.useForm(),
39
40
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
40
41
  form = _Form$useForm2[0];
@@ -520,39 +521,24 @@ var Info = function Info(_, ref) {
520
521
  return renderBundles(item, state.amountSymbol);
521
522
  }
522
523
  })))), /*#__PURE__*/React.createElement(Col, {
523
- span: 12
524
+ span: 24
524
525
  }, /*#__PURE__*/React.createElement(Form.Item, {
525
526
  label: locales.getText('pisell2.text.price'),
526
527
  name: "total",
527
528
  rules: [{
528
529
  required: true
529
- }]
530
- }, /*#__PURE__*/React.createElement(InputNumber, {
531
- disabled: state.channelDisabledEdit,
532
- prefix: state.amountSymbol,
533
- size: "large",
534
- precision: 2,
530
+ }],
531
+ extra: useTotal !== ((_state$service$cacheI9 = state.service.cacheItem) === null || _state$service$cacheI9 === void 0 ? void 0 : (_state$service$cacheI10 = _state$service$cacheI9._extend) === null || _state$service$cacheI10 === void 0 ? void 0 : _state$service$cacheI10.origin_total) && locales.getText('page.booking.text.price-extra')(formatAmount((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total, 2, state.amountSymbol), formatAmount(useTotal, 2, state.amountSymbol))
532
+ }, /*#__PURE__*/React.createElement(PisellAdjustPriceInputNumber, {
535
533
  style: {
536
534
  width: '100%'
537
535
  },
538
536
  min: 0,
539
- max: ((_state$service$cacheI9 = state.service.cacheItem) === null || _state$service$cacheI9 === void 0 ? void 0 : (_state$service$cacheI10 = _state$service$cacheI9._extend) === null || _state$service$cacheI10 === void 0 ? void 0 : _state$service$cacheI10.origin_total) || 0,
540
- placeholder: ((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total) || '0'
541
- }))), /*#__PURE__*/React.createElement(Col, {
542
- span: 12
543
- }, /*#__PURE__*/React.createElement(Form.Item, {
544
- label: locales.getText('pisell2.text.discount'),
545
- name: "discount"
546
- }, /*#__PURE__*/React.createElement(Select, {
537
+ precision: 2,
538
+ prefix: state.amountSymbol,
547
539
  disabled: state.channelDisabledEdit,
548
- size: "large",
549
- open: false,
550
- allowClear: isDiscount,
551
- onChange: function onChange(e) {
552
- form.setFieldsValue({
553
- total: state.service.cacheItem._extend.origin_total
554
- });
555
- }
540
+ originValue: ((_state$service$cacheI13 = state.service.cacheItem) === null || _state$service$cacheI13 === void 0 ? void 0 : (_state$service$cacheI14 = _state$service$cacheI13._extend) === null || _state$service$cacheI14 === void 0 ? void 0 : _state$service$cacheI14.origin_total) || 0,
541
+ placeholder: ((_state$service$cacheI15 = state.service.cacheItem) === null || _state$service$cacheI15 === void 0 ? void 0 : (_state$service$cacheI16 = _state$service$cacheI15._extend) === null || _state$service$cacheI16 === void 0 ? void 0 : _state$service$cacheI16.origin_total) || '0'
556
542
  }))), isReason ? /*#__PURE__*/React.createElement(Col, {
557
543
  span: 24
558
544
  }, /*#__PURE__*/React.createElement(Form.Item, {
@@ -216,6 +216,8 @@ declare const _default: {
216
216
  'pisell2.booking.info.text.clear-cart': string;
217
217
  'pisell2.booking.info.text.clear-all': string;
218
218
  'pisell2.booking.info.text.create-new': string;
219
+ 'pisell2.booking.info.text.form-agreement-yes': string;
220
+ 'pisell2.booking.info.text.form-agreement-no': string;
219
221
  };
220
222
  'zh-CN': {
221
223
  'pisell2.text.refunded-amount': string;
@@ -434,6 +436,8 @@ declare const _default: {
434
436
  'pisell2.booking.info.text.clear-cart': string;
435
437
  'pisell2.booking.info.text.clear-all': string;
436
438
  'pisell2.booking.info.text.create-new': string;
439
+ 'pisell2.booking.info.text.form-agreement-yes': string;
440
+ 'pisell2.booking.info.text.form-agreement-no': string;
437
441
  };
438
442
  'zh-HK': {
439
443
  'pisell2.text.refunded-amount': string;
@@ -652,6 +656,8 @@ declare const _default: {
652
656
  'pisell2.booking.info.text.clear-cart': string;
653
657
  'pisell2.booking.info.text.clear-all': string;
654
658
  'pisell2.booking.info.text.create-new': string;
659
+ 'pisell2.booking.info.text.form-agreement-yes': string;
660
+ 'pisell2.booking.info.text.form-agreement-no': string;
655
661
  };
656
662
  };
657
663
  export default _default;
@@ -248,7 +248,9 @@ export default {
248
248
  'pisell2.booking.dashboard.default': "Default",
249
249
  'pisell2.booking.info.text.clear-cart': "Clear cart",
250
250
  'pisell2.booking.info.text.clear-all': "Clear all",
251
- 'pisell2.booking.info.text.create-new': "Create new"
251
+ 'pisell2.booking.info.text.create-new': "Create new",
252
+ 'pisell2.booking.info.text.form-agreement-yes': "Yes",
253
+ 'pisell2.booking.info.text.form-agreement-no': "No"
252
254
  },
253
255
  'zh-CN': {
254
256
  'pisell2.text.refunded-amount': '已退金额',
@@ -503,7 +505,9 @@ export default {
503
505
  'pisell2.booking.dashboard.default': "默认",
504
506
  'pisell2.booking.info.text.clear-cart': "清空购物车",
505
507
  'pisell2.booking.info.text.clear-all': "清空",
506
- 'pisell2.booking.info.text.create-new': "新建"
508
+ 'pisell2.booking.info.text.create-new': "新建",
509
+ 'pisell2.booking.info.text.form-agreement-yes': "是",
510
+ 'pisell2.booking.info.text.form-agreement-no': "否"
507
511
  },
508
512
  'zh-HK': {
509
513
  'pisell2.text.refunded-amount': '已退金額',
@@ -758,6 +762,8 @@ export default {
758
762
  'pisell2.booking.dashboard.default': "默认",
759
763
  'pisell2.booking.info.text.clear-cart': "清空購物車",
760
764
  'pisell2.booking.info.text.clear-all': "清空",
761
- 'pisell2.booking.info.text.create-new': "新建"
765
+ 'pisell2.booking.info.text.create-new': "新建",
766
+ 'pisell2.booking.info.text.form-agreement-yes': "是",
767
+ 'pisell2.booking.info.text.form-agreement-no': "否"
762
768
  }
763
769
  };
@@ -53,7 +53,7 @@ var formatCapacityToChildrenData = (data) => {
53
53
  }
54
54
  map[name].value = (map[name].value || 0) + (item.value || 0);
55
55
  });
56
- return Object.values(map).sort((a, b) => b.label.localeCompare(a.label));
56
+ return Object.values(map).filter((item) => !!item.value).sort((a, b) => b.label.localeCompare(a.label));
57
57
  };
58
58
  import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
59
59
  var BookingDashboard = (props) => {
@@ -111,6 +111,9 @@ var Single = ({
111
111
  if (field.filed_type === "body_hotspot_image") {
112
112
  return HumanBodySelector ? /* @__PURE__ */ import_react.default.createElement(HumanBodySelector, { value: val, disable: true }) : val;
113
113
  }
114
+ if (field.filed_type === "agreement") {
115
+ return val === 1 ? import_utils.locales.getText("pisell2.booking.info.text.form-agreement-yes") : import_utils.locales.getText("pisell2.booking.info.text.form-agreement-no");
116
+ }
114
117
  if (queryValueById.includes(field == null ? void 0 : field.filed_type)) {
115
118
  return /* @__PURE__ */ import_react.default.createElement(import_RenderValueById.default, { field, value: val });
116
119
  }
@@ -48,9 +48,10 @@ var import_ahooks = require("ahooks");
48
48
  var import_utils3 = require("../../../utils");
49
49
  var import_utilsByBooking = require("../../utilsByBooking");
50
50
  var import_utils4 = require("../addService/utils");
51
+ var import_materials = require("@pisell/materials");
51
52
  var submitLock = false;
52
53
  var Info = (_, ref) => {
53
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
54
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
54
55
  const [form] = import_antd.Form.useForm();
55
56
  const useTotal = import_antd.Form.useWatch("total", form);
56
57
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -380,44 +381,31 @@ var Info = (_, ref) => {
380
381
  list: bundles,
381
382
  renderItem: (item) => (0, import_utils2.renderBundles)(item, state.amountSymbol)
382
383
  }
383
- )))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
384
+ )))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
384
385
  import_antd.Form.Item,
385
386
  {
386
387
  label: import_utils.locales.getText("pisell2.text.price"),
387
388
  name: "total",
388
- rules: [{ required: true }]
389
+ rules: [{ required: true }],
390
+ extra: useTotal !== ((_t = (_s = state.service.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.origin_total) && import_utils.locales.getText("page.booking.text.price-extra")(
391
+ (0, import_utils.formatAmount)(
392
+ (_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total,
393
+ 2,
394
+ state.amountSymbol
395
+ ),
396
+ (0, import_utils.formatAmount)(useTotal, 2, state.amountSymbol)
397
+ )
389
398
  },
390
399
  /* @__PURE__ */ import_react.default.createElement(
391
- import_antd.InputNumber,
400
+ import_materials.PisellAdjustPriceInputNumber,
392
401
  {
393
- disabled: state.channelDisabledEdit,
394
- prefix: state.amountSymbol,
395
- size: "large",
396
- precision: 2,
397
402
  style: { width: "100%" },
398
403
  min: 0,
399
- max: ((_t = (_s = state.service.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.origin_total) || 0,
400
- placeholder: ((_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total) || "0"
401
- }
402
- )
403
- )), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
404
- import_antd.Form.Item,
405
- {
406
- label: import_utils.locales.getText("pisell2.text.discount"),
407
- name: "discount"
408
- },
409
- /* @__PURE__ */ import_react.default.createElement(
410
- import_antd.Select,
411
- {
404
+ precision: 2,
405
+ prefix: state.amountSymbol,
412
406
  disabled: state.channelDisabledEdit,
413
- size: "large",
414
- open: false,
415
- allowClear: isDiscount,
416
- onChange: (e) => {
417
- form.setFieldsValue({
418
- total: state.service.cacheItem._extend.origin_total
419
- });
420
- }
407
+ originValue: ((_x = (_w = state.service.cacheItem) == null ? void 0 : _w._extend) == null ? void 0 : _x.origin_total) || 0,
408
+ placeholder: ((_z = (_y = state.service.cacheItem) == null ? void 0 : _y._extend) == null ? void 0 : _z.origin_total) || "0"
421
409
  }
422
410
  )
423
411
  )), isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
@@ -437,7 +425,7 @@ var Info = (_, ref) => {
437
425
  SelectTime ? /* @__PURE__ */ import_react.default.createElement(
438
426
  SelectTime,
439
427
  {
440
- slice: (_z = (_y = (_x = (_w = state.bookingConfig) == null ? void 0 : _w.config) == null ? void 0 : _x.basic) == null ? void 0 : _y.service_time) == null ? void 0 : _z.value,
428
+ slice: (_D = (_C = (_B = (_A = state.bookingConfig) == null ? void 0 : _A.config) == null ? void 0 : _B.basic) == null ? void 0 : _C.service_time) == null ? void 0 : _D.value,
441
429
  timePickerProps: {
442
430
  style: { width: "100%" }
443
431
  },
@@ -482,7 +470,7 @@ var Info = (_, ref) => {
482
470
  {
483
471
  type: "primary",
484
472
  className: "pisell-lowcode__booking-service-body-edit-footer-apple",
485
- disabled: !((_A = state.service.resourcesOrigin) == null ? void 0 : _A.length),
473
+ disabled: !((_E = state.service.resourcesOrigin) == null ? void 0 : _E.length),
486
474
  onClick: () => {
487
475
  form.submit();
488
476
  }
@@ -216,6 +216,8 @@ declare const _default: {
216
216
  'pisell2.booking.info.text.clear-cart': string;
217
217
  'pisell2.booking.info.text.clear-all': string;
218
218
  'pisell2.booking.info.text.create-new': string;
219
+ 'pisell2.booking.info.text.form-agreement-yes': string;
220
+ 'pisell2.booking.info.text.form-agreement-no': string;
219
221
  };
220
222
  'zh-CN': {
221
223
  'pisell2.text.refunded-amount': string;
@@ -434,6 +436,8 @@ declare const _default: {
434
436
  'pisell2.booking.info.text.clear-cart': string;
435
437
  'pisell2.booking.info.text.clear-all': string;
436
438
  'pisell2.booking.info.text.create-new': string;
439
+ 'pisell2.booking.info.text.form-agreement-yes': string;
440
+ 'pisell2.booking.info.text.form-agreement-no': string;
437
441
  };
438
442
  'zh-HK': {
439
443
  'pisell2.text.refunded-amount': string;
@@ -652,6 +656,8 @@ declare const _default: {
652
656
  'pisell2.booking.info.text.clear-cart': string;
653
657
  'pisell2.booking.info.text.clear-all': string;
654
658
  'pisell2.booking.info.text.create-new': string;
659
+ 'pisell2.booking.info.text.form-agreement-yes': string;
660
+ 'pisell2.booking.info.text.form-agreement-no': string;
655
661
  };
656
662
  };
657
663
  export default _default;
@@ -271,7 +271,9 @@ var locales_default = {
271
271
  "pisell2.booking.dashboard.default": "Default",
272
272
  "pisell2.booking.info.text.clear-cart": "Clear cart",
273
273
  "pisell2.booking.info.text.clear-all": "Clear all",
274
- "pisell2.booking.info.text.create-new": "Create new"
274
+ "pisell2.booking.info.text.create-new": "Create new",
275
+ "pisell2.booking.info.text.form-agreement-yes": "Yes",
276
+ "pisell2.booking.info.text.form-agreement-no": "No"
275
277
  },
276
278
  "zh-CN": {
277
279
  "pisell2.text.refunded-amount": "已退金额",
@@ -515,7 +517,9 @@ var locales_default = {
515
517
  "pisell2.booking.dashboard.default": "默认",
516
518
  "pisell2.booking.info.text.clear-cart": "清空购物车",
517
519
  "pisell2.booking.info.text.clear-all": "清空",
518
- "pisell2.booking.info.text.create-new": "新建"
520
+ "pisell2.booking.info.text.create-new": "新建",
521
+ "pisell2.booking.info.text.form-agreement-yes": "是",
522
+ "pisell2.booking.info.text.form-agreement-no": "否"
519
523
  },
520
524
  "zh-HK": {
521
525
  "pisell2.text.refunded-amount": "已退金額",
@@ -759,6 +763,8 @@ var locales_default = {
759
763
  "pisell2.booking.dashboard.default": "默认",
760
764
  "pisell2.booking.info.text.clear-cart": "清空購物車",
761
765
  "pisell2.booking.info.text.clear-all": "清空",
762
- "pisell2.booking.info.text.create-new": "新建"
766
+ "pisell2.booking.info.text.create-new": "新建",
767
+ "pisell2.booking.info.text.form-agreement-yes": "是",
768
+ "pisell2.booking.info.text.form-agreement-no": "否"
763
769
  }
764
770
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.170",
3
+ "version": "3.0.172",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
+ "@pisell/date-picker": "1.0.100",
62
63
  "@pisell/utils": "1.0.42",
63
64
  "@pisell/icon": "0.0.11",
64
- "@pisell/materials": "3.0.50",
65
- "@pisell/date-picker": "1.0.100"
65
+ "@pisell/materials": "3.0.50"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",