@pisell/private-materials 3.4.41 → 3.4.43
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/appointmentBooking/components/Services/index.js +22 -8
- package/es/components/authentication/admin/AuthMethods/AuthMethods.less +11 -9
- package/es/components/authentication/admin/AuthMethods/index.js +29 -6
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +1 -1
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +1 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/es/plus/productSelect/ProductCard/index.js +14 -5
- package/es/plus/productSelect/index.d.ts +3 -2
- package/es/plus/productSelect/index.js +33 -8
- package/es/plus/productSelect/index.less +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -3
- package/lib/components/authentication/admin/AuthMethods/AuthMethods.less +11 -9
- package/lib/components/authentication/admin/AuthMethods/index.js +23 -7
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/lib/plus/productSelect/ProductCard/index.js +18 -4
- package/lib/plus/productSelect/index.d.ts +3 -2
- package/lib/plus/productSelect/index.js +20 -6
- package/lib/plus/productSelect/index.less +4 -0
- package/package.json +2 -2
|
@@ -69,8 +69,19 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
69
69
|
setProductLoading(false);
|
|
70
70
|
});
|
|
71
71
|
}, [isDateSelectedFirst]);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @description: 是否显示商品详情页面的步进器
|
|
75
|
+
* @param {*} useMemo
|
|
76
|
+
* @return {*}
|
|
77
|
+
*/
|
|
78
|
+
var isShowProductDetailStepper = useMemo(function () {
|
|
79
|
+
var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
80
|
+
productModuleParams = _ref3.productModuleParams;
|
|
81
|
+
return productModuleParams === null || productModuleParams === void 0 ? void 0 : productModuleParams.isShowProductDetailStepper;
|
|
82
|
+
}, [appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams]);
|
|
72
83
|
var handleSelectProduct = /*#__PURE__*/function () {
|
|
73
|
-
var
|
|
84
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item, clickType) {
|
|
74
85
|
var type;
|
|
75
86
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
76
87
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -96,7 +107,9 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
96
107
|
open_deposit: 1
|
|
97
108
|
}),
|
|
98
109
|
setting: {
|
|
99
|
-
can_input: true
|
|
110
|
+
can_input: true,
|
|
111
|
+
item_max_length: isShowProductDetailStepper,
|
|
112
|
+
is_detail_open: clickType === 'cover'
|
|
100
113
|
}
|
|
101
114
|
},
|
|
102
115
|
callback: function () {
|
|
@@ -226,7 +239,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
226
239
|
}
|
|
227
240
|
}, _callee);
|
|
228
241
|
}));
|
|
229
|
-
function callback(
|
|
242
|
+
function callback(_x3) {
|
|
230
243
|
return _callback.apply(this, arguments);
|
|
231
244
|
}
|
|
232
245
|
return callback;
|
|
@@ -238,14 +251,14 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
238
251
|
}
|
|
239
252
|
}, _callee2);
|
|
240
253
|
}));
|
|
241
|
-
return function handleSelectProduct(_x) {
|
|
242
|
-
return
|
|
254
|
+
return function handleSelectProduct(_x, _x2) {
|
|
255
|
+
return _ref4.apply(this, arguments);
|
|
243
256
|
};
|
|
244
257
|
}();
|
|
245
258
|
var productListSetting = useMemo(function () {
|
|
246
259
|
var _context$engine, _productListBlock;
|
|
247
|
-
var
|
|
248
|
-
customPageData =
|
|
260
|
+
var _ref5 = ((_context$engine = context.engine) === null || _context$engine === void 0 ? void 0 : _context$engine.props) || {},
|
|
261
|
+
customPageData = _ref5.customPageData;
|
|
249
262
|
var productListBlock;
|
|
250
263
|
if (Array.isArray(customPageData === null || customPageData === void 0 ? void 0 : customPageData.block)) {
|
|
251
264
|
productListBlock = customPageData.block.find(function (b) {
|
|
@@ -277,7 +290,8 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
277
290
|
cardSelectedBg: 'var(--theme-color)'
|
|
278
291
|
},
|
|
279
292
|
productListSetting: productListSetting,
|
|
280
|
-
selectedItems: carts
|
|
293
|
+
selectedItems: carts,
|
|
294
|
+
hideCategoryWhenOne: true
|
|
281
295
|
}));
|
|
282
296
|
});
|
|
283
297
|
export default Services;
|
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
.auth-methods-item {
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
|
-
padding: 20px 24px;
|
|
10
9
|
border: 1px solid #f0f0f0;
|
|
11
10
|
border-radius: 8px;
|
|
12
11
|
background: #fff;
|
|
13
12
|
margin-bottom: 12px;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.auth-methods-item-body {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex: 1;
|
|
18
|
+
padding: 20px 24px 20px 0;
|
|
19
|
+
align-items: center;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
.auth-methods-item:hover {
|
|
@@ -23,14 +27,12 @@
|
|
|
23
27
|
display: flex;
|
|
24
28
|
align-items: center;
|
|
25
29
|
justify-content: center;
|
|
26
|
-
margin-right: 16px;
|
|
27
30
|
color: #d9d9d9;
|
|
28
|
-
font-size:
|
|
31
|
+
font-size: 20px;
|
|
32
|
+
padding-left: 24px;
|
|
33
|
+
padding-right: 16px;
|
|
29
34
|
cursor: grab;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.auth-methods-item-drag:active {
|
|
33
|
-
cursor: grabbing;
|
|
35
|
+
align-self: stretch;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.auth-methods-item-icon {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
4
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
9
|
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."); }
|
|
6
10
|
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); }
|
|
@@ -12,7 +16,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
12
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
17
|
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); }
|
|
14
18
|
import React, { useState, useEffect } from 'react';
|
|
15
|
-
import { Switch,
|
|
19
|
+
import { Switch, Empty } from 'antd';
|
|
20
|
+
import { Button } from '@pisell/materials';
|
|
16
21
|
import { HolderOutlined, SettingOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
|
17
22
|
import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
|
|
18
23
|
import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
@@ -61,6 +66,8 @@ var SortableItem = function SortableItem(_ref) {
|
|
|
61
66
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
62
67
|
className: "auth-methods-item-drag"
|
|
63
68
|
}, attributes, listeners), /*#__PURE__*/React.createElement(HolderOutlined, null)), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: "auth-methods-item-body"
|
|
70
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
64
71
|
className: "auth-methods-item-icon"
|
|
65
72
|
}, method.icon), /*#__PURE__*/React.createElement("div", {
|
|
66
73
|
className: "auth-methods-item-content"
|
|
@@ -93,12 +100,14 @@ var SortableItem = function SortableItem(_ref) {
|
|
|
93
100
|
}, enableSetting && method.hasSettings && /*#__PURE__*/React.createElement(Button, {
|
|
94
101
|
type: "default",
|
|
95
102
|
icon: /*#__PURE__*/React.createElement(SettingOutlined, null),
|
|
96
|
-
onClick:
|
|
103
|
+
onClick: function onClick() {
|
|
104
|
+
return onSettings();
|
|
105
|
+
}
|
|
97
106
|
}, locales.getText('auth.button.settings')), /*#__PURE__*/React.createElement(Switch, {
|
|
98
107
|
checked: method.enabled,
|
|
99
108
|
onChange: onToggle,
|
|
100
109
|
disabled: method.disableToggle
|
|
101
|
-
})));
|
|
110
|
+
}))));
|
|
102
111
|
};
|
|
103
112
|
var AuthMethods = function AuthMethods(_ref2) {
|
|
104
113
|
var _context$engine;
|
|
@@ -122,7 +131,14 @@ var AuthMethods = function AuthMethods(_ref2) {
|
|
|
122
131
|
useEffect(function () {
|
|
123
132
|
if (initialMethods && initialMethods.length > 0) {
|
|
124
133
|
console.log('AuthMethods 组件同步父组件数据:', initialMethods);
|
|
125
|
-
|
|
134
|
+
// 确保按照 sort 字段排序
|
|
135
|
+
var sortedMethods = _toConsumableArray(initialMethods).sort(function (a, b) {
|
|
136
|
+
var _a$sort, _b$sort;
|
|
137
|
+
var sortA = (_a$sort = a.sort) !== null && _a$sort !== void 0 ? _a$sort : 0;
|
|
138
|
+
var sortB = (_b$sort = b.sort) !== null && _b$sort !== void 0 ? _b$sort : 0;
|
|
139
|
+
return sortA - sortB;
|
|
140
|
+
});
|
|
141
|
+
setMethods(sortedMethods);
|
|
126
142
|
}
|
|
127
143
|
}, [initialMethods]);
|
|
128
144
|
var sensors = useSensors(useSensor(PointerSensor, {
|
|
@@ -144,8 +160,15 @@ var AuthMethods = function AuthMethods(_ref2) {
|
|
|
144
160
|
return item.id === over.id;
|
|
145
161
|
});
|
|
146
162
|
var newItems = arrayMove(items, oldIndex, newIndex);
|
|
147
|
-
|
|
148
|
-
|
|
163
|
+
|
|
164
|
+
// 更新每个 item 的 sort 字段以反映新的顺序
|
|
165
|
+
var updatedItems = newItems.map(function (item, index) {
|
|
166
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
167
|
+
sort: index
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
onOrderChange === null || onOrderChange === void 0 || onOrderChange(updatedItems);
|
|
171
|
+
return updatedItems;
|
|
149
172
|
});
|
|
150
173
|
}
|
|
151
174
|
};
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"stripe" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "stripe" | "
|
|
300
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -116,7 +116,7 @@ var ApplePay = function ApplePay(props, ref) {
|
|
|
116
116
|
|
|
117
117
|
// 提取域名
|
|
118
118
|
shop_domain = linkElement.hostname;
|
|
119
|
-
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/apple-pay?order_id=".concat((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id, "&front_order_uuid=").concat(state.front_order_uuid), state.history)); // 记录即将跳转到ApplePay
|
|
119
|
+
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/apple-pay?order_id=".concat((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id, "&front_order_uuid=").concat(state.front_order_uuid, "&is_replace_router=1"), state.history)); // 记录即将跳转到ApplePay
|
|
120
120
|
paymentLogger.addLog({
|
|
121
121
|
key: 'ApplePay准备跳转',
|
|
122
122
|
value: ""
|
|
@@ -131,7 +131,7 @@ var GooglePay = function GooglePay(props, ref) {
|
|
|
131
131
|
|
|
132
132
|
// 提取域名
|
|
133
133
|
shop_domain = linkElement.hostname;
|
|
134
|
-
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/google-pay?order_id=".concat((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id, "&front_order_uuid=").concat(state.front_order_uuid), state.history)); // 记录即将跳转到GooglePay
|
|
134
|
+
_href = "".concat(config.pay).concat(formatFranchiseeRoute("/google-pay?order_id=".concat((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id, "&shop_id=").concat(shopId, "&locale=").concat(locale, "&shop_domain=").concat(shop_domain, "&total_amount=").concat(values.amount, "&payment_group_id=").concat(values.payment_group_id, "&front_order_uuid=").concat(state.front_order_uuid, "&is_replace_router=1"), state.history)); // 记录即将跳转到GooglePay
|
|
135
135
|
paymentLogger.addLog({
|
|
136
136
|
key: 'GooglePay准备跳转',
|
|
137
137
|
value: ''
|
|
@@ -29,10 +29,12 @@ export interface ProductCardProps {
|
|
|
29
29
|
onSelectProduct?: (item: any) => void;
|
|
30
30
|
currentProductId?: number;
|
|
31
31
|
onSelect?: (item: any) => void;
|
|
32
|
+
onSelectCover?: (item: any) => void;
|
|
33
|
+
onSelectInfo?: (item: any) => void;
|
|
32
34
|
isSelected?: boolean;
|
|
33
35
|
decorateConfig?: ProductCardConfig;
|
|
34
36
|
}
|
|
35
|
-
export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
|
|
37
|
+
export declare const ProductCard: React.MemoExoticComponent<({ item, index, context, onSelect, onSelectCover, onSelectInfo, isSelected, className, decorateConfig, }: ProductCardProps) => JSX.Element>;
|
|
36
38
|
export declare const DefaultItemContent: React.MemoExoticComponent<(props: {
|
|
37
39
|
item: any;
|
|
38
40
|
index: number;
|
|
@@ -42,6 +42,8 @@ export var ProductCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
42
42
|
index = _ref.index,
|
|
43
43
|
context = _ref.context,
|
|
44
44
|
onSelect = _ref.onSelect,
|
|
45
|
+
onSelectCover = _ref.onSelectCover,
|
|
46
|
+
onSelectInfo = _ref.onSelectInfo,
|
|
45
47
|
isSelected = _ref.isSelected,
|
|
46
48
|
className = _ref.className,
|
|
47
49
|
_ref$decorateConfig = _ref.decorateConfig,
|
|
@@ -116,10 +118,11 @@ export var ProductCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
116
118
|
var cardContent = /*#__PURE__*/React.createElement("div", {
|
|
117
119
|
className: classNames("".concat(PREFIX, "__product-card"), className, {
|
|
118
120
|
selected: isSelected
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
121
|
+
})
|
|
122
|
+
// onClick={() => {
|
|
123
|
+
// onSelect?.(item);
|
|
124
|
+
// }}
|
|
125
|
+
,
|
|
123
126
|
"data-index": index,
|
|
124
127
|
"data-item-index": index
|
|
125
128
|
}, isProductCover ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -127,6 +130,9 @@ export var ProductCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
127
130
|
style: {
|
|
128
131
|
width: imgWidth || 'auto',
|
|
129
132
|
height: imgHeight || 'auto'
|
|
133
|
+
},
|
|
134
|
+
onClick: function onClick() {
|
|
135
|
+
onSelectCover === null || onSelectCover === void 0 || onSelectCover(item);
|
|
130
136
|
}
|
|
131
137
|
}, item.cover ? /*#__PURE__*/React.createElement("img", {
|
|
132
138
|
loading: "lazy",
|
|
@@ -141,7 +147,10 @@ export var ProductCard = /*#__PURE__*/memo(function (_ref) {
|
|
|
141
147
|
borderRadius: radius
|
|
142
148
|
}
|
|
143
149
|
}, getTextCover(item.title))) : null, /*#__PURE__*/React.createElement("div", {
|
|
144
|
-
className: "card-right"
|
|
150
|
+
className: "card-right",
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
onSelectInfo === null || onSelectInfo === void 0 || onSelectInfo(item);
|
|
153
|
+
}
|
|
145
154
|
}, !!isTitle ? /*#__PURE__*/React.createElement("div", {
|
|
146
155
|
className: "title"
|
|
147
156
|
}, item.title) : null, !!isSubtitle && item.subtitle ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -8,7 +8,7 @@ interface ProductSelectProps {
|
|
|
8
8
|
grid: boolean;
|
|
9
9
|
config: string;
|
|
10
10
|
};
|
|
11
|
-
onChange: (value: any) => void;
|
|
11
|
+
onChange: (value: any, type?: string) => void;
|
|
12
12
|
value?: number;
|
|
13
13
|
loading?: boolean;
|
|
14
14
|
style?: React.CSSProperties;
|
|
@@ -25,7 +25,8 @@ interface ProductSelectProps {
|
|
|
25
25
|
productListSetting?: Partial<any>;
|
|
26
26
|
/** 兼容scrollDom */
|
|
27
27
|
customScrollParent?: HTMLElement | string;
|
|
28
|
+
hideCategoryWhenOne?: boolean;
|
|
28
29
|
}
|
|
29
30
|
export declare const PREFIX = "pisell-product-select";
|
|
30
|
-
declare const index: ({ dataSource, emptyDescription, showSearch, scrollDom, offsetDom, style, token: customToken, onChange, value, selectedItems, productListSetting, customScrollParent, loading, layout, ...rest }: ProductSelectProps) => JSX.Element;
|
|
31
|
+
declare const index: ({ dataSource, emptyDescription, showSearch, scrollDom, offsetDom, style, token: customToken, onChange, value, selectedItems, productListSetting, customScrollParent, loading, layout, hideCategoryWhenOne, ...rest }: ProductSelectProps) => JSX.Element;
|
|
31
32
|
export default index;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["dataSource", "emptyDescription", "showSearch", "scrollDom", "offsetDom", "style", "token", "onChange", "value", "selectedItems", "productListSetting", "customScrollParent", "loading", "layout"];
|
|
2
|
+
var _excluded = ["dataSource", "emptyDescription", "showSearch", "scrollDom", "offsetDom", "style", "token", "onChange", "value", "selectedItems", "productListSetting", "customScrollParent", "loading", "layout", "hideCategoryWhenOne"];
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -67,6 +67,8 @@ var index = function index(_ref) {
|
|
|
67
67
|
_ref$loading = _ref.loading,
|
|
68
68
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
69
69
|
layout = _ref.layout,
|
|
70
|
+
_ref$hideCategoryWhen = _ref.hideCategoryWhenOne,
|
|
71
|
+
hideCategoryWhenOne = _ref$hideCategoryWhen === void 0 ? false : _ref$hideCategoryWhen,
|
|
70
72
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
71
73
|
var searchRef = useRef(null);
|
|
72
74
|
var _useState = useState(''),
|
|
@@ -113,6 +115,22 @@ var index = function index(_ref) {
|
|
|
113
115
|
});
|
|
114
116
|
});
|
|
115
117
|
}, [_groupedList]);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @title: 是否隐藏分类
|
|
121
|
+
* @description:
|
|
122
|
+
* @param {*} useMemo
|
|
123
|
+
* @return {*}
|
|
124
|
+
* @Author: WangHan
|
|
125
|
+
* @Date: 2025-10-09 15:13
|
|
126
|
+
*/
|
|
127
|
+
var isHideCategory = useMemo(function () {
|
|
128
|
+
if (hideCategoryWhenOne) {
|
|
129
|
+
// 只有一个分类或者没有分类
|
|
130
|
+
return (_categories === null || _categories === void 0 ? void 0 : _categories.length) === 1 || !(_categories !== null && _categories !== void 0 && _categories.length);
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}, [_categories, hideCategoryWhenOne]);
|
|
116
134
|
useEffect(function () {
|
|
117
135
|
if (!(_categories !== null && _categories !== void 0 && _categories.length)) {
|
|
118
136
|
setActiveKey('');
|
|
@@ -151,9 +169,9 @@ var index = function index(_ref) {
|
|
|
151
169
|
var disabled = useMemo(function () {
|
|
152
170
|
return !!(productListSetting !== null && productListSetting !== void 0 && productListSetting.list_max_length) && Array.isArray(selectedItems) && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) > 0;
|
|
153
171
|
}, [productListSetting, selectedItems]);
|
|
154
|
-
var _onChange = useCallback(function (value) {
|
|
172
|
+
var _onChange = useCallback(function (value, type) {
|
|
155
173
|
if (disabled) return;
|
|
156
|
-
onChange === null || onChange === void 0 || onChange(value);
|
|
174
|
+
onChange === null || onChange === void 0 || onChange(value, type);
|
|
157
175
|
}, [disabled, onChange]);
|
|
158
176
|
var debounceIndicator = useCallback(function (delay) {
|
|
159
177
|
isIndicatorVisibleRef.current = true;
|
|
@@ -228,19 +246,19 @@ var index = function index(_ref) {
|
|
|
228
246
|
// switchCategory('');
|
|
229
247
|
setKeyword(e.target.value);
|
|
230
248
|
}
|
|
231
|
-
})) : null, /*#__PURE__*/React.createElement(CategoryTabs, {
|
|
249
|
+
})) : null, !isHideCategory ? /*#__PURE__*/React.createElement(CategoryTabs, {
|
|
232
250
|
activeKey: activeKey,
|
|
233
251
|
items: _categories,
|
|
234
252
|
onChange: switchCategory,
|
|
235
253
|
loading: loading,
|
|
236
254
|
skeleton: /*#__PURE__*/React.createElement(CategorySkeleton, null)
|
|
237
|
-
}), !loading && !(_groupedList !== null && _groupedList !== void 0 && _groupedList.length) ? /*#__PURE__*/React.createElement(PisellEmpty, {
|
|
255
|
+
}) : null, !loading && !(_groupedList !== null && _groupedList !== void 0 && _groupedList.length) ? /*#__PURE__*/React.createElement(PisellEmpty, {
|
|
238
256
|
description: emptyDescription || locales.getText('pisell2.product-select.empty')
|
|
239
257
|
}) : /*#__PURE__*/React.createElement(IntersectionObserverProvider, {
|
|
240
258
|
rootMargin: "-270px 0px -270px 0px",
|
|
241
259
|
priorityMode: "top"
|
|
242
260
|
}, /*#__PURE__*/React.createElement(ProductList, {
|
|
243
|
-
className: "".concat(PREFIX, "__product-list"),
|
|
261
|
+
className: classNames("".concat(PREFIX, "__product-list"), _defineProperty({}, "".concat(PREFIX, "__product-list_hide_category"), isHideCategory)),
|
|
244
262
|
loading: loading,
|
|
245
263
|
data: loading ? MOCK_DATA : _groupedList,
|
|
246
264
|
context: {
|
|
@@ -259,8 +277,15 @@ var index = function index(_ref) {
|
|
|
259
277
|
return /*#__PURE__*/React.createElement(ProductCard, {
|
|
260
278
|
index: index,
|
|
261
279
|
item: item,
|
|
262
|
-
context: context
|
|
263
|
-
onSelect
|
|
280
|
+
context: context
|
|
281
|
+
// onSelect={_onChange}
|
|
282
|
+
,
|
|
283
|
+
onSelectCover: function onSelectCover(e) {
|
|
284
|
+
_onChange(e, 'cover');
|
|
285
|
+
},
|
|
286
|
+
onSelectInfo: function onSelectInfo(e) {
|
|
287
|
+
_onChange(e, 'info');
|
|
288
|
+
},
|
|
264
289
|
isSelected: item.id === value,
|
|
265
290
|
decorateConfig: productListSetting
|
|
266
291
|
});
|