fogwind преди 1 ден
родител
ревизия
7d3e701696
променени са 1 файла, в които са добавени 5 реда и са изтрити 8 реда
  1. 5 8
      src/app/(public)/customer/account/_components/AccountVipPopup.tsx

+ 5 - 8
src/app/(public)/customer/account/_components/AccountVipPopup.tsx

@@ -3,7 +3,7 @@
 // 轮播逻辑
 import { Swiper, SwiperSlide } from "swiper/react";
 import { Navigation, Scrollbar } from "swiper/modules";
-import { Swiper as SwiperType } from "swiper/types";
+import type { Swiper as SwiperType } from "swiper/types";
 import { useEffect, useState } from "react";
 import Image from "next/image";
 import "swiper/css";
@@ -121,17 +121,16 @@ export default function AccountVipPopup({
   visible: boolean;
   onClose: () => void;
 }) {
-  // swiper实例
-  const [_swiperRef, setSwiperRef] = useState<SwiperType | null>(null);
+
   // 当前slide下标
   const [activeIndex, setActiveIndex] = useState(0);
-  const [_loading, setLoading] = useState(true);
+
   const [VipGrothData, setVipGrothData] = useState<any>(null);
   // 如果不显示,直接 return null
   useEffect(() => {
     const fetchGrothValue = async () => {
       try {
-        setLoading(true);
+
         const res = await clientFetch("/api/customer/growth-value");
         if (res.success) {
           setVipGrothData(res.data);
@@ -139,8 +138,6 @@ export default function AccountVipPopup({
         }
       } catch (error) {
         console.error("获取vip成长值失败:", error);
-      } finally {
-        setLoading(false);
       }
     };
     fetchGrothValue();
@@ -261,7 +258,7 @@ export default function AccountVipPopup({
                         nextEl: ".btn-next", // 右箭头class
                         disabledClass: "opacity-20", // 滑到首尾自动加这个类,Tailwind直接用
                       }}
-                      onSwiper={(swiper) => setSwiperRef(swiper)}
+
                       onSlideChange={handleSlideChange}
                       spaceBetween={0}
                       className="swiper-container-horizontal"