|
|
@@ -7,7 +7,7 @@ import Grid from "@/components/theme/ui/grid/Grid";
|
|
|
import HotSearch from "@/app/(public)/search/_components/HotSearch";
|
|
|
import NewProductGridItems from "@components/catalog/product/NewProductGridItems";
|
|
|
import Recommend from "@/app/(public)/product/_components/youmaylike/Recommend";
|
|
|
-import { usePathname } from "next/navigation";
|
|
|
+// import { usePathname } from "next/navigation";
|
|
|
// const ProductGridItems = dynamicImport(
|
|
|
// () => import("@/components/catalog/product/ProductGridItems"),
|
|
|
// );
|
|
|
@@ -43,13 +43,8 @@ export default function SearchPop({
|
|
|
const hasKeyword = keyword.trim().length > 0;
|
|
|
|
|
|
const hasSearchResults = hasKeyword && products.length > 0;
|
|
|
- const pathname = usePathname();
|
|
|
- useEffect(() => {
|
|
|
- // 打开状态下,路由变化就关闭弹窗
|
|
|
- if (open) {
|
|
|
- handleClose();
|
|
|
- }
|
|
|
- }, [pathname]);
|
|
|
+ // const pathname = usePathname();
|
|
|
+
|
|
|
const showYouMayLike = !hasKeyword || (hasKeyword && products.length === 0);
|
|
|
|
|
|
// =========================
|
|
|
@@ -118,7 +113,12 @@ export default function SearchPop({
|
|
|
setKeyword("");
|
|
|
onClose();
|
|
|
};
|
|
|
-
|
|
|
+ // useEffect(() => {
|
|
|
+ // // 打开状态下,路由变化就关闭弹窗
|
|
|
+ // if (open) {
|
|
|
+ // handleClose();
|
|
|
+ // }
|
|
|
+ // }, [pathname]);
|
|
|
// =========================
|
|
|
// placeholder 轮播
|
|
|
// =========================
|