s-platform-landing-section 0.1.22 → 0.1.23
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/dist/index.js +235 -84
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +235 -84
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -150,7 +150,6 @@ var LinkToPage = function LinkToPage(props) {
|
|
|
150
150
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
151
151
|
return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
|
|
152
152
|
};
|
|
153
|
-
var SSHOP_SPA_TOKEN = "sshop-spa-token";
|
|
154
153
|
var genLinkSearch = function genLinkSearch(keyword) {
|
|
155
154
|
return "/tim-kiem?tu-khoa=" + keyword;
|
|
156
155
|
};
|
|
@@ -885,6 +884,8 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
885
884
|
style = _props$style === void 0 ? {} : _props$style,
|
|
886
885
|
_props$onChange = props.onChange,
|
|
887
886
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
887
|
+
_props$onKeyDown = props.onKeyDown,
|
|
888
|
+
onKeyDown = _props$onKeyDown === void 0 ? function () {} : _props$onKeyDown,
|
|
888
889
|
_props$disabled = props.disabled,
|
|
889
890
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
890
891
|
_props$defaultValue = props.defaultValue,
|
|
@@ -963,6 +964,9 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
963
964
|
_setValue(value);
|
|
964
965
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
965
966
|
};
|
|
967
|
+
var handleOnKeyDown = function handleOnKeyDown(e) {
|
|
968
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
969
|
+
};
|
|
966
970
|
var changeQuantity = function changeQuantity(quantity) {
|
|
967
971
|
var newValue = parseInt(value) + quantity;
|
|
968
972
|
if (!disabled && newValue > min && (max === null || newValue <= max)) {
|
|
@@ -1003,7 +1007,10 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
1003
1007
|
onChange: handleOnChange,
|
|
1004
1008
|
required: required,
|
|
1005
1009
|
className: _inputClassName,
|
|
1006
|
-
ref: refInput
|
|
1010
|
+
ref: refInput,
|
|
1011
|
+
onKeyDown: function onKeyDown(e) {
|
|
1012
|
+
handleOnKeyDown(e);
|
|
1013
|
+
}
|
|
1007
1014
|
}), suffix ? /*#__PURE__*/React__default.createElement("div", null, suffix) : null, isHidden ? /*#__PURE__*/React__default.createElement("button", {
|
|
1008
1015
|
onClick: function onClick() {
|
|
1009
1016
|
changeHidden();
|
|
@@ -1023,12 +1030,19 @@ var Hero1 = function Hero1(props) {
|
|
|
1023
1030
|
var _sectionData$, _sectionData$$srcImag, _sectionData$2, _sectionData$3, _sectionData$4, _sectionData$4$button, _sectionData$4$button2, _sectionData$5, _sectionData$5$button, _sectionData$5$button2, _sectionData$6, _sectionData$6$button, _sectionData$6$button2;
|
|
1024
1031
|
var shopConfigStyle = props.shopConfigStyle,
|
|
1025
1032
|
data = props.data,
|
|
1033
|
+
_props$router = props.router,
|
|
1034
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
1026
1035
|
_props$Link = props.Link,
|
|
1027
1036
|
Link = _props$Link === void 0 ? null : _props$Link;
|
|
1028
1037
|
var _useState = React.useState(""),
|
|
1029
1038
|
value = _useState[0],
|
|
1030
1039
|
setValue = _useState[1];
|
|
1031
1040
|
var sectionData = data === null || data === void 0 ? void 0 : data.data;
|
|
1041
|
+
var handleSearch = function handleSearch(e) {
|
|
1042
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
1043
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1032
1046
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1033
1047
|
style: {
|
|
1034
1048
|
backgroundImage: "url(" + (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0]) + ")"
|
|
@@ -1056,6 +1070,9 @@ var Hero1 = function Hero1(props) {
|
|
|
1056
1070
|
icons: /*#__PURE__*/React__default.createElement(io5.IoSearchOutline, null),
|
|
1057
1071
|
wrapClassName: "w-full",
|
|
1058
1072
|
inputClassName: "w-full",
|
|
1073
|
+
onKeyDown: function onKeyDown(e) {
|
|
1074
|
+
handleSearch(e);
|
|
1075
|
+
},
|
|
1059
1076
|
onChange: setValue
|
|
1060
1077
|
}), value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
1061
1078
|
Link: Link,
|
|
@@ -1082,7 +1099,7 @@ var Hero2 = function Hero2(props) {
|
|
|
1082
1099
|
alt: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title,
|
|
1083
1100
|
className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
|
|
1084
1101
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1085
|
-
className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-
|
|
1102
|
+
className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-[40%] top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
|
|
1086
1103
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
1087
1104
|
src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
|
|
1088
1105
|
alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
|
|
@@ -8033,10 +8050,12 @@ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
|
|
|
8033
8050
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
|
|
8034
8051
|
className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
|
|
8035
8052
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
8036
|
-
return /*#__PURE__*/React__default.createElement(
|
|
8053
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
8037
8054
|
key: index,
|
|
8055
|
+
href: getLinkServiceDetail(product === null || product === void 0 ? void 0 : product.productInfo)
|
|
8056
|
+
}, /*#__PURE__*/React__default.createElement(ProductItem1, {
|
|
8038
8057
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
8039
|
-
});
|
|
8058
|
+
}));
|
|
8040
8059
|
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
8041
8060
|
className: "text-gray3 text-center p-12"
|
|
8042
8061
|
}, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
|
|
@@ -8123,6 +8142,12 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8123
8142
|
style = _props$style === void 0 ? {} : _props$style,
|
|
8124
8143
|
_props$buttonClassNam = props.buttonClassName,
|
|
8125
8144
|
buttonClassName = _props$buttonClassNam === void 0 ? "" : _props$buttonClassNam;
|
|
8145
|
+
React.useEffect(function () {
|
|
8146
|
+
document.body.style.overflow = "hidden";
|
|
8147
|
+
return function () {
|
|
8148
|
+
document.body.style.overflow = "auto";
|
|
8149
|
+
};
|
|
8150
|
+
}, []);
|
|
8126
8151
|
var handleClickOutside = function handleClickOutside(event) {
|
|
8127
8152
|
event.stopPropagation();
|
|
8128
8153
|
if (onClose) {
|
|
@@ -8134,7 +8159,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8134
8159
|
};
|
|
8135
8160
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8136
8161
|
className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 ",
|
|
8137
|
-
onClick:
|
|
8162
|
+
onClick: function onClick(e) {
|
|
8163
|
+
return handleClickOutside(e);
|
|
8164
|
+
}
|
|
8138
8165
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8139
8166
|
className: "flex items-center justify-center relative " + className,
|
|
8140
8167
|
onClick: function onClick(e) {
|
|
@@ -8144,7 +8171,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8144
8171
|
ref: modalRef
|
|
8145
8172
|
}, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
|
|
8146
8173
|
className: "absolute top-4 right-4 " + buttonClassName,
|
|
8147
|
-
onClick:
|
|
8174
|
+
onClick: function onClick(e) {
|
|
8175
|
+
return handleClickOutside(e);
|
|
8176
|
+
}
|
|
8148
8177
|
}, /*#__PURE__*/React__default.createElement(rx.RxCross2, null))));
|
|
8149
8178
|
};
|
|
8150
8179
|
|
|
@@ -8947,7 +8976,6 @@ var BookingForm = function BookingForm(props) {
|
|
|
8947
8976
|
var _EmployeeController = EmployeeController(_extends({}, props)),
|
|
8948
8977
|
_EmployeeController$l = _EmployeeController.listEmployment,
|
|
8949
8978
|
listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
|
|
8950
|
-
var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
|
|
8951
8979
|
var _ProductController = ProductController(_extends({}, props, {
|
|
8952
8980
|
params: productsParams
|
|
8953
8981
|
})),
|
|
@@ -9118,6 +9146,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9118
9146
|
inputClassName: "w-full focus:outline-none focus:ring-0"
|
|
9119
9147
|
}), /*#__PURE__*/React__default.createElement(InputPhoneNumber, {
|
|
9120
9148
|
ref: inputPhoneNumberRef,
|
|
9149
|
+
name: "customerPhone",
|
|
9121
9150
|
label: "Số điện thoại",
|
|
9122
9151
|
placeholder: "Nhập số điện thoại",
|
|
9123
9152
|
rules: [{
|
|
@@ -9412,44 +9441,6 @@ var ProductDetailController = function ProductDetailController(props) {
|
|
|
9412
9441
|
};
|
|
9413
9442
|
};
|
|
9414
9443
|
|
|
9415
|
-
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9416
|
-
var shopConfigStyle = props.shopConfigStyle;
|
|
9417
|
-
var _ProductDetailControl = ProductDetailController(props),
|
|
9418
|
-
product = _ProductDetailControl.product;
|
|
9419
|
-
console.log('product', product);
|
|
9420
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9421
|
-
className: SECTION_DEFAULT_CLASS + " !py-0"
|
|
9422
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9423
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
|
|
9424
|
-
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9425
|
-
product: product,
|
|
9426
|
-
className: "w-full aspect-square rounded-2xl"
|
|
9427
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9428
|
-
className: "col-span-2"
|
|
9429
|
-
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9430
|
-
className: "font-semibold text-2xl"
|
|
9431
|
-
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9432
|
-
product: product,
|
|
9433
|
-
className: "mt-6"
|
|
9434
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9435
|
-
className: "flex gap-4 mt-6"
|
|
9436
|
-
}, /*#__PURE__*/React__default.createElement("div", null, "Th\u1EDDi l\u01B0\u1EE3ng: "), /*#__PURE__*/React__default.createElement("div", null, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes))), /*#__PURE__*/React__default.createElement("div", {
|
|
9437
|
-
className: "flex gap-4 mt-6"
|
|
9438
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9439
|
-
label: "ĐẶT LỊCH",
|
|
9440
|
-
shopConfigStyle: shopConfigStyle
|
|
9441
|
-
})), /*#__PURE__*/React__default.createElement("p", {
|
|
9442
|
-
className: "text-lg mt-12 pt-6 border-t border-stroke"
|
|
9443
|
-
}, "M\xF4 t\u1EA3"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9444
|
-
className: "mt-6",
|
|
9445
|
-
dangerouslySetInnerHTML: {
|
|
9446
|
-
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9447
|
-
}
|
|
9448
|
-
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
9449
|
-
className: "text-gray3 mt-2"
|
|
9450
|
-
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
|
|
9451
|
-
};
|
|
9452
|
-
|
|
9453
9444
|
var CartController = function CartController(props) {
|
|
9454
9445
|
var addToCart = props.addToCart,
|
|
9455
9446
|
dispatch = props.dispatch;
|
|
@@ -9475,7 +9466,7 @@ var CartController = function CartController(props) {
|
|
|
9475
9466
|
};
|
|
9476
9467
|
};
|
|
9477
9468
|
|
|
9478
|
-
var
|
|
9469
|
+
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9479
9470
|
var _product$images;
|
|
9480
9471
|
var shopConfigStyle = props.shopConfigStyle,
|
|
9481
9472
|
shopConfig = props.shopConfig;
|
|
@@ -9532,34 +9523,168 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9532
9523
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9533
9524
|
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9534
9525
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9535
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
|
|
9526
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9536
9527
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9537
9528
|
className: "flex flex-col gap-4 col-span-2"
|
|
9529
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9530
|
+
className: "rounded-2xl p-2 border"
|
|
9538
9531
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9539
9532
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9540
|
-
className: "w-full aspect-square object-
|
|
9533
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9541
9534
|
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9542
9535
|
product: product,
|
|
9543
|
-
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9536
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9537
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9538
|
+
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9539
|
+
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9540
|
+
return /*#__PURE__*/React__default.createElement("img", {
|
|
9541
|
+
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9542
|
+
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9543
|
+
alt: "",
|
|
9544
|
+
className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
|
|
9545
|
+
onClick: function onClick() {
|
|
9546
|
+
handleDisplayImage(item);
|
|
9547
|
+
}
|
|
9548
|
+
});
|
|
9549
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9550
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9551
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9552
|
+
className: "font-semibold text-2xl"
|
|
9553
|
+
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9554
|
+
product: product,
|
|
9555
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9544
9556
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9557
|
+
className: " text-lg py-3"
|
|
9558
|
+
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
9559
|
+
label: "ĐẶT LỊCH NGAY",
|
|
9560
|
+
shopConfigStyle: shopConfigStyle,
|
|
9561
|
+
onClick: function onClick(e) {
|
|
9562
|
+
return handleOpenModalBooking(e);
|
|
9563
|
+
}
|
|
9564
|
+
}), /*#__PURE__*/React__default.createElement("p", {
|
|
9565
|
+
className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
|
|
9566
|
+
}, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9567
|
+
className: "h-max"
|
|
9568
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9569
|
+
ref: descriptionRef,
|
|
9570
|
+
className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
|
|
9571
|
+
dangerouslySetInnerHTML: {
|
|
9572
|
+
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9573
|
+
}
|
|
9574
|
+
}), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9575
|
+
className: "h-10 relative -mt-10 rounded-b-lg",
|
|
9576
|
+
style: {
|
|
9577
|
+
background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
|
|
9578
|
+
}
|
|
9579
|
+
}) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9580
|
+
className: "w-full flex justify-center mt-2"
|
|
9581
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9582
|
+
label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
|
|
9583
|
+
className: " bottom-0 z-50",
|
|
9584
|
+
onClick: function onClick() {
|
|
9585
|
+
setIsSeeMore(!isSeeMore);
|
|
9586
|
+
}
|
|
9587
|
+
})) : null) : /*#__PURE__*/React__default.createElement("div", {
|
|
9588
|
+
className: "text-gray3 mt-2"
|
|
9589
|
+
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9590
|
+
onClose: handleCloseModal
|
|
9591
|
+
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9592
|
+
isModalBooking: isBooking,
|
|
9593
|
+
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9594
|
+
onCloseFormBooking: handleCloseModal,
|
|
9595
|
+
defaultValue: dataBooking,
|
|
9596
|
+
shopConfig: shopConfig,
|
|
9597
|
+
shopConfigStyle: shopConfigStyle
|
|
9598
|
+
})) : null);
|
|
9599
|
+
};
|
|
9600
|
+
|
|
9601
|
+
var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
9602
|
+
var _product$images;
|
|
9603
|
+
var shopConfigStyle = props.shopConfigStyle,
|
|
9604
|
+
shopConfig = props.shopConfig;
|
|
9605
|
+
var _ProductDetailControl = ProductDetailController(props),
|
|
9606
|
+
product = _ProductDetailControl.product;
|
|
9607
|
+
var _useState = React.useState(),
|
|
9608
|
+
displayImage = _useState[0],
|
|
9609
|
+
setDisplayImage = _useState[1];
|
|
9610
|
+
var _useState2 = React.useState(false),
|
|
9611
|
+
isSeeMore = _useState2[0],
|
|
9612
|
+
setIsSeeMore = _useState2[1];
|
|
9613
|
+
var _useState3 = React.useState(true),
|
|
9614
|
+
hiddenButton = _useState3[0],
|
|
9615
|
+
setHiddenButton = _useState3[1];
|
|
9616
|
+
var descriptionRef = React.useRef();
|
|
9617
|
+
var _useState4 = React.useState(false),
|
|
9618
|
+
isBooking = _useState4[0],
|
|
9619
|
+
setIsBooking = _useState4[1];
|
|
9620
|
+
var _useState5 = React.useState([]),
|
|
9621
|
+
dataBooking = _useState5[0],
|
|
9622
|
+
setDataBooking = _useState5[1];
|
|
9623
|
+
React.useEffect(function () {
|
|
9624
|
+
if (product) {
|
|
9625
|
+
if (descriptionRef.current) {
|
|
9626
|
+
var descriptionHeight = descriptionRef.current.offsetHeight;
|
|
9627
|
+
if (descriptionHeight >= 700) {
|
|
9628
|
+
setHiddenButton(false);
|
|
9629
|
+
}
|
|
9630
|
+
}
|
|
9631
|
+
}
|
|
9632
|
+
}, [product]);
|
|
9633
|
+
var handleDisplayImage = function handleDisplayImage(item) {
|
|
9634
|
+
setDisplayImage(item);
|
|
9635
|
+
};
|
|
9636
|
+
var handleOpenModalBooking = function handleOpenModalBooking(event) {
|
|
9637
|
+
try {
|
|
9638
|
+
event.stopPropagation();
|
|
9639
|
+
setDataBooking([_extends({}, product, {
|
|
9640
|
+
quantity: 1,
|
|
9641
|
+
technical: {},
|
|
9642
|
+
oldService: false,
|
|
9643
|
+
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9644
|
+
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9645
|
+
})]);
|
|
9646
|
+
setIsBooking(true);
|
|
9647
|
+
} catch (error) {
|
|
9648
|
+
console.log("::::::::::errrorrrrr::::::", error);
|
|
9649
|
+
}
|
|
9650
|
+
};
|
|
9651
|
+
var handleCloseModal = function handleCloseModal() {
|
|
9652
|
+
setIsBooking(false);
|
|
9653
|
+
setDataBooking([]);
|
|
9654
|
+
};
|
|
9655
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9656
|
+
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9657
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9658
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9659
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9660
|
+
className: "flex flex-col gap-4 col-span-2"
|
|
9661
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9662
|
+
className: "rounded-2xl p-2 border"
|
|
9663
|
+
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9664
|
+
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9665
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9666
|
+
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9667
|
+
product: product,
|
|
9668
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9669
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9545
9670
|
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9546
9671
|
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9547
9672
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
9548
9673
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9549
9674
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9550
9675
|
alt: "",
|
|
9551
|
-
className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
|
|
9676
|
+
className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " h-16 w-16 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
|
|
9552
9677
|
onClick: function onClick() {
|
|
9553
9678
|
handleDisplayImage(item);
|
|
9554
9679
|
}
|
|
9555
9680
|
});
|
|
9556
9681
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9557
|
-
className: "col-span-3"
|
|
9682
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9558
9683
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9559
9684
|
className: "font-semibold text-2xl"
|
|
9560
9685
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9561
9686
|
product: product,
|
|
9562
|
-
className: "mt-6 text-[22px]"
|
|
9687
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9563
9688
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9564
9689
|
className: " text-lg py-3"
|
|
9565
9690
|
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -9596,6 +9721,7 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9596
9721
|
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9597
9722
|
onClose: handleCloseModal
|
|
9598
9723
|
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9724
|
+
isModalBooking: isBooking,
|
|
9599
9725
|
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9600
9726
|
onCloseFormBooking: handleCloseModal,
|
|
9601
9727
|
defaultValue: dataBooking,
|
|
@@ -10238,23 +10364,17 @@ var Products10 = function Products10(props) {
|
|
|
10238
10364
|
};
|
|
10239
10365
|
|
|
10240
10366
|
var listFilter = [{
|
|
10367
|
+
label: "Tất cả",
|
|
10368
|
+
value: "all"
|
|
10369
|
+
}, {
|
|
10241
10370
|
label: "Khuyến mãi",
|
|
10242
|
-
value: "discount"
|
|
10243
|
-
filter: {
|
|
10244
|
-
isDiscount: true
|
|
10245
|
-
}
|
|
10371
|
+
value: "discount"
|
|
10246
10372
|
}, {
|
|
10247
10373
|
label: "Nổi bật",
|
|
10248
|
-
value: "isHighlight"
|
|
10249
|
-
filter: {
|
|
10250
|
-
isHighlight: true
|
|
10251
|
-
}
|
|
10374
|
+
value: "isHighlight"
|
|
10252
10375
|
}, {
|
|
10253
10376
|
label: "Giá thấp đến cao",
|
|
10254
|
-
value: "sortPriceDESC"
|
|
10255
|
-
filter: {
|
|
10256
|
-
isHighlight: true
|
|
10257
|
-
}
|
|
10377
|
+
value: "sortPriceDESC"
|
|
10258
10378
|
}];
|
|
10259
10379
|
var Products11 = function Products11(props) {
|
|
10260
10380
|
var _productsFilter$slice;
|
|
@@ -10282,6 +10402,9 @@ var Products11 = function Products11(props) {
|
|
|
10282
10402
|
var _useState4 = React.useState([]),
|
|
10283
10403
|
productsFilter = _useState4[0],
|
|
10284
10404
|
setProductsFilter = _useState4[1];
|
|
10405
|
+
var _useState5 = React.useState(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]),
|
|
10406
|
+
filterItem = _useState5[0],
|
|
10407
|
+
setFilterItem = _useState5[1];
|
|
10285
10408
|
var _CategoryController = CategoryController(_extends({}, props, {
|
|
10286
10409
|
params: params
|
|
10287
10410
|
})),
|
|
@@ -10305,6 +10428,7 @@ var Products11 = function Products11(props) {
|
|
|
10305
10428
|
var handleChooseCategory = function handleChooseCategory(category) {
|
|
10306
10429
|
setCategorySelected(category);
|
|
10307
10430
|
setFirstLoading(true);
|
|
10431
|
+
setFilterItem(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]);
|
|
10308
10432
|
setParams(function (prev) {
|
|
10309
10433
|
return _extends({}, prev, {
|
|
10310
10434
|
categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
|
|
@@ -10326,6 +10450,7 @@ var Products11 = function Products11(props) {
|
|
|
10326
10450
|
}
|
|
10327
10451
|
}, [products]);
|
|
10328
10452
|
var handleFilter = function handleFilter(item) {
|
|
10453
|
+
setFilterItem(item);
|
|
10329
10454
|
if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
|
|
10330
10455
|
var productsCopy = [].concat(products);
|
|
10331
10456
|
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
|
|
@@ -10351,26 +10476,32 @@ var Products11 = function Products11(props) {
|
|
|
10351
10476
|
}
|
|
10352
10477
|
};
|
|
10353
10478
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10354
|
-
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
|
|
10479
|
+
className: SECTION_CLASS + " grid grid-cols-1 !mt-0 md:grid-cols-4 gap-6"
|
|
10355
10480
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10356
|
-
className: "md:sticky top-
|
|
10481
|
+
className: "md:sticky top-0 self-start"
|
|
10357
10482
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10358
10483
|
className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
|
|
10359
10484
|
}, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
|
|
10360
10485
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10361
10486
|
className: "px-6 py-2 hover:bg-gray-100 hover:text-primary cursor-pointer rounded-lg " + ((categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId) === (item === null || item === void 0 ? void 0 : item.categoryId) ? " bg-primary text-textButton" : ""),
|
|
10487
|
+
key: "sdjfdh-" + index,
|
|
10362
10488
|
onClick: function onClick() {
|
|
10363
10489
|
handleChooseCategory(item);
|
|
10364
|
-
}
|
|
10365
|
-
key: "sdjfdh-" + index
|
|
10490
|
+
}
|
|
10366
10491
|
}, item === null || item === void 0 ? void 0 : item.cateName);
|
|
10367
10492
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
10368
|
-
className: "md:col-span-3 flex flex-col gap-
|
|
10369
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10493
|
+
className: "md:col-span-3 flex flex-col gap-6"
|
|
10494
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10495
|
+
className: "flex gap-4"
|
|
10496
|
+
}, listFilter === null || listFilter === void 0 ? void 0 : listFilter.map(function (item, index) {
|
|
10497
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10498
|
+
key: "kgkf-" + index,
|
|
10499
|
+
className: ((filterItem === null || filterItem === void 0 ? void 0 : filterItem.value) === (item === null || item === void 0 ? void 0 : item.value) ? "bg-primary text-textButton" : "bg-background") + " \n w-max border border-primary py-1 px-2 md:py-2 md:px-3 rounded-lg cursor-pointer whitespace-nowrap",
|
|
10500
|
+
onClick: function onClick() {
|
|
10501
|
+
handleFilter(item);
|
|
10502
|
+
}
|
|
10503
|
+
}, item === null || item === void 0 ? void 0 : item.label);
|
|
10504
|
+
})), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
10374
10505
|
className: "w-full h-96 mb-1 flex justify-center items-center"
|
|
10375
10506
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
10376
10507
|
className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
|
|
@@ -10871,8 +11002,8 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10871
11002
|
var _product$images2;
|
|
10872
11003
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10873
11004
|
shopConfig = props.shopConfig,
|
|
10874
|
-
_props$
|
|
10875
|
-
|
|
11005
|
+
_props$router = props.router,
|
|
11006
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
10876
11007
|
var _ProductDetailControl = ProductDetailController(props),
|
|
10877
11008
|
product = _ProductDetailControl.product;
|
|
10878
11009
|
var _useState = React.useState(),
|
|
@@ -10970,7 +11101,7 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10970
11101
|
var _refInputQuantity$cur3;
|
|
10971
11102
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
10972
11103
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
10973
|
-
|
|
11104
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
10974
11105
|
});
|
|
10975
11106
|
}
|
|
10976
11107
|
}();
|
|
@@ -11100,8 +11231,8 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11100
11231
|
var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
|
|
11101
11232
|
var shopConfigStyle = props.shopConfigStyle,
|
|
11102
11233
|
shopConfig = props.shopConfig,
|
|
11103
|
-
_props$
|
|
11104
|
-
|
|
11234
|
+
_props$router = props.router,
|
|
11235
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
11105
11236
|
var _ProductDetailControl = ProductDetailController(props),
|
|
11106
11237
|
product = _ProductDetailControl.product;
|
|
11107
11238
|
var _useState = React.useState(),
|
|
@@ -11199,7 +11330,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11199
11330
|
var _refInputQuantity$cur3;
|
|
11200
11331
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
11201
11332
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
11202
|
-
|
|
11333
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
11203
11334
|
});
|
|
11204
11335
|
}
|
|
11205
11336
|
}();
|
|
@@ -13360,7 +13491,7 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
13360
13491
|
}
|
|
13361
13492
|
}))
|
|
13362
13493
|
}), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13363
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
|
|
13494
|
+
className: "max-h-64 overflow-y-auto flex flex-col scroll-container gap-2 pr-3"
|
|
13364
13495
|
}, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
|
|
13365
13496
|
var _item$productInfo, _item$productInfo2;
|
|
13366
13497
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13448,7 +13579,7 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
13448
13579
|
placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
|
|
13449
13580
|
onChange: setSearchValue
|
|
13450
13581
|
}), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13451
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2"
|
|
13582
|
+
className: "max-h-64 overflow-y-auto scroll-container flex flex-col gap-2"
|
|
13452
13583
|
}, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
|
|
13453
13584
|
var _item$productInfo;
|
|
13454
13585
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13475,10 +13606,17 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13475
13606
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13476
13607
|
var _props$Link = props.Link,
|
|
13477
13608
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13609
|
+
_props$router = props.router,
|
|
13610
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13478
13611
|
data = props.data;
|
|
13479
13612
|
var _useState = React.useState(""),
|
|
13480
13613
|
value = _useState[0],
|
|
13481
13614
|
setValue = _useState[1];
|
|
13615
|
+
var handleSearch = function handleSearch(e) {
|
|
13616
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13617
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13618
|
+
}
|
|
13619
|
+
};
|
|
13482
13620
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13483
13621
|
className: SECTION_CLASS + " md:mt-6"
|
|
13484
13622
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13499,6 +13637,9 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13499
13637
|
}),
|
|
13500
13638
|
wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
|
|
13501
13639
|
className: "w-full bg-bgSecondary mb-2 md:h-12",
|
|
13640
|
+
onKeyDown: function onKeyDown(e) {
|
|
13641
|
+
handleSearch(e);
|
|
13642
|
+
},
|
|
13502
13643
|
style: {
|
|
13503
13644
|
borderRadius: "32px"
|
|
13504
13645
|
},
|
|
@@ -13521,10 +13662,17 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13521
13662
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13522
13663
|
var _props$Link = props.Link,
|
|
13523
13664
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13665
|
+
_props$router = props.router,
|
|
13666
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13524
13667
|
data = props.data;
|
|
13525
13668
|
var _useState = React.useState(""),
|
|
13526
13669
|
value = _useState[0],
|
|
13527
13670
|
setValue = _useState[1];
|
|
13671
|
+
var handleSearch = function handleSearch(e) {
|
|
13672
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13673
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13674
|
+
}
|
|
13675
|
+
};
|
|
13528
13676
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13529
13677
|
className: "w-full flex flex-col justify-center px-3 md:px-6 gap-2 lg:gap-3 items-center h-32 lg:h-44 ",
|
|
13530
13678
|
style: {
|
|
@@ -13546,7 +13694,10 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13546
13694
|
wrapClassName: " w-full h-full",
|
|
13547
13695
|
inputClassName: "w-full",
|
|
13548
13696
|
placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
|
|
13549
|
-
onChange: setValue
|
|
13697
|
+
onChange: setValue,
|
|
13698
|
+
onKeyDown: function onKeyDown(e) {
|
|
13699
|
+
handleSearch(e);
|
|
13700
|
+
}
|
|
13550
13701
|
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
13551
13702
|
Link: Link,
|
|
13552
13703
|
href: genLinkSearch(value)
|