zhangzf 1 روز پیش
والد
کامیت
5ac0421306

+ 2 - 2
src/app/(public)/_components/HomeBestSellers.tsx

@@ -27,7 +27,7 @@ const HomeBestSellers = ({ bestSellerSection }: jinGangSectionProps) => {
       <div className="grid grid-cols-4 gap-8">
         {bestSellers.map((product) => (
           <div key={product.id} className="flex min-w-0 flex-col gap-2">
-            <Link  href={`/${product.urlKey}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
+            <Link  href={`/products/${product.urlKey}_${product.id}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
               <Image
                 src={product.image_url}
                 alt={product.name}
@@ -38,7 +38,7 @@ const HomeBestSellers = ({ bestSellerSection }: jinGangSectionProps) => {
             </Link>
 
             <Link
-              href={`/${product.urlKey}.html`}
+              href={`/products/${product.urlKey}_${product.id}.html`}
               className="truncate text-sm leading-ly-22 font-normal text-gray-800"
             >
               {product.name}

+ 2 - 2
src/app/(public)/_components/HomeNewArrival.tsx

@@ -23,7 +23,7 @@ const HomeNewArrival = ({ newArrivalSection }: newArrivalSectionProps) => {
       <div className="grid grid-cols-4 gap-8">
         {newArrival.map((product) => (
           <div key={product.id} className="flex min-w-0 flex-col gap-2">
-             <Link  href={`/${product.urlKey}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
+             <Link  href={`/products/${product.urlKey}_${product.id}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
               <Image
                 src={product.image_url}
                 alt={product.name}
@@ -34,7 +34,7 @@ const HomeNewArrival = ({ newArrivalSection }: newArrivalSectionProps) => {
             </Link>
 
             <Link
-              href={`/${product.urlKey}.html`}
+              href={`/products/${product.urlKey}_${product.id}.html`}
               className="truncate text-sm leading-ly-22 font-normal text-gray-800"
             >
               {product.name}

+ 2 - 2
src/app/(public)/_components/MiddleImageSwiper.tsx

@@ -182,7 +182,7 @@ const MiddleImageSwiper = ({ zeroWear,zeroWearImage }: zeroWearProps) => {
                     alt={item.name}
                     className="w-full aspect-[3/4] object-cover"
                   /> */}
-                  <Link  href={`/${item.urlKey}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
+                  <Link  href={`/products/${item.urlKey}_${item.id}.html`} className="relative aspect-[3/4] w-full overflow-hidden rounded-sm block">
                     <Image
                       src={item.image_url}
                       alt={item.name}
@@ -191,7 +191,7 @@ const MiddleImageSwiper = ({ zeroWear,zeroWearImage }: zeroWearProps) => {
                     />
                   </Link>
                   <div className="p-2 flex flex-col gap-2">
-                    <Link   href={`/${item.urlKey}.html`} className="text-sm text-gray-800 truncate">
+                    <Link   href={`/products/${item.urlKey}_${item.id}.html`} className="text-sm text-gray-800 truncate">
                       {item.name}
                     </Link>
                     {/* 价格 + 购物车图标 */}

+ 2 - 2
src/app/(public)/_components/RecommendedProducts.tsx

@@ -131,7 +131,7 @@ export default function RecommendedProducts({ recommendedSection }: newArrivalSe
         {productList.map((item) => (
           <div key={item.id} className="flex flex-col gap-3">
             {/* Next.Image 商品图容器 */}
-            <Link  href={`/${item.urlKey}.html`} className="relative w-full aspect-[3/4] overflow-hidden rounded-md block">
+            <Link  href={`/products/${item.urlKey}_${item.id}.html`} className="relative w-full aspect-[3/4] overflow-hidden rounded-md block">
               <Image
                 src={item.image_url}
                 alt={item.name}
@@ -142,7 +142,7 @@ export default function RecommendedProducts({ recommendedSection }: newArrivalSe
             </Link>
 
             {/* 标题 */}
-            <Link   href={`/${item.urlKey}.html`} className="text-sm text-gray-800 truncate">
+            <Link   href={`/products/${item.urlKey}_${item.id}.html`} className="text-sm text-gray-800 truncate">
               {item.name}
             </Link>
 

+ 2 - 2
src/app/(public)/_components/Trending.tsx

@@ -134,7 +134,7 @@ const Trending = ({ trendingSection }: newArrivalSectionProps) => {
             <SwiperSlide key={`${item.id}-${index}`}>
               <div className=" overflow-hidden  flex flex-col">
                 {/* 图片区域 + 中间播放按钮 */}
-                <Link href={`/${item.urlKey}.html`} className="relative rounded-xl w-full aspect-[4/5] overflow-hidden rounded-xl block">
+                <Link href={`/products/${item.urlKey}_${item.id}.html`} className="relative rounded-xl w-full aspect-[4/5] overflow-hidden rounded-xl block">
                   <Image
                       src={item.image_url}
                       alt={item.name}
@@ -165,7 +165,7 @@ const Trending = ({ trendingSection }: newArrivalSectionProps) => {
 
                 {/* 底部文字价格区域 */}
                 <div className="p-3 flex flex-col rounded-xl mt-3 bg-[#f0f8f5] gap-3">
-                  <Link   href={`/${item.urlKey}.html`} className="text-sm text-gray-800 truncate">
+                  <Link   href={`/products/${item.urlKey}_${item.id}.html`} className="text-sm text-gray-800 truncate">
                     {item.name}
                   </Link>
                   {/* 价格 + 购物车图标 */}

+ 2 - 2
src/components/catalog/product/NewProductGridItems.tsx

@@ -19,7 +19,7 @@ export default function NewProductGridItems({
     return (
             <Grid.Item key={product.id} className="flex flex-col ">
                         {/* 产品图片 */}
-                        <Link href={`/${product.urlKey}.html`} className="block relative">
+                        <Link href={`/products/${product.urlKey}_${product._id}.html`} className="block relative">
                         <Image
                           src={imageUrl}
                           alt={product.name}
@@ -29,7 +29,7 @@ export default function NewProductGridItems({
                           className=" bg-neutral-100 object-cover transition duration-300 ease-in-out group-hover:scale-105"
                         />
                         </Link>
-                        <Link href={`/${product.urlKey}.html`} className="text-sm text-gray-800 truncate mt-4 mb-2" aria-label={`View ${product.name}`}>
+                        <Link href={`/products/${product.urlKey}_${product._id}.html`} className="text-sm text-gray-800 truncate mt-4 mb-2" aria-label={`View ${product.name}`}>
                           {product.name}
                         </Link>
                         {/* 评分 + 评论数 */}