s-platform-landing-section 0.1.22 → 0.1.24
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 +241 -84
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +241 -84
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -147,7 +147,6 @@ var LinkToPage = function LinkToPage(props) {
|
|
|
147
147
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
148
148
|
return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
|
|
149
149
|
};
|
|
150
|
-
var SSHOP_SPA_TOKEN = "sshop-spa-token";
|
|
151
150
|
var genLinkSearch = function genLinkSearch(keyword) {
|
|
152
151
|
return "/tim-kiem?tu-khoa=" + keyword;
|
|
153
152
|
};
|
|
@@ -882,6 +881,8 @@ var Input = forwardRef(function (props, ref) {
|
|
|
882
881
|
style = _props$style === void 0 ? {} : _props$style,
|
|
883
882
|
_props$onChange = props.onChange,
|
|
884
883
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
884
|
+
_props$onKeyDown = props.onKeyDown,
|
|
885
|
+
onKeyDown = _props$onKeyDown === void 0 ? function () {} : _props$onKeyDown,
|
|
885
886
|
_props$disabled = props.disabled,
|
|
886
887
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
887
888
|
_props$defaultValue = props.defaultValue,
|
|
@@ -960,6 +961,9 @@ var Input = forwardRef(function (props, ref) {
|
|
|
960
961
|
_setValue(value);
|
|
961
962
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
962
963
|
};
|
|
964
|
+
var handleOnKeyDown = function handleOnKeyDown(e) {
|
|
965
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
966
|
+
};
|
|
963
967
|
var changeQuantity = function changeQuantity(quantity) {
|
|
964
968
|
var newValue = parseInt(value) + quantity;
|
|
965
969
|
if (!disabled && newValue > min && (max === null || newValue <= max)) {
|
|
@@ -1000,7 +1004,10 @@ var Input = forwardRef(function (props, ref) {
|
|
|
1000
1004
|
onChange: handleOnChange,
|
|
1001
1005
|
required: required,
|
|
1002
1006
|
className: _inputClassName,
|
|
1003
|
-
ref: refInput
|
|
1007
|
+
ref: refInput,
|
|
1008
|
+
onKeyDown: function onKeyDown(e) {
|
|
1009
|
+
handleOnKeyDown(e);
|
|
1010
|
+
}
|
|
1004
1011
|
}), suffix ? /*#__PURE__*/React__default.createElement("div", null, suffix) : null, isHidden ? /*#__PURE__*/React__default.createElement("button", {
|
|
1005
1012
|
onClick: function onClick() {
|
|
1006
1013
|
changeHidden();
|
|
@@ -1020,12 +1027,19 @@ var Hero1 = function Hero1(props) {
|
|
|
1020
1027
|
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;
|
|
1021
1028
|
var shopConfigStyle = props.shopConfigStyle,
|
|
1022
1029
|
data = props.data,
|
|
1030
|
+
_props$router = props.router,
|
|
1031
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
1023
1032
|
_props$Link = props.Link,
|
|
1024
1033
|
Link = _props$Link === void 0 ? null : _props$Link;
|
|
1025
1034
|
var _useState = useState(""),
|
|
1026
1035
|
value = _useState[0],
|
|
1027
1036
|
setValue = _useState[1];
|
|
1028
1037
|
var sectionData = data === null || data === void 0 ? void 0 : data.data;
|
|
1038
|
+
var handleSearch = function handleSearch(e) {
|
|
1039
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
1040
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1029
1043
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1030
1044
|
style: {
|
|
1031
1045
|
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]) + ")"
|
|
@@ -1053,6 +1067,9 @@ var Hero1 = function Hero1(props) {
|
|
|
1053
1067
|
icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, null),
|
|
1054
1068
|
wrapClassName: "w-full",
|
|
1055
1069
|
inputClassName: "w-full",
|
|
1070
|
+
onKeyDown: function onKeyDown(e) {
|
|
1071
|
+
handleSearch(e);
|
|
1072
|
+
},
|
|
1056
1073
|
onChange: setValue
|
|
1057
1074
|
}), value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
1058
1075
|
Link: Link,
|
|
@@ -1079,7 +1096,7 @@ var Hero2 = function Hero2(props) {
|
|
|
1079
1096
|
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,
|
|
1080
1097
|
className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
|
|
1081
1098
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1082
|
-
className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-
|
|
1099
|
+
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%]"
|
|
1083
1100
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
1084
1101
|
src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
|
|
1085
1102
|
alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
|
|
@@ -8030,10 +8047,12 @@ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
|
|
|
8030
8047
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
|
|
8031
8048
|
className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
|
|
8032
8049
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
8033
|
-
return /*#__PURE__*/React__default.createElement(
|
|
8050
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
8034
8051
|
key: index,
|
|
8052
|
+
href: getLinkServiceDetail(product === null || product === void 0 ? void 0 : product.productInfo)
|
|
8053
|
+
}, /*#__PURE__*/React__default.createElement(ProductItem1, {
|
|
8035
8054
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
8036
|
-
});
|
|
8055
|
+
}));
|
|
8037
8056
|
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
8038
8057
|
className: "text-gray3 text-center p-12"
|
|
8039
8058
|
}, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
|
|
@@ -8120,6 +8139,12 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8120
8139
|
style = _props$style === void 0 ? {} : _props$style,
|
|
8121
8140
|
_props$buttonClassNam = props.buttonClassName,
|
|
8122
8141
|
buttonClassName = _props$buttonClassNam === void 0 ? "" : _props$buttonClassNam;
|
|
8142
|
+
useEffect(function () {
|
|
8143
|
+
document.body.style.overflow = "hidden";
|
|
8144
|
+
return function () {
|
|
8145
|
+
document.body.style.overflow = "auto";
|
|
8146
|
+
};
|
|
8147
|
+
}, []);
|
|
8123
8148
|
var handleClickOutside = function handleClickOutside(event) {
|
|
8124
8149
|
event.stopPropagation();
|
|
8125
8150
|
if (onClose) {
|
|
@@ -8131,7 +8156,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8131
8156
|
};
|
|
8132
8157
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8133
8158
|
className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 ",
|
|
8134
|
-
onClick:
|
|
8159
|
+
onClick: function onClick(e) {
|
|
8160
|
+
return handleClickOutside(e);
|
|
8161
|
+
}
|
|
8135
8162
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8136
8163
|
className: "flex items-center justify-center relative " + className,
|
|
8137
8164
|
onClick: function onClick(e) {
|
|
@@ -8141,7 +8168,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8141
8168
|
ref: modalRef
|
|
8142
8169
|
}, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
|
|
8143
8170
|
className: "absolute top-4 right-4 " + buttonClassName,
|
|
8144
|
-
onClick:
|
|
8171
|
+
onClick: function onClick(e) {
|
|
8172
|
+
return handleClickOutside(e);
|
|
8173
|
+
}
|
|
8145
8174
|
}, /*#__PURE__*/React__default.createElement(RxCross2, null))));
|
|
8146
8175
|
};
|
|
8147
8176
|
|
|
@@ -8944,7 +8973,6 @@ var BookingForm = function BookingForm(props) {
|
|
|
8944
8973
|
var _EmployeeController = EmployeeController(_extends({}, props)),
|
|
8945
8974
|
_EmployeeController$l = _EmployeeController.listEmployment,
|
|
8946
8975
|
listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
|
|
8947
|
-
var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
|
|
8948
8976
|
var _ProductController = ProductController(_extends({}, props, {
|
|
8949
8977
|
params: productsParams
|
|
8950
8978
|
})),
|
|
@@ -9115,6 +9143,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9115
9143
|
inputClassName: "w-full focus:outline-none focus:ring-0"
|
|
9116
9144
|
}), /*#__PURE__*/React__default.createElement(InputPhoneNumber, {
|
|
9117
9145
|
ref: inputPhoneNumberRef,
|
|
9146
|
+
name: "customerPhone",
|
|
9118
9147
|
label: "Số điện thoại",
|
|
9119
9148
|
placeholder: "Nhập số điện thoại",
|
|
9120
9149
|
rules: [{
|
|
@@ -9409,44 +9438,6 @@ var ProductDetailController = function ProductDetailController(props) {
|
|
|
9409
9438
|
};
|
|
9410
9439
|
};
|
|
9411
9440
|
|
|
9412
|
-
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9413
|
-
var shopConfigStyle = props.shopConfigStyle;
|
|
9414
|
-
var _ProductDetailControl = ProductDetailController(props),
|
|
9415
|
-
product = _ProductDetailControl.product;
|
|
9416
|
-
console.log('product', product);
|
|
9417
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9418
|
-
className: SECTION_DEFAULT_CLASS + " !py-0"
|
|
9419
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9420
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
|
|
9421
|
-
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9422
|
-
product: product,
|
|
9423
|
-
className: "w-full aspect-square rounded-2xl"
|
|
9424
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9425
|
-
className: "col-span-2"
|
|
9426
|
-
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9427
|
-
className: "font-semibold text-2xl"
|
|
9428
|
-
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9429
|
-
product: product,
|
|
9430
|
-
className: "mt-6"
|
|
9431
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9432
|
-
className: "flex gap-4 mt-6"
|
|
9433
|
-
}, /*#__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", {
|
|
9434
|
-
className: "flex gap-4 mt-6"
|
|
9435
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9436
|
-
label: "ĐẶT LỊCH",
|
|
9437
|
-
shopConfigStyle: shopConfigStyle
|
|
9438
|
-
})), /*#__PURE__*/React__default.createElement("p", {
|
|
9439
|
-
className: "text-lg mt-12 pt-6 border-t border-stroke"
|
|
9440
|
-
}, "M\xF4 t\u1EA3"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9441
|
-
className: "mt-6",
|
|
9442
|
-
dangerouslySetInnerHTML: {
|
|
9443
|
-
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9444
|
-
}
|
|
9445
|
-
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
9446
|
-
className: "text-gray3 mt-2"
|
|
9447
|
-
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
|
|
9448
|
-
};
|
|
9449
|
-
|
|
9450
9441
|
var CartController = function CartController(props) {
|
|
9451
9442
|
var addToCart = props.addToCart,
|
|
9452
9443
|
dispatch = props.dispatch;
|
|
@@ -9472,7 +9463,7 @@ var CartController = function CartController(props) {
|
|
|
9472
9463
|
};
|
|
9473
9464
|
};
|
|
9474
9465
|
|
|
9475
|
-
var
|
|
9466
|
+
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9476
9467
|
var _product$images;
|
|
9477
9468
|
var shopConfigStyle = props.shopConfigStyle,
|
|
9478
9469
|
shopConfig = props.shopConfig;
|
|
@@ -9514,6 +9505,9 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9514
9505
|
quantity: 1,
|
|
9515
9506
|
technical: {},
|
|
9516
9507
|
oldService: false,
|
|
9508
|
+
productInfo: {
|
|
9509
|
+
productId: product === null || product === void 0 ? void 0 : product.productId
|
|
9510
|
+
},
|
|
9517
9511
|
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9518
9512
|
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9519
9513
|
})]);
|
|
@@ -9529,34 +9523,171 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9529
9523
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9530
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")
|
|
9531
9525
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9532
|
-
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"
|
|
9533
9527
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9534
9528
|
className: "flex flex-col gap-4 col-span-2"
|
|
9529
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9530
|
+
className: "rounded-2xl p-2 border"
|
|
9535
9531
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9536
9532
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9537
|
-
className: "w-full aspect-square object-
|
|
9533
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9538
9534
|
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9539
9535
|
product: product,
|
|
9540
|
-
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]"
|
|
9541
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 = useState(),
|
|
9608
|
+
displayImage = _useState[0],
|
|
9609
|
+
setDisplayImage = _useState[1];
|
|
9610
|
+
var _useState2 = useState(false),
|
|
9611
|
+
isSeeMore = _useState2[0],
|
|
9612
|
+
setIsSeeMore = _useState2[1];
|
|
9613
|
+
var _useState3 = useState(true),
|
|
9614
|
+
hiddenButton = _useState3[0],
|
|
9615
|
+
setHiddenButton = _useState3[1];
|
|
9616
|
+
var descriptionRef = useRef();
|
|
9617
|
+
var _useState4 = useState(false),
|
|
9618
|
+
isBooking = _useState4[0],
|
|
9619
|
+
setIsBooking = _useState4[1];
|
|
9620
|
+
var _useState5 = useState([]),
|
|
9621
|
+
dataBooking = _useState5[0],
|
|
9622
|
+
setDataBooking = _useState5[1];
|
|
9623
|
+
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
|
+
productInfo: {
|
|
9644
|
+
productId: product === null || product === void 0 ? void 0 : product.productId
|
|
9645
|
+
},
|
|
9646
|
+
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9647
|
+
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9648
|
+
})]);
|
|
9649
|
+
setIsBooking(true);
|
|
9650
|
+
} catch (error) {
|
|
9651
|
+
console.log("::::::::::errrorrrrr::::::", error);
|
|
9652
|
+
}
|
|
9653
|
+
};
|
|
9654
|
+
var handleCloseModal = function handleCloseModal() {
|
|
9655
|
+
setIsBooking(false);
|
|
9656
|
+
setDataBooking([]);
|
|
9657
|
+
};
|
|
9658
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9659
|
+
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9660
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9661
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9662
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9663
|
+
className: "flex flex-col gap-4 col-span-2"
|
|
9664
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9665
|
+
className: "rounded-2xl p-2 border"
|
|
9666
|
+
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9667
|
+
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9668
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9669
|
+
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9670
|
+
product: product,
|
|
9671
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9672
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9542
9673
|
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9543
9674
|
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9544
9675
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
9545
9676
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9546
9677
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9547
9678
|
alt: "",
|
|
9548
|
-
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"),
|
|
9679
|
+
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"),
|
|
9549
9680
|
onClick: function onClick() {
|
|
9550
9681
|
handleDisplayImage(item);
|
|
9551
9682
|
}
|
|
9552
9683
|
});
|
|
9553
9684
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9554
|
-
className: "col-span-3"
|
|
9685
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9555
9686
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9556
9687
|
className: "font-semibold text-2xl"
|
|
9557
9688
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9558
9689
|
product: product,
|
|
9559
|
-
className: "mt-6 text-[22px]"
|
|
9690
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9560
9691
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9561
9692
|
className: " text-lg py-3"
|
|
9562
9693
|
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -9593,6 +9724,7 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9593
9724
|
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9594
9725
|
onClose: handleCloseModal
|
|
9595
9726
|
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9727
|
+
isModalBooking: isBooking,
|
|
9596
9728
|
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9597
9729
|
onCloseFormBooking: handleCloseModal,
|
|
9598
9730
|
defaultValue: dataBooking,
|
|
@@ -10235,23 +10367,17 @@ var Products10 = function Products10(props) {
|
|
|
10235
10367
|
};
|
|
10236
10368
|
|
|
10237
10369
|
var listFilter = [{
|
|
10370
|
+
label: "Tất cả",
|
|
10371
|
+
value: "all"
|
|
10372
|
+
}, {
|
|
10238
10373
|
label: "Khuyến mãi",
|
|
10239
|
-
value: "discount"
|
|
10240
|
-
filter: {
|
|
10241
|
-
isDiscount: true
|
|
10242
|
-
}
|
|
10374
|
+
value: "discount"
|
|
10243
10375
|
}, {
|
|
10244
10376
|
label: "Nổi bật",
|
|
10245
|
-
value: "isHighlight"
|
|
10246
|
-
filter: {
|
|
10247
|
-
isHighlight: true
|
|
10248
|
-
}
|
|
10377
|
+
value: "isHighlight"
|
|
10249
10378
|
}, {
|
|
10250
10379
|
label: "Giá thấp đến cao",
|
|
10251
|
-
value: "sortPriceDESC"
|
|
10252
|
-
filter: {
|
|
10253
|
-
isHighlight: true
|
|
10254
|
-
}
|
|
10380
|
+
value: "sortPriceDESC"
|
|
10255
10381
|
}];
|
|
10256
10382
|
var Products11 = function Products11(props) {
|
|
10257
10383
|
var _productsFilter$slice;
|
|
@@ -10279,6 +10405,9 @@ var Products11 = function Products11(props) {
|
|
|
10279
10405
|
var _useState4 = useState([]),
|
|
10280
10406
|
productsFilter = _useState4[0],
|
|
10281
10407
|
setProductsFilter = _useState4[1];
|
|
10408
|
+
var _useState5 = useState(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]),
|
|
10409
|
+
filterItem = _useState5[0],
|
|
10410
|
+
setFilterItem = _useState5[1];
|
|
10282
10411
|
var _CategoryController = CategoryController(_extends({}, props, {
|
|
10283
10412
|
params: params
|
|
10284
10413
|
})),
|
|
@@ -10302,6 +10431,7 @@ var Products11 = function Products11(props) {
|
|
|
10302
10431
|
var handleChooseCategory = function handleChooseCategory(category) {
|
|
10303
10432
|
setCategorySelected(category);
|
|
10304
10433
|
setFirstLoading(true);
|
|
10434
|
+
setFilterItem(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]);
|
|
10305
10435
|
setParams(function (prev) {
|
|
10306
10436
|
return _extends({}, prev, {
|
|
10307
10437
|
categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
|
|
@@ -10323,6 +10453,7 @@ var Products11 = function Products11(props) {
|
|
|
10323
10453
|
}
|
|
10324
10454
|
}, [products]);
|
|
10325
10455
|
var handleFilter = function handleFilter(item) {
|
|
10456
|
+
setFilterItem(item);
|
|
10326
10457
|
if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
|
|
10327
10458
|
var productsCopy = [].concat(products);
|
|
10328
10459
|
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
|
|
@@ -10348,26 +10479,32 @@ var Products11 = function Products11(props) {
|
|
|
10348
10479
|
}
|
|
10349
10480
|
};
|
|
10350
10481
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10351
|
-
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
|
|
10482
|
+
className: SECTION_CLASS + " grid grid-cols-1 !mt-0 md:grid-cols-4 gap-6"
|
|
10352
10483
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10353
|
-
className: "md:sticky top-
|
|
10484
|
+
className: "md:sticky top-0 self-start"
|
|
10354
10485
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10355
10486
|
className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
|
|
10356
10487
|
}, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
|
|
10357
10488
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10358
10489
|
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" : ""),
|
|
10490
|
+
key: "sdjfdh-" + index,
|
|
10359
10491
|
onClick: function onClick() {
|
|
10360
10492
|
handleChooseCategory(item);
|
|
10361
|
-
}
|
|
10362
|
-
key: "sdjfdh-" + index
|
|
10493
|
+
}
|
|
10363
10494
|
}, item === null || item === void 0 ? void 0 : item.cateName);
|
|
10364
10495
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
10365
|
-
className: "md:col-span-3 flex flex-col gap-
|
|
10366
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10496
|
+
className: "md:col-span-3 flex flex-col gap-6"
|
|
10497
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10498
|
+
className: "flex gap-4"
|
|
10499
|
+
}, listFilter === null || listFilter === void 0 ? void 0 : listFilter.map(function (item, index) {
|
|
10500
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10501
|
+
key: "kgkf-" + index,
|
|
10502
|
+
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",
|
|
10503
|
+
onClick: function onClick() {
|
|
10504
|
+
handleFilter(item);
|
|
10505
|
+
}
|
|
10506
|
+
}, item === null || item === void 0 ? void 0 : item.label);
|
|
10507
|
+
})), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
10371
10508
|
className: "w-full h-96 mb-1 flex justify-center items-center"
|
|
10372
10509
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
10373
10510
|
className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
|
|
@@ -10868,8 +11005,8 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10868
11005
|
var _product$images2;
|
|
10869
11006
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10870
11007
|
shopConfig = props.shopConfig,
|
|
10871
|
-
_props$
|
|
10872
|
-
|
|
11008
|
+
_props$router = props.router,
|
|
11009
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
10873
11010
|
var _ProductDetailControl = ProductDetailController(props),
|
|
10874
11011
|
product = _ProductDetailControl.product;
|
|
10875
11012
|
var _useState = useState(),
|
|
@@ -10967,7 +11104,7 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10967
11104
|
var _refInputQuantity$cur3;
|
|
10968
11105
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
10969
11106
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
10970
|
-
|
|
11107
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
10971
11108
|
});
|
|
10972
11109
|
}
|
|
10973
11110
|
}();
|
|
@@ -11097,8 +11234,8 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11097
11234
|
var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
|
|
11098
11235
|
var shopConfigStyle = props.shopConfigStyle,
|
|
11099
11236
|
shopConfig = props.shopConfig,
|
|
11100
|
-
_props$
|
|
11101
|
-
|
|
11237
|
+
_props$router = props.router,
|
|
11238
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
11102
11239
|
var _ProductDetailControl = ProductDetailController(props),
|
|
11103
11240
|
product = _ProductDetailControl.product;
|
|
11104
11241
|
var _useState = useState(),
|
|
@@ -11196,7 +11333,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11196
11333
|
var _refInputQuantity$cur3;
|
|
11197
11334
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
11198
11335
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
11199
|
-
|
|
11336
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
11200
11337
|
});
|
|
11201
11338
|
}
|
|
11202
11339
|
}();
|
|
@@ -13357,7 +13494,7 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
13357
13494
|
}
|
|
13358
13495
|
}))
|
|
13359
13496
|
}), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13360
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
|
|
13497
|
+
className: "max-h-64 overflow-y-auto flex flex-col scroll-container gap-2 pr-3"
|
|
13361
13498
|
}, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
|
|
13362
13499
|
var _item$productInfo, _item$productInfo2;
|
|
13363
13500
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13445,7 +13582,7 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
13445
13582
|
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",
|
|
13446
13583
|
onChange: setSearchValue
|
|
13447
13584
|
}), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13448
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2"
|
|
13585
|
+
className: "max-h-64 overflow-y-auto scroll-container flex flex-col gap-2"
|
|
13449
13586
|
}, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
|
|
13450
13587
|
var _item$productInfo;
|
|
13451
13588
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13472,10 +13609,17 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13472
13609
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13473
13610
|
var _props$Link = props.Link,
|
|
13474
13611
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13612
|
+
_props$router = props.router,
|
|
13613
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13475
13614
|
data = props.data;
|
|
13476
13615
|
var _useState = useState(""),
|
|
13477
13616
|
value = _useState[0],
|
|
13478
13617
|
setValue = _useState[1];
|
|
13618
|
+
var handleSearch = function handleSearch(e) {
|
|
13619
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13620
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13621
|
+
}
|
|
13622
|
+
};
|
|
13479
13623
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13480
13624
|
className: SECTION_CLASS + " md:mt-6"
|
|
13481
13625
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13496,6 +13640,9 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13496
13640
|
}),
|
|
13497
13641
|
wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
|
|
13498
13642
|
className: "w-full bg-bgSecondary mb-2 md:h-12",
|
|
13643
|
+
onKeyDown: function onKeyDown(e) {
|
|
13644
|
+
handleSearch(e);
|
|
13645
|
+
},
|
|
13499
13646
|
style: {
|
|
13500
13647
|
borderRadius: "32px"
|
|
13501
13648
|
},
|
|
@@ -13518,10 +13665,17 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13518
13665
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13519
13666
|
var _props$Link = props.Link,
|
|
13520
13667
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13668
|
+
_props$router = props.router,
|
|
13669
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13521
13670
|
data = props.data;
|
|
13522
13671
|
var _useState = useState(""),
|
|
13523
13672
|
value = _useState[0],
|
|
13524
13673
|
setValue = _useState[1];
|
|
13674
|
+
var handleSearch = function handleSearch(e) {
|
|
13675
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13676
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13677
|
+
}
|
|
13678
|
+
};
|
|
13525
13679
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13526
13680
|
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 ",
|
|
13527
13681
|
style: {
|
|
@@ -13543,7 +13697,10 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13543
13697
|
wrapClassName: " w-full h-full",
|
|
13544
13698
|
inputClassName: "w-full",
|
|
13545
13699
|
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",
|
|
13546
|
-
onChange: setValue
|
|
13700
|
+
onChange: setValue,
|
|
13701
|
+
onKeyDown: function onKeyDown(e) {
|
|
13702
|
+
handleSearch(e);
|
|
13703
|
+
}
|
|
13547
13704
|
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
13548
13705
|
Link: Link,
|
|
13549
13706
|
href: genLinkSearch(value)
|