s-platform-landing-section 0.1.21 → 0.1.22
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 +202 -109
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +204 -111
- 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) {
|
|
@@ -536,7 +537,8 @@ var NavBar1 = function NavBar1(props) {
|
|
|
536
537
|
_props$useSelector = props.useSelector,
|
|
537
538
|
useSelector = _props$useSelector === void 0 ? null : _props$useSelector,
|
|
538
539
|
_props$logout = props.logout,
|
|
539
|
-
logout = _props$logout === void 0 ? function () {} : _props$logout
|
|
540
|
+
logout = _props$logout === void 0 ? function () {} : _props$logout,
|
|
541
|
+
data = props.data;
|
|
540
542
|
var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
|
|
541
543
|
var _state$cart;
|
|
542
544
|
return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
|
|
@@ -594,7 +596,11 @@ var NavBar1 = function NavBar1(props) {
|
|
|
594
596
|
top: "-100px"
|
|
595
597
|
}
|
|
596
598
|
}, 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-
|
|
599
|
+
className: "hidden lg:flex justify-between items-center px-20 py-2 bg-primary"
|
|
600
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
601
|
+
className: "text-background text-xl"
|
|
602
|
+
}, data === null || data === void 0 ? void 0 : data.title), /*#__PURE__*/React__default.createElement("div", {
|
|
603
|
+
className: "flex gap-6 "
|
|
598
604
|
}, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
|
|
599
605
|
className: "font-medium border-r pr-6 text-background"
|
|
600
606
|
}, "Hotline: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -617,7 +623,7 @@ var NavBar1 = function NavBar1(props) {
|
|
|
617
623
|
}, /*#__PURE__*/React__default.createElement(SiZalo, {
|
|
618
624
|
size: 24,
|
|
619
625
|
className: "p-1 rounded bg-background text-primary"
|
|
620
|
-
})))), /*#__PURE__*/React__default.createElement("div", {
|
|
626
|
+
}))))), /*#__PURE__*/React__default.createElement("div", {
|
|
621
627
|
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
628
|
}, /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
623
629
|
Link: Link,
|
|
@@ -7580,6 +7586,11 @@ var ProductController = function ProductController(props) {
|
|
|
7580
7586
|
var _res$data2, _res$data3;
|
|
7581
7587
|
setProducts(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
|
|
7582
7588
|
setPage(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.page);
|
|
7589
|
+
var url = new URL(window.location.href);
|
|
7590
|
+
if (/^(\/(danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
|
|
7591
|
+
url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
|
|
7592
|
+
window.history.replaceState({}, '', url.pathname + url.search);
|
|
7593
|
+
}
|
|
7583
7594
|
}
|
|
7584
7595
|
setLoading(false);
|
|
7585
7596
|
});
|
|
@@ -7618,6 +7629,7 @@ var ProductController = function ProductController(props) {
|
|
|
7618
7629
|
};
|
|
7619
7630
|
return {
|
|
7620
7631
|
products: products,
|
|
7632
|
+
setProducts: setProducts,
|
|
7621
7633
|
loading: loading,
|
|
7622
7634
|
page: page,
|
|
7623
7635
|
getProductListSearch: getProductListSearch
|
|
@@ -8897,7 +8909,9 @@ var BookingForm = function BookingForm(props) {
|
|
|
8897
8909
|
_props$defaultValue = props.defaultValue,
|
|
8898
8910
|
defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
|
|
8899
8911
|
_props$className = props.className,
|
|
8900
|
-
className = _props$className === void 0 ? "" : _props$className
|
|
8912
|
+
className = _props$className === void 0 ? "" : _props$className,
|
|
8913
|
+
_props$isModalBooking = props.isModalBooking,
|
|
8914
|
+
isModalBooking = _props$isModalBooking === void 0 ? false : _props$isModalBooking;
|
|
8901
8915
|
var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
|
|
8902
8916
|
_shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
|
|
8903
8917
|
background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
|
|
@@ -8924,9 +8938,9 @@ var BookingForm = function BookingForm(props) {
|
|
|
8924
8938
|
var _useState7 = useState(false),
|
|
8925
8939
|
isOpenPopup = _useState7[0],
|
|
8926
8940
|
setIsOpenPopup = _useState7[1];
|
|
8927
|
-
var _useState8 = useState(
|
|
8928
|
-
|
|
8929
|
-
|
|
8941
|
+
var _useState8 = useState(false),
|
|
8942
|
+
isHiddenForm = _useState8[0],
|
|
8943
|
+
setIsHiddenForm = _useState8[1];
|
|
8930
8944
|
var _EmployeeController = EmployeeController(_extends({}, props)),
|
|
8931
8945
|
_EmployeeController$l = _EmployeeController.listEmployment,
|
|
8932
8946
|
listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
|
|
@@ -9053,11 +9067,14 @@ var BookingForm = function BookingForm(props) {
|
|
|
9053
9067
|
return Promise.resolve(createSchedule(customerName, customerPhone, scheduleDate, services, shopId)).then(function (response) {
|
|
9054
9068
|
var _response$data, _response$data$status;
|
|
9055
9069
|
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
|
-
|
|
9070
|
+
var _inputPhoneNumberRef$3, _inputNameRef$current3, _inputDateRef$current4;
|
|
9071
|
+
if (isModalBooking) {
|
|
9072
|
+
setIsHiddenForm(true);
|
|
9073
|
+
}
|
|
9058
9074
|
setIsOpenPopup(true);
|
|
9059
9075
|
inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$3 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$3 === void 0 ? void 0 : _inputPhoneNumberRef$3.setValue("");
|
|
9060
9076
|
inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current3 = inputNameRef.current) === null || _inputNameRef$current3 === void 0 ? void 0 : _inputNameRef$current3.setValue("");
|
|
9077
|
+
inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current4 = inputDateRef.current) === null || _inputDateRef$current4 === void 0 ? void 0 : _inputDateRef$current4.setValue(new Date());
|
|
9061
9078
|
setListProductSelected([]);
|
|
9062
9079
|
}
|
|
9063
9080
|
});
|
|
@@ -9070,7 +9087,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9070
9087
|
};
|
|
9071
9088
|
var handleClosePopup = function handleClosePopup() {
|
|
9072
9089
|
setIsOpenPopup(false);
|
|
9073
|
-
|
|
9090
|
+
setIsHiddenForm(false);
|
|
9074
9091
|
};
|
|
9075
9092
|
var handleSearchProducts = function handleSearchProducts(value) {
|
|
9076
9093
|
setProductsParams(function (prev) {
|
|
@@ -9079,7 +9096,7 @@ var BookingForm = function BookingForm(props) {
|
|
|
9079
9096
|
});
|
|
9080
9097
|
});
|
|
9081
9098
|
};
|
|
9082
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9099
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isHiddenForm ? /*#__PURE__*/React__default.createElement("div", {
|
|
9083
9100
|
className: "grid gap-4 rounded-2xl p-6 border " + className,
|
|
9084
9101
|
style: {
|
|
9085
9102
|
backgroundColor: background
|
|
@@ -9211,32 +9228,23 @@ var BookingForm = function BookingForm(props) {
|
|
|
9211
9228
|
label: "Đặt lịch ngay",
|
|
9212
9229
|
shopConfigStyle: shopConfigStyle,
|
|
9213
9230
|
onClick: handleSubmit
|
|
9214
|
-
})), isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9231
|
+
}))) : null, isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
|
|
9215
9232
|
onCloseFormBooking: onCloseFormBooking,
|
|
9216
9233
|
onClose: handleClosePopup
|
|
9217
9234
|
}, /*#__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
|
|
9235
|
+
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
9236
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9220
|
-
className: "
|
|
9237
|
+
className: "flex items-center justify-center"
|
|
9221
9238
|
}, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
|
|
9222
9239
|
className: "h-full text-green-500",
|
|
9223
9240
|
style: {
|
|
9224
|
-
fontSize: "
|
|
9241
|
+
fontSize: "56px"
|
|
9225
9242
|
}
|
|
9226
9243
|
})), /*#__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
|
-
})))));
|
|
9244
|
+
className: "font-medium text-2xl"
|
|
9245
|
+
}, "\u0110\u1EB7t l\u1ECBch th\xE0nh c\xF4ng"), /*#__PURE__*/React__default.createElement("div", {
|
|
9246
|
+
className: "text-center"
|
|
9247
|
+
}, "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
9248
|
};
|
|
9241
9249
|
|
|
9242
9250
|
var TreatmentsList7 = function TreatmentsList7(props) {
|
|
@@ -9361,7 +9369,8 @@ var TreatmentsList7 = function TreatmentsList7(props) {
|
|
|
9361
9369
|
onCloseFormBooking: handleCloseModal,
|
|
9362
9370
|
defaultValue: dataBooking,
|
|
9363
9371
|
shopConfig: shopConfig,
|
|
9364
|
-
shopConfigStyle: shopConfigStyle
|
|
9372
|
+
shopConfigStyle: shopConfigStyle,
|
|
9373
|
+
isModalBooking: isOpenModal
|
|
9365
9374
|
})) : null);
|
|
9366
9375
|
};
|
|
9367
9376
|
|
|
@@ -10225,8 +10234,27 @@ var Products10 = function Products10(props) {
|
|
|
10225
10234
|
})) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
|
|
10226
10235
|
};
|
|
10227
10236
|
|
|
10237
|
+
var listFilter = [{
|
|
10238
|
+
label: "Khuyến mãi",
|
|
10239
|
+
value: "discount",
|
|
10240
|
+
filter: {
|
|
10241
|
+
isDiscount: true
|
|
10242
|
+
}
|
|
10243
|
+
}, {
|
|
10244
|
+
label: "Nổi bật",
|
|
10245
|
+
value: "isHighlight",
|
|
10246
|
+
filter: {
|
|
10247
|
+
isHighlight: true
|
|
10248
|
+
}
|
|
10249
|
+
}, {
|
|
10250
|
+
label: "Giá thấp đến cao",
|
|
10251
|
+
value: "sortPriceDESC",
|
|
10252
|
+
filter: {
|
|
10253
|
+
isHighlight: true
|
|
10254
|
+
}
|
|
10255
|
+
}];
|
|
10228
10256
|
var Products11 = function Products11(props) {
|
|
10229
|
-
var
|
|
10257
|
+
var _productsFilter$slice;
|
|
10230
10258
|
var _props$shopConfigStyl = props.shopConfigStyle,
|
|
10231
10259
|
shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
|
|
10232
10260
|
_props$Link = props.Link,
|
|
@@ -10248,6 +10276,9 @@ var Products11 = function Products11(props) {
|
|
|
10248
10276
|
var _useState3 = useState({}),
|
|
10249
10277
|
categorySelected = _useState3[0],
|
|
10250
10278
|
setCategorySelected = _useState3[1];
|
|
10279
|
+
var _useState4 = useState([]),
|
|
10280
|
+
productsFilter = _useState4[0],
|
|
10281
|
+
setProductsFilter = _useState4[1];
|
|
10251
10282
|
var _CategoryController = CategoryController(_extends({}, props, {
|
|
10252
10283
|
params: params
|
|
10253
10284
|
})),
|
|
@@ -10281,36 +10312,66 @@ var Products11 = function Products11(props) {
|
|
|
10281
10312
|
useEffect(function () {
|
|
10282
10313
|
if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0 && params !== null && params !== void 0 && params.categoryId) {
|
|
10283
10314
|
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;
|
|
10315
|
+
return (item === null || item === void 0 ? void 0 : item.categoryId) == (params === null || params === void 0 ? void 0 : params.categoryId);
|
|
10285
10316
|
});
|
|
10286
10317
|
setCategorySelected(category);
|
|
10287
10318
|
}
|
|
10288
|
-
}, [
|
|
10289
|
-
|
|
10319
|
+
}, [categories]);
|
|
10320
|
+
useEffect(function () {
|
|
10321
|
+
if ((products === null || products === void 0 ? void 0 : products.length) > 0) {
|
|
10322
|
+
setProductsFilter(products);
|
|
10323
|
+
}
|
|
10324
|
+
}, [products]);
|
|
10325
|
+
var handleFilter = function handleFilter(item) {
|
|
10326
|
+
if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
|
|
10327
|
+
var productsCopy = [].concat(products);
|
|
10328
|
+
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
|
|
10329
|
+
var _b$productInfo, _a$productInfo;
|
|
10330
|
+
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);
|
|
10331
|
+
});
|
|
10332
|
+
setProductsFilter(productsCopy);
|
|
10333
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
|
|
10334
|
+
var _productsCopy = [].concat(products);
|
|
10335
|
+
_productsCopy === null || _productsCopy === void 0 ? void 0 : _productsCopy.filter(function (product) {
|
|
10336
|
+
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);
|
|
10337
|
+
});
|
|
10338
|
+
setProductsFilter(_productsCopy);
|
|
10339
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
|
|
10340
|
+
var _productsCopy3;
|
|
10341
|
+
var _productsCopy2 = [].concat(products);
|
|
10342
|
+
_productsCopy2 = (_productsCopy3 = _productsCopy2) === null || _productsCopy3 === void 0 ? void 0 : _productsCopy3.filter(function (product) {
|
|
10343
|
+
return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
|
|
10344
|
+
});
|
|
10345
|
+
setProductsFilter(_productsCopy2);
|
|
10346
|
+
} else {
|
|
10347
|
+
setProductsFilter(products);
|
|
10348
|
+
}
|
|
10349
|
+
};
|
|
10290
10350
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10291
10351
|
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
|
|
10292
10352
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10293
10353
|
className: "md:sticky top-20 self-start"
|
|
10294
10354
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10295
|
-
className: "rounded-3xl bg-bgSecondary p-4"
|
|
10355
|
+
className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
|
|
10296
10356
|
}, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
|
|
10297
|
-
return /*#__PURE__*/React__default.createElement(
|
|
10298
|
-
|
|
10299
|
-
Link: Link
|
|
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" : ""),
|
|
10357
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
10358
|
+
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" : ""),
|
|
10302
10359
|
onClick: function onClick() {
|
|
10303
10360
|
handleChooseCategory(item);
|
|
10304
10361
|
},
|
|
10305
10362
|
key: "sdjfdh-" + index
|
|
10306
|
-
}, item === null || item === void 0 ? void 0 : item.cateName)
|
|
10363
|
+
}, item === null || item === void 0 ? void 0 : item.cateName);
|
|
10307
10364
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
10308
10365
|
className: "md:col-span-3 flex flex-col gap-8"
|
|
10309
|
-
},
|
|
10310
|
-
|
|
10311
|
-
|
|
10366
|
+
}, /*#__PURE__*/React__default.createElement(CarouselItem, {
|
|
10367
|
+
data: listFilter,
|
|
10368
|
+
isNavigateButton: false,
|
|
10369
|
+
onClick: handleFilter
|
|
10370
|
+
}), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
|
|
10371
|
+
className: "w-full h-96 mb-1 flex justify-center items-center"
|
|
10372
|
+
}, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
10312
10373
|
className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
|
|
10313
|
-
}, (
|
|
10374
|
+
}, (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
10375
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
10315
10376
|
href: getLinkProductDetail(product === null || product === void 0 ? void 0 : product.productInfo),
|
|
10316
10377
|
Link: Link,
|
|
@@ -10323,7 +10384,7 @@ var Products11 = function Products11(props) {
|
|
|
10323
10384
|
}));
|
|
10324
10385
|
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
10325
10386
|
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", {
|
|
10387
|
+
}, /*#__PURE__*/React__default.createElement(NotFoundProduct, null)))), /*#__PURE__*/React__default.createElement("div", {
|
|
10327
10388
|
className: "w-full m-auto"
|
|
10328
10389
|
}, (page === null || page === void 0 ? void 0 : page.total_pages) > 1 ? /*#__PURE__*/React__default.createElement(Pagination, {
|
|
10329
10390
|
total_pages: page === null || page === void 0 ? void 0 : page.total_pages,
|
|
@@ -10439,8 +10500,21 @@ var ProductSale2 = function ProductSale2(props) {
|
|
|
10439
10500
|
})) : null;
|
|
10440
10501
|
};
|
|
10441
10502
|
|
|
10503
|
+
var listFilter$1 = [{
|
|
10504
|
+
label: "Khuyến mãi",
|
|
10505
|
+
value: "discount",
|
|
10506
|
+
filter: {
|
|
10507
|
+
isDiscount: true
|
|
10508
|
+
}
|
|
10509
|
+
}, {
|
|
10510
|
+
label: "Nổi bật",
|
|
10511
|
+
value: "isHighlight",
|
|
10512
|
+
filter: {
|
|
10513
|
+
isHighlight: true
|
|
10514
|
+
}
|
|
10515
|
+
}];
|
|
10442
10516
|
var ProductSearch1 = function ProductSearch1(props) {
|
|
10443
|
-
var _window, _window$location;
|
|
10517
|
+
var _window, _window$location, _productsFilter$slice;
|
|
10444
10518
|
var _props$Link = props.Link,
|
|
10445
10519
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
10446
10520
|
_props$SectionTitle = props.SectionTitle,
|
|
@@ -10450,12 +10524,12 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10450
10524
|
shopConfigStyle = props.shopConfigStyle;
|
|
10451
10525
|
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
10526
|
var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('tu-khoa');
|
|
10453
|
-
var _useState = useState(
|
|
10454
|
-
|
|
10455
|
-
|
|
10527
|
+
var _useState = useState([]),
|
|
10528
|
+
productsFilter = _useState[0],
|
|
10529
|
+
setProductsFilter = _useState[1];
|
|
10456
10530
|
var _useState2 = useState({
|
|
10457
10531
|
productName: keywordValue,
|
|
10458
|
-
size:
|
|
10532
|
+
size: 12
|
|
10459
10533
|
}),
|
|
10460
10534
|
params = _useState2[0],
|
|
10461
10535
|
setParams = _useState2[1];
|
|
@@ -10474,36 +10548,34 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10474
10548
|
});
|
|
10475
10549
|
});
|
|
10476
10550
|
}, [keywordValue]);
|
|
10551
|
+
useEffect(function () {
|
|
10552
|
+
if ((products === null || products === void 0 ? void 0 : products.length) > 0) setProductsFilter(products);
|
|
10553
|
+
}, [products]);
|
|
10477
10554
|
var handleGetMoreProducts = function handleGetMoreProducts() {
|
|
10478
10555
|
setIsGetMore(false);
|
|
10479
|
-
|
|
10480
|
-
return prev
|
|
10556
|
+
setParams(function (prev) {
|
|
10557
|
+
return _extends({}, prev, {
|
|
10558
|
+
size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
|
|
10559
|
+
});
|
|
10481
10560
|
});
|
|
10482
10561
|
};
|
|
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
10562
|
var handleFilter = function handleFilter(item) {
|
|
10497
|
-
|
|
10498
|
-
var
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
if (key !== 'productName' && key !== 'size') {
|
|
10502
|
-
delete newParams[key];
|
|
10503
|
-
}
|
|
10563
|
+
if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
|
|
10564
|
+
var productsCopy = [].concat(products);
|
|
10565
|
+
productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.filter(function (product) {
|
|
10566
|
+
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
10567
|
});
|
|
10505
|
-
|
|
10506
|
-
})
|
|
10568
|
+
setProductsFilter(productsCopy);
|
|
10569
|
+
} else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
|
|
10570
|
+
var _productsCopy2;
|
|
10571
|
+
var _productsCopy = [].concat(products);
|
|
10572
|
+
_productsCopy = (_productsCopy2 = _productsCopy) === null || _productsCopy2 === void 0 ? void 0 : _productsCopy2.filter(function (product) {
|
|
10573
|
+
return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
|
|
10574
|
+
});
|
|
10575
|
+
setProductsFilter(_productsCopy);
|
|
10576
|
+
} else {
|
|
10577
|
+
setProductsFilter(products);
|
|
10578
|
+
}
|
|
10507
10579
|
};
|
|
10508
10580
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10509
10581
|
className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
|
|
@@ -10515,20 +10587,20 @@ var ProductSearch1 = function ProductSearch1(props) {
|
|
|
10515
10587
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
10516
10588
|
className: "text-lg"
|
|
10517
10589
|
}, "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,
|
|
10590
|
+
data: listFilter$1,
|
|
10519
10591
|
isNavigateButton: false,
|
|
10520
10592
|
onClick: handleFilter
|
|
10521
10593
|
}), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
|
|
10522
10594
|
className: "m-auto mt-20 min-h-32"
|
|
10523
|
-
}, /*#__PURE__*/React__default.createElement(Loading, null)) : (
|
|
10595
|
+
}, /*#__PURE__*/React__default.createElement(Loading, null)) : (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
10524
10596
|
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
|
-
},
|
|
10597
|
+
}, 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
10598
|
return /*#__PURE__*/React__default.createElement(ProductItem, {
|
|
10527
10599
|
Link: Link,
|
|
10528
10600
|
product: product === null || product === void 0 ? void 0 : product.productInfo,
|
|
10529
10601
|
key: "htrhr-" + idx
|
|
10530
10602
|
});
|
|
10531
|
-
})) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (
|
|
10603
|
+
})) : /*#__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
10604
|
label: "Xem thêm",
|
|
10533
10605
|
onClick: handleGetMoreProducts,
|
|
10534
10606
|
className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
|
|
@@ -11022,7 +11094,7 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
11022
11094
|
};
|
|
11023
11095
|
|
|
11024
11096
|
var ProductDetail11 = function ProductDetail11(props) {
|
|
11025
|
-
var _product$images2, _product$images3, _product$attributes, _product$attributes2;
|
|
11097
|
+
var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
|
|
11026
11098
|
var shopConfigStyle = props.shopConfigStyle,
|
|
11027
11099
|
shopConfig = props.shopConfig,
|
|
11028
11100
|
_props$handleRedirect = props.handleRedirect,
|
|
@@ -11144,7 +11216,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11144
11216
|
className: "grid grid-cols-5 gap-6"
|
|
11145
11217
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11146
11218
|
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) {
|
|
11219
|
+
}, (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
11220
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
11149
11221
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
11150
11222
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
@@ -11154,7 +11226,13 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11154
11226
|
handleDisplayImage(item);
|
|
11155
11227
|
}
|
|
11156
11228
|
});
|
|
11157
|
-
})
|
|
11229
|
+
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
11230
|
+
className: "p-2 border rounded-lg"
|
|
11231
|
+
}, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
|
|
11232
|
+
width: "100%",
|
|
11233
|
+
height: "25%",
|
|
11234
|
+
fill: "#D9D9D9"
|
|
11235
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11158
11236
|
className: "flex flex-col gap-4 col-span-5 lg:col-span-4 p-4 border border-stroke rounded-2xl"
|
|
11159
11237
|
}, displayImage ? /*#__PURE__*/React__default.createElement("img", {
|
|
11160
11238
|
src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
|
|
@@ -11170,7 +11248,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11170
11248
|
fill: "#D9D9D9"
|
|
11171
11249
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11172
11250
|
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$
|
|
11251
|
+
}, (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
11252
|
return /*#__PURE__*/React__default.createElement("img", {
|
|
11175
11253
|
src: item === null || item === void 0 ? void 0 : item.imageUrl,
|
|
11176
11254
|
key: item === null || item === void 0 ? void 0 : item.imageId,
|
|
@@ -11180,7 +11258,7 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11180
11258
|
handleDisplayImage(item);
|
|
11181
11259
|
}
|
|
11182
11260
|
});
|
|
11183
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
11261
|
+
}) : null)), /*#__PURE__*/React__default.createElement("div", {
|
|
11184
11262
|
className: "mt-2 md:ms-10"
|
|
11185
11263
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
11186
11264
|
className: "font-semibold text-2xl"
|
|
@@ -11265,8 +11343,8 @@ var ProductDetail11 = function ProductDetail11(props) {
|
|
|
11265
11343
|
setIsSeeMore(!isSeeMore);
|
|
11266
11344
|
}
|
|
11267
11345
|
})) : 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", {
|
|
11346
|
+
className: "text-lg text-gray3 rounded-lg p-2"
|
|
11347
|
+
}, "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
11348
|
className: "lg:col-span-2"
|
|
11271
11349
|
}, /*#__PURE__*/React__default.createElement("h2", {
|
|
11272
11350
|
className: "text-3xl mb-8 font-semibold"
|
|
@@ -11673,7 +11751,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11673
11751
|
var genShopAddress = function genShopAddress() {
|
|
11674
11752
|
try {
|
|
11675
11753
|
var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
|
|
11676
|
-
if (addressJson) {
|
|
11754
|
+
if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
|
|
11677
11755
|
setShopAddressList(addressJson);
|
|
11678
11756
|
} else {
|
|
11679
11757
|
setShopAddressList([{
|
|
@@ -11709,7 +11787,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11709
11787
|
className: " col-span-2 flex flex-col mb-10 leading-8 sm:mb-0 "
|
|
11710
11788
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
11711
11789
|
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) {
|
|
11790
|
+
}, "Th\xF4ng tin li\xEAn h\u1EC7"), Array.isArray(shopAddressList) ? shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
|
|
11713
11791
|
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
11792
|
className: "flex gap-2 items-center"
|
|
11715
11793
|
}, /*#__PURE__*/React__default.createElement(HiOutlineLocationMarker, {
|
|
@@ -11727,7 +11805,7 @@ var Footer1 = function Footer1(props) {
|
|
|
11727
11805
|
color: primary
|
|
11728
11806
|
}
|
|
11729
11807
|
}), /*#__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", {
|
|
11808
|
+
}) : null), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
11731
11809
|
className: "mb-3 font-semibold text-lg"
|
|
11732
11810
|
}, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
|
|
11733
11811
|
className: "leading-10 flex flex-col "
|
|
@@ -11813,7 +11891,7 @@ var Footer7 = function Footer7(props) {
|
|
|
11813
11891
|
var genShopAddress = function genShopAddress() {
|
|
11814
11892
|
try {
|
|
11815
11893
|
var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
|
|
11816
|
-
if (addressJson) {
|
|
11894
|
+
if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
|
|
11817
11895
|
setShopAddressList(addressJson);
|
|
11818
11896
|
} else {
|
|
11819
11897
|
setShopAddressList([{
|
|
@@ -12062,7 +12140,7 @@ var CustomerRating6 = function CustomerRating6(props) {
|
|
|
12062
12140
|
_props$SectionTitle = props.SectionTitle,
|
|
12063
12141
|
SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
|
|
12064
12142
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
12065
|
-
className: SECTION_CLASS + " !my-0 py-12 bg-
|
|
12143
|
+
className: SECTION_CLASS + " !my-0 py-12 bg-"
|
|
12066
12144
|
}, /*#__PURE__*/React__default.createElement(SectionTitle, {
|
|
12067
12145
|
data: data,
|
|
12068
12146
|
shopConfigStyle: shopConfigStyle
|
|
@@ -12072,9 +12150,9 @@ var CustomerRating6 = function CustomerRating6(props) {
|
|
|
12072
12150
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
12073
12151
|
key: index,
|
|
12074
12152
|
className: "relative bg-primary rounded-lg text-textButton px-6 py-4"
|
|
12075
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
12076
|
-
size:
|
|
12077
|
-
className: "absolute text-
|
|
12153
|
+
}, /*#__PURE__*/React__default.createElement(MdOutlineFormatQuote, {
|
|
12154
|
+
size: 43,
|
|
12155
|
+
className: "absolute text-black top-[-20px] right-8"
|
|
12078
12156
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
12079
12157
|
className: "flex items-end gap-2"
|
|
12080
12158
|
}, /*#__PURE__*/React__default.createElement("img", {
|
|
@@ -12299,7 +12377,7 @@ var Contact1 = function Contact1(props) {
|
|
|
12299
12377
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-12 mt-6"
|
|
12300
12378
|
}, /*#__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
12379
|
className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
|
|
12302
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
12380
|
+
}, /*#__PURE__*/React__default.createElement(FaPhoneAlt, {
|
|
12303
12381
|
size: 40,
|
|
12304
12382
|
className: "p-2 text-textButton bg-primary"
|
|
12305
12383
|
}), /*#__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", {
|
|
@@ -13711,6 +13789,11 @@ var NewsController = function NewsController(props) {
|
|
|
13711
13789
|
var _response$data2, _response$data2$data, _response$data3, _response$data3$data;
|
|
13712
13790
|
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
13791
|
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);
|
|
13792
|
+
var url = new URL(window.location.href);
|
|
13793
|
+
if (/^(\/(tin-tuc-theo-danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
|
|
13794
|
+
url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
|
|
13795
|
+
window.history.replaceState({}, '', url.pathname + url.search);
|
|
13796
|
+
}
|
|
13714
13797
|
}
|
|
13715
13798
|
setLoading(false);
|
|
13716
13799
|
});
|
|
@@ -13906,13 +13989,12 @@ var News1 = function News1(props) {
|
|
|
13906
13989
|
shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
|
|
13907
13990
|
_props$Link = props.Link,
|
|
13908
13991
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
13909
|
-
|
|
13910
|
-
catId = _props$catId === void 0 ? "" : _props$catId;
|
|
13992
|
+
catId = props.catId;
|
|
13911
13993
|
var _useState = useState({
|
|
13912
13994
|
page: 0,
|
|
13913
13995
|
sort: "timeUpdate,DESC",
|
|
13914
|
-
|
|
13915
|
-
|
|
13996
|
+
catId: catId,
|
|
13997
|
+
size: 10
|
|
13916
13998
|
}),
|
|
13917
13999
|
params = _useState[0],
|
|
13918
14000
|
setParams = _useState[1];
|
|
@@ -13942,11 +14024,11 @@ var News1 = function News1(props) {
|
|
|
13942
14024
|
useEffect(function () {
|
|
13943
14025
|
if ((newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.length) > 0 && params !== null && params !== void 0 && params.catId) {
|
|
13944
14026
|
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;
|
|
14027
|
+
return (item === null || item === void 0 ? void 0 : item.catId) == (params === null || params === void 0 ? void 0 : params.catId);
|
|
13946
14028
|
});
|
|
13947
14029
|
setCategorySelected(category);
|
|
13948
14030
|
}
|
|
13949
|
-
}, [
|
|
14031
|
+
}, [newsCategories]);
|
|
13950
14032
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
13951
14033
|
className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-6"
|
|
13952
14034
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -13991,18 +14073,29 @@ var News1 = function News1(props) {
|
|
|
13991
14073
|
}) : null)), /*#__PURE__*/React__default.createElement("div", {
|
|
13992
14074
|
className: "sticky top-20 self-start"
|
|
13993
14075
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
13994
|
-
className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
|
|
14076
|
+
className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center ",
|
|
14077
|
+
onClick: function onClick() {
|
|
14078
|
+
setParams({
|
|
14079
|
+
page: 0,
|
|
14080
|
+
sort: "timeUpdate,DESC",
|
|
14081
|
+
size: 10
|
|
14082
|
+
});
|
|
14083
|
+
}
|
|
13995
14084
|
}, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
|
|
13996
14085
|
className: "rounded-b-lg bg-bgSecondary"
|
|
13997
14086
|
}, 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", {
|
|
14087
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
14003
14088
|
className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
|
|
14004
|
-
key: "sdjfdh-" + index
|
|
14005
|
-
|
|
14089
|
+
key: "sdjfdh-" + index,
|
|
14090
|
+
onClick: function onClick() {
|
|
14091
|
+
setCategorySelected(item);
|
|
14092
|
+
setParams(function (prev) {
|
|
14093
|
+
return _extends({}, prev, {
|
|
14094
|
+
catId: item === null || item === void 0 ? void 0 : item.catId
|
|
14095
|
+
});
|
|
14096
|
+
});
|
|
14097
|
+
}
|
|
14098
|
+
}, item === null || item === void 0 ? void 0 : item.catName);
|
|
14006
14099
|
}))));
|
|
14007
14100
|
};
|
|
14008
14101
|
|