|
|
@@ -48,7 +48,7 @@ import {
|
|
|
getUserID,
|
|
|
getUserInfo,
|
|
|
isLogined,
|
|
|
- updateCurrGame, updateOpenPay, getIsGuest, getPopBindPhone
|
|
|
+ updateCurrGame, updateOpenPay, getIsGuest, getPopBindPhone, getPopFirst
|
|
|
} from '@features/mainSlice';
|
|
|
import {useDispatch, useSelector} from "react-redux";
|
|
|
import {REQ_STATUS} from "@api/config";
|
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
} from "@features/api";
|
|
|
import LoadingScreen from "@components/LoadingScreen";
|
|
|
import DropCoins from "@components/DropCoins";
|
|
|
-import {reqPayConfig} from "@features/paySlice";
|
|
|
+import {getFirstPayMulti, reqPayConfig} from "@features/paySlice";
|
|
|
import {connectHall, disconnectHall, hallSendState} from "@features/actions/hallClient";
|
|
|
import {toast} from "react-toastify";
|
|
|
import {useBlocker} from "react-router";
|
|
|
@@ -110,6 +110,8 @@ const App = () => {
|
|
|
const [isMaintain, setIsMaintain] = useState(false);
|
|
|
//是否唤起选择area
|
|
|
const [isSelectArea, setIsSelectArea] = useState(false);
|
|
|
+ const popFirst=useSelector(getPopFirst);
|
|
|
+ const firstPayMulti=useSelector(getFirstPayMulti);
|
|
|
const muiTheme = createTheme({
|
|
|
direction: direction,
|
|
|
});
|
|
|
@@ -225,6 +227,19 @@ const App = () => {
|
|
|
SoundHelp.loadAllAudioFile();
|
|
|
// preventTouchMove();
|
|
|
}
|
|
|
+ const checkFirstPay=()=>{
|
|
|
+ if (!popFirst)return;
|
|
|
+ if (firstPayMulti==null)return;
|
|
|
+ let key="first_open_time";
|
|
|
+ let now=Date.now();
|
|
|
+ let lst=Number(localStorageGet(key,0));
|
|
|
+ let delta=now-lst;
|
|
|
+ if (delta<86400000){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ global.showFirstPay();
|
|
|
+ localStorageSet(key,Date.now());
|
|
|
+ }
|
|
|
const checkOpenCheckin=()=>{
|
|
|
if (userID>0){
|
|
|
if (pathname==="/"){
|
|
|
@@ -234,20 +249,27 @@ const App = () => {
|
|
|
let lst=Number(localStorageGet(key,0));
|
|
|
let delta=now-lst;
|
|
|
if (delta<86400000){
|
|
|
+ checkFirstPay();
|
|
|
return false;
|
|
|
}
|
|
|
dispatch(reqCheckinCheck((isCanCheckIn)=>{
|
|
|
+ let is_check_first=true;
|
|
|
if(hash==null||hash===""){
|
|
|
if(isCanCheckIn===1){
|
|
|
navigate(ROUTE_PATH.CHECK_IN,{replace:true});
|
|
|
localStorageSet(key,Date.now());
|
|
|
+ is_check_first=false;
|
|
|
}
|
|
|
}
|
|
|
+ if (is_check_first){
|
|
|
+ checkFirstPay();
|
|
|
+ }
|
|
|
}));
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ checkFirstPay();
|
|
|
return false;
|
|
|
}
|
|
|
const onCloseHallWheel=()=>{
|