@pisell/private-materials 3.4.42 → 3.4.44
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/index.js +1 -1
- package/build/lowcode/meta.js +9 -1
- package/build/lowcode/preview.js +150 -155
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/components/Services/index.js +22 -8
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.js +4 -1
- package/es/components/booking/components/footer/utils.js +75 -73
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/locales.d.ts +6 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/model.d.ts +13 -1
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -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/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/plus/clientName/index.d.ts +4 -0
- package/es/plus/clientName/index.js +18 -0
- package/es/plus/clientName/index.less +10 -0
- package/es/plus/clientName/type.d.ts +13 -0
- package/es/plus/clientName/type.js +1 -0
- package/es/plus/clientName/utils.d.ts +2 -0
- package/es/plus/clientName/utils.js +18 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- 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/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -3
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +4 -1
- package/lib/components/booking/components/footer/utils.js +93 -68
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +5 -4
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/locales.d.ts +6 -0
- package/lib/components/booking/locales.js +12 -3
- package/lib/components/booking/model.d.ts +13 -1
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -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/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/plus/clientName/index.d.ts +4 -0
- package/lib/plus/clientName/index.js +53 -0
- package/lib/plus/clientName/index.less +10 -0
- package/lib/plus/clientName/type.d.ts +13 -0
- package/lib/plus/clientName/type.js +17 -0
- package/lib/plus/clientName/utils.d.ts +2 -0
- package/lib/plus/clientName/utils.js +43 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- 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/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/package.json +6 -4
|
@@ -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
|
});
|
|
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
30
30
|
* @return {*}
|
|
31
31
|
* @Author: xiangfeng.xue
|
|
32
32
|
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
|
34
34
|
/**
|
|
35
35
|
* 计算所有价格明细
|
|
36
36
|
* @param items - 购物车商品数组
|
|
@@ -45,7 +45,7 @@ var import_Total = __toESM(require("./Total"));
|
|
|
45
45
|
var import_Deposit = __toESM(require("../../Deposit"));
|
|
46
46
|
var import_utils3 = require("../utils");
|
|
47
47
|
var import_index = require("./index.less");
|
|
48
|
-
var CartItem = ({ onNext }) => {
|
|
48
|
+
var CartItem = ({ onNext, renderContactInfo }) => {
|
|
49
49
|
var _a, _b, _c, _d, _e;
|
|
50
50
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
51
51
|
const {
|
|
@@ -152,7 +152,9 @@ var CartItem = ({ onNext }) => {
|
|
|
152
152
|
const products = (0, import_react.useMemo)(() => {
|
|
153
153
|
if (!(carts == null ? void 0 : carts.length)) return [];
|
|
154
154
|
carts.forEach((item) => {
|
|
155
|
-
item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(
|
|
155
|
+
item.isShowChangeHolder = !appointmentBooking.isTargetCartIdNormalProduct(
|
|
156
|
+
item == null ? void 0 : item._id
|
|
157
|
+
);
|
|
156
158
|
});
|
|
157
159
|
if ((currentSelectedResources == null ? void 0 : currentSelectedResources.length) > 0) {
|
|
158
160
|
const newCarts = carts.map((item) => {
|
|
@@ -181,7 +183,7 @@ var CartItem = ({ onNext }) => {
|
|
|
181
183
|
{
|
|
182
184
|
className: `appointment-cart-item-wrap ${(0, import_utils.isMobile)() ? "appointment-cart-mobile-item-wrap" : ""}`
|
|
183
185
|
},
|
|
184
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
186
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "content" }, renderContactInfo ? renderContactInfo() : null, /* @__PURE__ */ import_react.default.createElement(
|
|
185
187
|
import_shoppingCart.default,
|
|
186
188
|
{
|
|
187
189
|
productParams: {
|
|
@@ -41,6 +41,9 @@ var import_Item = __toESM(require("../Cart/Item"));
|
|
|
41
41
|
var import_utils2 = require("../../utils");
|
|
42
42
|
var import_utils3 = require("./utils");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
|
+
var import_ContactInfoContent = __toESM(require("../../../../plus/contactInfoModal/ContactInfoContent"));
|
|
45
|
+
var import_antd = require("antd");
|
|
46
|
+
var import_useLoginUser = __toESM(require("../../../../hooks/useLoginUser"));
|
|
44
47
|
var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
45
48
|
var _a, _b;
|
|
46
49
|
const hasSubscribedRef = (0, import_react.useRef)(false);
|
|
@@ -49,7 +52,69 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
49
52
|
const utils = (0, import_hooks.contextUtils)();
|
|
50
53
|
const { pubsub } = context.appHelper.utils;
|
|
51
54
|
const { appointmentBooking, summary, isAgreeDepositPolicy, setLoading } = (0, import_context.useAppointmentBookingContext)();
|
|
52
|
-
const { isRetailTemplate } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
55
|
+
const { isRetailTemplate, bookingSetting } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
56
|
+
console.log(bookingSetting, "bookingSetting");
|
|
57
|
+
const [form] = import_antd.Form.useForm();
|
|
58
|
+
const userInfo = (0, import_useLoginUser.default)();
|
|
59
|
+
const getContactsInfo = async () => {
|
|
60
|
+
var _a2;
|
|
61
|
+
let contacts_info = null;
|
|
62
|
+
try {
|
|
63
|
+
const res = await ((_a2 = appointmentBooking == null ? void 0 : appointmentBooking.getContactInfo) == null ? void 0 : _a2.call(appointmentBooking, {
|
|
64
|
+
key: "contacts_info"
|
|
65
|
+
}));
|
|
66
|
+
if ((res == null ? void 0 : res.code) == 200 && (res == null ? void 0 : res.data)) {
|
|
67
|
+
contacts_info = res == null ? void 0 : res.data;
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.log("error", error);
|
|
71
|
+
contacts_info = null;
|
|
72
|
+
}
|
|
73
|
+
const transfromCountryCallingCode = (code) => {
|
|
74
|
+
if (!code) {
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
return (code == null ? void 0 : code.startsWith("+")) ? code : `+${code}`;
|
|
78
|
+
};
|
|
79
|
+
if (contacts_info) {
|
|
80
|
+
const { first_name, last_name, phone, email } = contacts_info || {};
|
|
81
|
+
form.setFieldsValue({
|
|
82
|
+
first_name,
|
|
83
|
+
last_name,
|
|
84
|
+
phone: {
|
|
85
|
+
phone: phone == null ? void 0 : phone.phone,
|
|
86
|
+
countryCallingCode: transfromCountryCallingCode(
|
|
87
|
+
phone == null ? void 0 : phone.country_calling_code
|
|
88
|
+
),
|
|
89
|
+
countryCode: phone == null ? void 0 : phone.country_code
|
|
90
|
+
},
|
|
91
|
+
email
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
console.log("userInfo", userInfo);
|
|
95
|
+
const {
|
|
96
|
+
first_name,
|
|
97
|
+
last_name,
|
|
98
|
+
phone,
|
|
99
|
+
email,
|
|
100
|
+
country_calling_code,
|
|
101
|
+
country_code
|
|
102
|
+
} = userInfo || {};
|
|
103
|
+
form.setFieldsValue({
|
|
104
|
+
first_name,
|
|
105
|
+
last_name,
|
|
106
|
+
phone: {
|
|
107
|
+
phone,
|
|
108
|
+
countryCallingCode: transfromCountryCallingCode(country_calling_code),
|
|
109
|
+
countryCode: country_code
|
|
110
|
+
},
|
|
111
|
+
email
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
(0, import_react.useEffect)(() => {
|
|
116
|
+
getContactsInfo();
|
|
117
|
+
}, []);
|
|
53
118
|
const goPaymentFinish = (order_id, amount) => {
|
|
54
119
|
var _a2;
|
|
55
120
|
const url = `/payment-finish/success?order_id=${order_id}&amount=${Number(
|
|
@@ -60,17 +125,17 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
60
125
|
};
|
|
61
126
|
(0, import_react.useEffect)(() => {
|
|
62
127
|
if (isRetailTemplate) {
|
|
63
|
-
handleForm();
|
|
128
|
+
handleForm(false);
|
|
64
129
|
}
|
|
65
130
|
}, [isRetailTemplate]);
|
|
66
|
-
const handleForm = async (isSubmit) => {
|
|
131
|
+
const handleForm = async (isSubmit, extraData) => {
|
|
67
132
|
var _a2;
|
|
68
133
|
const carts = await appointmentBooking.getCart();
|
|
69
134
|
const key = "isRetailFormSubmit";
|
|
70
135
|
const isRetailFormSubmit = appointmentBooking.getOtherData(key);
|
|
71
136
|
const callback = () => {
|
|
72
137
|
if (isSubmit) {
|
|
73
|
-
onCheckout();
|
|
138
|
+
onCheckout(extraData);
|
|
74
139
|
}
|
|
75
140
|
};
|
|
76
141
|
if (isRetailFormSubmit) {
|
|
@@ -94,7 +159,7 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
94
159
|
}
|
|
95
160
|
});
|
|
96
161
|
};
|
|
97
|
-
const handleNext = async () => {
|
|
162
|
+
const handleNext = async (extraData) => {
|
|
98
163
|
var _a2;
|
|
99
164
|
const { deposit } = summary;
|
|
100
165
|
if ((deposit == null ? void 0 : deposit.hasDeposit) && ((_a2 = deposit == null ? void 0 : deposit.protocols) == null ? void 0 : _a2.length) > 0 && !isAgreeDepositPolicy) {
|
|
@@ -102,15 +167,15 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
102
167
|
}
|
|
103
168
|
setLoading(true);
|
|
104
169
|
if (isRetailTemplate) {
|
|
105
|
-
handleForm(true);
|
|
170
|
+
handleForm(true, extraData);
|
|
106
171
|
return;
|
|
107
172
|
}
|
|
108
|
-
onCheckout();
|
|
173
|
+
onCheckout(extraData);
|
|
109
174
|
};
|
|
110
|
-
const onCheckout = async () => {
|
|
175
|
+
const onCheckout = async (extraData) => {
|
|
111
176
|
try {
|
|
112
177
|
const { deposit } = summary;
|
|
113
|
-
const { data } = await appointmentBooking.submitOrder();
|
|
178
|
+
const { data } = await appointmentBooking.submitOrder(extraData);
|
|
114
179
|
const { is_deposit, deposit_amount, total_amount, order_id } = data || {};
|
|
115
180
|
const _total = is_deposit ? deposit_amount : total_amount;
|
|
116
181
|
if (_total > 0) {
|
|
@@ -143,8 +208,8 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
143
208
|
}, 50);
|
|
144
209
|
}
|
|
145
210
|
};
|
|
146
|
-
const handleSubmit = () => {
|
|
147
|
-
var _a2, _b2, _c, _d;
|
|
211
|
+
const handleSubmit = async () => {
|
|
212
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
148
213
|
if ((_b2 = (_a2 = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _a2.isGuestUser) == null ? void 0 : _b2.call(_a2)) {
|
|
149
214
|
if (!hasSubscribedRef.current) {
|
|
150
215
|
pubsub.subscribe("bind.guest.user", handleNext);
|
|
@@ -153,7 +218,28 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
153
218
|
(_d = (_c = utils == null ? void 0 : utils.businessUtils) == null ? void 0 : _c.openRegisterModal) == null ? void 0 : _d.call(_c, true);
|
|
154
219
|
return;
|
|
155
220
|
}
|
|
156
|
-
|
|
221
|
+
let contacts_info = null;
|
|
222
|
+
try {
|
|
223
|
+
if (showContactInfo) {
|
|
224
|
+
contacts_info = await form.validateFields();
|
|
225
|
+
const newPhone = {
|
|
226
|
+
phone: ((_e = contacts_info == null ? void 0 : contacts_info.phone) == null ? void 0 : _e.phone) || "",
|
|
227
|
+
country_calling_code: ((_f = contacts_info == null ? void 0 : contacts_info.phone) == null ? void 0 : _f.countryCallingCode) || "",
|
|
228
|
+
country_code: ((_g = contacts_info == null ? void 0 : contacts_info.phone) == null ? void 0 : _g.countryCode) || ""
|
|
229
|
+
};
|
|
230
|
+
contacts_info.phone = newPhone;
|
|
231
|
+
if ((contacts_info == null ? void 0 : contacts_info.first_name) || (contacts_info == null ? void 0 : contacts_info.last_name)) {
|
|
232
|
+
contacts_info.display_name = `${(contacts_info == null ? void 0 : contacts_info.first_name) || ""} ${(contacts_info == null ? void 0 : contacts_info.last_name) || ""}`;
|
|
233
|
+
} else {
|
|
234
|
+
contacts_info.display_name = "";
|
|
235
|
+
}
|
|
236
|
+
console.log("contacts_info", contacts_info);
|
|
237
|
+
}
|
|
238
|
+
} catch (error) {
|
|
239
|
+
console.log("error", error);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
handleNext({ contacts_info });
|
|
157
243
|
};
|
|
158
244
|
(0, import_react.useEffect)(() => {
|
|
159
245
|
return () => {
|
|
@@ -164,7 +250,64 @@ var ConfirmInformation = (0, import_react.forwardRef)((props, ref) => {
|
|
|
164
250
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
165
251
|
next: handleSubmit
|
|
166
252
|
}));
|
|
167
|
-
|
|
253
|
+
const showContactInfo = (0, import_react.useMemo)(() => {
|
|
254
|
+
let visible = false;
|
|
255
|
+
const { showContactInfo: showContactInfoValue, contactInfoSetting } = bookingSetting || {};
|
|
256
|
+
if (showContactInfoValue === 1 || showContactInfoValue === "1") {
|
|
257
|
+
const { showName, showPhone, showEmail } = contactInfoSetting || {};
|
|
258
|
+
if ((showName === 0 || showName === "0") && (showPhone === 0 || showPhone === "0") && (showEmail === 0 || showEmail === "0")) {
|
|
259
|
+
visible = false;
|
|
260
|
+
} else {
|
|
261
|
+
visible = true;
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
visible = false;
|
|
265
|
+
}
|
|
266
|
+
return visible;
|
|
267
|
+
}, [bookingSetting == null ? void 0 : bookingSetting.showContactInfo, bookingSetting == null ? void 0 : bookingSetting.contactInfoSetting]);
|
|
268
|
+
const renderContactInfo = () => {
|
|
269
|
+
const {
|
|
270
|
+
emailRequired,
|
|
271
|
+
nameRequired,
|
|
272
|
+
phoneRequired,
|
|
273
|
+
showEmail,
|
|
274
|
+
showName,
|
|
275
|
+
showPhone
|
|
276
|
+
} = (bookingSetting == null ? void 0 : bookingSetting.contactInfoSetting) || {};
|
|
277
|
+
if (!showContactInfo) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-contact-info-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-contact-info-title" }, import_utils.locales.getText("pisell2.text.contact-info.title")), /* @__PURE__ */ import_react.default.createElement(
|
|
281
|
+
import_ContactInfoContent.default,
|
|
282
|
+
{
|
|
283
|
+
dataSource: null,
|
|
284
|
+
form,
|
|
285
|
+
config: {
|
|
286
|
+
first_name: {
|
|
287
|
+
visible: showName === 0 ? false : true,
|
|
288
|
+
required: nameRequired === "required" ? true : false
|
|
289
|
+
// 姓名默认选填
|
|
290
|
+
},
|
|
291
|
+
last_name: {
|
|
292
|
+
visible: showName === 0 ? false : true,
|
|
293
|
+
required: nameRequired === "required" ? true : false
|
|
294
|
+
// 姓名默认选填
|
|
295
|
+
},
|
|
296
|
+
phone: {
|
|
297
|
+
visible: showPhone === 0 ? false : true,
|
|
298
|
+
required: phoneRequired === "optional" ? false : true
|
|
299
|
+
// 手机号默认必填
|
|
300
|
+
},
|
|
301
|
+
email: {
|
|
302
|
+
visible: showEmail === 0 ? false : true,
|
|
303
|
+
required: emailRequired === "optional" ? false : true
|
|
304
|
+
// 邮箱默认选填
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
));
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-wrap" }, (0, import_utils.isMobile)() ? /* @__PURE__ */ import_react.default.createElement(import_Item.default, { onNext: handleSubmit, renderContactInfo }) : showContactInfo ? renderContactInfo() : /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-confirm-information-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "image" }, /* @__PURE__ */ import_react.default.createElement(
|
|
168
311
|
"img",
|
|
169
312
|
{
|
|
170
313
|
src: `${config == null ? void 0 : config.awsStatic}/checkout_confirm.png`,
|
|
@@ -33,3 +33,18 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
.appointment-confirm-information-contact-info-wrap {
|
|
37
|
+
.appointment-confirm-information-contact-info-title {
|
|
38
|
+
color: #1b1b1b;
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pisell-contact-info-modal-content {
|
|
44
|
+
padding: 14px 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pisell-lowcode-form-item {
|
|
48
|
+
margin-bottom: 14px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -70,7 +70,11 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
70
70
|
setProductLoading(false);
|
|
71
71
|
});
|
|
72
72
|
}, [isDateSelectedFirst]);
|
|
73
|
-
const
|
|
73
|
+
const isShowProductDetailStepper = (0, import_react.useMemo)(() => {
|
|
74
|
+
const { productModuleParams } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
75
|
+
return productModuleParams == null ? void 0 : productModuleParams.isShowProductDetailStepper;
|
|
76
|
+
}, [appointmentBooking == null ? void 0 : appointmentBooking.otherParams]);
|
|
77
|
+
const handleSelectProduct = async (item, clickType) => {
|
|
74
78
|
let type = "";
|
|
75
79
|
if (!isRetailTemplate) {
|
|
76
80
|
type = await checkProductType(item == null ? void 0 : item.id);
|
|
@@ -82,7 +86,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
82
86
|
type: "pisell1.productDetail",
|
|
83
87
|
data: {
|
|
84
88
|
detail: { ...item, open_deposit: 1 },
|
|
85
|
-
setting: { can_input: true }
|
|
89
|
+
setting: { can_input: true, item_max_length: isShowProductDetailStepper, is_detail_open: clickType === "cover" }
|
|
86
90
|
},
|
|
87
91
|
callback: async (data) => {
|
|
88
92
|
var _a, _b;
|
|
@@ -205,7 +209,8 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
205
209
|
cardSelectedBg: "var(--theme-color)"
|
|
206
210
|
},
|
|
207
211
|
productListSetting,
|
|
208
|
-
selectedItems: carts
|
|
212
|
+
selectedItems: carts,
|
|
213
|
+
hideCategoryWhenOne: true
|
|
209
214
|
}
|
|
210
215
|
));
|
|
211
216
|
});
|