소스 검색

Merge branch 'zzf-link' into dev

zhangzf 14 시간 전
부모
커밋
283146c259

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

@@ -47,7 +47,7 @@ const HomeBestSellers = ({ bestSellers }: HomeBestSellersProps) => {
             <div className="grid grid-cols-2 gap-4">
               {block.map((product) => (
                 <div key={product.id}  className="flex 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}
@@ -58,7 +58,7 @@ const HomeBestSellers = ({ bestSellers }: HomeBestSellersProps) => {
                   />
                   </Link>
                   {/* 产品标题 */}
-                  <Link href={`/${product.urlKey}.html`} className="text-sm text-gray-800 truncate">
+                  <Link href={`/products/${product.urlKey}_${product.id}.html`} className="text-sm text-gray-800 truncate">
                     {product.name}
                   </Link>
                   {/* 评分 + 评论数 */}

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

@@ -46,7 +46,7 @@ const HomeNewArrival = ({ newArrival }: NewArrivalProps) => {
               {block.map((product) => (
                 <div key={product.id} className="flex 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}
@@ -56,7 +56,7 @@ const HomeNewArrival = ({ newArrival }: NewArrivalProps) => {
                     />
                   </Link>
                   {/* 产品标题 */}
-                   <Link href={`/${product.urlKey}.html`} className="text-sm text-gray-800 truncate">
+                   <Link href={`/products/${product.urlKey}_${product.id}.html`} className="text-sm text-gray-800 truncate">
                     {product.name}
                   </Link>
                   {/* 评分 + 评论数 */}

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

@@ -68,7 +68,7 @@ const MiddleImageSwiper = ({ zeroWear,zeroWearImage }: zeroWearProps) => {
             {productList.map((item) => (
               <SwiperSlide key={item.id}>
                 <div className="bg-white rounded overflow-hidden  flex flex-col">
-                  <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}
@@ -78,7 +78,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

@@ -128,7 +128,7 @@ export default function RecommendedProducts({ recommended }: recommendedProps) {
         {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}
@@ -139,7 +139,7 @@ export default function RecommendedProducts({ recommended }: recommendedProps) {
             </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

@@ -139,7 +139,7 @@ const Trending = ({ trending }: trendingProps) => {
                 {/* 单个商品卡片 */}
                 <div className=" overflow-hidden  flex flex-col">
                   {/* 图片区域 + 中间播放按钮 */}
-                  <Link  href={`/${item.urlKey}.html`} className="relative  w-full aspect-[4/5] overflow-hidden rounded-xl block">
+                  <Link  href={`/products/${item.urlKey}_${item.id}.html`} className="relative  w-full aspect-[4/5] overflow-hidden rounded-xl block">
                    <Image
                        src={item.image_url}
                        alt={item.name}
@@ -168,7 +168,7 @@ const Trending = ({ trending }: trendingProps) => {
 
                   {/* 底部文字价格区域 */}
                   <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>
                         {/* 评分 + 评论数 */}