Browse Source

feat: 修改

year 10 hours ago
parent
commit
10ded9e511

+ 1 - 1
src/app/[locale]/(navbar)/vip/List.tsx

@@ -19,7 +19,7 @@ const List: React.FC<Props> = ({ data, level = 0 }) => {
                 key: "upgrade",
                 text: "Upgrade",
                 render(itemData: LevelInfoItem) {
-                    return itemData.reward[0].amount;
+                    return itemData?.reward[0]?.amount || 0;
                 },
             },
             {

+ 4 - 1
src/app/[locale]/(navbar)/vip/VipCard.tsx

@@ -4,9 +4,10 @@ import { formatAmount } from "@/utils";
 import { ProgressBar } from "antd-mobile";
 import clsx from "clsx";
 import React from "react";
+import "swiper/css/effect-fade";
+import { EffectFade } from "swiper/modules";
 import { Swiper, SwiperSlide } from "swiper/react";
 import styles from "./page.module.scss";
-
 interface Props {
     actKey: number;
     onChange?: (key: number) => void;
@@ -73,6 +74,8 @@ const VipCard: React.FC<Props> = ({ actKey = 0, onChange, vipInfo }) => {
                 allowTouchMove={false}
                 className="rounded-[.1rem]"
                 onSlideChange={swiperChange}
+                modules={[EffectFade]}
+                effect="fade"
             >
                 {!!vipInfo?.level_info?.length &&
                     vipInfo.level_info.map((item) => {

+ 0 - 3
src/app/[locale]/(navbar)/vip/page.module.scss

@@ -132,9 +132,6 @@
     box-sizing: border-box;
     padding: 0.15rem 0.25rem 0.2rem 0.25rem;
     position: relative;
-    :global(.swiper-wrapper) {
-        transition-duration: 0ms !important;
-    }
 }
 
 .vipCard {

+ 7 - 5
src/app/[locale]/(navbar)/vip/page.tsx

@@ -209,7 +209,7 @@ const Page = () => {
                                 (curReward.current?.cur_pay || 0) >=
                                 (curReward.current?.double_pay || 0)
                             }
-                            className="!min-w-[120px] !px-[12px] !py-[6px] !text-[12px]"
+                            className="mt-[.1rem] !min-w-[120px] !px-[12px] !py-[6px] !text-[12px]"
                         >
                             check in
                         </CustomButton>
@@ -238,7 +238,7 @@ const Page = () => {
                             })}
                         <CustomButton
                             onClick={() => multClick({ ...contentProps })}
-                            className="!min-w-[120px] !px-[12px] !py-[6px] !text-[12px]"
+                            className="mt-[.1rem] !min-w-[120px] !px-[12px] !py-[6px] !text-[12px]"
                         >
                             {(curReward.current?.cur_pay || 0) >=
                             (curReward.current?.double_pay || 0)
@@ -325,9 +325,11 @@ const Page = () => {
                     />
                 );
             }
-            if (Date.now() > data.end_time * 1000) {
-                text = "Expired";
-                status = "disable2";
+        }
+        if ([5, 6].includes(data.type)) {
+            const res = data.reward.find((item) => item.amount > 0);
+            if (!res) {
+                text = "Upgrade VIP";
             }
         }
         return (

+ 1 - 1
src/components/VipProgress/index.tsx

@@ -10,7 +10,7 @@ import { Swiper, SwiperClass, SwiperSlide } from "swiper/react";
 import styles from "./index.module.scss";
 
 interface Props {
-    actKey: number;
+    actKey?: number;
     onChange?: (key: number) => void;
 }