|
|
@@ -69,7 +69,7 @@ import {toast} from "react-toastify";
|
|
|
import {useBlocker} from "react-router";
|
|
|
import FontFaceObserver from 'fontfaceobserver';
|
|
|
import {getTurnplate} from "@features/turnplateSlice";
|
|
|
-import {LOCAL_ACTIVITY_C, LOCAL_WHEEL_INVITE_CODE} from "@constants/localkey";
|
|
|
+import {LOCAL_ACTIVITY_C, LOCAL_VISTOR_ID, LOCAL_WHEEL_INVITE_CODE} from "@constants/localkey";
|
|
|
import LoadingFull from "@components/Loading/LoadingFull";
|
|
|
import {ClickAwayListener} from "@mui/base/ClickAwayListener";
|
|
|
import useGlobalClick from "@hooks/useGlobalClick";
|
|
|
@@ -77,6 +77,7 @@ import SoundHelp from "@utils/SoundManger";
|
|
|
import {ROUTE_PATH} from "@constants/routes";
|
|
|
import {onChangeUser, onChangeUserID} from "@features/actions/mainAction";
|
|
|
import {isInAppBrowser, isShowInstallBox, openUrlUseChrome} from "@utils/UAUtils";
|
|
|
+import WInstallBox from "@widgets/WInstallBox";
|
|
|
const App = () => {
|
|
|
const dispatch = useDispatch();
|
|
|
const fetchStatus=useSelector(getFetchStatus);
|
|
|
@@ -139,6 +140,11 @@ const App = () => {
|
|
|
// else{
|
|
|
// localStorageSet(LOCAL_ACTIVITY_C,"");
|
|
|
// }
|
|
|
+ let bfp=getUrlParam("bfp");
|
|
|
+ if (bfp!=null&&bfp!==""){
|
|
|
+ localStorageSet(LOCAL_VISTOR_ID,bfp);
|
|
|
+ global.BFP=bfp;
|
|
|
+ }
|
|
|
}
|
|
|
const reProgressierInstallBanner=()=>{
|
|
|
if (window.NewProgressierInstallBanner!=null)return;
|
|
|
@@ -194,6 +200,7 @@ const App = () => {
|
|
|
const appInitData=()=>{
|
|
|
// scroll to top on route change
|
|
|
checkInviteCode();
|
|
|
+ checkOpenInstallBox();
|
|
|
loadFont();
|
|
|
//请求routes
|
|
|
startReqRoutes();
|
|
|
@@ -231,6 +238,23 @@ const App = () => {
|
|
|
const onCloseHallWheel=()=>{
|
|
|
checkOpenCheckin();
|
|
|
}
|
|
|
+ const checkOpenInstallBox=()=>{
|
|
|
+ if (global.installed===1)return;
|
|
|
+ global.installed=1;
|
|
|
+ let time=200;
|
|
|
+ // global.showBindPhone();
|
|
|
+ // time=1000;
|
|
|
+ setTimeout(async ()=>{
|
|
|
+ // if (window.progressier==null)return ;
|
|
|
+ // if (window.progressier.detection.isStandalone())return;
|
|
|
+ // window.progressier.flow.init("install",true)
|
|
|
+ if (!isShowInstallBox())return;
|
|
|
+ if (isInAppBrowser()){
|
|
|
+ openUrlUseChrome();
|
|
|
+ }
|
|
|
+ global.showInstallBox();
|
|
|
+ },time);
|
|
|
+ }
|
|
|
//app Effect
|
|
|
//初始化
|
|
|
useEffect(() => {
|
|
|
@@ -287,23 +311,23 @@ const App = () => {
|
|
|
},[serverKick])
|
|
|
//监听安装提示
|
|
|
useEffect(()=>{
|
|
|
- if (promoteInstall>0){
|
|
|
- if (global.installed===1)return;
|
|
|
- global.installed=1;
|
|
|
- let time=promoteInstall*1000;
|
|
|
- // global.showBindPhone();
|
|
|
- // time=1000;
|
|
|
- setTimeout(async ()=>{
|
|
|
- // if (window.progressier==null)return ;
|
|
|
- // if (window.progressier.detection.isStandalone())return;
|
|
|
- // window.progressier.flow.init("install",true)
|
|
|
- if (!isShowInstallBox())return;
|
|
|
- if (isInAppBrowser()){
|
|
|
- openUrlUseChrome();
|
|
|
- }
|
|
|
- global.showInstallBox();
|
|
|
- },time);
|
|
|
- }
|
|
|
+ // if (promoteInstall>0){
|
|
|
+ // if (global.installed===1)return;
|
|
|
+ // global.installed=1;
|
|
|
+ // let time=promoteInstall*1000;
|
|
|
+ // // global.showBindPhone();
|
|
|
+ // // time=1000;
|
|
|
+ // setTimeout(async ()=>{
|
|
|
+ // // if (window.progressier==null)return ;
|
|
|
+ // // if (window.progressier.detection.isStandalone())return;
|
|
|
+ // // window.progressier.flow.init("install",true)
|
|
|
+ // if (!isShowInstallBox())return;
|
|
|
+ // if (isInAppBrowser()){
|
|
|
+ // openUrlUseChrome();
|
|
|
+ // }
|
|
|
+ // global.showInstallBox();
|
|
|
+ // },time);
|
|
|
+ // }
|
|
|
},[promoteInstall])
|
|
|
//监听打开pay
|
|
|
useEffect(()=>{
|
|
|
@@ -323,6 +347,15 @@ const App = () => {
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
+ const renderPreload=()=>{
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ {
|
|
|
+ <WInstallBox/>
|
|
|
+ }
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
return (
|
|
|
<CacheProvider value={cacheRtl}>
|
|
|
@@ -337,6 +370,9 @@ const App = () => {
|
|
|
renderLayout()
|
|
|
}
|
|
|
</StyleSheetManager>
|
|
|
+ {
|
|
|
+ renderPreload()
|
|
|
+ }
|
|
|
</SidebarProvider>
|
|
|
</ThemeProvider>
|
|
|
</MuiThemeProvider>
|