Sfoglia il codice sorgente

Merge branch 'zzf-account' into dev

zhangzf 2 giorni fa
parent
commit
cc4567744d

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

@@ -10,11 +10,11 @@ export default function HomeMiddleBanner() {
 
   const [swiperRef] = useState(null);
 
-  const handleSlideChange = (swiper) => {
+  const handleSlideChange = (swiper:any) => {
     setActiveIndex(swiper.activeIndex);
   };
 
-  const handleIndicatorClick = (index) => {
+  const handleIndicatorClick = (index:any) => {
     if (swiperRef) {
       setActiveIndex(index);
     }

+ 5 - 4
src/app/(public)/_components/JinGangSwiper.tsx

@@ -1,6 +1,7 @@
 "use client";
 import { useState } from "react";
 import { Swiper, SwiperSlide } from "swiper/react";
+import type { Swiper as SwiperType } from "swiper/types";
 import { Navigation } from "swiper/modules";
 import "swiper/css";
 import "swiper/css/navigation";
@@ -65,13 +66,13 @@ const MOCK_DATA = [
 export default function JinGangSwiper() {
   const [activeIndex, setActiveIndex] = useState(0);
 
-  const [swiperRef, setSwiperRef] = useState(null);
+  const [swiperRef, setSwiperRef] = useState<SwiperType | null>(null);
 
-  const handleSlideChange = (swiper) => {
+  const handleSlideChange = (swiper:any) => {
     setActiveIndex(swiper.activeIndex);
   };
 
-  const handleIndicatorClick = (index) => {
+  const handleIndicatorClick = (index:any) => {
     if (swiperRef) {
       swiperRef.slideTo(index);
       setActiveIndex(index);
@@ -84,7 +85,7 @@ export default function JinGangSwiper() {
         modules={[Navigation]}
         spaceBetween={10}
         slidesPerView={1}
-        onSwiper={setSwiperRef}
+         onSwiper={(swiper) => setSwiperRef(swiper)}
         onSlideChange={handleSlideChange}
         className="mb-6"
       >

+ 1 - 2
src/app/(public)/customer/address/new/_components/NewAddressDefault.tsx

@@ -75,9 +75,8 @@ export default function NewAddressDefault({ countries }: { countries: any[] }) {
   const {
     register,
     handleSubmit,
-    formState: {  },
+    formState: { errors },
   } = addressForm;
-
   return (
     <div className="w-full h-full">
       <FormProvider {...addressForm}>

+ 10 - 5
src/app/(public)/customer/order/history/_components/OrderHistory.tsx

@@ -15,6 +15,7 @@ const mockOrders = [
         name: "Highlight Wigs For Women Headband Wigs with Blonde Highlights",
         specs: "10, #022, Straight, 5 Free Headbands",
         price: "88 points + $154.05x1",
+        image:"",
       },
     ],
     progress: "Preparing Order",
@@ -29,6 +30,7 @@ const mockOrders = [
         name: "Alipearl Lace Front Wig 180% Density Body Wave Human Hair Wigs Pre...",
         specs: "10+180%, Medium, No Adjustable Band",
         price: "$128.82x1",
+        image:"",
       },
     ],
     progress: "Preparing Order",
@@ -43,6 +45,7 @@ const mockOrders = [
         name: "3 Bundles Deep Wave Hair With 4*4 Lace Closure Alipearl Brazilian Hair",
         specs: "8 8 8, Free Part, 8",
         price: "$142.14x1",
+        image:"",
       },
       {
         name: "Princess Braids Wig Blonde Barbie Pre-Styled Highlight Wig 13×4 Front Wig",
@@ -55,6 +58,7 @@ const mockOrders = [
         name: "Deep Wave Wig 100 Human Hair Swiss Lace Wig Lace Front Wig",
         specs: "10, Medium, 100%",
         price: "$252.00x1",
+         image:"",
       },
       {
         name: "Braids Wig Blonde Barbie Pre-Styled Highlight Wig 13×4 Front Wig",
@@ -67,6 +71,7 @@ const mockOrders = [
         name: "random free wigs-2",
         specs: "",
         price: "$0.00x1",
+        image:"",
       },
     ],
     progress: "Preparing Order",
@@ -281,11 +286,11 @@ export default function OrderHistory() {
                     </Link>
                     <Link
                       href={`/customer/order/track/order_id/${order.id}`}
-                      state={{
-                        addressData: {
-                          /* 你的地址对象 */
-                        },
-                      }}
+                      // state={{
+                      //   addressData: {
+                      //     /* 你的地址对象 */
+                      //   },
+                      // }}
                       className="border border-gray-300 rounded-full px-4 py-1 text-sm text-gray-800 hover:bg-gray-50"
                     >
                       Track Order

+ 6 - 5
src/app/(public)/customer/order/history/page.tsx

@@ -1,10 +1,11 @@
-
-import OrderHistory from "./_components/OrderHistory"
-export default function OderIndex(){
-
+import OrderHistory from "./_components/OrderHistory";
+import { Suspense } from "react";
+export default function OderIndex() {
   return (
     <>
-     <OrderHistory />
+      <Suspense fallback={<div className="p-4">Loading order tabs...</div>}>
+        <OrderHistory />
+      </Suspense>
     </>
   );
 }

+ 1 - 0
src/app/(public)/customer/order/view/order_id/[id]/page.tsx

@@ -43,6 +43,7 @@ export default async function OrderDetail({ params }: { params: Params }) {
         name: "Human Hair Headband Wigs Curly Bob Wig Straight Hair Wigs",
         spec: "8, Straight, 5 Free Headbands.",
         price: "$114.11",
+        image:"",
         qty: 1,
       },
       // 你可以取消注释,测试多商品渲染