@pisell/private-materials 3.0.211 → 3.0.212

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 (63) 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 +5 -5
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/Sales/Cart/index.js +3 -1
  12. package/es/components/Sales/Event/Detail.js +1 -1
  13. package/es/components/Sales/Init/index.d.ts +4 -0
  14. package/es/components/Sales/Init/index.js +6 -2
  15. package/es/components/Sales/Resource/serve.d.ts +1 -0
  16. package/es/components/Sales/Summary/index.d.ts +3 -0
  17. package/es/components/Sales/Summary/index.js +9 -3
  18. package/es/components/Sales/Summary/serve.d.ts +0 -2
  19. package/es/components/Sales/Summary/serve.js +0 -11
  20. package/es/components/Sales/Summary/utils.d.ts +15 -1
  21. package/es/components/Sales/Summary/utils.js +32 -3
  22. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
  23. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +40 -0
  24. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -8
  25. package/es/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
  26. package/es/components/eventBooking/components/Provider/Footer/index.js +2 -2
  27. package/es/components/eventBooking/components/Provider/Header/index.js +4 -2
  28. package/es/components/eventBooking/components/Provider/Resource/index.js +4 -21
  29. package/es/components/eventBooking/components/bookingDetailModal/index.js +98 -32
  30. package/es/components/eventBooking/components/bookingDetailModal/index.less +1 -1
  31. package/es/components/eventBooking/components/resourceDisplay/index.less +14 -0
  32. package/es/components/eventBooking/index.js +2 -1
  33. package/es/components/eventBooking/locales.d.ts +6 -3
  34. package/es/components/eventBooking/locales.js +22 -7
  35. package/es/components/eventBooking/utils.d.ts +9 -0
  36. package/es/components/eventBooking/utils.js +17 -0
  37. package/lib/components/Sales/Cart/index.js +6 -4
  38. package/lib/components/Sales/Event/Detail.js +1 -1
  39. package/lib/components/Sales/Init/index.d.ts +4 -0
  40. package/lib/components/Sales/Init/index.js +5 -2
  41. package/lib/components/Sales/Resource/serve.d.ts +1 -0
  42. package/lib/components/Sales/Summary/index.d.ts +3 -0
  43. package/lib/components/Sales/Summary/index.js +11 -3
  44. package/lib/components/Sales/Summary/serve.d.ts +0 -2
  45. package/lib/components/Sales/Summary/serve.js +0 -37
  46. package/lib/components/Sales/Summary/utils.d.ts +15 -1
  47. package/lib/components/Sales/Summary/utils.js +25 -5
  48. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +4 -0
  49. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +75 -0
  50. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -9
  51. package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +42 -10
  52. package/lib/components/eventBooking/components/Provider/Footer/index.js +2 -2
  53. package/lib/components/eventBooking/components/Provider/Header/index.js +5 -2
  54. package/lib/components/eventBooking/components/Provider/Resource/index.js +4 -12
  55. package/lib/components/eventBooking/components/bookingDetailModal/index.js +73 -17
  56. package/lib/components/eventBooking/components/bookingDetailModal/index.less +1 -1
  57. package/lib/components/eventBooking/components/resourceDisplay/index.less +14 -0
  58. package/lib/components/eventBooking/index.js +2 -1
  59. package/lib/components/eventBooking/locales.d.ts +6 -3
  60. package/lib/components/eventBooking/locales.js +10 -7
  61. package/lib/components/eventBooking/utils.d.ts +9 -0
  62. package/lib/components/eventBooking/utils.js +12 -2
  63. package/package.json +2 -2
@@ -2,7 +2,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2
2
  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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
3
  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
4
  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); }); }; }
5
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
6
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
7
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -46,6 +45,7 @@ var BookingDetailModal = function BookingDetailModal(props) {
46
45
  _useState6 = _slicedToArray(_useState5, 2),
47
46
  openCheckout = _useState6[0],
48
47
  setOpenCheckout = _useState6[1];
48
+ var isUserClickRef = useRef(false); // 添加用户点击标记
49
49
 
50
50
  /**
51
51
  * @title: 详情锚点
@@ -100,49 +100,103 @@ var BookingDetailModal = function BookingDetailModal(props) {
100
100
  useEffect(function () {
101
101
  if (!modalContentRef.current || !open) return;
102
102
  var handleScroll = function handleScroll() {
103
- if (isScrolling) return;
103
+ if (isScrolling || isUserClickRef.current) return;
104
104
  var container = modalContentRef.current;
105
105
  if (!container) return;
106
106
  var scrollTop = container.scrollTop;
107
107
  var headerHeight = 58;
108
+ var containerHeight = container.clientHeight;
109
+ var scrollHeight = container.scrollHeight;
110
+ var lastOption = anchorOptions[anchorOptions.length - 1];
108
111
 
109
- // 找到当前可见的区域
110
- var _iterator = _createForOfIteratorHelper(anchorOptions),
111
- _step;
112
- try {
113
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
114
- var option = _step.value;
115
- var element = document.getElementById(option.id);
116
- if (element) {
117
- var rect = element.getBoundingClientRect();
118
- var elementTop = rect.top;
112
+ // 优先检查是否完全滚动到底部
113
+ var isExactBottom = Math.abs(scrollTop + containerHeight - scrollHeight) <= 1;
114
+ if (isExactBottom && activeTab !== lastOption.id) {
115
+ var _tabsRef$current;
116
+ setActiveTab(lastOption.id);
117
+ tabsRef === null || tabsRef === void 0 ? void 0 : (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 ? void 0 : _tabsRef$current.scroll(lastOption.id);
118
+ return;
119
+ }
119
120
 
120
- // 当元素进入视口顶部附近时
121
- if (Math.abs(elementTop - headerHeight) < 50) {
122
- if (activeTab !== option.id) {
123
- var _tabsRef$current;
124
- setActiveTab(option.id);
125
- tabsRef === null || tabsRef === void 0 ? void 0 : (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 ? void 0 : _tabsRef$current.scroll(option.id);
126
- }
127
- break;
128
- }
129
- }
121
+ // 其次检查是否接近底部
122
+ var isNearBottom = scrollTop + containerHeight + 100 >= scrollHeight;
123
+ var lastElement = document.getElementById(lastOption.id);
124
+ if (isNearBottom && lastElement) {
125
+ var rect = lastElement.getBoundingClientRect();
126
+ if (rect.top < containerHeight && activeTab !== lastOption.id) {
127
+ var _tabsRef$current2;
128
+ setActiveTab(lastOption.id);
129
+ tabsRef === null || tabsRef === void 0 ? void 0 : (_tabsRef$current2 = tabsRef.current) === null || _tabsRef$current2 === void 0 ? void 0 : _tabsRef$current2.scroll(lastOption.id);
130
+ return;
130
131
  }
131
- } catch (err) {
132
- _iterator.e(err);
133
- } finally {
134
- _iterator.f();
132
+ }
133
+
134
+ // 找到当前在视口中的所有元素
135
+ var visibleElements = anchorOptions.map(function (option) {
136
+ var element = document.getElementById(option.id);
137
+ if (!element) return null;
138
+ var rect = element.getBoundingClientRect();
139
+ var elementTop = rect.top;
140
+ var elementBottom = rect.bottom;
141
+
142
+ // 元素顶部相对于视口顶部(考虑 header)的距离
143
+ var topDistance = Math.abs(elementTop - headerHeight);
144
+
145
+ // 元素是否在视口中
146
+ var isVisible = elementTop < containerHeight && elementBottom > headerHeight;
147
+ return {
148
+ id: option.id,
149
+ topDistance: topDistance,
150
+ isVisible: isVisible,
151
+ top: elementTop
152
+ };
153
+ }).filter(Boolean);
154
+
155
+ // 找到最接近顶部且可见的元素
156
+ var currentElement = visibleElements.filter(function (el) {
157
+ return el.isVisible;
158
+ }).sort(function (a, b) {
159
+ // 如果两个元素都在 header 下方,选择最靠近 header 的
160
+ if (a.top > headerHeight && b.top > headerHeight) {
161
+ return a.top - b.top;
162
+ }
163
+ // 如果两个元素都在 header 上方,选择最靠近 header 的
164
+ if (a.top < headerHeight && b.top < headerHeight) {
165
+ return b.top - a.top;
166
+ }
167
+ // 优先选择在 header 下方的元素
168
+ return a.top > headerHeight ? -1 : 1;
169
+ })[0];
170
+ if (currentElement && activeTab !== currentElement.id) {
171
+ var _tabsRef$current3;
172
+ setActiveTab(currentElement.id);
173
+ tabsRef === null || tabsRef === void 0 ? void 0 : (_tabsRef$current3 = tabsRef.current) === null || _tabsRef$current3 === void 0 ? void 0 : _tabsRef$current3.scroll(currentElement.id);
135
174
  }
136
175
  };
137
176
  var container = modalContentRef.current;
138
177
  container.addEventListener('scroll', handleScroll);
139
-
140
- // 初始化时执行一次
141
- setTimeout(handleScroll, 100);
142
178
  return function () {
143
179
  return container.removeEventListener('scroll', handleScroll);
144
180
  };
145
181
  }, [anchorOptions, activeTab, open, isScrolling]);
182
+ var handleTabChange = function handleTabChange(key) {
183
+ if (isUserClickRef.current) {
184
+ // 如果是用户点击,立即更新并禁用滚动监听
185
+ setActiveTab(key);
186
+ setIsScrolling(true); // 临时禁用滚动监听
187
+
188
+ // 延长禁用时间,确保滚动完全结束
189
+ setTimeout(function () {
190
+ setIsScrolling(false);
191
+ isUserClickRef.current = false; // 重置点击标记
192
+ }, 1200); // 稍微延长时间
193
+ } else {
194
+ // 如果是滚动触发,只在非滚动状态下更新
195
+ if (!isScrolling && !isUserClickRef.current) {
196
+ setActiveTab(key);
197
+ }
198
+ }
199
+ };
146
200
  var content = function content() {
147
201
  return /*#__PURE__*/React.createElement("div", {
148
202
  className: "booking-detail-modal-content",
@@ -153,9 +207,11 @@ var BookingDetailModal = function BookingDetailModal(props) {
153
207
  ref: tabsRef,
154
208
  options: anchorOptions,
155
209
  tab: activeTab,
156
- onChange: function onChange(key) {
157
- scrollToElement(key);
158
- setActiveTab(key);
210
+ containerRef: modalContentRef,
211
+ onChange: handleTabChange,
212
+ onTabClick: function onTabClick() {
213
+ // 设置点击标记
214
+ isUserClickRef.current = true;
159
215
  }
160
216
  })), /*#__PURE__*/React.createElement("div", {
161
217
  className: "content-wrapper"
@@ -223,6 +279,16 @@ var BookingDetailModal = function BookingDetailModal(props) {
223
279
  return _ref.apply(this, arguments);
224
280
  };
225
281
  }();
282
+
283
+ // 监听弹窗打开/关闭状态,重置 activeTab
284
+ useEffect(function () {
285
+ if (open) {
286
+ setActiveTab('introduction');
287
+ // 重置其他相关状态
288
+ setIsScrolling(false);
289
+ isUserClickRef.current = false;
290
+ }
291
+ }, [open]);
226
292
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellModal, {
227
293
  open: open,
228
294
  title: locales.getText('pisell2.event.details'),
@@ -12,7 +12,7 @@
12
12
  top: 0;
13
13
  z-index: 10;
14
14
  background: #fff;
15
- padding: 0 !important;
15
+ padding: 0 16px !important;
16
16
  // padding: 16px;
17
17
  }
18
18
 
@@ -78,4 +78,18 @@
78
78
  line-height: 10px;
79
79
  }
80
80
  }
81
+
82
+ &-empty-avatar {
83
+ .pisell-lowcode-avatar-string {
84
+ position: relative;
85
+ left: 0;
86
+ height: 32px;
87
+ line-height: 32px;
88
+ transform: scale(1) !important;
89
+ .pisell-lowcode-image {
90
+ width: 32px;
91
+ height: 32px;
92
+ }
93
+ }
94
+ }
81
95
  }
@@ -40,7 +40,8 @@ var Content = function Content() {
40
40
  if (!form_id) return;
41
41
  getResourceList.run({
42
42
  form_id: form_id,
43
- shop_id: shop_id
43
+ shop_id: shop_id,
44
+ form_data_status: 'active'
44
45
  });
45
46
  }, [form_id]);
46
47
  return getResourceList.data ? /*#__PURE__*/React.createElement("div", {
@@ -13,11 +13,12 @@ declare const _default: {
13
13
  'pisell2.event.close.continue': string;
14
14
  'pisell2.event.close.exit': string;
15
15
  'pisell2.event.step': (step: number) => string;
16
- 'pisell2.event.select.category': string;
16
+ 'pisell2.event.select.category': (val: string) => string;
17
17
  'pisell2.event.select.campus': (val: string) => string;
18
18
  'pisell2.event.select.event': string;
19
19
  'pisell2.event.cart': string;
20
20
  'pisell2.event.total': string;
21
+ 'pisell2.event.total.gst': (val: string, amount: any) => string;
21
22
  'pisell2.event.continue': string;
22
23
  'pisell2.event.details': string;
23
24
  'pisell2.event.introduction': string;
@@ -83,11 +84,12 @@ declare const _default: {
83
84
  'pisell2.event.close.continue': string;
84
85
  'pisell2.event.close.exit': string;
85
86
  'pisell2.event.step': (step: number) => string;
86
- 'pisell2.event.select.category': string;
87
+ 'pisell2.event.select.category': (val: string) => string;
87
88
  'pisell2.event.select.event': string;
88
89
  'pisell2.event.select.campus': (val: string) => string;
89
90
  'pisell2.event.cart': string;
90
91
  'pisell2.event.total': string;
92
+ 'pisell2.event.total.gst': (val: string, amount: any) => string;
91
93
  'pisell2.event.continue': string;
92
94
  'pisell2.event.details': string;
93
95
  'pisell2.event.introduction': string;
@@ -153,11 +155,12 @@ declare const _default: {
153
155
  'pisell2.event.close.continue': string;
154
156
  'pisell2.event.close.exit': string;
155
157
  'pisell2.event.step': (step: number) => string;
156
- 'pisell2.event.select.category': string;
158
+ 'pisell2.event.select.category': (val: string) => string;
157
159
  'pisell2.event.select.event': string;
158
160
  'pisell2.event.select.campus': (val: string) => string;
159
161
  'pisell2.event.cart': string;
160
162
  'pisell2.event.total': string;
163
+ 'pisell2.event.total.gst': (val: string, amount: any) => string;
161
164
  'pisell2.event.continue': string;
162
165
  'pisell2.event.details': string;
163
166
  'pisell2.event.introduction': string;
@@ -15,13 +15,18 @@ export default {
15
15
  'pisell2.event.step': function pisell2EventStep(step) {
16
16
  return "Step ".concat(step);
17
17
  },
18
- 'pisell2.event.select.category': "Select category",
18
+ 'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
19
+ return "Select ".concat(val || 'resource');
20
+ },
19
21
  'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
20
- return "Please choose ".concat(val || 'resource');
22
+ return "Please select ".concat(val || 'resource');
21
23
  },
22
- 'pisell2.event.select.event': "Select event",
24
+ 'pisell2.event.select.event': "Select service",
23
25
  'pisell2.event.cart': "Cart",
24
26
  'pisell2.event.total': "Total",
27
+ 'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
28
+ return "Including ".concat(val, " ").concat(amount);
29
+ },
25
30
  'pisell2.event.continue': "Continue",
26
31
  'pisell2.event.details': "Details",
27
32
  'pisell2.event.introduction': "Introduction",
@@ -93,13 +98,18 @@ export default {
93
98
  'pisell2.event.step': function pisell2EventStep(step) {
94
99
  return "\u6B65\u9AA4 ".concat(step);
95
100
  },
96
- 'pisell2.event.select.category': "选择分类",
97
- 'pisell2.event.select.event': "选择活动",
101
+ 'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
102
+ return "\u9009\u62E9".concat(val || '资源');
103
+ },
104
+ 'pisell2.event.select.event': "选择服务",
98
105
  'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
99
106
  return "\u8BF7\u9009\u62E9".concat(val || '资源');
100
107
  },
101
108
  'pisell2.event.cart': "购物车",
102
109
  'pisell2.event.total': "总计",
110
+ 'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
111
+ return "\u5305\u542B".concat(val, " ").concat(amount);
112
+ },
103
113
  'pisell2.event.continue': "继续",
104
114
  'pisell2.event.details': "详情",
105
115
  'pisell2.event.introduction': "介绍",
@@ -171,13 +181,18 @@ export default {
171
181
  'pisell2.event.step': function pisell2EventStep(step) {
172
182
  return "\u6B65\u9A5F ".concat(step);
173
183
  },
174
- 'pisell2.event.select.category': "選擇分類",
175
- 'pisell2.event.select.event': "選擇活動",
184
+ 'pisell2.event.select.category': function pisell2EventSelectCategory(val) {
185
+ return "\u9078\u64C7".concat(val || '資源');
186
+ },
187
+ 'pisell2.event.select.event': "選擇服務",
176
188
  'pisell2.event.select.campus': function pisell2EventSelectCampus(val) {
177
189
  return "\u8ACB\u9078\u64C7".concat(val || '資源');
178
190
  },
179
191
  'pisell2.event.cart': "購物車",
180
192
  'pisell2.event.total': "總計",
193
+ 'pisell2.event.total.gst': function pisell2EventTotalGst(val, amount) {
194
+ return "\u5305\u542B".concat(val, " ").concat(amount);
195
+ },
181
196
  'pisell2.event.continue': "繼續",
182
197
  'pisell2.event.details': "詳情",
183
198
  'pisell2.event.introduction': "介紹",
@@ -34,3 +34,12 @@ export declare const getScheduleColors: (schedules: any[]) => string;
34
34
  * @Date: 2025-01-12 11:55
35
35
  */
36
36
  export declare const formatMonthDisplay: (dateString: string) => string;
37
+ /**
38
+ * @title: 资源名称
39
+ * @description:
40
+ * @param {any} data
41
+ * @return {*}
42
+ * @Author: WangHan
43
+ * @Date: 2025-02-11 13:39
44
+ */
45
+ export declare const resourceTitle: (data: any) => any;
@@ -79,4 +79,21 @@ export var formatMonthDisplay = function formatMonthDisplay(dateString) {
79
79
  month: 'long',
80
80
  year: 'numeric'
81
81
  });
82
+ };
83
+
84
+ /**
85
+ * @title: 资源名称
86
+ * @description:
87
+ * @param {any} data
88
+ * @return {*}
89
+ * @Author: WangHan
90
+ * @Date: 2025-02-11 13:39
91
+ */
92
+ export var resourceTitle = function resourceTitle(data) {
93
+ var _data$initData, _data$initData$boardS, _data$initData$boardS2, _form$setting, _context$appHelper, _context$appHelper$ut, _translation;
94
+ var context = useEngineContext();
95
+ var form = data === null || data === void 0 ? void 0 : (_data$initData = data.initData) === null || _data$initData === void 0 ? void 0 : (_data$initData$boardS = _data$initData.boardSetting) === null || _data$initData$boardS === void 0 ? void 0 : (_data$initData$boardS2 = _data$initData$boardS.event_v2_form) === null || _data$initData$boardS2 === void 0 ? void 0 : _data$initData$boardS2.form;
96
+ var title = (form === null || form === void 0 ? void 0 : (_form$setting = form.setting) === null || _form$setting === void 0 ? void 0 : _form$setting.title) || (form === null || form === void 0 ? void 0 : form.title);
97
+ var translation = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translation;
98
+ return (_translation = translation(title)) === null || _translation === void 0 ? void 0 : _translation.toLowerCase();
82
99
  };
@@ -219,7 +219,7 @@ var CartProvider = ({ children }) => {
219
219
  });
220
220
  };
221
221
  const createCartItemData = () => {
222
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
222
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
223
223
  const _cartData = getCurrentData().cartData;
224
224
  if (_cartData.currentCartItem) {
225
225
  const {
@@ -256,6 +256,8 @@ var CartProvider = ({ children }) => {
256
256
  // 是否显示时间
257
257
  show_time: true,
258
258
  end_time: endTime ? (0, import_dayjs.default)(endTime || "").format("HH:mm") : "",
259
+ custom_day_count: ((_n = (_m = (_l = eventItem == null ? void 0 : eventItem.eventDetail) == null ? void 0 : _l.selectDate) == null ? void 0 : _m.dates) == null ? void 0 : _n.length) || 0,
260
+ is_charge_tax: bookingOptionData == null ? void 0 : bookingOptionData.is_charge_tax,
259
261
  _originData: {
260
262
  ..._cartData.currentCartItem._originData,
261
263
  product: {
@@ -281,9 +283,9 @@ var CartProvider = ({ children }) => {
281
283
  };
282
284
  if (holderItem == null ? void 0 : holderItem._originData) {
283
285
  newCartItem._originData.holder = {
284
- customer_id: (_l = getUserInfo()) == null ? void 0 : _l.id,
285
- form_id: (_m = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _m.form_id,
286
- form_record: ((_n = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _n.form_record_id) ? [(_o = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _o.form_record_id] : null
286
+ customer_id: (_o = getUserInfo()) == null ? void 0 : _o.id,
287
+ form_id: (_p = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _p.form_id,
288
+ form_record: ((_q = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _q.form_record_id) ? [(_r = holderItem == null ? void 0 : holderItem._originData) == null ? void 0 : _r.form_record_id] : null
287
289
  };
288
290
  }
289
291
  return newCartItem;
@@ -60,7 +60,7 @@ var EventDetailProvider = ({
60
60
  const introduction = {
61
61
  title: eventItem.title,
62
62
  price: eventItem.price,
63
- images: [eventItem.image]
63
+ images: eventItem.image ? [eventItem.image] : []
64
64
  };
65
65
  eventRef.current = eventItem;
66
66
  _setDetail({ introduction });
@@ -1,5 +1,9 @@
1
1
  import React from 'react';
2
2
  interface InitData {
3
+ boardSetting?: any;
4
+ form_id?: number;
5
+ shop_id?: number;
6
+ shop?: any;
3
7
  }
4
8
  interface InitContextType {
5
9
  getBoardSetting: any;
@@ -45,11 +45,13 @@ var import_Holder = __toESM(require("../Holder"));
45
45
  var import_Event = __toESM(require("../Event"));
46
46
  var import_Resource = __toESM(require("../Resource"));
47
47
  var import_Summary = __toESM(require("../Summary"));
48
+ var import_Customer = require("../Customer");
48
49
  var InitContext = (0, import_react.createContext)(
49
50
  void 0
50
51
  );
51
52
  var InitProvider = ({ children }) => {
52
53
  const { data, setData, hooks, getCurrentData, getSessionStorage } = (0, import_SalesModel.useSales)();
54
+ const { appUtils } = (0, import_Customer.useCustomer)();
53
55
  const { useCustomInit } = hooks;
54
56
  const customInit = useCustomInit();
55
57
  const initData = (0, import_react.useMemo)(() => {
@@ -95,11 +97,12 @@ var InitProvider = ({ children }) => {
95
97
  const getBoardSetting = (0, import_ahooks.useRequest)(import_serve.getBoardSettingApi, {
96
98
  manual: true,
97
99
  onSuccess: (res) => {
98
- var _a, _b, _c, _d, _e;
100
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
99
101
  setInitData({
100
102
  boardSetting: res == null ? void 0 : res.data,
101
103
  form_id: (_d = (_c = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.config) == null ? void 0 : _b.resource) == null ? void 0 : _c.booking_event_v2_resource) == null ? void 0 : _d.form_id,
102
- shop_id: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.shop_id
104
+ shop_id: (_e = res == null ? void 0 : res.data) == null ? void 0 : _e.shop_id,
105
+ shop: (_i = (_h = (_g = (_f = appUtils.getStore()) == null ? void 0 : _f.getState()) == null ? void 0 : _g.core) == null ? void 0 : _h.core) == null ? void 0 : _i.shop
103
106
  });
104
107
  }
105
108
  });
@@ -1,4 +1,5 @@
1
1
  export declare const getResourceListApi: (params: {
2
2
  form_id: string;
3
3
  shop_id: string;
4
+ form_data_status: string;
4
5
  }) => Promise<any>;
@@ -4,6 +4,9 @@ interface SummaryData {
4
4
  interface SummaryContextType {
5
5
  subtotal: number | string;
6
6
  total: number | string;
7
+ taxTitle?: string;
8
+ totalTaxFee?: string;
9
+ isPriceIncludeTax?: 0 | 1;
7
10
  }
8
11
  interface SummaryProviderProps {
9
12
  children: React.ReactNode;
@@ -38,6 +38,7 @@ module.exports = __toCommonJS(Summary_exports);
38
38
  var import_react = __toESM(require("react"));
39
39
  var import_Cart = require("../Cart");
40
40
  var import_utils = require("./utils");
41
+ var import_Init = require("../Init");
41
42
  var defaultState = {};
42
43
  var SummaryContext = (0, import_react.createContext)(
43
44
  void 0
@@ -46,14 +47,21 @@ var SummaryProvider = ({
46
47
  children
47
48
  }) => {
48
49
  const { cartData } = (0, import_Cart.useCart)();
50
+ const { initData } = (0, import_Init.useInit)();
49
51
  const summaryData = (0, import_react.useMemo)(() => {
50
- return (0, import_utils.calculatePriceDetails)(cartData.cartItems);
51
- }, [cartData.cartItems]);
52
+ return (0, import_utils.calculatePriceDetails)(
53
+ (initData == null ? void 0 : initData.shop) || {},
54
+ cartData.cartItems
55
+ );
56
+ }, [cartData.cartItems, initData == null ? void 0 : initData.shop]);
52
57
  const contextValue = {
53
58
  // 商品总价
54
59
  subtotal: summaryData.subtotal,
55
60
  // 总金额
56
- total: summaryData.total
61
+ total: summaryData.total,
62
+ taxTitle: summaryData.taxTitle,
63
+ totalTaxFee: summaryData.totalTaxFee,
64
+ isPriceIncludeTax: summaryData.isPriceIncludeTax
57
65
  };
58
66
  return /* @__PURE__ */ import_react.default.createElement(SummaryContext.Provider, { value: contextValue }, children);
59
67
  };
@@ -1,2 +0,0 @@
1
- export declare const getHolderListApi: () => any;
2
- export declare const createHolderApi: (data: any) => any;
@@ -1,37 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/components/Sales/Summary/serve.ts
20
- var serve_exports = {};
21
- __export(serve_exports, {
22
- createHolderApi: () => createHolderApi,
23
- getHolderListApi: () => getHolderListApi
24
- });
25
- module.exports = __toCommonJS(serve_exports);
26
- var import_request = require("../../../utils/request");
27
- var getHolderListApi = () => {
28
- return (0, import_request.get)("/api/holder/list");
29
- };
30
- var createHolderApi = (data) => {
31
- return (0, import_request.post)("/api/holder/create", data);
32
- };
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- createHolderApi,
36
- getHolderListApi
37
- });
@@ -1,10 +1,15 @@
1
+ import Decimal from 'decimal.js';
1
2
  interface CartItem {
2
3
  price: number | string;
3
4
  quantity?: number;
5
+ [k: string]: any;
4
6
  }
5
7
  interface PriceDetail {
6
8
  subtotal: string;
7
9
  total: string;
10
+ taxTitle?: string;
11
+ totalTaxFee?: string;
12
+ isPriceIncludeTax?: 0 | 1;
8
13
  }
9
14
  /**
10
15
  * 计算商品小计(不含其他费用)
@@ -12,11 +17,20 @@ interface PriceDetail {
12
17
  * @returns 商品总价字符串,保留2位小数
13
18
  */
14
19
  export declare const calculateSubtotal: (items: CartItem[]) => string;
20
+ /**
21
+ * @title: 单个商品的税费
22
+ * @description:
23
+ * 单个商品的税费 = 商品销售单价(折扣后) * 税率 * is_charge_tax /( 1+ 税率 * is_price_include_tax)
24
+ * $taxFee = $price * $taxRate * $isChargeTax / (1 + $taxRate * $isPriceIncludeTax);
25
+ * @return {*}
26
+ * @Author: xiangfeng.xue
27
+ */
28
+ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
15
29
  /**
16
30
  * 计算所有价格明细
17
31
  * @param items - 购物车商品数组
18
32
  * @param options - 其他费用配置
19
33
  * @returns 价格明细对象
20
34
  */
21
- export declare const calculatePriceDetails: (items: CartItem[]) => PriceDetail;
35
+ export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
22
36
  export {};