@pisell/private-materials 6.3.139 → 6.3.141

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 (153) 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 +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  12. package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  14. package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  15. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  16. package/es/components/booking/forms/footer.d.ts +1 -0
  17. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  18. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  19. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  20. package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
  21. package/es/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
  22. package/es/components/ecocup/components/CupActionList/index.d.ts +1 -0
  23. package/es/components/ecocup/components/CupActionModal/index.d.ts +1 -0
  24. package/es/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
  25. package/es/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
  26. package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  27. package/es/components/ecocup/components/SearchBar/index.d.ts +1 -0
  28. package/es/components/ecocup/components/SettingModal/index.d.ts +1 -0
  29. package/es/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  30. package/es/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  31. package/es/components/ecocup/cupList/index.d.ts +1 -0
  32. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  33. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  34. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  35. package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  36. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  37. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  38. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  39. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  40. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  43. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  44. package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  45. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  46. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  47. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  48. package/es/components/scanOrder/components/Cart/index.js +127 -56
  49. package/es/components/scanOrder/components/Cart/index.less +11 -5
  50. package/es/components/scanOrder/components/Check/index.js +85 -80
  51. package/es/components/scanOrder/components/Content/index.js +356 -164
  52. package/es/components/scanOrder/components/Menu/index.d.ts +11 -0
  53. package/es/components/scanOrder/components/Menu/index.js +140 -169
  54. package/es/components/scanOrder/components/Voucher/index.d.ts +8 -0
  55. package/es/components/scanOrder/components/Voucher/index.js +250 -0
  56. package/es/components/scanOrder/context.js +38 -13
  57. package/es/components/scanOrder/hooks.js +4 -1
  58. package/es/components/scanOrder/locales.d.ts +65 -0
  59. package/es/components/scanOrder/locales.js +65 -0
  60. package/es/components/scanOrder/types.d.ts +10 -0
  61. package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  62. package/es/components/scanOrder/utils/toShoppingCartProducts.js +137 -9
  63. package/es/components/scanOrder/utils/transformProductDetail.js +21 -4
  64. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  65. package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  66. package/es/components/venueBooking/components/Addons/index.js +42 -33
  67. package/es/components/venueBooking/components/Cart/index.js +26 -14
  68. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  69. package/es/plus/orderList/components/HandleActions.d.ts +1 -0
  70. package/es/plus/orderList/components/QuickFilter.d.ts +1 -0
  71. package/es/plus/orderList/components/Reset.d.ts +1 -0
  72. package/es/plus/orderList/components/Toolbar.d.ts +1 -0
  73. package/es/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
  74. package/es/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
  75. package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  76. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  77. package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  78. package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
  79. package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  80. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  81. package/es/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  82. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
  83. package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
  84. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
  85. package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
  86. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
  87. package/lib/components/booking/forms/footer.d.ts +1 -0
  88. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
  89. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  90. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  91. package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
  92. package/lib/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
  93. package/lib/components/ecocup/components/CupActionList/index.d.ts +1 -0
  94. package/lib/components/ecocup/components/CupActionModal/index.d.ts +1 -0
  95. package/lib/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
  96. package/lib/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
  97. package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
  98. package/lib/components/ecocup/components/SearchBar/index.d.ts +1 -0
  99. package/lib/components/ecocup/components/SettingModal/index.d.ts +1 -0
  100. package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
  101. package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
  102. package/lib/components/ecocup/cupList/index.d.ts +1 -0
  103. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  104. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
  105. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  106. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
  107. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
  108. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  109. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  110. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  111. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
  112. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  113. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  114. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
  115. package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
  116. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  117. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
  118. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  119. package/lib/components/scanOrder/components/Cart/index.js +79 -24
  120. package/lib/components/scanOrder/components/Cart/index.less +11 -5
  121. package/lib/components/scanOrder/components/Check/index.js +28 -23
  122. package/lib/components/scanOrder/components/Content/index.js +136 -42
  123. package/lib/components/scanOrder/components/Menu/index.d.ts +11 -0
  124. package/lib/components/scanOrder/components/Menu/index.js +23 -36
  125. package/lib/components/scanOrder/components/Voucher/index.d.ts +8 -0
  126. package/lib/components/scanOrder/components/Voucher/index.js +162 -0
  127. package/lib/components/scanOrder/context.js +21 -10
  128. package/lib/components/scanOrder/hooks.js +4 -1
  129. package/lib/components/scanOrder/locales.d.ts +65 -0
  130. package/lib/components/scanOrder/locales.js +65 -0
  131. package/lib/components/scanOrder/types.d.ts +10 -0
  132. package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
  133. package/lib/components/scanOrder/utils/toShoppingCartProducts.js +88 -6
  134. package/lib/components/scanOrder/utils/transformProductDetail.js +10 -3
  135. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  136. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
  137. package/lib/components/venueBooking/components/Addons/index.js +15 -8
  138. package/lib/components/venueBooking/components/Cart/index.js +8 -2
  139. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  140. package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
  141. package/lib/plus/orderList/components/QuickFilter.d.ts +1 -0
  142. package/lib/plus/orderList/components/Reset.d.ts +1 -0
  143. package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
  144. package/lib/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +1 -0
  145. package/lib/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
  146. package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
  147. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
  148. package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
  149. package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
  150. package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
  151. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  152. package/lib/pro/pisellPhoneKeyboard/index.d.ts +1 -0
  153. package/package.json +1 -1
@@ -1,3 +1,12 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ 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); }
7
+ 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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
8
+ 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); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1
10
  function toNumber(value) {
2
11
  var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3
12
  var parsedValue = Number(value);
@@ -52,13 +61,117 @@ function normalizeOptions(product) {
52
61
  };
53
62
  });
54
63
  }
64
+
65
+ /** 与 getDisplayName 一致:优先 metadata 上的完整商品快照 */
66
+ function getProductOriginRich(product) {
67
+ var _product$metadata2, _product$_origin4;
68
+ return (product === null || product === void 0 || (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.origin) || (product === null || product === void 0 || (_product$_origin4 = product._origin) === null || _product$_origin4 === void 0 || (_product$_origin4 = _product$_origin4.callbackData) === null || _product$_origin4 === void 0 ? void 0 : _product$_origin4.origin) || {};
69
+ }
70
+ function findVariantGroupById(groups, groupId) {
71
+ return groups.find(function (g) {
72
+ return Number(g === null || g === void 0 ? void 0 : g.id) === Number(groupId);
73
+ });
74
+ }
75
+ function findVariantItemDisplayName(variantGroup, variantItemId) {
76
+ var _ref, _found$name;
77
+ var items = Array.isArray(variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.variant_item) ? variantGroup.variant_item : [];
78
+ var found = items.find(function (it) {
79
+ return Number(it === null || it === void 0 ? void 0 : it.id) === Number(variantItemId);
80
+ });
81
+ var raw = (_ref = (_found$name = found === null || found === void 0 ? void 0 : found.name) !== null && _found$name !== void 0 ? _found$name : typeof (found === null || found === void 0 ? void 0 : found.title) === 'string' ? found.title : found === null || found === void 0 ? void 0 : found.title) !== null && _ref !== void 0 ? _ref : '';
82
+ return String(raw !== null && raw !== void 0 ? raw : '').trim();
83
+ }
84
+
85
+ /**
86
+ * 按 sku_ids(如 "7006:19533" 或 "g1:i1_g2:i2")与 variant_group 拼「组名: 选项名」,与选品器 transformSelectorValueToValue 风格一致(", " 连接)。
87
+ */
88
+ function buildVariantStringFromSkuIds(origin, skuIdsRaw) {
89
+ var groups = Array.isArray(origin === null || origin === void 0 ? void 0 : origin.variant_group) ? origin.variant_group : [];
90
+ var parts = [];
91
+ var segments = String(skuIdsRaw || '').split('_').map(function (s) {
92
+ return s.trim();
93
+ }).filter(Boolean);
94
+ var _iterator = _createForOfIteratorHelper(segments),
95
+ _step;
96
+ try {
97
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
+ var _vg$name;
99
+ var seg = _step.value;
100
+ var colonIdx = seg.indexOf(':');
101
+ if (colonIdx <= 0) continue;
102
+ var groupId = Number(seg.slice(0, colonIdx));
103
+ var itemId = Number(seg.slice(colonIdx + 1));
104
+ if (Number.isNaN(groupId) || Number.isNaN(itemId)) continue;
105
+ var vg = findVariantGroupById(groups, groupId);
106
+ if (!vg) continue;
107
+ var groupName = String((_vg$name = vg === null || vg === void 0 ? void 0 : vg.name) !== null && _vg$name !== void 0 ? _vg$name : '').trim();
108
+ var itemName = findVariantItemDisplayName(vg, itemId);
109
+ if (groupName && itemName) parts.push("".concat(groupName, ": ").concat(itemName));else if (itemName) parts.push(itemName);else if (groupName) parts.push(groupName);
110
+ }
111
+ } catch (err) {
112
+ _iterator.e(err);
113
+ } finally {
114
+ _iterator.f();
115
+ }
116
+ return parts.join(', ');
117
+ }
118
+
119
+ /** sku_ids 解析失败时用 variant 的 name/title 与 variant_group.position_id 对齐 */
120
+ function fallbackVariantLabelFromTitles(origin, variantRow) {
121
+ var groups = Array.isArray(origin === null || origin === void 0 ? void 0 : origin.variant_group) ? origin.variant_group : [];
122
+ var nameObj = (variantRow === null || variantRow === void 0 ? void 0 : variantRow.name) || (variantRow === null || variantRow === void 0 ? void 0 : variantRow.title);
123
+ if (!nameObj || _typeof(nameObj) !== 'object') return '';
124
+ var parts = [];
125
+ var _iterator2 = _createForOfIteratorHelper(groups),
126
+ _step2;
127
+ try {
128
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
129
+ var _String, _g$name;
130
+ var g = _step2.value;
131
+ var pid = g === null || g === void 0 ? void 0 : g.position_id;
132
+ if (pid == null) continue;
133
+ var val = (_String = nameObj[String(pid)]) !== null && _String !== void 0 ? _String : nameObj[pid];
134
+ if (val == null || val === '') continue;
135
+ var groupName = String((_g$name = g === null || g === void 0 ? void 0 : g.name) !== null && _g$name !== void 0 ? _g$name : '').trim();
136
+ var itemLabel = String(val).trim();
137
+ if (groupName && itemLabel) parts.push("".concat(groupName, ": ").concat(itemLabel));else if (itemLabel) parts.push(itemLabel);
138
+ }
139
+ } catch (err) {
140
+ _iterator2.e(err);
141
+ } finally {
142
+ _iterator2.f();
143
+ }
144
+ if (parts.length) return parts.join(', ');
145
+ var vals = Object.values(nameObj).filter(function (v) {
146
+ return v != null && String(v).trim() !== '';
147
+ });
148
+ return vals.map(function (v) {
149
+ return String(v).trim();
150
+ }).join(' / ');
151
+ }
152
+ function getVariantProductOptionString(product) {
153
+ var variantId = product === null || product === void 0 ? void 0 : product.product_variant_id;
154
+ if (variantId == null || variantId === '' || Number(variantId) <= 0) return '';
155
+ var origin = getProductOriginRich(product);
156
+ var variants = Array.isArray(origin === null || origin === void 0 ? void 0 : origin.variant) ? origin.variant : [];
157
+ var matched = variants.find(function (v) {
158
+ return Number(v === null || v === void 0 ? void 0 : v.id) === Number(variantId);
159
+ });
160
+ if (!matched) return '';
161
+ var skuIds = matched === null || matched === void 0 ? void 0 : matched.sku_ids;
162
+ if (skuIds != null && String(skuIds).trim() !== '') {
163
+ var fromSku = buildVariantStringFromSkuIds(origin, String(skuIds));
164
+ if (fromSku) return fromSku;
165
+ }
166
+ return fallbackVariantLabelFromTitles(origin, matched);
167
+ }
55
168
  function normalizeBundles(product) {
56
- var _product$_origin4;
57
- var callbackData = (product === null || product === void 0 || (_product$_origin4 = product._origin) === null || _product$_origin4 === void 0 ? void 0 : _product$_origin4.callbackData) || {};
169
+ var _product$_origin5;
170
+ var callbackData = (product === null || product === void 0 || (_product$_origin5 = product._origin) === null || _product$_origin5 === void 0 ? void 0 : _product$_origin5.callbackData) || {};
58
171
  var sourceBundles = Array.isArray(callbackData === null || callbackData === void 0 ? void 0 : callbackData.bundle) ? callbackData.bundle : (product === null || product === void 0 ? void 0 : product.product_bundle) || [];
59
172
  return sourceBundles.map(function (bundleItem, bundleIndex) {
60
- var _ref, _bundleItem$price, _bundleItem$id;
61
- var bundlePrice = toNumber((_ref = (_bundleItem$price = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.price) !== null && _bundleItem$price !== void 0 ? _bundleItem$price : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.product_price) !== null && _ref !== void 0 ? _ref : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.custom_price, 0);
173
+ var _ref2, _bundleItem$price, _bundleItem$id;
174
+ var bundlePrice = toNumber((_ref2 = (_bundleItem$price = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.price) !== null && _bundleItem$price !== void 0 ? _bundleItem$price : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.product_price) !== null && _ref2 !== void 0 ? _ref2 : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.custom_price, 0);
62
175
  var bundleNum = toSafeNum(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.num);
63
176
  var bundleOptions = Array.isArray(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option) ? bundleItem.option : [];
64
177
  return {
@@ -90,17 +203,24 @@ export function toShoppingCartProducts(params) {
90
203
  amountSymbol = _params$amountSymbol === void 0 ? '$' : _params$amountSymbol;
91
204
  if (!Array.isArray(orderProducts)) return [];
92
205
  return orderProducts.map(function (productItem, index) {
93
- var _productItem$_origin, _productItem$_origin2, _productItem$_origin3, _productItem$product_, _productItem$metadata;
206
+ var _productItem$_origin, _productItem$product_, _productItem$metadata;
94
207
  var productNum = toSafeNum(productItem === null || productItem === void 0 ? void 0 : productItem.num);
95
208
  var unitPrice = getUnitPrice(productItem);
96
- var rowKey = (productItem === null || productItem === void 0 || (_productItem$_origin = productItem._origin) === null || _productItem$_origin === void 0 || (_productItem$_origin = _productItem$_origin.callbackData) === null || _productItem$_origin === void 0 ? void 0 : _productItem$_origin.rowKey) || (productItem === null || productItem === void 0 || (_productItem$_origin2 = productItem._origin) === null || _productItem$_origin2 === void 0 || (_productItem$_origin2 = _productItem$_origin2.callbackData) === null || _productItem$_origin2 === void 0 ? void 0 : _productItem$_origin2.key) || (productItem === null || productItem === void 0 || (_productItem$_origin3 = productItem._origin) === null || _productItem$_origin3 === void 0 || (_productItem$_origin3 = _productItem$_origin3.callbackData) === null || _productItem$_origin3 === void 0 ? void 0 : _productItem$_origin3.unique) || (productItem === null || productItem === void 0 ? void 0 : productItem.identity_key) || "".concat((_productItem$product_ = productItem.product_id) !== null && _productItem$product_ !== void 0 ? _productItem$product_ : 'p', "_").concat(productItem.product_variant_id, "_").concat(index);
97
- var base = {
209
+ var callbackData = (productItem === null || productItem === void 0 || (_productItem$_origin = productItem._origin) === null || _productItem$_origin === void 0 ? void 0 : _productItem$_origin.callbackData) || {};
210
+ // 不透明 identity 契约:rowKey / _id 直接复用 SDK 回灌的 identity_key;
211
+ // 仅当(升级路径或非常规调用)identity_key 缺失时退到 SKU + index 兜底。
212
+ var identityKey = typeof (productItem === null || productItem === void 0 ? void 0 : productItem.identity_key) === 'string' && productItem.identity_key.length > 0 ? productItem.identity_key : undefined;
213
+ var rowKey = identityKey !== null && identityKey !== void 0 ? identityKey : "".concat((_productItem$product_ = productItem.product_id) !== null && _productItem$product_ !== void 0 ? _productItem$product_ : 'p', "_").concat(productItem.product_variant_id, "_").concat(index);
214
+ var fromCallbackOptionString = typeof (callbackData === null || callbackData === void 0 ? void 0 : callbackData.product_option_string) === 'string' ? callbackData.product_option_string.trim() : '';
215
+ var productOptionString = fromCallbackOptionString || getVariantProductOptionString(productItem) || undefined;
216
+ var base = _objectSpread({
98
217
  _id: rowKey,
99
218
  rowKey: rowKey,
100
- identity_key: (productItem === null || productItem === void 0 ? void 0 : productItem.identity_key) || undefined,
219
+ identity_key: identityKey,
101
220
  id: productItem.product_id,
102
221
  product_id: productItem.product_id,
103
222
  product_variant_id: productItem.product_variant_id,
223
+ note: (productItem === null || productItem === void 0 ? void 0 : productItem.note) != null ? String(productItem.note) : '',
104
224
  name: getDisplayName(productItem),
105
225
  image: getDisplayImage(productItem),
106
226
  num: productNum,
@@ -112,7 +232,15 @@ export function toShoppingCartProducts(params) {
112
232
  bundle: normalizeBundles(productItem),
113
233
  _origin: productItem === null || productItem === void 0 ? void 0 : productItem._origin,
114
234
  isNormalProduct: true
115
- };
235
+ }, productOptionString ? {
236
+ product_option_string: productOptionString
237
+ } : {});
238
+ if (Array.isArray(productItem.product_option_item) && productItem.product_option_item.length) {
239
+ base.product_option_item = productItem.product_option_item;
240
+ }
241
+ if (Array.isArray(productItem.product_bundle) && productItem.product_bundle.length) {
242
+ base.product_bundle = productItem.product_bundle;
243
+ }
116
244
  if (productItem !== null && productItem !== void 0 && (_productItem$metadata = productItem.metadata) !== null && _productItem$metadata !== void 0 && _productItem$metadata.venue_booking) {
117
245
  var _origin$resources2;
118
246
  var origin = productItem._origin || {};
@@ -49,8 +49,21 @@ function normalizeBundleItems(bundleItems) {
49
49
  });
50
50
  });
51
51
  }
52
+
53
+ /**
54
+ * 在商品 origin 数据中按 variant_id 命中对应的规格行,用于取「规格级」字段(price / base_price / is_charge_tax 等)。
55
+ * 主商品字段仅作为无规格或无法命中时的兜底,避免把主商品价误当成规格价写入订单行。
56
+ */
57
+ function findVariantById(origin, variantId) {
58
+ if (!origin || !variantId || variantId <= 0) return null;
59
+ var variants = Array.isArray(origin === null || origin === void 0 ? void 0 : origin.variant) ? origin.variant : [];
60
+ var matched = variants.find(function (v) {
61
+ return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
62
+ });
63
+ return matched || null;
64
+ }
52
65
  export function transformProductDetailToOrderProduct(params) {
53
- var _ref, _ref2, _payload$product_id, _ref3, _payload$product_vari, _payload$_origin, _ref4, _ref5, _ref6, _ref7, _payload$price, _ref8, _payload$tax_fee, _ref9, _payload$is_charge_ta, _payload$quantity, _payload$option, _payload$bundle;
66
+ var _ref, _ref2, _payload$product_id, _ref3, _payload$product_vari, _payload$_origin, _findVariantById, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _payload$price, _ref10, _ref11, _payload$tax_fee, _ref12, _ref13, _payload$is_charge_ta, _payload$quantity, _payload$option, _payload$bundle;
54
67
  var payload = params.payload,
55
68
  _params$fallbackProdu = params.fallbackProductId,
56
69
  fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu,
@@ -61,13 +74,17 @@ export function transformProductDetailToOrderProduct(params) {
61
74
  if (productId === null) return null;
62
75
  var productVariantId = toNumber((_ref3 = (_payload$product_vari = payload.product_variant_id) !== null && _payload$product_vari !== void 0 ? _payload$product_vari : payload.variant_id) !== null && _ref3 !== void 0 ? _ref3 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.product_variant_id, 0);
63
76
  var callbackOrigin = (payload === null || payload === void 0 ? void 0 : payload.origin) || (payload === null || payload === void 0 || (_payload$_origin = payload._origin) === null || _payload$_origin === void 0 ? void 0 : _payload$_origin.sourceItem) || (payload === null || payload === void 0 ? void 0 : payload._origin) || {};
64
- var sellingPrice = toPriceString((_ref4 = (_ref5 = (_ref6 = (_ref7 = (_payload$price = payload === null || payload === void 0 ? void 0 : payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload === null || payload === void 0 ? void 0 : payload.selling_price) !== null && _ref7 !== void 0 ? _ref7 : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.price) !== null && _ref6 !== void 0 ? _ref6 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _ref5 !== void 0 ? _ref5 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price) !== null && _ref4 !== void 0 ? _ref4 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.base_price, '0.00');
77
+ // 规格商品的价格、税率等字段必须以 variant 行为准;主商品上的 price 只是「起售价/默认价」。
78
+ // productDetail 弹窗回调 payload 里通常不会带 price,如果不做 variant 查找,
79
+ // 就会退到 callbackOrigin.price(主商品价),导致加购价格错位。
80
+ var matchedVariant = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceItem, productVariantId);
81
+ var sellingPrice = toPriceString((_ref4 = (_ref5 = (_ref6 = (_ref7 = (_ref8 = (_ref9 = (_payload$price = payload === null || payload === void 0 ? void 0 : payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload === null || payload === void 0 ? void 0 : payload.selling_price) !== null && _ref9 !== void 0 ? _ref9 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref8 !== void 0 ? _ref8 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref7 !== void 0 ? _ref7 : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.price) !== null && _ref6 !== void 0 ? _ref6 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _ref5 !== void 0 ? _ref5 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price) !== null && _ref4 !== void 0 ? _ref4 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.base_price, '0.00');
65
82
  // 入口不引入后台划线价(payload/source.original_price 可能承载 UI 划线展示用的原价)。
66
83
  // 订单域 original_price 语义为「券前店铺售价」,初次加购恒等于 selling_price;
67
84
  // 券应用后由 SDK Rules 引擎维护差异。
68
85
  var originalPrice = sellingPrice;
69
- var taxFee = toPriceString((_ref8 = (_payload$tax_fee = payload === null || payload === void 0 ? void 0 : payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.tax_fee) !== null && _ref8 !== void 0 ? _ref8 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.tax_fee, '0.00');
70
- var isChargeTax = toNumber((_ref9 = (_payload$is_charge_ta = payload === null || payload === void 0 ? void 0 : payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.is_charge_tax) !== null && _ref9 !== void 0 ? _ref9 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.is_charge_tax, 0);
86
+ var taxFee = toPriceString((_ref10 = (_ref11 = (_payload$tax_fee = payload === null || payload === void 0 ? void 0 : payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.tax_fee) !== null && _ref11 !== void 0 ? _ref11 : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.tax_fee) !== null && _ref10 !== void 0 ? _ref10 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.tax_fee, '0.00');
87
+ var isChargeTax = toNumber((_ref12 = (_ref13 = (_payload$is_charge_ta = payload === null || payload === void 0 ? void 0 : payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.is_charge_tax) !== null && _ref13 !== void 0 ? _ref13 : callbackOrigin === null || callbackOrigin === void 0 ? void 0 : callbackOrigin.is_charge_tax) !== null && _ref12 !== void 0 ? _ref12 : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.is_charge_tax, 0);
71
88
  return {
72
89
  product_id: productId,
73
90
  product_variant_id: productVariantId,
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useAddService: (id?: number, type?: string) => JSX.Element | null;
2
3
  export default useAddService;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useClearCart: (key?: number | undefined) => JSX.Element;
2
3
  export default useClearCart;
@@ -131,17 +131,19 @@ export default function Addons() {
131
131
  // ── 从订单移除商品 ──
132
132
  var removeOrderProduct = /*#__PURE__*/function () {
133
133
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
134
- var product_id, product_variant_id, sourceData;
134
+ var product_id, product_variant_id, identity_key, sourceData;
135
135
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
136
136
  while (1) switch (_context3.prev = _context3.next) {
137
137
  case 0:
138
- product_id = params.product_id, product_variant_id = params.product_variant_id, sourceData = params.sourceData;
138
+ product_id = params.product_id, product_variant_id = params.product_variant_id, identity_key = params.identity_key, sourceData = params.sourceData;
139
139
  _context3.prev = 1;
140
140
  _context3.next = 4;
141
- return runModuleAction('removeProductFromOrder', {
141
+ return runModuleAction('removeProductFromOrder', _objectSpread({
142
142
  product_id: product_id,
143
143
  product_variant_id: product_variant_id
144
- });
144
+ }, identity_key ? {
145
+ identity_key: identity_key
146
+ } : {}));
145
147
  case 4:
146
148
  _context3.next = 6;
147
149
  return refreshViewModel();
@@ -155,7 +157,8 @@ export default function Addons() {
155
157
  error: _context3.t0,
156
158
  sourceData: sourceData,
157
159
  product_id: product_id,
158
- product_variant_id: product_variant_id
160
+ product_variant_id: product_variant_id,
161
+ identity_key: identity_key
159
162
  });
160
163
  case 11:
161
164
  case "end":
@@ -171,18 +174,21 @@ export default function Addons() {
171
174
  // ── 更新订单中商品数量 ──
172
175
  var updateOrderProduct = /*#__PURE__*/function () {
173
176
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
174
- var product_id, product_variant_id, updates, sourceData;
177
+ var product_id, product_variant_id, identity_key, updates, sourceData;
175
178
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
176
179
  while (1) switch (_context4.prev = _context4.next) {
177
180
  case 0:
178
- product_id = params.product_id, product_variant_id = params.product_variant_id, updates = params.updates, sourceData = params.sourceData;
181
+ product_id = params.product_id, product_variant_id = params.product_variant_id, identity_key = params.identity_key, updates = params.updates, sourceData = params.sourceData;
179
182
  _context4.prev = 1;
180
183
  _context4.next = 4;
181
- return runModuleAction('updateProductInOrder', {
184
+ return runModuleAction('updateProductInOrder', _objectSpread(_objectSpread({
182
185
  product_id: product_id,
183
- product_variant_id: product_variant_id,
186
+ product_variant_id: product_variant_id
187
+ }, identity_key ? {
188
+ identity_key: identity_key
189
+ } : {}), {}, {
184
190
  updates: updates
185
- });
191
+ }));
186
192
  case 4:
187
193
  _context4.next = 6;
188
194
  return refreshViewModel();
@@ -197,6 +203,7 @@ export default function Addons() {
197
203
  sourceData: sourceData,
198
204
  product_id: product_id,
199
205
  product_variant_id: product_variant_id,
206
+ identity_key: identity_key,
200
207
  updates: updates
201
208
  });
202
209
  case 11:
@@ -218,13 +225,13 @@ export default function Addons() {
218
225
  */
219
226
  var handleSelectProduct = /*#__PURE__*/function () {
220
227
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(item, clickType, meta) {
221
- var sourceItem, _item$option, _item$bundle, _item$price, _item$product_id, _ref7, _meta$quantity, _orderProduct$product, _orderProduct$product4, quantityData, orderProduct, nextQuantity, productVariantId, normalizedQuantity, _orderProduct$product2, cartItems, existedCartItem;
228
+ var sourceItem, _item$option, _item$bundle, _item$price, _item$product_id, _ref7, _meta$quantity, _orderProduct$product, _orderProduct$product4, quantityData, orderProduct, nextQuantity, productVariantId, normalizedQuantity, cartItems, existedCartItem, existedIdentityKey, _orderProduct$product3;
222
229
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
223
230
  while (1) switch (_context6.prev = _context6.next) {
224
231
  case 0:
225
232
  sourceItem = (meta === null || meta === void 0 ? void 0 : meta.product) || item;
226
233
  if (!((meta === null || meta === void 0 ? void 0 : meta.intent) === 'quantity')) {
227
- _context6.next = 27;
234
+ _context6.next = 28;
228
235
  break;
229
236
  }
230
237
  // ── 数量变更模式 ──
@@ -259,54 +266,56 @@ export default function Addons() {
259
266
  });
260
267
  return _context6.abrupt("return");
261
268
  case 12:
262
- normalizedQuantity = Number.isNaN(nextQuantity) ? 0 : Math.max(0, Math.floor(nextQuantity)); // 数量为 0 → 移除商品
269
+ normalizedQuantity = Number.isNaN(nextQuantity) ? 0 : Math.max(0, Math.floor(nextQuantity)); // 检查购物车中是否已存在该商品(优先取 SDK 回灌的 identity_key 做精确删改)
270
+ cartItems = Array.isArray(viewModel === null || viewModel === void 0 ? void 0 : viewModel.cartItems) ? viewModel.cartItems : [];
271
+ existedCartItem = cartItems.find(function (cartItem) {
272
+ var _cartItem$product_id, _orderProduct$product2, _cartItem$product_var;
273
+ return String((_cartItem$product_id = cartItem === null || cartItem === void 0 ? void 0 : cartItem.product_id) !== null && _cartItem$product_id !== void 0 ? _cartItem$product_id : null) === String((_orderProduct$product2 = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.product_id) !== null && _orderProduct$product2 !== void 0 ? _orderProduct$product2 : null) && Number((_cartItem$product_var = cartItem === null || cartItem === void 0 ? void 0 : cartItem.product_variant_id) !== null && _cartItem$product_var !== void 0 ? _cartItem$product_var : 0) === productVariantId;
274
+ });
275
+ existedIdentityKey = typeof (existedCartItem === null || existedCartItem === void 0 ? void 0 : existedCartItem.identity_key) === 'string' && existedCartItem.identity_key.length > 0 ? existedCartItem.identity_key : undefined; // 数量为 0 → 移除商品
263
276
  if (!(normalizedQuantity <= 0)) {
264
- _context6.next = 17;
277
+ _context6.next = 20;
265
278
  break;
266
279
  }
267
- _context6.next = 16;
280
+ _context6.next = 19;
268
281
  return removeOrderProduct({
269
- product_id: (_orderProduct$product2 = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.product_id) !== null && _orderProduct$product2 !== void 0 ? _orderProduct$product2 : null,
282
+ product_id: (_orderProduct$product3 = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.product_id) !== null && _orderProduct$product3 !== void 0 ? _orderProduct$product3 : null,
270
283
  product_variant_id: productVariantId,
284
+ identity_key: existedIdentityKey,
271
285
  sourceData: quantityData
272
286
  });
273
- case 16:
287
+ case 19:
274
288
  return _context6.abrupt("return");
275
- case 17:
276
- // 检查购物车中是否已存在该商品
277
- cartItems = Array.isArray(viewModel === null || viewModel === void 0 ? void 0 : viewModel.cartItems) ? viewModel.cartItems : [];
278
- existedCartItem = cartItems.find(function (cartItem) {
279
- var _cartItem$product_id, _orderProduct$product3, _cartItem$product_var;
280
- return String((_cartItem$product_id = cartItem === null || cartItem === void 0 ? void 0 : cartItem.product_id) !== null && _cartItem$product_id !== void 0 ? _cartItem$product_id : null) === String((_orderProduct$product3 = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.product_id) !== null && _orderProduct$product3 !== void 0 ? _orderProduct$product3 : null) && Number((_cartItem$product_var = cartItem === null || cartItem === void 0 ? void 0 : cartItem.product_variant_id) !== null && _cartItem$product_var !== void 0 ? _cartItem$product_var : 0) === productVariantId;
281
- }); // 不存在 → 新增;已存在 → 更新数量
289
+ case 20:
282
290
  if (existedCartItem) {
283
- _context6.next = 23;
291
+ _context6.next = 24;
284
292
  break;
285
293
  }
286
- _context6.next = 22;
294
+ _context6.next = 23;
287
295
  return addOrderProduct({
288
296
  orderProduct: _objectSpread(_objectSpread({}, orderProduct), {}, {
289
297
  num: normalizedQuantity
290
298
  }),
291
299
  sourceData: quantityData
292
300
  });
293
- case 22:
294
- return _context6.abrupt("return");
295
301
  case 23:
296
- _context6.next = 25;
302
+ return _context6.abrupt("return");
303
+ case 24:
304
+ _context6.next = 26;
297
305
  return updateOrderProduct({
298
306
  product_id: (_orderProduct$product4 = orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct.product_id) !== null && _orderProduct$product4 !== void 0 ? _orderProduct$product4 : null,
299
307
  product_variant_id: productVariantId,
308
+ identity_key: existedIdentityKey,
300
309
  updates: {
301
310
  num: normalizedQuantity,
302
311
  _origin: orderProduct === null || orderProduct === void 0 ? void 0 : orderProduct._origin
303
312
  },
304
313
  sourceData: quantityData
305
314
  });
306
- case 25:
307
- _context6.next = 28;
315
+ case 26:
316
+ _context6.next = 29;
308
317
  break;
309
- case 27:
318
+ case 28:
310
319
  // ── 打开商品详情弹窗 ──
311
320
  utils === null || utils === void 0 || utils.action({
312
321
  type: 'pisell1.productDetail',
@@ -362,7 +371,7 @@ export default function Addons() {
362
371
  return callback;
363
372
  }()
364
373
  });
365
- case 28:
374
+ case 29:
366
375
  case "end":
367
376
  return _context6.stop();
368
377
  }
@@ -147,7 +147,10 @@ export default function Cart(props) {
147
147
  var isVenueBookingCartItem = function isVenueBookingCartItem(target) {
148
148
  if (!target || _typeof(target) !== 'object') return false;
149
149
  if (target !== null && target !== void 0 && target.start_date && target !== null && target !== void 0 && target.end_date) return true;
150
- var identity = String((target === null || target === void 0 ? void 0 : target.identity_key) || (target === null || target === void 0 ? void 0 : target.rowKey) || (target === null || target === void 0 ? void 0 : target._id) || '');
150
+
151
+ // 不透明 identity 契约下,venueBooking 行的 identity_key 形如 `venue:<resourceId>:<groupIndex>:<uuid>`,
152
+ // 仅依据 SDK 回灌的 identity_key 判断;不再回退 rowKey / _id。
153
+ var identity = String((target === null || target === void 0 ? void 0 : target.identity_key) || '');
151
154
  if (identity.startsWith('venue:')) return true;
152
155
  return false;
153
156
  };
@@ -176,39 +179,48 @@ export default function Cart(props) {
176
179
  return _context.abrupt("return");
177
180
  case 6:
178
181
  productId = (_ref6 = (_targetItem$product_i = targetItem === null || targetItem === void 0 ? void 0 : targetItem.product_id) !== null && _targetItem$product_i !== void 0 ? _targetItem$product_i : targetItem === null || targetItem === void 0 ? void 0 : targetItem.id) !== null && _ref6 !== void 0 ? _ref6 : null;
179
- productVariantId = Number((_targetItem$product_v = targetItem === null || targetItem === void 0 ? void 0 : targetItem.product_variant_id) !== null && _targetItem$product_v !== void 0 ? _targetItem$product_v : 0);
180
- identityKey = (targetItem === null || targetItem === void 0 ? void 0 : targetItem.identity_key) || (targetItem === null || targetItem === void 0 ? void 0 : targetItem.rowKey) || undefined;
182
+ productVariantId = Number((_targetItem$product_v = targetItem === null || targetItem === void 0 ? void 0 : targetItem.product_variant_id) !== null && _targetItem$product_v !== void 0 ? _targetItem$product_v : 0); // 不透明 identity 契约:删除只信任 SDK 回灌的 identity_key,禁用 rowKey 回退。
183
+ identityKey = targetItem === null || targetItem === void 0 ? void 0 : targetItem.identity_key;
181
184
  if (!(productId === null && Number.isNaN(productVariantId))) {
182
185
  _context.next = 11;
183
186
  break;
184
187
  }
185
188
  return _context.abrupt("return");
186
189
  case 11:
187
- _context.prev = 11;
188
- _context.next = 14;
190
+ if (!(typeof identityKey !== 'string' || identityKey.length === 0)) {
191
+ _context.next = 14;
192
+ break;
193
+ }
194
+ console.error('[venueBooking] removeProductFromOrder skipped: missing identity_key', {
195
+ item: targetItem
196
+ });
197
+ return _context.abrupt("return");
198
+ case 14:
199
+ _context.prev = 14;
200
+ _context.next = 17;
189
201
  return runModuleAction('removeProductFromOrder', {
190
202
  product_id: productId,
191
203
  product_variant_id: Number.isNaN(productVariantId) ? 0 : productVariantId,
192
204
  identity_key: identityKey
193
205
  });
194
- case 14:
195
- _context.next = 16;
206
+ case 17:
207
+ _context.next = 19;
196
208
  return refreshViewModel();
197
- case 16:
198
- _context.next = 21;
209
+ case 19:
210
+ _context.next = 24;
199
211
  break;
200
- case 18:
201
- _context.prev = 18;
202
- _context.t0 = _context["catch"](11);
212
+ case 21:
213
+ _context.prev = 21;
214
+ _context.t0 = _context["catch"](14);
203
215
  console.error('[venueBooking] removeProductFromOrder failed', {
204
216
  error: _context.t0,
205
217
  item: targetItem
206
218
  });
207
- case 21:
219
+ case 24:
208
220
  case "end":
209
221
  return _context.stop();
210
222
  }
211
- }, _callee, null, [[11, 18]]);
223
+ }, _callee, null, [[14, 21]]);
212
224
  }));
213
225
  return function handleCartChange(_x, _x2, _x3) {
214
226
  return _ref5.apply(this, arguments);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Modal as AntModal, ModalFuncProps as AntModalFuncProps, ModalProps as AntModalProps } from 'antd';
2
3
  import './index.less';
3
4
  interface ModalProps extends AntModalProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const HandleActions: (props: {
2
3
  locales: any;
3
4
  __id?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const QuickFilter: (props: {
2
3
  locales: any;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const Reset: (props: {
2
3
  locales: any;
3
4
  setValueType: (value: any) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const Toolbar: (props: {
2
3
  locales: any;
3
4
  clearSelectedData: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { FloorMapViewConfig } from '@pisell/materials';
2
3
  export declare function useReservationFloorPlan(options: {
3
4
  resolvedFloorPlanId: number | null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const MembersField: (props: {
3
4
  id?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../index.less';
2
3
  declare const VertifyEmail: (props: {
3
4
  email: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ErrorTip: ({ text }: any) => JSX.Element;
3
4
  export default ErrorTip;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const OptionItemCard: (props: any) => JSX.Element;
3
4
  export default OptionItemCard;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 单规格商品卡片,点击后需要拉起弹窗展示具体的规格信息
3
3
  */
4
+ /// <reference types="react" />
4
5
  import { RenderItemProps } from '../../../../pro/Selector/types';
5
6
  import './index.less';
6
7
  declare const OptionsCard: (props: RenderItemProps & {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface OptionsModalProps {
2
3
  parentDataSource: any;
3
4
  dataSource: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface TimelineSectionProps {
3
4
  code: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PopoverProps } from 'antd';
2
3
  import './index.less';
3
4
  interface PisellPhoneKeyboardProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
3
4
  export default Total;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Cart: ({ open, onCancel, onNext }: any) => JSX.Element;
3
4
  export default Cart;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface DepositProps {
3
4
  showTitle?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Footer: ({ onNext, isOpen }: any) => JSX.Element;
3
4
  export default Footer;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const GuestOptionsModal: (props: any) => JSX.Element;
3
4
  export default GuestOptionsModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface FooterProps {
2
3
  state: any;
3
4
  reload: () => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SendModalValues } from './index';
2
3
  declare const useSendModal: (bookingId?: number) => {
3
4
  open: boolean;