Bladeren bron

no message

zhejiushizhuce 2 jaren geleden
bovenliggende
commit
fb1d710db0

+ 3 - 1
src/App.js

@@ -195,7 +195,9 @@ const App = () => {
             if (pathname==="/"){
                 if(hash==null||hash===""){
                     dispatch(reqCheckinCheck((isCanCheckIn)=>{
-                        if(isCanCheckIn===1)navigate(ROUTE_PATH.CHECK_IN);
+                        if(hash==null||hash===""){
+                            if(isCanCheckIn===1)navigate(ROUTE_PATH.CHECK_IN,{replace:true});
+                        }
                     }));
                     return true;
                 }

+ 2 - 1
src/features/actions/hallClient.js

@@ -13,7 +13,8 @@ const __playground_message_types=(message,dispatch)=>{
 const handlePayFinish=(message,dispatch)=>{
     dispatch(reqGameInfo());
     dispatch(updatePayFinish(message));
-    global.showDropCoins();
+    let {data}=message;
+    if (data&&data.PayNum>=200)global.showDropCoins();
 }
 const roger=(message,dispatch)=>{
     // console.log(message);

+ 3 - 1
src/layout/BottomNav/index.jsx

@@ -20,6 +20,7 @@ import {ReactComponent as TabSett} from '@assets/tabicon/sett.svg';
 import {ROUTE_PATH} from "@constants/routes";
 import {useSelector} from "react-redux";
 import {getMailNew} from "@features/mailSlice";
+import {checkIsStandalone} from "@utils/helpers";
 const i18n=global.i18n;
 
 const BottomNav = () => {
@@ -28,6 +29,7 @@ const BottomNav = () => {
     const isStoreRoute = useStoreRoute();
     const {setCartOpen} = useShopProvider();
     const mailNew=useSelector(getMailNew);
+    const isStandalone=checkIsStandalone()
 
     // return (
     //     <div className={styles.container}>
@@ -62,7 +64,7 @@ const BottomNav = () => {
     //     </div>
     // )
     return (
-        <div className={styles.container}>
+        <div className={`${styles.container} ${isStandalone?styles.container_full:''}`}>
             <NavLink className={styles.button} to={ROUTE_PATH.PROMOTION}>
                 {/*<svg className={"icon"}>*/}
                 {/*    <use xlinkHref={`${ticon_gift}#gift`} />*/}

+ 5 - 1
src/layout/BottomNav/styles.module.scss

@@ -1,7 +1,7 @@
 .container {
     color: var(--text);
     background: var(--widget);
-    padding: 0 10px;
+    padding: 0 0.6rem;
     border-top: 2px solid var(--border);
     position: fixed;
     bottom: 0;
@@ -14,6 +14,10 @@
     justify-content: space-between;
     gap: 20px;
     pointer-events:auto;
+    &_full{
+        padding: 0rem 0.6rem 0.6rem 0.6rem;
+        height: 4.725rem;
+    }
 }
 
 .button {

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

@@ -8,7 +8,7 @@ import SubScreen from "@components/SubScreen";
 import RouteContainer from "@layout/Routes/RouteContainer";
 import {Navigate} from "react-router";
 import usePreviousRoute from "@hooks/usePreviousRoute";
-import {ROUTE_PATH} from "@constants/routes";
+import {ROUTE_PATH, ROUTE_TYPE_POP_OR_FULL} from "@constants/routes";
 import {useThemeProvider} from "@contexts/themeContext";
 import useAuthLockRoute from "@hooks/useAuthLockRoute";
 const RouteWrapper = lazy(() => import('@layout/Routes/RouteWrapper'));
@@ -69,6 +69,7 @@ const CHashRouter=(props)=>{
     hashs.shift();
     let currpath=pathname+hash;
     let currhash="";
+    let subIndex=-1;
     // const timeout=500;
     //多hash 切到最后一个
     const getRoutes=(path)=>{
@@ -111,9 +112,10 @@ const CHashRouter=(props)=>{
                         // return (<Navigate to={pathname+currhash} replace={true}/>)
                     }
                     currhash+=hash;
+                    if (route.type===ROUTE_TYPE_POP_OR_FULL)subIndex++;
                     return (
                         // <CSSTransition timeout={timeout}>
-                            <RouteContainer level={index} route={route} onClose={handleClose} header={Header[route.component]}>
+                            <RouteContainer level={subIndex} route={route} onClose={handleClose} header={Header[route.component]}>
                                 <Suspense fallback={<SmallLoading/>}>
                                     <Routes key={index} location={{pathname:currpath,hash:hash,search}}>
                                         {

+ 28 - 0
src/utils/helpers.js

@@ -388,3 +388,31 @@ export const formatLongChips=(value,isfixed=false)=>{
     }
     return addsign+result+dotstr;
 }
+
+export const isAndroid = () =>{
+    try {
+        var e = /Android/.test(window.navigator.userAgent);
+        return e
+    } catch (t) {
+        return false
+    }
+}
+export const isIOS = () =>{
+    try {
+        var e = ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"];
+        var t = e.includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend"in document;
+        return t
+    } catch (i) {
+        return false
+    }
+}
+export const checkIsStandalone = () =>{
+    // return true;
+    try {
+        if (window.location.href.includes("launchedfrom=homescreen") || window.sessionStorage.getItem("launched-from-homescreen")) {
+            window.sessionStorage.setItem("launched-from-homescreen", true);
+            return true
+        }
+    } catch (e) {}
+    return navigator.standalone || window.matchMedia("(display-mode: standalone)").matches || window.matchMedia("(display-mode: fullscreen)").matches && (isAndroid() || isIOS()) || window.matchMedia("(display-mode: minimal-ui)").matches || window.matchMedia("(display-mode: window-controls-overlay)").matches
+}