year 2 mēneši atpakaļ
vecāks
revīzija
a5c388eb4c
1 mainītis faili ar 15 papildinājumiem un 15 dzēšanām
  1. 15 15
      src/app/[locale]/(TabBar)/deposit/DepositData.tsx

+ 15 - 15
src/app/[locale]/(TabBar)/deposit/DepositData.tsx

@@ -52,15 +52,15 @@ const DepositData: FC<Props> = (props) => {
     const [formInput, setFormInput] = useState<ShopProductItem | null>(null);
     const { eventInitiate } = useEventPoint();
     const isStrictMode = useSystemStore((state) => state.identity_verify.deposit === 1);
-    const [middleHeight, setMiddleHeight] = useState<{ top: number; footer: number }>({
-        top: 50,
-        footer: 80,
-    }); // 中间区域高度
+    // const [middleHeight, setMiddleHeight] = useState<{ top: number; footer: number }>({
+    //     top: 50,
+    //     footer: 80,
+    // }); // 中间区域高度
     const formInstanceRef = useRef<FormInstance>(null);
     let [amount, setAmount] = useState<number | undefined>(undefined);
 
-    const swiperBox = useRef<HTMLDivElement>(null);
-    const footerBox = useRef<HTMLDivElement>(null);
+    // const swiperBox = useRef<HTMLDivElement>(null);
+    // const footerBox = useRef<HTMLDivElement>(null);
 
     const titleChangeHandler = (data: PayChannel) => {
         setAmount(undefined);
@@ -92,14 +92,14 @@ const DepositData: FC<Props> = (props) => {
             setFormInput(null);
             setBtns([]);
         }
-        computMiddleHeight();
+        // computMiddleHeight();
     }, [shopInfo]);
 
-    const computMiddleHeight = () => {
-        const topHeight = swiperBox.current?.offsetHeight || 0;
-        const footerHeight = footerBox.current?.offsetHeight || 0;
-        setMiddleHeight({ top: topHeight, footer: footerHeight });
-    };
+    // const computMiddleHeight = () => {
+    //     const topHeight = swiperBox.current?.offsetHeight || 0;
+    //     const footerHeight = footerBox.current?.offsetHeight || 0;
+    //     setMiddleHeight({ top: topHeight, footer: footerHeight });
+    // };
 
     const getCurrentProduct = (amount: number) => {
         if (!shopInfo?.products?.length) return null;
@@ -218,7 +218,7 @@ const DepositData: FC<Props> = (props) => {
 
     return (
         <div className="deposit-box">
-            <div ref={swiperBox}>
+            <div>
                 <Swiper
                     slidesPerView={3}
                     spaceBetween={10}
@@ -244,7 +244,7 @@ const DepositData: FC<Props> = (props) => {
                 className={"custom-form"}
                 style={{
                     padding: "0 .1rem",
-                    maxHeight: `clac(100% - ${middleHeight.top}px -${middleHeight.footer}px)`,
+                    // maxHeight: `calc(100% - ${middleHeight.top}px - ${middleHeight.footer}px)`,
                     overflow: "auto",
                 }}
             >
@@ -335,7 +335,7 @@ const DepositData: FC<Props> = (props) => {
                     </div>
                 </Form>
             </Box>
-            <div style={{ padding: ".1rem" }} ref={footerBox}>
+            <div style={{ padding: ".1rem" }}>
                 {!isEmpty && (
                     <ButtonOwn
                         deposit