s-platform-landing-section 0.1.21 → 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 +420 -176
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +422 -178
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect, forwardRef, useImperativeHandle, createElement, memo } from 'react';
|
|
2
2
|
import { IoCartOutline, IoChevronDownOutline, IoPersonCircleOutline, IoLogOutOutline, IoInformationCircleOutline, IoBagOutline, IoSearchOutline, IoChevronBackOutline, IoChevronForwardOutline } from 'react-icons/io5';
|
|
3
|
-
import { FaUserCircle, FaRegNewspaper, FaFacebookF, FaFacebookMessenger, FaBoxOpen, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight } from 'react-icons/fa';
|
|
3
|
+
import { FaUserCircle, FaRegNewspaper, FaFacebookF, FaFacebookMessenger, FaBoxOpen, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight, FaPhoneAlt } from 'react-icons/fa';
|
|
4
4
|
import { FiMenu, FiLogIn, FiHome, FiBox, FiPhoneCall, FiShoppingCart, FiSearch } from 'react-icons/fi';
|
|
5
5
|
import { RxCross2 } from 'react-icons/rx';
|
|
6
6
|
import { PiHandHeartBold } from 'react-icons/pi';
|
|
7
7
|
import { TbCategory } from 'react-icons/tb';
|
|
8
8
|
import { SiZalo, SiVisa } from 'react-icons/si';
|
|
9
|
-
import { IoIosStar, IoIosArrowBack, IoIosArrowForward, IoMdCheckmark, IoIosHeartEmpty
|
|
9
|
+
import { IoIosStar, IoIosArrowBack, IoIosArrowForward, IoMdCheckmark, IoIosHeartEmpty } from 'react-icons/io';
|
|
10
10
|
import { FaMinus, FaRegEyeSlash, FaPlus, FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
|
|
11
11
|
import 'react-icons/ci';
|
|
12
12
|
import { BsCurrencyDollar } from 'react-icons/bs';
|
|
@@ -19,6 +19,7 @@ import 'slick-carousel/slick/slick-theme.css';
|
|
|
19
19
|
import { AiOutlineShoppingCart, AiOutlinePhone } from 'react-icons/ai';
|
|
20
20
|
import { GoCreditCard, GoClock } from 'react-icons/go';
|
|
21
21
|
import { HiOutlineLocationMarker } from 'react-icons/hi';
|
|
22
|
+
import { MdOutlineFormatQuote } from 'react-icons/md';
|
|
22
23
|
import { RiDeleteBin7Line } from 'react-icons/ri';
|
|
23
24
|
import { GiNewspaper } from 'react-icons/gi';
|
|
24
25
|
|
|
@@ -129,7 +130,7 @@ var getLinkNewsDetail = function getLinkNewsDetail(news) {
|
|
|
129
130
|
};
|
|
130
131
|
var getLinkNewsByCategory = function getLinkNewsByCategory(news) {
|
|
131
132
|
var slug = genProductSlugVi(news === null || news === void 0 ? void 0 : news.catName, news === null || news === void 0 ? void 0 : news.catId);
|
|
132
|
-
return "/tin-tuc/" + slug;
|
|
133
|
+
return "/tin-tuc-theo-danh-muc/" + slug;
|
|
133
134
|
};
|
|
134
135
|
var getLinkProductsByCategory = function getLinkProductsByCategory(product) {
|
|
135
136
|
if (product !== null && product !== void 0 && product.categoryName) {
|
|
@@ -146,7 +147,6 @@ var LinkToPage = function LinkToPage(props) {
|
|
|
146
147
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
147
148
|
return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
|
|
148
149
|
};
|
|
149
|
-
var SSHOP_SPA_TOKEN = "sshop-spa-token";
|
|
150
150
|
var genLinkSearch = function genLinkSearch(keyword) {
|
|
151
151
|
return "/tim-kiem?tu-khoa=" + keyword;
|
|
152
152
|
};
|
|
@@ -536,7 +536,8 @@ var NavBar1 = function NavBar1(props) {
|
|
|
536
536
|
_props$useSelector = props.useSelector,
|
|
537
537
|
useSelector = _props$useSelector === void 0 ? null : _props$useSelector,
|
|
538
538
|
_props$logout = props.logout,
|
|
539
|
-
logout = _props$logout === void 0 ? function () {} : _props$logout
|
|
539
|
+
logout = _props$logout === void 0 ? function () {} : _props$logout,
|
|
540
|
+
data = props.data;
|
|
540
541
|
var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
541
542
|
var _state$cart;
|
|
542
543
|
return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
|
|
@@ -594,7 +595,11 @@ var NavBar1 = function NavBar1(props) {
|
|
|
594
595
|
top: "-100px"
|
|
595
596
|
}
|
|
596
597
|
}, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.defaultDomain, " | ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName), /*#__PURE__*/React__default.createElement("div", {
|
|
597
|
-
className: "hidden lg:flex justify-
|
|
598
|
+
className: "hidden lg:flex justify-between items-center px-20 py-2 bg-primary"
|
|
599
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
600
|
+
className: "text-background text-xl"
|
|
601
|
+
}, data === null || data === void 0 ? void 0 : data.title), /*#__PURE__*/React__default.createElement("div", {
|
|
602
|
+
className: "flex gap-6 "
|
|
598
603
|
}, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
|
|
599
604
|
className: "font-medium border-r pr-6 text-background"
|
|
600
605
|
}, "Hotline: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -617,7 +622,7 @@ var NavBar1 = function NavBar1(props) {
|
|
|
617
622
|
}, /*#__PURE__*/React__default.createElement(SiZalo, {
|
|
618
623
|
size: 24,
|
|
619
624
|
className: "p-1 rounded bg-background text-primary"
|
|
620
|
-
})))), /*#__PURE__*/React__default.createElement("div", {
|
|
625
|
+
}))))), /*#__PURE__*/React__default.createElement("div", {
|
|
621
626
|
className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20 sticky top-0 z-50 bg-background shadow "
|
|
622
627
|
}, /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
623
628
|
Link: Link,
|
|
@@ -876,6 +881,8 @@ var Input = forwardRef(function (props, ref) {
|
|
|
876
881
|
style = _props$style === void 0 ? {} : _props$style,
|
|
877
882
|
_props$onChange = props.onChange,
|
|
878
883
|
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
884
|
+
_props$onKeyDown = props.onKeyDown,
|
|
885
|
+
onKeyDown = _props$onKeyDown === void 0 ? function () {} : _props$onKeyDown,
|
|
879
886
|
_props$disabled = props.disabled,
|
|
880
887
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
881
888
|
_props$defaultValue = props.defaultValue,
|
|
@@ -954,6 +961,9 @@ var Input = forwardRef(function (props, ref) {
|
|
|
954
961
|
_setValue(value);
|
|
955
962
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
956
963
|
};
|
|
964
|
+
var handleOnKeyDown = function handleOnKeyDown(e) {
|
|
965
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
966
|
+
};
|
|
957
967
|
var changeQuantity = function changeQuantity(quantity) {
|
|
958
968
|
var newValue = parseInt(value) + quantity;
|
|
959
969
|
if (!disabled && newValue > min && (max === null || newValue <= max)) {
|
|
@@ -994,7 +1004,10 @@ var Input = forwardRef(function (props, ref) {
|
|
|
994
1004
|
onChange: handleOnChange,
|
|
995
1005
|
required: required,
|
|
996
1006
|
className: _inputClassName,
|
|
997
|
-
ref: refInput
|
|
1007
|
+
ref: refInput,
|
|
1008
|
+
onKeyDown: function onKeyDown(e) {
|
|
1009
|
+
handleOnKeyDown(e);
|
|
1010
|
+
}
|
|
998
1011
|
}), suffix ? /*#__PURE__*/React__default.createElement("div", null, suffix) : null, isHidden ? /*#__PURE__*/React__default.createElement("button", {
|
|
999
1012
|
onClick: function onClick() {
|
|
1000
1013
|
changeHidden();
|
|
@@ -1014,12 +1027,19 @@ var Hero1 = function Hero1(props) {
|
|
|
1014
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;
|
|
1015
1028
|
var shopConfigStyle = props.shopConfigStyle,
|
|
1016
1029
|
data = props.data,
|
|
1030
|
+
_props$router = props.router,
|
|
1031
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
1017
1032
|
_props$Link = props.Link,
|
|
1018
1033
|
Link = _props$Link === void 0 ? null : _props$Link;
|
|
1019
1034
|
var _useState = useState(""),
|
|
1020
1035
|
value = _useState[0],
|
|
1021
1036
|
setValue = _useState[1];
|
|
1022
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
|
+
};
|
|
1023
1043
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1024
1044
|
style: {
|
|
1025
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]) + ")"
|
|
@@ -1047,6 +1067,9 @@ var Hero1 = function Hero1(props) {
|
|
|
1047
1067
|
icons: /*#__PURE__*/React__default.createElement(IoSearchOutline, null),
|
|
1048
1068
|
wrapClassName: "w-full",
|
|
1049
1069
|
inputClassName: "w-full",
|
|
1070
|
+
onKeyDown: function onKeyDown(e) {
|
|
1071
|
+
handleSearch(e);
|
|
1072
|
+
},
|
|
1050
1073
|
onChange: setValue
|
|
1051
1074
|
}), value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
1052
1075
|
Link: Link,
|
|
@@ -1073,7 +1096,7 @@ var Hero2 = function Hero2(props) {
|
|
|
1073
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,
|
|
1074
1097
|
className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
|
|
1075
1098
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
1076
|
-
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%]"
|
|
1077
1100
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
1078
1101
|
src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
|
|
1079
1102
|
alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
|
|
@@ -7580,6 +7603,11 @@ var ProductController = function ProductController(props) {
|
|
|
7580
7603
|
var _res$data2, _res$data3;
|
|
7581
7604
|
setProducts(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
|
|
7582
7605
|
setPage(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.page);
|
|
7606
|
+
var url = new URL(window.location.href);
|
|
7607
|
+
if (/^(\/(danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
|
|
7608
|
+
url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
|
|
7609
|
+
window.history.replaceState({}, '', url.pathname + url.search);
|
|
7610
|
+
}
|
|
7583
7611
|
}
|
|
7584
7612
|
setLoading(false);
|
|
7585
7613
|
});
|
|
@@ -7618,6 +7646,7 @@ var ProductController = function ProductController(props) {
|
|
|
7618
7646
|
};
|
|
7619
7647
|
return {
|
|
7620
7648
|
products: products,
|
|
7649
|
+
setProducts: setProducts,
|
|
7621
7650
|
loading: loading,
|
|
7622
7651
|
page: page,
|
|
7623
7652
|
getProductListSearch: getProductListSearch
|
|
@@ -8018,10 +8047,12 @@ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
|
|
|
8018
8047
|
}, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
|
|
8019
8048
|
className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
|
|
8020
8049
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
|
|
8021
|
-
return /*#__PURE__*/React__default.createElement(
|
|
8050
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
8022
8051
|
key: index,
|
|
8052
|
+
href: getLinkServiceDetail(product === null || product === void 0 ? void 0 : product.productInfo)
|
|
8053
|
+
}, /*#__PURE__*/React__default.createElement(ProductItem1, {
|
|
8023
8054
|
product: product === null || product === void 0 ? void 0 : product.productInfo
|
|
8024
|
-
});
|
|
8055
|
+
}));
|
|
8025
8056
|
})) : /*#__PURE__*/React__default.createElement("div", {
|
|
8026
8057
|
className: "text-gray3 text-center p-12"
|
|
8027
8058
|
}, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
|
|
@@ -8108,6 +8139,12 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8108
8139
|
style = _props$style === void 0 ? {} : _props$style,
|
|
8109
8140
|
_props$buttonClassNam = props.buttonClassName,
|
|
8110
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
|
+
}, []);
|
|
8111
8148
|
var handleClickOutside = function handleClickOutside(event) {
|
|
8112
8149
|
event.stopPropagation();
|
|
8113
8150
|
if (onClose) {
|
|
@@ -8119,7 +8156,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8119
8156
|
};
|
|
8120
8157
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8121
8158
|
className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 ",
|
|
8122
|
-
onClick:
|
|
8159
|
+
onClick: function onClick(e) {
|
|
8160
|
+
return handleClickOutside(e);
|
|
8161
|
+
}
|
|
8123
8162
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8124
8163
|
className: "flex items-center justify-center relative " + className,
|
|
8125
8164
|
onClick: function onClick(e) {
|
|
@@ -8129,7 +8168,9 @@ var ModalNotification = function ModalNotification(props) {
|
|
|
8129
8168
|
ref: modalRef
|
|
8130
8169
|
}, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
|
|
8131
8170
|
className: "absolute top-4 right-4 " + buttonClassName,
|
|
8132
|
-
onClick:
|
|
8171
|
+
onClick: function onClick(e) {
|
|
8172
|
+
return handleClickOutside(e);
|
|
8173
|
+
}
|
|
8133
8174
|
}, /*#__PURE__*/React__default.createElement(RxCross2, null))));
|
|
8134
8175
|
};
|
|
8135
8176
|
|
|
@@ -8897,7 +8938,9 @@ var BookingForm = function BookingForm(props) {
|
|
|
8897
8938
|
_props$defaultValue = props.defaultValue,
|
|
8898
8939
|
defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
|
|
8899
8940
|
_props$className = props.className,
|
|
8900
|
-
className = _props$className === void 0 ? "" : _props$className
|
|
8941
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
8942
|
+
_props$isModalBooking = props.isModalBooking,
|
|
8943
|
+
isModalBooking = _props$isModalBooking === void 0 ? false : _props$isModalBooking;
|
|
8901
8944
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
8902
8945
|
_shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
|
|
8903
8946
|
background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
|
|
@@ -8924,13 +8967,12 @@ var BookingForm = function BookingForm(props) {
|
|
|
8924
8967
|
var _useState7 = useState(false),
|
|
8925
8968
|
isOpenPopup = _useState7[0],
|
|
8926
8969
|
setIsOpenPopup = _useState7[1];
|
|
8927
|
-
var _useState8 = useState(
|
|
8928
|
-
|
|
8929
|
-
|
|
8970
|
+
var _useState8 = useState(false),
|
|
8971
|
+
isHiddenForm = _useState8[0],
|
|
8972
|
+
setIsHiddenForm = _useState8[1];
|
|
8930
8973
|
var _EmployeeController = EmployeeController(_extends({}, props)),
|
|
8931
8974
|
_EmployeeController$l = _EmployeeController.listEmployment,
|
|
8932
8975
|
listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
|
|
8933
|
-
var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
|
|
8934
8976
|
var _ProductController = ProductController(_extends({}, props, {
|
|
8935
8977
|
params: productsParams
|
|
8936
8978
|
})),
|
|
@@ -9053,11 +9095,14 @@ var BookingForm = function BookingForm(props) {
|
|
|
9053
9095
|
return Promise.resolve(createSchedule(customerName, customerPhone, scheduleDate, services, shopId)).then(function (response) {
|
|
9054
9096
|
var _response$data, _response$data$status;
|
|
9055
9097
|
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$status = _response$data.status) === null || _response$data$status === void 0 ? void 0 : _response$data$status.code) === '200') {
|
|
9056
|
-
var
|
|
9057
|
-
|
|
9098
|
+
var _inputPhoneNumberRef$3, _inputNameRef$current3, _inputDateRef$current4;
|
|
9099
|
+
if (isModalBooking) {
|
|
9100
|
+
setIsHiddenForm(true);
|
|
9101
|
+
}
|
|
9058
9102
|
setIsOpenPopup(true);
|
|
9059
9103
|
inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$3 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$3 === void 0 ? void 0 : _inputPhoneNumberRef$3.setValue("");
|
|
9060
9104
|
inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current3 = inputNameRef.current) === null || _inputNameRef$current3 === void 0 ? void 0 : _inputNameRef$current3.setValue("");
|
|
9105
|
+
inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current4 = inputDateRef.current) === null || _inputDateRef$current4 === void 0 ? void 0 : _inputDateRef$current4.setValue(new Date());
|
|
9061
9106
|
setListProductSelected([]);
|
|
9062
9107
|
}
|
|
9063
9108
|
});
|
|
@@ -9070,7 +9115,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9070
9115
|
};
|
|
9071
9116
|
var handleClosePopup = function handleClosePopup() {
|
|
9072
9117
|
setIsOpenPopup(false);
|
|
9073
|
-
|
|
9118
|
+
setIsHiddenForm(false);
|
|
9074
9119
|
};
|
|
9075
9120
|
var handleSearchProducts = function handleSearchProducts(value) {
|
|
9076
9121
|
setProductsParams(function (prev) {
|
|
@@ -9079,7 +9124,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9079
9124
|
});
|
|
9080
9125
|
});
|
|
9081
9126
|
};
|
|
9082
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9127
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isHiddenForm ? /*#__PURE__*/React__default.createElement("div", {
|
|
9083
9128
|
className: "grid gap-4 rounded-2xl p-6 border " + className,
|
|
9084
9129
|
style: {
|
|
9085
9130
|
backgroundColor: background
|
|
@@ -9098,6 +9143,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9098
9143
|
inputClassName: "w-full focus:outline-none focus:ring-0"
|
|
9099
9144
|
}), /*#__PURE__*/React__default.createElement(InputPhoneNumber, {
|
|
9100
9145
|
ref: inputPhoneNumberRef,
|
|
9146
|
+
name: "customerPhone",
|
|
9101
9147
|
label: "Số điện thoại",
|
|
9102
9148
|
placeholder: "Nhập số điện thoại",
|
|
9103
9149
|
rules: [{
|
|
@@ -9211,32 +9257,23 @@ var BookingForm = function BookingForm(props) {
|
|
|
9211
9257
|
label: "Đặt lịch ngay",
|
|
9212
9258
|
shopConfigStyle: shopConfigStyle,
|
|
9213
9259
|
onClick: handleSubmit
|
|
9214
|
-
})), isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9260
|
+
}))) : null, isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9215
9261
|
onCloseFormBooking: onCloseFormBooking,
|
|
9216
9262
|
onClose: handleClosePopup
|
|
9217
9263
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9218
|
-
className: "bg-white rounded-lg shadow-lg p-6 max-w-sm flex flex-col items-center justify-center
|
|
9264
|
+
className: "bg-white rounded-lg shadow-lg p-6 lg:px-16 lg:pb-10 max-w-sm flex gap-4 flex-col items-center justify-center"
|
|
9219
9265
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9220
|
-
className: "
|
|
9266
|
+
className: "flex items-center justify-center"
|
|
9221
9267
|
}, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
|
|
9222
9268
|
className: "h-full text-green-500",
|
|
9223
9269
|
style: {
|
|
9224
|
-
fontSize: "
|
|
9270
|
+
fontSize: "56px"
|
|
9225
9271
|
}
|
|
9226
9272
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9227
|
-
className: "
|
|
9228
|
-
}, "
|
|
9229
|
-
className: "
|
|
9230
|
-
}, "
|
|
9231
|
-
className: "mb-4"
|
|
9232
|
-
}, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), token ? /*#__PURE__*/React__default.createElement("div", null) : /*#__PURE__*/React__default.createElement("div", {
|
|
9233
|
-
className: "flex flex-col items-center"
|
|
9234
|
-
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9235
|
-
className: "mb-4 text-center"
|
|
9236
|
-
}, "B\u1EA1n \u0111\xE3 c\xF3 t\xE0i kho\u1EA3n, vui l\xF2ng \u0111\u0103ng nh\u1EADp \u0111\u1EC3 xem chi ti\u1EBFt c\xE1c s\u1EA3n ph\u1EA9m, d\u1ECBch v\u1EE5 li\u1EC7u tr\xECnh m\xE0 b\u1EA1n \u0111ang s\u1EDF h\u1EEFu"), /*#__PURE__*/React__default.createElement(Button, {
|
|
9237
|
-
label: "Đăng nhập",
|
|
9238
|
-
shopConfigStyle: shopConfigStyle
|
|
9239
|
-
})))));
|
|
9273
|
+
className: "font-medium text-2xl"
|
|
9274
|
+
}, "\u0110\u1EB7t l\u1ECBch th\xE0nh c\xF4ng"), /*#__PURE__*/React__default.createElement("div", {
|
|
9275
|
+
className: "text-center"
|
|
9276
|
+
}, "Ch\xFAng t\xF4i \u0111\xE3 ghi nh\u1EADn th\xF4ng tin c\u1EE7a b\u1EA1n v\xE0 s\u1EBD li\xEAn h\u1EC7 l\u1EA1i ngay"))));
|
|
9240
9277
|
};
|
|
9241
9278
|
|
|
9242
9279
|
var TreatmentsList7 = function TreatmentsList7(props) {
|
|
@@ -9361,7 +9398,8 @@ var TreatmentsList7 = function TreatmentsList7(props) {
|
|
|
9361
9398
|
onCloseFormBooking: handleCloseModal,
|
|
9362
9399
|
defaultValue: dataBooking,
|
|
9363
9400
|
shopConfig: shopConfig,
|
|
9364
|
-
shopConfigStyle: shopConfigStyle
|
|
9401
|
+
shopConfigStyle: shopConfigStyle,
|
|
9402
|
+
isModalBooking: isOpenModal
|
|
9365
9403
|
})) : null);
|
|
9366
9404
|
};
|
|
9367
9405
|
|
|
@@ -9400,44 +9438,6 @@ var ProductDetailController = function ProductDetailController(props) {
|
|
|
9400
9438
|
};
|
|
9401
9439
|
};
|
|
9402
9440
|
|
|
9403
|
-
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9404
|
-
var shopConfigStyle = props.shopConfigStyle;
|
|
9405
|
-
var _ProductDetailControl = ProductDetailController(props),
|
|
9406
|
-
product = _ProductDetailControl.product;
|
|
9407
|
-
console.log('product', product);
|
|
9408
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9409
|
-
className: SECTION_DEFAULT_CLASS + " !py-0"
|
|
9410
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9411
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-3 gap-6 bg-bgSecondary"
|
|
9412
|
-
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9413
|
-
product: product,
|
|
9414
|
-
className: "w-full aspect-square rounded-2xl"
|
|
9415
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9416
|
-
className: "col-span-2"
|
|
9417
|
-
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9418
|
-
className: "font-semibold text-2xl"
|
|
9419
|
-
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9420
|
-
product: product,
|
|
9421
|
-
className: "mt-6"
|
|
9422
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9423
|
-
className: "flex gap-4 mt-6"
|
|
9424
|
-
}, /*#__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", {
|
|
9425
|
-
className: "flex gap-4 mt-6"
|
|
9426
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9427
|
-
label: "ĐẶT LỊCH",
|
|
9428
|
-
shopConfigStyle: shopConfigStyle
|
|
9429
|
-
})), /*#__PURE__*/React__default.createElement("p", {
|
|
9430
|
-
className: "text-lg mt-12 pt-6 border-t border-stroke"
|
|
9431
|
-
}, "M\xF4 t\u1EA3"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9432
|
-
className: "mt-6",
|
|
9433
|
-
dangerouslySetInnerHTML: {
|
|
9434
|
-
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9435
|
-
}
|
|
9436
|
-
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
9437
|
-
className: "text-gray3 mt-2"
|
|
9438
|
-
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
|
|
9439
|
-
};
|
|
9440
|
-
|
|
9441
9441
|
var CartController = function CartController(props) {
|
|
9442
9442
|
var addToCart = props.addToCart,
|
|
9443
9443
|
dispatch = props.dispatch;
|
|
@@ -9463,7 +9463,7 @@ var CartController = function CartController(props) {
|
|
|
9463
9463
|
};
|
|
9464
9464
|
};
|
|
9465
9465
|
|
|
9466
|
-
var
|
|
9466
|
+
var ServiceDetail1 = function ServiceDetail1(props) {
|
|
9467
9467
|
var _product$images;
|
|
9468
9468
|
var shopConfigStyle = props.shopConfigStyle,
|
|
9469
9469
|
shopConfig = props.shopConfig;
|
|
@@ -9520,34 +9520,168 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9520
9520
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9521
9521
|
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9522
9522
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9523
|
-
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
|
|
9523
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9524
9524
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9525
9525
|
className: "flex flex-col gap-4 col-span-2"
|
|
9526
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9527
|
+
className: "rounded-2xl p-2 border"
|
|
9526
9528
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9527
9529
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9528
|
-
className: "w-full aspect-square object-
|
|
9530
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9529
9531
|
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9530
9532
|
product: product,
|
|
9531
|
-
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9533
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9534
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9535
|
+
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9536
|
+
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9537
|
+
return /*#__PURE__*/React__default.createElement("img", {
|
|
9538
|
+
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9539
|
+
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9540
|
+
alt: "",
|
|
9541
|
+
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"),
|
|
9542
|
+
onClick: function onClick() {
|
|
9543
|
+
handleDisplayImage(item);
|
|
9544
|
+
}
|
|
9545
|
+
});
|
|
9546
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9547
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9548
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9549
|
+
className: "font-semibold text-2xl"
|
|
9550
|
+
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9551
|
+
product: product,
|
|
9552
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9532
9553
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9554
|
+
className: " text-lg py-3"
|
|
9555
|
+
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
9556
|
+
label: "ĐẶT LỊCH NGAY",
|
|
9557
|
+
shopConfigStyle: shopConfigStyle,
|
|
9558
|
+
onClick: function onClick(e) {
|
|
9559
|
+
return handleOpenModalBooking(e);
|
|
9560
|
+
}
|
|
9561
|
+
}), /*#__PURE__*/React__default.createElement("p", {
|
|
9562
|
+
className: "text-lg mt-12 text-xl pb-1 pt-6 border-t border-stroke"
|
|
9563
|
+
}, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
|
|
9564
|
+
className: "h-max"
|
|
9565
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9566
|
+
ref: descriptionRef,
|
|
9567
|
+
className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
|
|
9568
|
+
dangerouslySetInnerHTML: {
|
|
9569
|
+
__html: product === null || product === void 0 ? void 0 : product.description
|
|
9570
|
+
}
|
|
9571
|
+
}), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9572
|
+
className: "h-10 relative -mt-10 rounded-b-lg",
|
|
9573
|
+
style: {
|
|
9574
|
+
background: "linear-gradient(to top, #81818169 0%, #00000003 50%)"
|
|
9575
|
+
}
|
|
9576
|
+
}) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
|
|
9577
|
+
className: "w-full flex justify-center mt-2"
|
|
9578
|
+
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
9579
|
+
label: isSeeMore ? "Thu nhỏ" : "Xem thêm",
|
|
9580
|
+
className: " bottom-0 z-50",
|
|
9581
|
+
onClick: function onClick() {
|
|
9582
|
+
setIsSeeMore(!isSeeMore);
|
|
9583
|
+
}
|
|
9584
|
+
})) : null) : /*#__PURE__*/React__default.createElement("div", {
|
|
9585
|
+
className: "text-gray3 mt-2"
|
|
9586
|
+
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9587
|
+
onClose: handleCloseModal
|
|
9588
|
+
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9589
|
+
isModalBooking: isBooking,
|
|
9590
|
+
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9591
|
+
onCloseFormBooking: handleCloseModal,
|
|
9592
|
+
defaultValue: dataBooking,
|
|
9593
|
+
shopConfig: shopConfig,
|
|
9594
|
+
shopConfigStyle: shopConfigStyle
|
|
9595
|
+
})) : null);
|
|
9596
|
+
};
|
|
9597
|
+
|
|
9598
|
+
var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
9599
|
+
var _product$images;
|
|
9600
|
+
var shopConfigStyle = props.shopConfigStyle,
|
|
9601
|
+
shopConfig = props.shopConfig;
|
|
9602
|
+
var _ProductDetailControl = ProductDetailController(props),
|
|
9603
|
+
product = _ProductDetailControl.product;
|
|
9604
|
+
var _useState = useState(),
|
|
9605
|
+
displayImage = _useState[0],
|
|
9606
|
+
setDisplayImage = _useState[1];
|
|
9607
|
+
var _useState2 = useState(false),
|
|
9608
|
+
isSeeMore = _useState2[0],
|
|
9609
|
+
setIsSeeMore = _useState2[1];
|
|
9610
|
+
var _useState3 = useState(true),
|
|
9611
|
+
hiddenButton = _useState3[0],
|
|
9612
|
+
setHiddenButton = _useState3[1];
|
|
9613
|
+
var descriptionRef = useRef();
|
|
9614
|
+
var _useState4 = useState(false),
|
|
9615
|
+
isBooking = _useState4[0],
|
|
9616
|
+
setIsBooking = _useState4[1];
|
|
9617
|
+
var _useState5 = useState([]),
|
|
9618
|
+
dataBooking = _useState5[0],
|
|
9619
|
+
setDataBooking = _useState5[1];
|
|
9620
|
+
useEffect(function () {
|
|
9621
|
+
if (product) {
|
|
9622
|
+
if (descriptionRef.current) {
|
|
9623
|
+
var descriptionHeight = descriptionRef.current.offsetHeight;
|
|
9624
|
+
if (descriptionHeight >= 700) {
|
|
9625
|
+
setHiddenButton(false);
|
|
9626
|
+
}
|
|
9627
|
+
}
|
|
9628
|
+
}
|
|
9629
|
+
}, [product]);
|
|
9630
|
+
var handleDisplayImage = function handleDisplayImage(item) {
|
|
9631
|
+
setDisplayImage(item);
|
|
9632
|
+
};
|
|
9633
|
+
var handleOpenModalBooking = function handleOpenModalBooking(event) {
|
|
9634
|
+
try {
|
|
9635
|
+
event.stopPropagation();
|
|
9636
|
+
setDataBooking([_extends({}, product, {
|
|
9637
|
+
quantity: 1,
|
|
9638
|
+
technical: {},
|
|
9639
|
+
oldService: false,
|
|
9640
|
+
label: product === null || product === void 0 ? void 0 : product.productName,
|
|
9641
|
+
value: product === null || product === void 0 ? void 0 : product.productId
|
|
9642
|
+
})]);
|
|
9643
|
+
setIsBooking(true);
|
|
9644
|
+
} catch (error) {
|
|
9645
|
+
console.log("::::::::::errrorrrrr::::::", error);
|
|
9646
|
+
}
|
|
9647
|
+
};
|
|
9648
|
+
var handleCloseModal = function handleCloseModal() {
|
|
9649
|
+
setIsBooking(false);
|
|
9650
|
+
setDataBooking([]);
|
|
9651
|
+
};
|
|
9652
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9653
|
+
className: SECTION_CLASS + " mt-6 mb-12 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
|
|
9654
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9655
|
+
className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 md:gap-6 bg-bgSecondary"
|
|
9656
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9657
|
+
className: "flex flex-col gap-4 col-span-2"
|
|
9658
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9659
|
+
className: "rounded-2xl p-2 border"
|
|
9660
|
+
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
9661
|
+
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
9662
|
+
className: "w-full aspect-square object-contain rounded-2xl"
|
|
9663
|
+
}) : /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9664
|
+
product: product,
|
|
9665
|
+
className: "w-full aspect-square !object-contain rounded-2xl"
|
|
9666
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9533
9667
|
className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
|
|
9534
9668
|
}, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
|
|
9535
9669
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
9536
9670
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
9537
9671
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
9538
9672
|
alt: "",
|
|
9539
|
-
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"),
|
|
9673
|
+
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"),
|
|
9540
9674
|
onClick: function onClick() {
|
|
9541
9675
|
handleDisplayImage(item);
|
|
9542
9676
|
}
|
|
9543
9677
|
});
|
|
9544
9678
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
9545
|
-
className: "col-span-3"
|
|
9679
|
+
className: "col-span-3 mt-4 lg:mt-0"
|
|
9546
9680
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
9547
9681
|
className: "font-semibold text-2xl"
|
|
9548
9682
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9549
9683
|
product: product,
|
|
9550
|
-
className: "mt-6 text-[22px]"
|
|
9684
|
+
className: "mt-3 md:mt-6 text-[22px]"
|
|
9551
9685
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9552
9686
|
className: " text-lg py-3"
|
|
9553
9687
|
}, "Th\u1EDDi gian: " + getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(Button, {
|
|
@@ -9584,6 +9718,7 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
|
|
|
9584
9718
|
}, "Kh\xF4ng c\xF3 th\xF4ng tin"))), isBooking ? /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9585
9719
|
onClose: handleCloseModal
|
|
9586
9720
|
}, /*#__PURE__*/React__default.createElement(BookingForm, {
|
|
9721
|
+
isModalBooking: isBooking,
|
|
9587
9722
|
className: "overflow-y-auto hide-scrollbar max-h-[80vh]",
|
|
9588
9723
|
onCloseFormBooking: handleCloseModal,
|
|
9589
9724
|
defaultValue: dataBooking,
|
|
@@ -10225,8 +10360,21 @@ var Products10 = function Products10(props) {
|
|
|
10225
10360
|
})) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
|
|
10226
10361
|
};
|
|
10227
10362
|
|
|
10363
|
+
var listFilter = [{
|
|
10364
|
+
label: "Tất cả",
|
|
10365
|
+
value: "all"
|
|
10366
|
+
}, {
|
|
10367
|
+
label: "Khuyến mãi",
|
|
10368
|
+
value: "discount"
|
|
10369
|
+
}, {
|
|
10370
|
+
label: "Nổi bật",
|
|
10371
|
+
value: "isHighlight"
|
|
10372
|
+
}, {
|
|
10373
|
+
label: "Giá thấp đến cao",
|
|
10374
|
+
value: "sortPriceDESC"
|
|
10375
|
+
}];
|
|
10228
10376
|
var Products11 = function Products11(props) {
|
|
10229
|
-
var
|
|
10377
|
+
var _productsFilter$slice;
|
|
10230
10378
|
var _props$shopConfigStyl = props.shopConfigStyle,
|
|
10231
10379
|
shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
|
|
10232
10380
|
_props$Link = props.Link,
|
|
@@ -10248,6 +10396,12 @@ var Products11 = function Products11(props) {
|
|
|
10248
10396
|
var _useState3 = useState({}),
|
|
10249
10397
|
categorySelected = _useState3[0],
|
|
10250
10398
|
setCategorySelected = _useState3[1];
|
|
10399
|
+
var _useState4 = useState([]),
|
|
10400
|
+
productsFilter = _useState4[0],
|
|
10401
|
+
setProductsFilter = _useState4[1];
|
|
10402
|
+
var _useState5 = useState(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]),
|
|
10403
|
+
filterItem = _useState5[0],
|
|
10404
|
+
setFilterItem = _useState5[1];
|
|
10251
10405
|
var _CategoryController = CategoryController(_extends({}, props, {
|
|
10252
10406
|
params: params
|
|
10253
10407
|
})),
|
|
@@ -10271,6 +10425,7 @@ var Products11 = function Products11(props) {
|
|
|
10271
10425
|
var handleChooseCategory = function handleChooseCategory(category) {
|
|
10272
10426
|
setCategorySelected(category);
|
|
10273
10427
|
setFirstLoading(true);
|
|
10428
|
+
setFilterItem(listFilter === null || listFilter === void 0 ? void 0 : listFilter[0]);
|
|
10274
10429
|
setParams(function (prev) {
|
|
10275
10430
|
return _extends({}, prev, {
|
|
10276
10431
|
categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
|
|
@@ -10281,36 +10436,73 @@ var Products11 = function Products11(props) {
|
|
|
10281
10436
|
useEffect(function () {
|
|
10282
10437
|
if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0 && params !== null && params !== void 0 && params.categoryId) {
|
|
10283
10438
|
var category = categories === null || categories === void 0 ? void 0 : categories.find(function (item) {
|
|
10284
|
-
return (item === null || item === void 0 ? void 0 : item.categoryId) == categoryId;
|
|
10439
|
+
return (item === null || item === void 0 ? void 0 : item.categoryId) == (params === null || params === void 0 ? void 0 : params.categoryId);
|
|
10285
10440
|
});
|
|
10286
10441
|
setCategorySelected(category);
|
|
10287
10442
|
}
|
|
10288
|
-
}, [
|
|
10289
|
-
|
|
10443
|
+
}, [categories]);
|
|
10444
|
+
useEffect(function () {
|
|
10445
|
+
if ((products === null || products === void 0 ? void 0 : products.length) > 0) {
|
|
10446
|
+
setProductsFilter(products);
|
|
10447
|
+
}
|
|
10448
|
+
}, [products]);
|
|
10449
|
+
var handleFilter = function handleFilter(item) {
|
|
10450
|
+
setFilterItem(item);
|
|
10451
|
+
if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
|
|
10452
|
+
var productsCopy = [].concat(products);
|
|
10453
|
+
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
|
|
10454
|
+
var _b$productInfo, _a$productInfo;
|
|
10455
|
+
return +(b === null || b === void 0 ? void 0 : (_b$productInfo = b.productInfo) === null || _b$productInfo === void 0 ? void 0 : _b$productInfo.price) - (a === null || a === void 0 ? void 0 : (_a$productInfo = a.productInfo) === null || _a$productInfo === void 0 ? void 0 : _a$productInfo.price);
|
|
10456
|
+
});
|
|
10457
|
+
setProductsFilter(productsCopy);
|
|
10458
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
|
|
10459
|
+
var _productsCopy = [].concat(products);
|
|
10460
|
+
_productsCopy === null || _productsCopy === void 0 ? void 0 : _productsCopy.filter(function (product) {
|
|
10461
|
+
return (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price);
|
|
10462
|
+
});
|
|
10463
|
+
setProductsFilter(_productsCopy);
|
|
10464
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
|
|
10465
|
+
var _productsCopy3;
|
|
10466
|
+
var _productsCopy2 = [].concat(products);
|
|
10467
|
+
_productsCopy2 = (_productsCopy3 = _productsCopy2) === null || _productsCopy3 === void 0 ? void 0 : _productsCopy3.filter(function (product) {
|
|
10468
|
+
return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
|
|
10469
|
+
});
|
|
10470
|
+
setProductsFilter(_productsCopy2);
|
|
10471
|
+
} else {
|
|
10472
|
+
setProductsFilter(products);
|
|
10473
|
+
}
|
|
10474
|
+
};
|
|
10290
10475
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10291
|
-
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
|
|
10476
|
+
className: SECTION_CLASS + " grid grid-cols-1 !mt-0 md:grid-cols-4 gap-6"
|
|
10292
10477
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10293
|
-
className: "md:sticky top-
|
|
10478
|
+
className: "md:sticky top-0 self-start"
|
|
10294
10479
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10295
|
-
className: "rounded-3xl bg-bgSecondary p-4"
|
|
10480
|
+
className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
|
|
10296
10481
|
}, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
|
|
10297
|
-
return /*#__PURE__*/React__default.createElement(
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10301
|
-
className: "px-6 py-3 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" : ""),
|
|
10482
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10483
|
+
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" : ""),
|
|
10484
|
+
key: "sdjfdh-" + index,
|
|
10302
10485
|
onClick: function onClick() {
|
|
10303
10486
|
handleChooseCategory(item);
|
|
10304
|
-
}
|
|
10305
|
-
|
|
10306
|
-
}, item === null || item === void 0 ? void 0 : item.cateName));
|
|
10487
|
+
}
|
|
10488
|
+
}, item === null || item === void 0 ? void 0 : item.cateName);
|
|
10307
10489
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
10308
|
-
className: "md:col-span-3 flex flex-col gap-
|
|
10309
|
-
},
|
|
10310
|
-
className: "
|
|
10311
|
-
},
|
|
10490
|
+
className: "md:col-span-3 flex flex-col gap-6"
|
|
10491
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10492
|
+
className: "flex gap-4"
|
|
10493
|
+
}, listFilter === null || listFilter === void 0 ? void 0 : listFilter.map(function (item, index) {
|
|
10494
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10495
|
+
key: "kgkf-" + index,
|
|
10496
|
+
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",
|
|
10497
|
+
onClick: function onClick() {
|
|
10498
|
+
handleFilter(item);
|
|
10499
|
+
}
|
|
10500
|
+
}, item === null || item === void 0 ? void 0 : item.label);
|
|
10501
|
+
})), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
10502
|
+
className: "w-full h-96 mb-1 flex justify-center items-center"
|
|
10503
|
+
}, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
10312
10504
|
className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
|
|
10313
|
-
}, (
|
|
10505
|
+
}, (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, index) {
|
|
10314
10506
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
10315
10507
|
href: getLinkProductDetail(product === null || product === void 0 ? void 0 : product.productInfo),
|
|
10316
10508
|
Link: Link,
|
|
@@ -10323,7 +10515,7 @@ var Products11 = function Products11(props) {
|
|
|
10323
10515
|
}));
|
|
10324
10516
|
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
10325
10517
|
className: "md:col-span-2 lg:col-span-3 mt-20 m-auto"
|
|
10326
|
-
}, /*#__PURE__*/React__default.createElement(NotFoundProduct, null))), /*#__PURE__*/React__default.createElement("div", {
|
|
10518
|
+
}, /*#__PURE__*/React__default.createElement(NotFoundProduct, null)))), /*#__PURE__*/React__default.createElement("div", {
|
|
10327
10519
|
className: "w-full m-auto"
|
|
10328
10520
|
}, (page === null || page === void 0 ? void 0 : page.total_pages) > 1 ? /*#__PURE__*/React__default.createElement(Pagination, {
|
|
10329
10521
|
total_pages: page === null || page === void 0 ? void 0 : page.total_pages,
|
|
@@ -10439,8 +10631,21 @@ var ProductSale2 = function ProductSale2(props) {
|
|
|
10439
10631
|
})) : null;
|
|
10440
10632
|
};
|
|
10441
10633
|
|
|
10634
|
+
var listFilter$1 = [{
|
|
10635
|
+
label: "Khuyến mãi",
|
|
10636
|
+
value: "discount",
|
|
10637
|
+
filter: {
|
|
10638
|
+
isDiscount: true
|
|
10639
|
+
}
|
|
10640
|
+
}, {
|
|
10641
|
+
label: "Nổi bật",
|
|
10642
|
+
value: "isHighlight",
|
|
10643
|
+
filter: {
|
|
10644
|
+
isHighlight: true
|
|
10645
|
+
}
|
|
10646
|
+
}];
|
|
10442
10647
|
var ProductSearch1 = function ProductSearch1(props) {
|
|
10443
|
-
var _window, _window$location;
|
|
10648
|
+
var _window, _window$location, _productsFilter$slice;
|
|
10444
10649
|
var _props$Link = props.Link,
|
|
10445
10650
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
10446
10651
|
_props$SectionTitle = props.SectionTitle,
|
|
@@ -10450,12 +10655,12 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10450
10655
|
shopConfigStyle = props.shopConfigStyle;
|
|
10451
10656
|
var queryParams = new URLSearchParams((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.search);
|
|
10452
10657
|
var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('tu-khoa');
|
|
10453
|
-
var _useState = useState(
|
|
10454
|
-
|
|
10455
|
-
|
|
10658
|
+
var _useState = useState([]),
|
|
10659
|
+
productsFilter = _useState[0],
|
|
10660
|
+
setProductsFilter = _useState[1];
|
|
10456
10661
|
var _useState2 = useState({
|
|
10457
10662
|
productName: keywordValue,
|
|
10458
|
-
size:
|
|
10663
|
+
size: 12
|
|
10459
10664
|
}),
|
|
10460
10665
|
params = _useState2[0],
|
|
10461
10666
|
setParams = _useState2[1];
|
|
@@ -10474,36 +10679,34 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10474
10679
|
});
|
|
10475
10680
|
});
|
|
10476
10681
|
}, [keywordValue]);
|
|
10682
|
+
useEffect(function () {
|
|
10683
|
+
if ((products === null || products === void 0 ? void 0 : products.length) > 0) setProductsFilter(products);
|
|
10684
|
+
}, [products]);
|
|
10477
10685
|
var handleGetMoreProducts = function handleGetMoreProducts() {
|
|
10478
10686
|
setIsGetMore(false);
|
|
10479
|
-
|
|
10480
|
-
return prev
|
|
10687
|
+
setParams(function (prev) {
|
|
10688
|
+
return _extends({}, prev, {
|
|
10689
|
+
size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
|
|
10690
|
+
});
|
|
10481
10691
|
});
|
|
10482
10692
|
};
|
|
10483
|
-
var listFilter = [{
|
|
10484
|
-
label: "Khuyến mãi",
|
|
10485
|
-
value: "discount",
|
|
10486
|
-
filter: {
|
|
10487
|
-
isDiscount: true
|
|
10488
|
-
}
|
|
10489
|
-
}, {
|
|
10490
|
-
label: "Nổi bật",
|
|
10491
|
-
value: "highlight",
|
|
10492
|
-
filter: {
|
|
10493
|
-
isHighlight: true
|
|
10494
|
-
}
|
|
10495
|
-
}];
|
|
10496
10693
|
var handleFilter = function handleFilter(item) {
|
|
10497
|
-
|
|
10498
|
-
var
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
if (key !== 'productName' && key !== 'size') {
|
|
10502
|
-
delete newParams[key];
|
|
10503
|
-
}
|
|
10694
|
+
if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
|
|
10695
|
+
var productsCopy = [].concat(products);
|
|
10696
|
+
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.filter(function (product) {
|
|
10697
|
+
return (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price);
|
|
10504
10698
|
});
|
|
10505
|
-
|
|
10506
|
-
})
|
|
10699
|
+
setProductsFilter(productsCopy);
|
|
10700
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
|
|
10701
|
+
var _productsCopy2;
|
|
10702
|
+
var _productsCopy = [].concat(products);
|
|
10703
|
+
_productsCopy = (_productsCopy2 = _productsCopy) === null || _productsCopy2 === void 0 ? void 0 : _productsCopy2.filter(function (product) {
|
|
10704
|
+
return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
|
|
10705
|
+
});
|
|
10706
|
+
setProductsFilter(_productsCopy);
|
|
10707
|
+
} else {
|
|
10708
|
+
setProductsFilter(products);
|
|
10709
|
+
}
|
|
10507
10710
|
};
|
|
10508
10711
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10509
10712
|
className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
|
|
@@ -10515,20 +10718,20 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10515
10718
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
10516
10719
|
className: "text-lg"
|
|
10517
10720
|
}, "T\u1EEB kh\xF3a \"", keywordValue, "\" (", products === null || products === void 0 ? void 0 : products.length, " s\u1EA3n ph\u1EA9m)"), /*#__PURE__*/React__default.createElement(CarouselItem, {
|
|
10518
|
-
data: listFilter,
|
|
10721
|
+
data: listFilter$1,
|
|
10519
10722
|
isNavigateButton: false,
|
|
10520
10723
|
onClick: handleFilter
|
|
10521
10724
|
}), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
|
|
10522
10725
|
className: "m-auto mt-20 min-h-32"
|
|
10523
|
-
}, /*#__PURE__*/React__default.createElement(Loading, null)) : (
|
|
10726
|
+
}, /*#__PURE__*/React__default.createElement(Loading, null)) : (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
10524
10727
|
className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
|
|
10525
|
-
},
|
|
10728
|
+
}, productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, idx) {
|
|
10526
10729
|
return /*#__PURE__*/React__default.createElement(ProductItem, {
|
|
10527
10730
|
Link: Link,
|
|
10528
10731
|
product: product === null || product === void 0 ? void 0 : product.productInfo,
|
|
10529
10732
|
key: "htrhr-" + idx
|
|
10530
10733
|
});
|
|
10531
|
-
})) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (
|
|
10734
|
+
})) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
|
|
10532
10735
|
label: "Xem thêm",
|
|
10533
10736
|
onClick: handleGetMoreProducts,
|
|
10534
10737
|
className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
|
|
@@ -10796,8 +10999,8 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10796
10999
|
var _product$images2;
|
|
10797
11000
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10798
11001
|
shopConfig = props.shopConfig,
|
|
10799
|
-
_props$
|
|
10800
|
-
|
|
11002
|
+
_props$router = props.router,
|
|
11003
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
10801
11004
|
var _ProductDetailControl = ProductDetailController(props),
|
|
10802
11005
|
product = _ProductDetailControl.product;
|
|
10803
11006
|
var _useState = useState(),
|
|
@@ -10895,7 +11098,7 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10895
11098
|
var _refInputQuantity$cur3;
|
|
10896
11099
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
10897
11100
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
10898
|
-
|
|
11101
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
10899
11102
|
});
|
|
10900
11103
|
}
|
|
10901
11104
|
}();
|
|
@@ -11022,11 +11225,11 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
11022
11225
|
};
|
|
11023
11226
|
|
|
11024
11227
|
var ProductDetail11 = function ProductDetail11(props) {
|
|
11025
|
-
var _product$images2, _product$images3, _product$attributes, _product$attributes2;
|
|
11228
|
+
var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
|
|
11026
11229
|
var shopConfigStyle = props.shopConfigStyle,
|
|
11027
11230
|
shopConfig = props.shopConfig,
|
|
11028
|
-
_props$
|
|
11029
|
-
|
|
11231
|
+
_props$router = props.router,
|
|
11232
|
+
router = _props$router === void 0 ? function () {} : _props$router;
|
|
11030
11233
|
var _ProductDetailControl = ProductDetailController(props),
|
|
11031
11234
|
product = _ProductDetailControl.product;
|
|
11032
11235
|
var _useState = useState(),
|
|
@@ -11124,7 +11327,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11124
11327
|
var _refInputQuantity$cur3;
|
|
11125
11328
|
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
11126
11329
|
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
11127
|
-
|
|
11330
|
+
router === null || router === void 0 ? void 0 : router.push("/gio-hang");
|
|
11128
11331
|
});
|
|
11129
11332
|
}
|
|
11130
11333
|
}();
|
|
@@ -11144,7 +11347,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11144
11347
|
className: "grid grid-cols-5 gap-6"
|
|
11145
11348
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11146
11349
|
className: "hidden lg:block col-span-1 lg:min-h-[240px] lg:max-h-[400px] xl:min-h-[400px] xl:max-h-[480px] overflow-y-auto overflow-hidden no-scrollbar"
|
|
11147
|
-
}, product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.map(function (item) {
|
|
11350
|
+
}, (product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images3 = product.images) === null || _product$images3 === void 0 ? void 0 : _product$images3.map(function (item) {
|
|
11148
11351
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
11149
11352
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
11150
11353
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
@@ -11154,7 +11357,13 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11154
11357
|
handleDisplayImage(item);
|
|
11155
11358
|
}
|
|
11156
11359
|
});
|
|
11157
|
-
})
|
|
11360
|
+
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
11361
|
+
className: "p-2 border rounded-lg"
|
|
11362
|
+
}, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
|
|
11363
|
+
width: "100%",
|
|
11364
|
+
height: "25%",
|
|
11365
|
+
fill: "#D9D9D9"
|
|
11366
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11158
11367
|
className: "flex flex-col gap-4 col-span-5 lg:col-span-4 p-4 border border-stroke rounded-2xl"
|
|
11159
11368
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
11160
11369
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
@@ -11170,7 +11379,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11170
11379
|
fill: "#D9D9D9"
|
|
11171
11380
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11172
11381
|
className: " block lg:hidden w-full flex gap-4 col-span-5 overflow-x-auto overflow-hidden no-scrollbar"
|
|
11173
|
-
}, product === null || product === void 0 ? void 0 : (_product$
|
|
11382
|
+
}, (product === null || product === void 0 ? void 0 : (_product$images4 = product.images) === null || _product$images4 === void 0 ? void 0 : _product$images4.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images5 = product.images) === null || _product$images5 === void 0 ? void 0 : _product$images5.map(function (item) {
|
|
11174
11383
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
11175
11384
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
11176
11385
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
@@ -11180,7 +11389,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11180
11389
|
handleDisplayImage(item);
|
|
11181
11390
|
}
|
|
11182
11391
|
});
|
|
11183
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11392
|
+
}) : null)), /*#__PURE__*/React__default.createElement("div", {
|
|
11184
11393
|
className: "mt-2 md:ms-10"
|
|
11185
11394
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11186
11395
|
className: "font-semibold text-2xl"
|
|
@@ -11265,8 +11474,8 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11265
11474
|
setIsSeeMore(!isSeeMore);
|
|
11266
11475
|
}
|
|
11267
11476
|
})) : null) : /*#__PURE__*/React__default.createElement("div", {
|
|
11268
|
-
className: "text-gray3
|
|
11269
|
-
}, "Kh\xF4ng c\xF3 th\xF4ng tin")), (product === null || product === void 0 ? void 0 : (_product$attributes = product.attributes) === null || _product$attributes === void 0 ? void 0 : _product$attributes.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
11477
|
+
className: "text-lg text-gray3 rounded-lg p-2"
|
|
11478
|
+
}, "Kh\xF4ng c\xF3 th\xF4ng tin s\u1EA3n ph\u1EA9m")), (product === null || product === void 0 ? void 0 : (_product$attributes = product.attributes) === null || _product$attributes === void 0 ? void 0 : _product$attributes.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
11270
11479
|
className: "lg:col-span-2"
|
|
11271
11480
|
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
11272
11481
|
className: "text-3xl mb-8 font-semibold"
|
|
@@ -11673,7 +11882,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11673
11882
|
var genShopAddress = function genShopAddress() {
|
|
11674
11883
|
try {
|
|
11675
11884
|
var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
|
|
11676
|
-
if (addressJson) {
|
|
11885
|
+
if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
|
|
11677
11886
|
setShopAddressList(addressJson);
|
|
11678
11887
|
} else {
|
|
11679
11888
|
setShopAddressList([{
|
|
@@ -11709,7 +11918,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11709
11918
|
className: " col-span-2 flex flex-col mb-10 leading-8 sm:mb-0 "
|
|
11710
11919
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11711
11920
|
className: "mb-3 font-semibold text-md md:text-lg"
|
|
11712
|
-
}, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
|
|
11921
|
+
}, "Th\xF4ng tin li\xEAn h\u1EC7"), Array.isArray(shopAddressList) ? shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
|
|
11713
11922
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
|
|
11714
11923
|
className: "flex gap-2 items-center"
|
|
11715
11924
|
}, /*#__PURE__*/React__default.createElement(HiOutlineLocationMarker, {
|
|
@@ -11727,7 +11936,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11727
11936
|
color: primary
|
|
11728
11937
|
}
|
|
11729
11938
|
}), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.phone)));
|
|
11730
|
-
})), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
11939
|
+
}) : null), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
11731
11940
|
className: "mb-3 font-semibold text-lg"
|
|
11732
11941
|
}, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
|
|
11733
11942
|
className: "leading-10 flex flex-col "
|
|
@@ -11813,7 +12022,7 @@ var Footer7 = function Footer7(props) {
|
|
|
11813
12022
|
var genShopAddress = function genShopAddress() {
|
|
11814
12023
|
try {
|
|
11815
12024
|
var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
|
|
11816
|
-
if (addressJson) {
|
|
12025
|
+
if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
|
|
11817
12026
|
setShopAddressList(addressJson);
|
|
11818
12027
|
} else {
|
|
11819
12028
|
setShopAddressList([{
|
|
@@ -12062,7 +12271,7 @@ var CustomerRating6 = function CustomerRating6(props) {
|
|
|
12062
12271
|
_props$SectionTitle = props.SectionTitle,
|
|
12063
12272
|
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
|
|
12064
12273
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
12065
|
-
className: SECTION_CLASS + " !my-0 py-12 bg-
|
|
12274
|
+
className: SECTION_CLASS + " !my-0 py-12 bg-"
|
|
12066
12275
|
}, /*#__PURE__*/React__default.createElement(SectionTitle, {
|
|
12067
12276
|
data: data,
|
|
12068
12277
|
shopConfigStyle: shopConfigStyle
|
|
@@ -12072,9 +12281,9 @@ var CustomerRating6 = function CustomerRating6(props) {
|
|
|
12072
12281
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
12073
12282
|
key: index,
|
|
12074
12283
|
className: "relative bg-primary rounded-lg text-textButton px-6 py-4"
|
|
12075
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
12076
|
-
size:
|
|
12077
|
-
className: "absolute text-
|
|
12284
|
+
}, /*#__PURE__*/React__default.createElement(MdOutlineFormatQuote, {
|
|
12285
|
+
size: 43,
|
|
12286
|
+
className: "absolute text-black top-[-20px] right-8"
|
|
12078
12287
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12079
12288
|
className: "flex items-end gap-2"
|
|
12080
12289
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
@@ -12299,7 +12508,7 @@ var Contact1 = function Contact1(props) {
|
|
|
12299
12508
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-12 mt-6"
|
|
12300
12509
|
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", null, "Trong qu\xE1 tr\xECnh gh\xE9 th\u0103m website, n\u1EBFu qu\xFD kh\xE1ch c\xF3 b\u1EA5t k\u1EF3 th\u1EAFc m\u1EAFc hay c\u1EA7n s\u1EF1 h\u1ED7 tr\u1EE3 n\xE0o, h\xE3y li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i theo c\xE1c k\xEAnh sau: "), shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
|
|
12301
12510
|
className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
|
|
12302
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
12511
|
+
}, /*#__PURE__*/React__default.createElement(FaPhoneAlt, {
|
|
12303
12512
|
size: 40,
|
|
12304
12513
|
className: "p-2 text-textButton bg-primary"
|
|
12305
12514
|
}), /*#__PURE__*/React__default.createElement("div", null, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone)) : null, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopZalo ? /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13279,7 +13488,7 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
13279
13488
|
}
|
|
13280
13489
|
}))
|
|
13281
13490
|
}), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13282
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
|
|
13491
|
+
className: "max-h-64 overflow-y-auto flex flex-col scroll-container gap-2 pr-3"
|
|
13283
13492
|
}, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
|
|
13284
13493
|
var _item$productInfo, _item$productInfo2;
|
|
13285
13494
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13367,7 +13576,7 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
13367
13576
|
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",
|
|
13368
13577
|
onChange: setSearchValue
|
|
13369
13578
|
}), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
13370
|
-
className: "max-h-64 overflow-y-auto flex flex-col gap-2"
|
|
13579
|
+
className: "max-h-64 overflow-y-auto scroll-container flex flex-col gap-2"
|
|
13371
13580
|
}, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
|
|
13372
13581
|
var _item$productInfo;
|
|
13373
13582
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -13394,10 +13603,17 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13394
13603
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13395
13604
|
var _props$Link = props.Link,
|
|
13396
13605
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13606
|
+
_props$router = props.router,
|
|
13607
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13397
13608
|
data = props.data;
|
|
13398
13609
|
var _useState = useState(""),
|
|
13399
13610
|
value = _useState[0],
|
|
13400
13611
|
setValue = _useState[1];
|
|
13612
|
+
var handleSearch = function handleSearch(e) {
|
|
13613
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13614
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13615
|
+
}
|
|
13616
|
+
};
|
|
13401
13617
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13402
13618
|
className: SECTION_CLASS + " md:mt-6"
|
|
13403
13619
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13418,6 +13634,9 @@ var SearchBar5 = function SearchBar5(props) {
|
|
|
13418
13634
|
}),
|
|
13419
13635
|
wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
|
|
13420
13636
|
className: "w-full bg-bgSecondary mb-2 md:h-12",
|
|
13637
|
+
onKeyDown: function onKeyDown(e) {
|
|
13638
|
+
handleSearch(e);
|
|
13639
|
+
},
|
|
13421
13640
|
style: {
|
|
13422
13641
|
borderRadius: "32px"
|
|
13423
13642
|
},
|
|
@@ -13440,10 +13659,17 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13440
13659
|
var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
|
|
13441
13660
|
var _props$Link = props.Link,
|
|
13442
13661
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13662
|
+
_props$router = props.router,
|
|
13663
|
+
router = _props$router === void 0 ? function () {} : _props$router,
|
|
13443
13664
|
data = props.data;
|
|
13444
13665
|
var _useState = useState(""),
|
|
13445
13666
|
value = _useState[0],
|
|
13446
13667
|
setValue = _useState[1];
|
|
13668
|
+
var handleSearch = function handleSearch(e) {
|
|
13669
|
+
if ((e === null || e === void 0 ? void 0 : e.key) === "Enter" && value && value.length > 0) {
|
|
13670
|
+
router === null || router === void 0 ? void 0 : router.push(genLinkSearch(value));
|
|
13671
|
+
}
|
|
13672
|
+
};
|
|
13447
13673
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13448
13674
|
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 ",
|
|
13449
13675
|
style: {
|
|
@@ -13465,7 +13691,10 @@ var SearchBar6 = function SearchBar6(props) {
|
|
|
13465
13691
|
wrapClassName: " w-full h-full",
|
|
13466
13692
|
inputClassName: "w-full",
|
|
13467
13693
|
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",
|
|
13468
|
-
onChange: setValue
|
|
13694
|
+
onChange: setValue,
|
|
13695
|
+
onKeyDown: function onKeyDown(e) {
|
|
13696
|
+
handleSearch(e);
|
|
13697
|
+
}
|
|
13469
13698
|
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, value && (value === null || value === void 0 ? void 0 : value.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
13470
13699
|
Link: Link,
|
|
13471
13700
|
href: genLinkSearch(value)
|
|
@@ -13711,6 +13940,11 @@ var NewsController = function NewsController(props) {
|
|
|
13711
13940
|
var _response$data2, _response$data2$data, _response$data3, _response$data3$data;
|
|
13712
13941
|
setNewsArticles(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$data = _response$data2.data) === null || _response$data2$data === void 0 ? void 0 : _response$data2$data.content);
|
|
13713
13942
|
setPage(response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : (_response$data3$data = _response$data3.data) === null || _response$data3$data === void 0 ? void 0 : _response$data3$data.totalElements);
|
|
13943
|
+
var url = new URL(window.location.href);
|
|
13944
|
+
if (/^(\/(tin-tuc-theo-danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
|
|
13945
|
+
url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
|
|
13946
|
+
window.history.replaceState({}, '', url.pathname + url.search);
|
|
13947
|
+
}
|
|
13714
13948
|
}
|
|
13715
13949
|
setLoading(false);
|
|
13716
13950
|
});
|
|
@@ -13906,13 +14140,12 @@ var News1 = function News1(props) {
|
|
|
13906
14140
|
shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
|
|
13907
14141
|
_props$Link = props.Link,
|
|
13908
14142
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13909
|
-
|
|
13910
|
-
catId = _props$catId === void 0 ? "" : _props$catId;
|
|
14143
|
+
catId = props.catId;
|
|
13911
14144
|
var _useState = useState({
|
|
13912
14145
|
page: 0,
|
|
13913
14146
|
sort: "timeUpdate,DESC",
|
|
13914
|
-
|
|
13915
|
-
|
|
14147
|
+
catId: catId,
|
|
14148
|
+
size: 10
|
|
13916
14149
|
}),
|
|
13917
14150
|
params = _useState[0],
|
|
13918
14151
|
setParams = _useState[1];
|
|
@@ -13942,11 +14175,11 @@ var News1 = function News1(props) {
|
|
|
13942
14175
|
useEffect(function () {
|
|
13943
14176
|
if ((newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.length) > 0 && params !== null && params !== void 0 && params.catId) {
|
|
13944
14177
|
var category = newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.find(function (item) {
|
|
13945
|
-
return (item === null || item === void 0 ? void 0 : item.catId) == catId;
|
|
14178
|
+
return (item === null || item === void 0 ? void 0 : item.catId) == (params === null || params === void 0 ? void 0 : params.catId);
|
|
13946
14179
|
});
|
|
13947
14180
|
setCategorySelected(category);
|
|
13948
14181
|
}
|
|
13949
|
-
}, [
|
|
14182
|
+
}, [newsCategories]);
|
|
13950
14183
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13951
14184
|
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-6"
|
|
13952
14185
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13991,18 +14224,29 @@ var News1 = function News1(props) {
|
|
|
13991
14224
|
}) : null)), /*#__PURE__*/React__default.createElement("div", {
|
|
13992
14225
|
className: "sticky top-20 self-start"
|
|
13993
14226
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
13994
|
-
className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
|
|
14227
|
+
className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center ",
|
|
14228
|
+
onClick: function onClick() {
|
|
14229
|
+
setParams({
|
|
14230
|
+
page: 0,
|
|
14231
|
+
sort: "timeUpdate,DESC",
|
|
14232
|
+
size: 10
|
|
14233
|
+
});
|
|
14234
|
+
}
|
|
13995
14235
|
}, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
|
|
13996
14236
|
className: "rounded-b-lg bg-bgSecondary"
|
|
13997
14237
|
}, newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.map(function (item, index) {
|
|
13998
|
-
return /*#__PURE__*/React__default.createElement(
|
|
13999
|
-
href: getLinkNewsByCategory(item),
|
|
14000
|
-
Link: Link,
|
|
14001
|
-
key: "fjhnfg-" + index
|
|
14002
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14238
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14003
14239
|
className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
|
|
14004
|
-
key: "sdjfdh-" + index
|
|
14005
|
-
|
|
14240
|
+
key: "sdjfdh-" + index,
|
|
14241
|
+
onClick: function onClick() {
|
|
14242
|
+
setCategorySelected(item);
|
|
14243
|
+
setParams(function (prev) {
|
|
14244
|
+
return _extends({}, prev, {
|
|
14245
|
+
catId: item === null || item === void 0 ? void 0 : item.catId
|
|
14246
|
+
});
|
|
14247
|
+
});
|
|
14248
|
+
}
|
|
14249
|
+
}, item === null || item === void 0 ? void 0 : item.catName);
|
|
14006
14250
|
}))));
|
|
14007
14251
|
};
|
|
14008
14252
|
|