@pisell/private-materials 3.3.68 → 3.3.69

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 (85) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +3 -3
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
  10. package/es/components/appointmentBooking/components/Services/index.js +25 -32
  11. package/es/components/appointmentBooking/components/Voucher/index.js +13 -0
  12. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +6 -7
  13. package/es/components/appointmentBooking/locales.js +3 -3
  14. package/es/components/booking/addons/index.js +9 -2
  15. package/es/components/booking/addons/model.js +5 -0
  16. package/es/components/booking/components/TabProduct/selectProductItem/index.js +3 -1
  17. package/es/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
  18. package/es/components/booking/components/footer/index.js +9 -3
  19. package/es/components/booking/components/footer/utils.js +73 -35
  20. package/es/components/booking/components/voucher/index.js +110 -66
  21. package/es/components/booking/components/voucher/utils.d.ts +4 -0
  22. package/es/components/booking/components/voucher/utils.js +15 -0
  23. package/es/components/booking/hooks/useQuotation.d.ts +1 -0
  24. package/es/components/booking/hooks/useQuotation.js +16 -1
  25. package/es/components/booking/info/service2/utils.d.ts +1 -1
  26. package/es/components/booking/info/service2/utils.js +6 -2
  27. package/es/components/booking/info2/index.js +9 -4
  28. package/es/components/booking/info2/serve.d.ts +1 -1
  29. package/es/components/booking/info2/serve.js +12 -8
  30. package/es/components/booking/info2/service/addService/index.js +2 -2
  31. package/es/components/booking/info2/service/editService/index.js +5 -2
  32. package/es/components/booking/info2/utils.d.ts +1 -1
  33. package/es/components/booking/info2/utils.js +3 -2
  34. package/es/components/booking/info2/utilsByBooking.d.ts +1 -1
  35. package/es/components/booking/info2/utilsByBooking.js +5 -3
  36. package/es/components/booking/locales.d.ts +3 -0
  37. package/es/components/booking/locales.js +6 -3
  38. package/es/components/booking/utils.d.ts +2 -2
  39. package/es/components/eftposPay/amount.d.ts +1 -1
  40. package/es/components/eftposPay/device.d.ts +1 -1
  41. package/es/components/eftposPay/hooks.d.ts +2 -2
  42. package/es/components/eftposPay/store/index.d.ts +5 -5
  43. package/es/components/ticketBooking/components/addServiceVariant/addService.js +5 -4
  44. package/es/components/ticketBooking/components/ticketBooking/index.js +4 -2
  45. package/es/components/ticketBooking/utils/index.d.ts +5 -1
  46. package/es/components/ticketBooking/utils/index.js +50 -5
  47. package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -4
  48. package/lib/components/appointmentBooking/components/Services/index.js +6 -14
  49. package/lib/components/appointmentBooking/components/Voucher/index.js +9 -0
  50. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +0 -1
  51. package/lib/components/appointmentBooking/locales.js +3 -3
  52. package/lib/components/booking/addons/index.js +10 -2
  53. package/lib/components/booking/addons/model.js +3 -0
  54. package/lib/components/booking/components/TabProduct/selectProductItem/index.js +5 -1
  55. package/lib/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
  56. package/lib/components/booking/components/footer/index.js +10 -5
  57. package/lib/components/booking/components/footer/utils.js +47 -11
  58. package/lib/components/booking/components/voucher/index.js +111 -67
  59. package/lib/components/booking/components/voucher/utils.d.ts +4 -0
  60. package/lib/components/booking/components/voucher/utils.js +43 -0
  61. package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
  62. package/lib/components/booking/hooks/useQuotation.js +19 -1
  63. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  64. package/lib/components/booking/info/service2/utils.js +3 -1
  65. package/lib/components/booking/info2/index.js +9 -9
  66. package/lib/components/booking/info2/serve.d.ts +1 -1
  67. package/lib/components/booking/info2/serve.js +1 -1
  68. package/lib/components/booking/info2/service/addService/index.js +2 -2
  69. package/lib/components/booking/info2/service/editService/index.js +5 -2
  70. package/lib/components/booking/info2/utils.d.ts +1 -1
  71. package/lib/components/booking/info2/utils.js +2 -2
  72. package/lib/components/booking/info2/utilsByBooking.d.ts +1 -1
  73. package/lib/components/booking/info2/utilsByBooking.js +3 -2
  74. package/lib/components/booking/locales.d.ts +3 -0
  75. package/lib/components/booking/locales.js +6 -3
  76. package/lib/components/booking/utils.d.ts +2 -2
  77. package/lib/components/eftposPay/amount.d.ts +1 -1
  78. package/lib/components/eftposPay/device.d.ts +1 -1
  79. package/lib/components/eftposPay/hooks.d.ts +2 -2
  80. package/lib/components/eftposPay/store/index.d.ts +5 -5
  81. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +5 -3
  82. package/lib/components/ticketBooking/components/ticketBooking/index.js +4 -2
  83. package/lib/components/ticketBooking/utils/index.d.ts +5 -1
  84. package/lib/components/ticketBooking/utils/index.js +44 -4
  85. package/package.json +2 -2
@@ -21,7 +21,7 @@ import Deposit from "../../Deposit";
21
21
  import { handleAddHolder } from "../utils";
22
22
  import "./index.less";
23
23
  var CartItem = function CartItem(_ref) {
24
- var _businessUtils$getApp, _currentStep$step, _currentStep$step2;
24
+ var _businessUtils$getApp, _businessUtils$getApp2, _currentStep$step, _currentStep$step2;
25
25
  var onNext = _ref.onNext;
26
26
  var appointmentBooking = useAppointmentBooking();
27
27
  var _ref2 = useAppointmentBookingContext(),
@@ -83,6 +83,8 @@ var CartItem = function CartItem(_ref) {
83
83
 
84
84
  // 是否安装商品券应用
85
85
  var hasGoodPassApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
86
+ // 是否安装折扣卡应用
87
+ var hasDiscountCardApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp2 = businessUtils.getAppByModal) !== null && _businessUtils$getApp2 !== void 0 && _businessUtils$getApp2.call(businessUtils, 'discountcard'));
86
88
  var handleClickCard = function handleClickCard(e, type, val) {
87
89
  console.log(e, type, val, 'handleClickCard');
88
90
  // 更改备注
@@ -249,7 +251,7 @@ var CartItem = function CartItem(_ref) {
249
251
  }
250
252
  })), /*#__PURE__*/React.createElement("div", {
251
253
  className: "appointment-footer"
252
- }, hasGoodPassApp ? /*#__PURE__*/React.createElement(VoucherCard, {
254
+ }, hasGoodPassApp || hasDiscountCardApp ? /*#__PURE__*/React.createElement(VoucherCard, {
253
255
  currentUser: currentUser,
254
256
  products: carts
255
257
  }) : null, /*#__PURE__*/React.createElement(Total, null), (carts === null || carts === void 0 ? void 0 : carts.length) > 0 && deposit !== null && deposit !== void 0 && deposit.hasDeposit ? /*#__PURE__*/React.createElement(Deposit, null) : null, /*#__PURE__*/React.createElement(ContinueButton, {
@@ -85,9 +85,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
85
85
  return checkProductType(item === null || item === void 0 ? void 0 : item.id);
86
86
  case 4:
87
87
  type = _context2.sent;
88
- if (type === 'session') {
89
- appointmentBooking.openProductDetail(item.id);
90
- }
88
+ appointmentBooking.openProductDetail(item.id);
91
89
  case 6:
92
90
  utils === null || utils === void 0 || utils.action({
93
91
  type: 'pisell1.productDetail',
@@ -105,6 +103,13 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
105
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
106
104
  while (1) switch (_context.prev = _context.next) {
107
105
  case 0:
106
+ if (!data.isCancel) {
107
+ _context.next = 3;
108
+ break;
109
+ }
110
+ appointmentBooking.closeProductDetail();
111
+ return _context.abrupt("return");
112
+ case 3:
108
113
  product = _objectSpread(_objectSpread({}, data), {}, {
109
114
  options: (data === null || data === void 0 ? void 0 : data.option) || []
110
115
  });
@@ -112,31 +117,21 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
112
117
 
113
118
  // 零售模版,直接加入购物车
114
119
  if (!isRetailTemplate) {
115
- _context.next = 7;
120
+ _context.next = 10;
116
121
  break;
117
122
  }
118
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
119
- _context.next = 5;
124
+ _context.next = 8;
120
125
  break;
121
126
  }
122
127
  return _context.abrupt("return");
123
- case 5:
128
+ case 8:
124
129
  appointmentBooking.storeProduct(product);
125
130
  return _context.abrupt("return");
126
- case 7:
127
- if (!(data !== null && data !== void 0 && data.isCancel)) {
128
- _context.next = 10;
129
- break;
130
- }
131
- if (type === 'session') {
132
- appointmentBooking.closeProductDetail();
133
- appointmentBooking.getAvailableDate();
134
- }
135
- return _context.abrupt("return");
136
131
  case 10:
137
132
  session = data === null || data === void 0 ? void 0 : data.session;
138
133
  if (!session) {
139
- _context.next = 20;
134
+ _context.next = 19;
140
135
  break;
141
136
  }
142
137
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
@@ -148,35 +143,33 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
148
143
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
149
144
  }
150
145
  });
151
- appointmentBooking.closeProductDetail();
152
- _context.next = 18;
146
+ _context.next = 17;
153
147
  return appointmentBooking.getAvailableDate({
154
148
  startDate: startDate,
155
149
  endDate: endDate
156
150
  });
157
- case 18:
158
- _context.next = 28;
151
+ case 17:
152
+ _context.next = 24;
159
153
  break;
160
- case 20:
154
+ case 19:
161
155
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
162
156
  activeStatus = resources.find(function (item) {
163
157
  return item.status === 1;
164
158
  });
165
159
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
166
- _context.next = 24;
160
+ _context.next = 23;
167
161
  break;
168
162
  }
169
163
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
170
- case 24:
164
+ case 23:
171
165
  appointmentBooking.storeProduct(product);
172
166
  // duration 类型的商品,要获取一下资源
173
- if (!(type === 'duration')) {
174
- _context.next = 28;
175
- break;
176
- }
177
- _context.next = 28;
178
- return appointmentBooking.getAvailableDate();
179
- case 28:
167
+ // if (type === 'duration') {
168
+ // await appointmentBooking.getAvailableDate();
169
+ // }
170
+ case 24:
171
+ appointmentBooking.closeProductDetail();
172
+
180
173
  // 先选择日期流程
181
174
  if (isDateSelectedFirst) {
182
175
  index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
@@ -197,7 +190,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
197
190
  removeStep('select-time');
198
191
  }
199
192
  }
200
- case 29:
193
+ case 26:
201
194
  case "end":
202
195
  return _context.stop();
203
196
  }
@@ -1,4 +1,8 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2
6
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
8
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -76,6 +80,7 @@ var VoucherCard = function VoucherCard(props) {
76
80
  return !!item.isAvailable;
77
81
  }).map(function (discount) {
78
82
  return _objectSpread(_objectSpread({}, discount), {}, {
83
+ isDisabled: discount.isDisabled || discount.isDisabledForProductUsed,
79
84
  savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
80
85
  });
81
86
  });
@@ -121,6 +126,7 @@ var VoucherCard = function VoucherCard(props) {
121
126
  });
122
127
  pisellos.effects.on('appointmentBooking_cart:onAddItem', onCartChange);
123
128
  pisellos.effects.on('appointmentBooking_cart:onUpdateQuotationPrice', onCartChange);
129
+ pisellos.effects.on('appointmentBooking_cart:onUpdateCartItemNums', onCartChange);
124
130
  pisellos.effects.on('appointmentBooking_cart:onRemoveItem', onCartChange);
125
131
  pisellos.effects.on(ShopDiscountHooks.onDiscountListChange, function (discount) {
126
132
  console.log(discount, 'discountChange');
@@ -187,6 +193,11 @@ var VoucherCard = function VoucherCard(props) {
187
193
  }
188
194
  }, locales.getText('pisell2.text.goodpass.login')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.goodpass.login-tip'))));
189
195
  };
196
+ var mixedSort = function mixedSort(val) {
197
+ return _toConsumableArray(val).sort(function (a, b) {
198
+ return Number(b === null || b === void 0 ? void 0 : b.isSelected) - Number(a === null || a === void 0 ? void 0 : a.isSelected);
199
+ });
200
+ };
190
201
  var renderVoucherInfo = function renderVoucherInfo() {
191
202
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
192
203
  className: "voucher-title"
@@ -211,6 +222,7 @@ var VoucherCard = function VoucherCard(props) {
211
222
  width: '100%'
212
223
  },
213
224
  dataSource: availableData,
225
+ mixedSort: mixedSort,
214
226
  onChange: function onChange(val) {
215
227
  var detail = shopDiscount.setDiscountSelected({
216
228
  discountId: val.id,
@@ -228,6 +240,7 @@ var VoucherCard = function VoucherCard(props) {
228
240
  }
229
241
  }, locales.getText('pisell2.text.goodpass.code'), ":"), /*#__PURE__*/React.createElement(PisellInput, {
230
242
  value: code,
243
+ allowClear: true,
231
244
  onChange: function onChange(e) {
232
245
  var _e$target;
233
246
  setCode((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
@@ -63,23 +63,22 @@ var DepositModal = function DepositModal(props) {
63
63
  data = _yield$appointmentBoo.data;
64
64
  setPolicy(data);
65
65
  onChange && onChange(data);
66
- _context.next = 15;
66
+ _context.next = 14;
67
67
  break;
68
68
  case 10:
69
69
  _context.prev = 10;
70
70
  _context.t0 = _context["catch"](1);
71
71
  console.log(_context.t0);
72
72
  onChange && onChange(_context.t0);
73
- debugger;
74
- case 15:
75
- _context.prev = 15;
73
+ case 14:
74
+ _context.prev = 14;
76
75
  setLoading(false);
77
- return _context.finish(15);
78
- case 18:
76
+ return _context.finish(14);
77
+ case 17:
79
78
  case "end":
80
79
  return _context.stop();
81
80
  }
82
- }, _callee, null, [[1, 10, 15, 18]]);
81
+ }, _callee, null, [[1, 10, 14, 17]]);
83
82
  }));
84
83
  return function getPolicy(_x) {
85
84
  return _ref.apply(this, arguments);
@@ -126,7 +126,7 @@ export default {
126
126
  return "Tip: Change ".concat(val || 'resource', " using the dropdown in the cart.");
127
127
  },
128
128
  'pisell2.text.apply': 'Apply',
129
- 'pisell2.text.goodpass': 'GoodPass',
129
+ 'pisell2.text.goodpass': 'Promotion',
130
130
  'pisell2.text.goodpass.product-vouchers': 'Product Vouchers',
131
131
  'pisell2.text.goodpass.view-more': 'View More',
132
132
  'pisell2.text.goodpass.code': 'Code',
@@ -262,7 +262,7 @@ export default {
262
262
  return "\u63D0\u793A\uFF1A\u5728\u53F3\u4FA7\u8D2D\u7269\u8F66\u4E2D\uFF0C\u901A\u8FC7\u4E0B\u62C9\u6846\u4FEE\u6539\u201C".concat(val || '资源', "\u201D");
263
263
  },
264
264
  'pisell2.text.apply': '应用',
265
- 'pisell2.text.goodpass': '商品券',
265
+ 'pisell2.text.goodpass': '促销',
266
266
  'pisell2.text.goodpass.product-vouchers': '商品兑换券',
267
267
  'pisell2.text.goodpass.view-more': '查看更多',
268
268
  'pisell2.text.goodpass.code': '券码',
@@ -398,7 +398,7 @@ export default {
398
398
  return "\u63D0\u793A\uFF1A\u5728\u53F3\u5074\u8CFC\u7269\u8ECA\u4E2D\uFF0C\u900F\u904E\u4E0B\u62C9\u6846\u4FEE\u6539\u201C".concat(val || '資源', "\u201D");
399
399
  },
400
400
  'pisell2.text.apply': '應用',
401
- 'pisell2.text.goodpass': '商品券',
401
+ 'pisell2.text.goodpass': '促銷',
402
402
  'pisell2.text.goodpass.product-vouchers': '商品兌換券',
403
403
  'pisell2.text.goodpass.view-more': '查看更多',
404
404
  'pisell2.text.goodpass.code': '券碼',
@@ -97,11 +97,13 @@ var formatProductValues = function formatProductValues(data) {
97
97
  return _objectSpread(_objectSpread({}, d), {}, {
98
98
  id: d.product_id,
99
99
  title: d.product_title,
100
+ isAddons: true,
100
101
  quantity: d.product_quantity,
101
102
  cover: d.product_cover,
102
103
  price: Number(d.source_product_price),
103
104
  _extend: {
104
105
  total: Number(d.selling_price),
106
+ origin_total: Number(d.selling_price),
105
107
  payment_price: Number(d.payment_price),
106
108
  price: Number(d.source_product_price),
107
109
  quantity: d.product_quantity,
@@ -309,6 +311,7 @@ var Addons = Provider(function (props) {
309
311
  var _detail = detail || item;
310
312
  var product = _objectSpread(_objectSpread({}, _detail), {}, {
311
313
  _id: getUniqueId(),
314
+ isAddons: true,
312
315
  _key: e.key,
313
316
  _extend: {
314
317
  price: _detail.price,
@@ -319,8 +322,11 @@ var Addons = Provider(function (props) {
319
322
  });
320
323
  var _total = getProductTotalPrice(product);
321
324
  product._extend.total = _total;
325
+ product._extend.origin_total = _total;
326
+ // 已经加入购物车的折扣商品 不叠加
322
327
  var _item = _list.find(function (d) {
323
- return d._extend.other.rowKey === e.rowKey;
328
+ var _d$discount_list;
329
+ return d._extend.other.rowKey === e.rowKey && !d.booking_id && !((_d$discount_list = d.discount_list) !== null && _d$discount_list !== void 0 && _d$discount_list.length);
324
330
  });
325
331
 
326
332
  // 如果已添加, 则数量+1
@@ -513,6 +519,7 @@ var Addons = Provider(function (props) {
513
519
  var _product$_extend;
514
520
  var _detail = detail || item;
515
521
  var product = _objectSpread(_objectSpread(_objectSpread({}, item), _detail), {}, {
522
+ isAddons: true,
516
523
  // 编辑商品时清除折扣信息
517
524
  discount_list: [],
518
525
  _extend: _objectSpread(_objectSpread({}, item._extend), {}, {
@@ -525,8 +532,8 @@ var Addons = Provider(function (props) {
525
532
  }
526
533
  var _total = getProductTotalPrice(product);
527
534
  product._extend.total = _total;
535
+ product._extend.origin_total = _total;
528
536
  var _list = _toConsumableArray(state.addons.value);
529
- console.log('cacheItem', product);
530
537
  _list = _list.map(function (d) {
531
538
  return d._id === product._id ? product : d;
532
539
  });
@@ -17,6 +17,11 @@ var _miniRedux = miniRedux({
17
17
  state.setGlobalState({
18
18
  addons: _objectSpread(_objectSpread({}, state.addons), payload)
19
19
  });
20
+ },
21
+ setService: function setService(state, payload) {
22
+ state.setGlobalState({
23
+ service: _objectSpread(_objectSpread({}, state.service), payload)
24
+ });
20
25
  }
21
26
  }
22
27
  }),
@@ -63,6 +63,8 @@ var SelectProductItem = function SelectProductItem(_ref) {
63
63
  disabled: disabled
64
64
  }), /*#__PURE__*/React.createElement("div", {
65
65
  className: "server-select-product-total"
66
- }, formatAmount(item._extend.total * item._extend.quantity, 2, amountSymbol)))));
66
+ }, item._extend.origin_total !== item._extend.total && /*#__PURE__*/React.createElement("span", {
67
+ className: "server-select-product-origin-total"
68
+ }, formatAmount(item._extend.origin_total * item._extend.quantity, 2, amountSymbol)), formatAmount(item._extend.total * item._extend.quantity, 2, amountSymbol)))));
67
69
  };
68
70
  export default SelectProductItem;
@@ -66,6 +66,7 @@
66
66
  font-style: normal;
67
67
  font-weight: 400;
68
68
 
69
+
69
70
  .server-select-product-total {
70
71
  color: var(--Base-Black, #000);
71
72
  font-size: 16px;
@@ -73,6 +74,11 @@
73
74
  font-weight: 500;
74
75
  line-height: 24px;
75
76
  }
77
+ .server-select-product-origin-total {
78
+ text-decoration: line-through;
79
+ color: #4e4e4e;
80
+ margin-right: 12px;
81
+ }
76
82
  }
77
83
 
78
84
 
@@ -47,7 +47,7 @@ import dayjs from 'dayjs';
47
47
  * @Date: 2024-01-30 16:51
48
48
  */
49
49
  var Footer = function Footer(props) {
50
- var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _state$addons4, _state$bookingDetail12, _state$bookingDetail13;
50
+ var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _businessUtils$getApp2, _state$addons4, _state$bookingDetail12, _state$bookingDetail13;
51
51
  var state = props.state,
52
52
  buttons = props.buttons,
53
53
  dispatch = props.dispatch,
@@ -240,6 +240,7 @@ var Footer = function Footer(props) {
240
240
 
241
241
  // 是否安装商品券应用
242
242
  var hasGoodPassApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp = businessUtils.getAppByModal) !== null && _businessUtils$getApp !== void 0 && _businessUtils$getApp.call(businessUtils, 'goodpass'));
243
+ var hasDiscountCardApp = !!(businessUtils !== null && businessUtils !== void 0 && (_businessUtils$getApp2 = businessUtils.getAppByModal) !== null && _businessUtils$getApp2 !== void 0 && _businessUtils$getApp2.call(businessUtils, 'discountcard'));
243
244
  console.log('has goodpass app:', hasGoodPassApp);
244
245
 
245
246
  /**
@@ -1291,14 +1292,19 @@ var Footer = function Footer(props) {
1291
1292
  label: locales.getText('pisell2.text.refunded-amount')
1292
1293
  }];
1293
1294
  }, [total, (_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.surcharge, state, state.bookingId]);
1295
+ var paymentRefundedStatus = useMemo(function () {
1296
+ var _state$bookingDetail14;
1297
+ return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.payment_status);
1298
+ }, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
1294
1299
  return /*#__PURE__*/React.createElement(Skeleton, {
1295
1300
  title: false,
1296
1301
  round: true,
1297
1302
  loading: showFooter,
1298
1303
  active: true
1299
- }, hasGoodPassApp && source === 'info' ? /*#__PURE__*/React.createElement(VoucherCard, {
1304
+ }, (hasGoodPassApp || hasDiscountCardApp) && ['addons', 'info'].includes(source) && !paymentRefundedStatus ? /*#__PURE__*/React.createElement(VoucherCard, {
1300
1305
  state: state,
1301
- dispatch: dispatch
1306
+ dispatch: dispatch,
1307
+ source: source
1302
1308
  }) : null, /*#__PURE__*/React.createElement("div", {
1303
1309
  className: "pisell-lowcode__booking-footer-total"
1304
1310
  }, /*#__PURE__*/React.createElement("span", {