zhejiushizhuce 2 жил өмнө
parent
commit
f91265f34f

+ 2 - 4
src/layout/Routes/RouteContainer.jsx

@@ -18,10 +18,8 @@ const RouteContainer=(props)=>{
     }
     const renderPop=()=>{
         return(
-            <Popup {...props}>
-                <div className="pop_content">
-                    {children}
-                </div>
+            <Popup {...props} popupClass={"popup-big"}>
+                {children}
             </Popup>
         )
     }

+ 2 - 2
src/layout/Routes/RouteWrapper.jsx

@@ -52,9 +52,9 @@ const RouteWrapper = (props) => {
         //     </Popup>
         // )
         return (
-            <div className="pop_content">
+            <>
                 {comp}
-            </div>
+            </>
         )
     }
     const renderSub=()=>{

+ 10 - 2
src/styles/_elements.scss

@@ -491,13 +491,21 @@ a {
 
     &_close {
         position: absolute;
-        top: 20px;
-        right: 20px;
+        top: 1rem;
+        right: 1rem;
+        z-index: 2;
         i{
             font-size: 1.4rem;
             color: var(--header);
         }
     }
+    &-big{
+        max-width: 40vw;
+        max-height: 90vh;
+        min-width: 40rem;
+        padding: 2rem 0.5rem 0.5rem 0.5rem;
+        overflow-y: auto;
+    }
 }
 
 .text-button {

+ 48 - 3
src/widgets/WCashWheel/WHallWheel/WHallWheel.jsx

@@ -6,9 +6,40 @@ import Modal from "@mui/material/Modal";
 import styles from "./styles.module.scss";
 import WShare from "@widgets/WCashWheel/WShare/WShare";
 import React, {useState} from "react";
+import WRetainPop from "@widgets/WCashWheel/WRetainPop/WRetainPop";
+import {localStorageGet, localStorageSet} from "@utils/helpers";
+import {LOCAL_WHEEL_RETAIN} from "@constants/localkey";
+import {useSelector} from "react-redux";
+import {isLogined} from "@features/mainSlice";
+import {getTurnplate} from "@features/turnplateSlice";
 
 const WHallWheel=({open,onClose})=>{
     const [openShare,setOpenShare]=useState(false);
+    const [openRetain,setOpenRetain]=useState(false);
+    const isLogin=useSelector(isLogined);
+    const turnplate=useSelector(getTurnplate);
+    const onCheckClose=()=>{
+        let isclose=true;
+        if (isLogin){
+            if (turnplate!=null){
+                let collect_amount=turnplate.collect_amount;
+                let total_amount=turnplate.total_amount;
+                if (collect_amount>0&&collect_amount<total_amount){
+                    let lsttime=localStorageGet(LOCAL_WHEEL_RETAIN,"0");
+                    lsttime=Number(lsttime);
+                    let now=Date.now();
+                    let dis=now-lsttime;
+                    if (dis>86400000){
+                        setOpenRetain(true);
+                        isclose=false;
+                    }
+                }
+            }
+        }
+        if (isclose){
+            if (onClose)onClose();
+        }
+    }
     const renderShare=()=>{
         return (
             <WShare open={openShare} onClose={()=>{
@@ -16,18 +47,31 @@ const WHallWheel=({open,onClose})=>{
             }}></WShare>
         )
     }
+    const renderRetainPop=()=>{
+        return (
+            <WRetainPop open={openRetain} onClose={()=>{
+                setOpenRetain(false);
+            }} openShare={openShareBox} closeP={()=>{
+                localStorageSet(LOCAL_WHEEL_RETAIN,Date.now())
+                if (onClose)onClose();
+            }}></WRetainPop>
+        )
+    }
     const openShareBox=()=>{
         setOpenShare(true);
     }
     return (
         <>
-            <Modal open={open} onClose={onClose} closeAfterTransition>
+            <Modal open={open} onClose={onCheckClose} closeAfterTransition>
                 <Fade in={open} timeout={500}>
                     <div className={styles.container}>
-                        <ClickAwayListener onClickAway={onClose}>
+                        {/*<ClickAwayListener onClickAway={onCheckClose}>*/}
+                        <ClickAwayListener onClickAway={()=>{
+                            onCheckClose()
+                        }}>
                             <Grow in={open} timeout={500}>
                                 <div className={styles.content}>
-                                    <button className={styles.close} onClick={onClose} aria-label="Close popup">
+                                    <button className={styles.close} onClick={onCheckClose} aria-label="Close popup">
                                         <i className="icon-xmark"/>
                                     </button>
                                     <WWheel showShare={false} openShare={openShareBox} onClose={onClose}></WWheel>
@@ -38,6 +82,7 @@ const WHallWheel=({open,onClose})=>{
                 </Fade>
             </Modal>
             {renderShare()}
+            {renderRetainPop()}
         </>
     )
 

+ 4 - 0
src/widgets/WCashWheel/WHallWheel/styles.module.scss

@@ -1,3 +1,4 @@
+@import "../../../styles/vars";
 .container{
   width: 100%;
   height: 100%;
@@ -25,4 +26,7 @@
       color: var(--header);
     }
   }
+  @media screen and (min-width: $width-desktop-small-min) {
+    max-width: 38rem;
+  }
 }