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.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;
|
|
@@ -9517,6 +9508,9 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9517
9508
|
quantity: 1,
|
|
9518
9509
|
technical: {},
|
|
9519
9510
|
oldService: false,
|
|
9511
|
+
productInfo: {
|
|
9512
|
+
productId: product === null || product === void 0 ? void 0 : product.productId
|
|
9513
|
+
},
|
|
9520
9514
|
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9521
9515
|
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9522
9516
|
})]);
|
|
@@ -9532,34 +9526,171 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9532
9526
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9533
9527
|
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
9528
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9535
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
|
|
9529
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9536
9530
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9537
9531
|
className: "flex flex-col gap-4 col-span-2"
|
|
9532
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9533
|
+
className: "rounded-2xl p-2 border"
|
|
9538
9534
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9539
9535
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9540
|
-
className: "w-full aspect-square object-
|
|
9536
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9541
9537
|
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9542
9538
|
product: product,
|
|
9543
|
-
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9539
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9540
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9541
|
+
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9542
|
+
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9543
|
+
return /*#__PURE__*/React__default.createElement("img", {
|
|
9544
|
+
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9545
|
+
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9546
|
+
alt: "",
|
|
9547
|
+
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"),
|
|
9548
|
+
onClick: function onClick() {
|
|
9549
|
+
handleDisplayImage(item);
|
|
9550
|
+
}
|
|
9551
|
+
});
|
|
9552
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9553
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9554
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9555
|
+
className: "font-semibold text-2xl"
|
|
9556
|
+
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9557
|
+
product: product,
|
|
9558
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9544
9559
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9560
|
+
className: " text-lg py-3"
|
|
9561
|
+
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
9562
|
+
label: "ĐẶT LỊCH NGAY",
|
|
9563
|
+
shopConfigStyle: shopConfigStyle,
|
|
9564
|
+
onClick: function onClick(e) {
|
|
9565
|
+
return handleOpenModalBooking(e);
|
|
9566
|
+
}
|
|
9567
|
+
}), /*#__PURE__*/React__default.createElement("p", {
|
|
9568
|
+
className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
|
|
9569
|
+
}, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9570
|
+
className: "h-max"
|
|
9571
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9572
|
+
ref: descriptionRef,
|
|
9573
|
+
className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
|
|
9574
|
+
dangerouslySetInnerHTML: {
|
|
9575
|
+
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9576
|
+
}
|
|
9577
|
+
}), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9578
|
+
className: "h-10 relative -mt-10 rounded-b-lg",
|
|
9579
|
+
style: {
|
|
9580
|
+
background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
|
|
9581
|
+
}
|
|
9582
|
+
}) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9583
|
+
className: "w-full flex justify-center mt-2"
|
|
9584
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9585
|
+
label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
|
|
9586
|
+
className: " bottom-0 z-50",
|
|
9587
|
+
onClick: function onClick() {
|
|
9588
|
+
setIsSeeMore(!isSeeMore);
|
|
9589
|
+
}
|
|
9590
|
+
})) : null) : /*#__PURE__*/React__default.createElement("div", {
|
|
9591
|
+
className: "text-gray3 mt-2"
|
|
9592
|
+
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9593
|
+
onClose: handleCloseModal
|
|
9594
|
+
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9595
|
+
isModalBooking: isBooking,
|
|
9596
|
+
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9597
|
+
onCloseFormBooking: handleCloseModal,
|
|
9598
|
+
defaultValue: dataBooking,
|
|
9599
|
+
shopConfig: shopConfig,
|
|
9600
|
+
shopConfigStyle: shopConfigStyle
|
|
9601
|
+
})) : null);
|
|
9602
|
+
};
|
|
9603
|
+
|
|
9604
|
+
var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
9605
|
+
var _product$images;
|
|
9606
|
+
var shopConfigStyle = props.shopConfigStyle,
|
|
9607
|
+
shopConfig = props.shopConfig;
|
|
9608
|
+
var _ProductDetailControl = ProductDetailController(props),
|
|
9609
|
+
product = _ProductDetailControl.product;
|
|
9610
|
+
var _useState = React.useState(),
|
|
9611
|
+
displayImage = _useState[0],
|
|
9612
|
+
setDisplayImage = _useState[1];
|
|
9613
|
+
var _useState2 = React.useState(false),
|
|
9614
|
+
isSeeMore = _useState2[0],
|
|
9615
|
+
setIsSeeMore = _useState2[1];
|
|
9616
|
+
var _useState3 = React.useState(true),
|
|
9617
|
+
hiddenButton = _useState3[0],
|
|
9618
|
+
setHiddenButton = _useState3[1];
|
|
9619
|
+
var descriptionRef = React.useRef();
|
|
9620
|
+
var _useState4 = React.useState(false),
|
|
9621
|
+
isBooking = _useState4[0],
|
|
9622
|
+
setIsBooking = _useState4[1];
|
|
9623
|
+
var _useState5 = React.useState([]),
|
|
9624
|
+
dataBooking = _useState5[0],
|
|
9625
|
+
setDataBooking = _useState5[1];
|
|
9626
|
+
React.useEffect(function () {
|
|
9627
|
+
if (product) {
|
|
9628
|
+
if (descriptionRef.current) {
|
|
9629
|
+
var descriptionHeight = descriptionRef.current.offsetHeight;
|
|
9630
|
+
if (descriptionHeight >= 700) {
|
|
9631
|
+
setHiddenButton(false);
|
|
9632
|
+
}
|
|
9633
|
+
}
|
|
9634
|
+
}
|
|
9635
|
+
}, [product]);
|
|
9636
|
+
var handleDisplayImage = function handleDisplayImage(item) {
|
|
9637
|
+
setDisplayImage(item);
|
|
9638
|
+
};
|
|
9639
|
+
var handleOpenModalBooking = function handleOpenModalBooking(event) {
|
|
9640
|
+
try {
|
|
9641
|
+
event.stopPropagation();
|
|
9642
|
+
setDataBooking([_extends({}, product, {
|
|
9643
|
+
quantity: 1,
|
|
9644
|
+
technical: {},
|
|
9645
|
+
oldService: false,
|
|
9646
|
+
productInfo: {
|
|
9647
|
+
productId: product === null || product === void 0 ? void 0 : product.productId
|
|
9648
|
+
},
|
|
9649
|
+
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9650
|
+
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9651
|
+
})]);
|
|
9652
|
+
setIsBooking(true);
|
|
9653
|
+
} catch (error) {
|
|
9654
|
+
console.log("::::::::::errrorrrrr::::::", error);
|
|
9655
|
+
}
|
|
9656
|
+
};
|
|
9657
|
+
var handleCloseModal = function handleCloseModal() {
|
|
9658
|
+
setIsBooking(false);
|
|
9659
|
+
setDataBooking([]);
|
|
9660
|
+
};
|
|
9661
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9662
|
+
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9663
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9664
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9665
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9666
|
+
className: "flex flex-col gap-4 col-span-2"
|
|
9667
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9668
|
+
className: "rounded-2xl p-2 border"
|
|
9669
|
+
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9670
|
+
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9671
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9672
|
+
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9673
|
+
product: product,
|
|
9674
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9675
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9545
9676
|
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9546
9677
|
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9547
9678
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
9548
9679
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9549
9680
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9550
9681
|
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"),
|
|
9682
|
+
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
9683
|
onClick: function onClick() {
|
|
9553
9684
|
handleDisplayImage(item);
|
|
9554
9685
|
}
|
|
9555
9686
|
});
|
|
9556
9687
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9557
|
-
className: "col-span-3"
|
|
9688
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9558
9689
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9559
9690
|
className: "font-semibold text-2xl"
|
|
9560
9691
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9561
9692
|
product: product,
|
|
9562
|
-
className: "mt-6 text-[22px]"
|
|
9693
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9563
9694
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9564
9695
|
className: " text-lg py-3"
|
|
9565
9696
|
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -9596,6 +9727,7 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9596
9727
|
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9597
9728
|
onClose: handleCloseModal
|
|
9598
9729
|
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9730
|
+
isModalBooking: isBooking,
|
|
9599
9731
|
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9600
9732
|
onCloseFormBooking: handleCloseModal,
|
|
9601
9733
|
defaultValue: dataBooking,
|
|
@@ -10238,23 +10370,17 @@ var Products10 = function Products10(props) {
|
|
|
10238
10370
|
};
|
|
10239
10371
|
|
|
10240
10372
|
var listFilter = [{
|
|
10373
|
+
label: "Tất cả",
|
|
10374
|
+
value: "all"
|
|
10375
|
+
}, {
|
|
10241
10376
|
label: "Khuyến mãi",
|
|
10242
|
-
value: "discount"
|
|
10243
|
-
filter: {
|
|
10244
|
-
isDiscount: true
|
|
10245
|
-
}
|
|
10377
|
+
value: "discount"
|
|
10246
10378
|
}, {
|
|
10247
10379
|
label: "Nổi bật",
|
|
10248
|
-
value: "isHighlight"
|
|
10249
|
-
filter: {
|
|
10250
|
-
isHighlight: true
|
|
10251
|
-
}
|
|
10380
|
+
value: "isHighlight"
|
|
10252
10381
|
}, {
|
|
10253
10382
|
label: "Giá thấp đến cao",
|
|
10254
|
-
value: "sortPriceDESC"
|
|
10255
|
-
filter: {
|
|
10256
|
-
isHighlight: true
|
|
10257
|
-
}
|
|
10383
|
+
value: "sortPriceDESC"
|
|
10258
10384
|
}];
|
|
10259
10385
|
var Products11 = function Products11(props) {
|
|
10260
10386
|
var _productsFilter$slice;
|
|
@@ -10282,6 +10408,9 @@ var Products11 = function Products11(props) {
|
|
|
10282
10408
|
var _useState4 = React.useState([]),
|
|
10283
10409
|
productsFilter = _useState4[0],
|
|
10284
10410
|
setProductsFilter = _useState4[1];
|
|
10411
|
+
var _useState5 = React.useState(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]),
|
|
10412
|
+
filterItem = _useState5[0],
|
|
10413
|
+
setFilterItem = _useState5[1];
|
|
10285
10414
|
var _CategoryController = CategoryController(_extends({}, props, {
|
|
10286
10415
|
params: params
|
|
10287
10416
|
})),
|
|
@@ -10305,6 +10434,7 @@ var Products11 = function Products11(props) {
|
|
|
10305
10434
|
var handleChooseCategory = function handleChooseCategory(category) {
|
|
10306
10435
|
setCategorySelected(category);
|
|
10307
10436
|
setFirstLoading(true);
|
|
10437
|
+
setFilterItem(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]);
|
|
10308
10438
|
setParams(function (prev) {
|
|
10309
10439
|
return _extends({}, prev, {
|
|
10310
10440
|
categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
|
|
@@ -10326,6 +10456,7 @@ var Products11 = function Products11(props) {
|
|
|
10326
10456
|
}
|
|
10327
10457
|
}, [products]);
|
|
10328
10458
|
var handleFilter = function handleFilter(item) {
|
|
10459
|
+
setFilterItem(item);
|
|
10329
10460
|
if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
|
|
10330
10461
|
var productsCopy = [].concat(products);
|
|
10331
10462
|
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
|
|
@@ -10351,26 +10482,32 @@ var Products11 = function Products11(props) {
|
|
|
10351
10482
|
}
|
|
10352
10483
|
};
|
|
10353
10484
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10354
|
-
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
|
|
10485
|
+
className: SECTION_CLASS + " grid grid-cols-1 !mt-0 md:grid-cols-4 gap-6"
|
|
10355
10486
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10356
|
-
className: "md:sticky top-
|
|
10487
|
+
className: "md:sticky top-0 self-start"
|
|
10357
10488
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10358
10489
|
className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
|
|
10359
10490
|
}, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
|
|
10360
10491
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10361
10492
|
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" : ""),
|
|
10493
|
+
key: "sdjfdh-" + index,
|
|
10362
10494
|
onClick: function onClick() {
|
|
10363
10495
|
handleChooseCategory(item);
|
|
10364
|
-
}
|
|
10365
|
-
key: "sdjfdh-" + index
|
|
10496
|
+
}
|
|
10366
10497
|
}, item === null || item === void 0 ? void 0 : item.cateName);
|
|
10367
10498
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
10368
|
-
className: "md:col-span-3 flex flex-col gap-
|
|
10369
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
10370
|
-
|
|
10371
|
-
|
|
10372
|
-
|
|
10373
|
-
|
|
10499
|
+
className: "md:col-span-3 flex flex-col gap-6"
|
|
10500
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10501
|
+
className: "flex gap-4"
|
|
10502
|
+
}, listFilter === null || listFilter === void 0 ? void 0 : listFilter.map(function (item, index) {
|
|
10503
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10504
|
+
key: "kgkf-" + index,
|
|
10505
|
+
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",
|
|
10506
|
+
onClick: function onClick() {
|
|
10507
|
+
handleFilter(item);
|
|
10508
|
+
}
|
|
10509
|
+
}, item === null || item === void 0 ? void 0 : item.label);
|
|
10510
|
+
})), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
10374
10511
|
className: "w-full h-96 mb-1 flex justify-center items-center"
|
|
10375
10512
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
10376
10513
|
className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
|
|
@@ -10871,8 +11008,8 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10871
11008
|
var _product$images2;
|
|
10872
11009
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10873
11010
|
shopConfig = props.shopConfig,
|
|
10874
|
-
_props$
|
|
10875
|
-
|
|
11011
|
+
_props$router = props.router,
|
|
11012
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
10876
11013
|
var _ProductDetailControl = ProductDetailController(props),
|
|
10877
11014
|
product = _ProductDetailControl.product;
|
|
10878
11015
|
var _useState = React.useState(),
|
|
@@ -10970,7 +11107,7 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10970
11107
|
var _refInputQuantity$cur3;
|
|
10971
11108
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
10972
11109
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
10973
|
-
|
|
11110
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
10974
11111
|
});
|
|
10975
11112
|
}
|
|
10976
11113
|
}();
|
|
@@ -11100,8 +11237,8 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11100
11237
|
var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
|
|
11101
11238
|
var shopConfigStyle = props.shopConfigStyle,
|
|
11102
11239
|
shopConfig = props.shopConfig,
|
|
11103
|
-
_props$
|
|
11104
|
-
|
|
11240
|
+
_props$router = props.router,
|
|
11241
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
11105
11242
|
var _ProductDetailControl = ProductDetailController(props),
|
|
11106
11243
|
product = _ProductDetailControl.product;
|
|
11107
11244
|
var _useState = React.useState(),
|
|
@@ -11199,7 +11336,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11199
11336
|
var _refInputQuantity$cur3;
|
|
11200
11337
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
11201
11338
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
11202
|
-
|
|
11339
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
11203
11340
|
});
|
|
11204
11341
|
}
|
|
11205
11342
|
}();
|
|
@@ -13360,7 +13497,7 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
13360
13497
|
}
|
|
13361
13498
|
}))
|
|
13362
13499
|
}), (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"
|
|
13500
|
+
className: "max-h-64 overflow-y-auto flex flex-col scroll-container gap-2 pr-3"
|
|
13364
13501
|
}, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
|
|
13365
13502
|
var _item$productInfo, _item$productInfo2;
|
|
13366
13503
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13448,7 +13585,7 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
13448
13585
|
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
13586
|
onChange: setSearchValue
|
|
13450
13587
|
}), (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"
|
|
13588
|
+
className: "max-h-64 overflow-y-auto scroll-container flex flex-col gap-2"
|
|
13452
13589
|
}, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
|
|
13453
13590
|
var _item$productInfo;
|
|
13454
13591
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13475,10 +13612,17 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13475
13612
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13476
13613
|
var _props$Link = props.Link,
|
|
13477
13614
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13615
|
+
_props$router = props.router,
|
|
13616
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13478
13617
|
data = props.data;
|
|
13479
13618
|
var _useState = React.useState(""),
|
|
13480
13619
|
value = _useState[0],
|
|
13481
13620
|
setValue = _useState[1];
|
|
13621
|
+
var handleSearch = function handleSearch(e) {
|
|
13622
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13623
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13624
|
+
}
|
|
13625
|
+
};
|
|
13482
13626
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13483
13627
|
className: SECTION_CLASS + " md:mt-6"
|
|
13484
13628
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13499,6 +13643,9 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13499
13643
|
}),
|
|
13500
13644
|
wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
|
|
13501
13645
|
className: "w-full bg-bgSecondary mb-2 md:h-12",
|
|
13646
|
+
onKeyDown: function onKeyDown(e) {
|
|
13647
|
+
handleSearch(e);
|
|
13648
|
+
},
|
|
13502
13649
|
style: {
|
|
13503
13650
|
borderRadius: "32px"
|
|
13504
13651
|
},
|
|
@@ -13521,10 +13668,17 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13521
13668
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13522
13669
|
var _props$Link = props.Link,
|
|
13523
13670
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13671
|
+
_props$router = props.router,
|
|
13672
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13524
13673
|
data = props.data;
|
|
13525
13674
|
var _useState = React.useState(""),
|
|
13526
13675
|
value = _useState[0],
|
|
13527
13676
|
setValue = _useState[1];
|
|
13677
|
+
var handleSearch = function handleSearch(e) {
|
|
13678
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13679
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13680
|
+
}
|
|
13681
|
+
};
|
|
13528
13682
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13529
13683
|
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
13684
|
style: {
|
|
@@ -13546,7 +13700,10 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13546
13700
|
wrapClassName: " w-full h-full",
|
|
13547
13701
|
inputClassName: "w-full",
|
|
13548
13702
|
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
|
|
13703
|
+
onChange: setValue,
|
|
13704
|
+
onKeyDown: function onKeyDown(e) {
|
|
13705
|
+
handleSearch(e);
|
|
13706
|
+
}
|
|
13550
13707
|
}), /*#__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
13708
|
Link: Link,
|
|
13552
13709
|
href: genLinkSearch(value)
|