|
@@ -1,74 +1,174 @@
|
|
|
-import {useEffect, useState} from "react";
|
|
|
|
|
-import {isAndroid} from "@utils/helpers";
|
|
|
|
|
|
|
+import { useEffect, useState, useRef } from "react";
|
|
|
|
|
+import {checkIsStandalone, formatCash, isAndroid, stringFormat} from "@utils/helpers";
|
|
|
import MuiDrawer from "@mui/material/Drawer";
|
|
import MuiDrawer from "@mui/material/Drawer";
|
|
|
import styles from "./styles.module.scss";
|
|
import styles from "./styles.module.scss";
|
|
|
-import img_hand from "@assets/shortcut/pointer.avif"
|
|
|
|
|
|
|
+import img_hand from "@assets/shortcut/pointer.avif";
|
|
|
|
|
+import { reqGetRoutes } from "@features/api";
|
|
|
|
|
+import {useDispatch, useSelector} from "react-redux";
|
|
|
|
|
+import {getDownloadConf, updatePwaInstalled} from "@features/mainSlice";
|
|
|
|
|
+import {iosVersion, isChrome, isInPc} from "@utils/UAUtils";
|
|
|
|
|
+//新增
|
|
|
|
|
+import img_close from "@assets/shortcut/close.webp";
|
|
|
|
|
+import img_add from "@assets/shortcut/add.png";
|
|
|
|
|
+import img_share from "@assets/shortcut/share.webp";
|
|
|
|
|
+import img_screen from "@assets/shortcut/h_screen.png";
|
|
|
|
|
+import img_more from "@assets/shortcut/more.webp";
|
|
|
|
|
+import img_hand_new from "@assets/shortcut/hand.webp";
|
|
|
|
|
+//chrome
|
|
|
|
|
+import img_ch_step_1 from "@assets/shortcut/chrome/navbar.png";
|
|
|
|
|
+import img_ch_step_2 from "@assets/shortcut/chrome/addhome.png";
|
|
|
|
|
+//safari
|
|
|
|
|
+import img_sa_step_1 from "@assets/shortcut/safari/navbar.png";
|
|
|
|
|
+import img_sa_step_2 from "@assets/shortcut/safari/addhome.png";
|
|
|
|
|
+import img_sa_h_step_1 from "@assets/shortcut/safari_h/navbar.png";
|
|
|
|
|
+import img_sa_h_step_1_1 from "@assets/shortcut/safari_h/share.png";
|
|
|
|
|
+import img_sa_h_step_2 from "@assets/shortcut/safari_h/addhome.png";
|
|
|
|
|
|
|
|
-const i18n=global.i18n;
|
|
|
|
|
|
|
+const i18n = global.i18n;
|
|
|
|
|
|
|
|
-const objInfo={
|
|
|
|
|
- count:0,
|
|
|
|
|
- timer:null
|
|
|
|
|
|
|
+const objInfo = {
|
|
|
|
|
+ count: 0,
|
|
|
|
|
+ timer: null
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const IOSStepItem=({children,stepNO,divider=true,bodyClass=null})=>{
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.item_con}>
|
|
|
|
|
+ <div className={styles.item_header}>
|
|
|
|
|
+ {divider&& (<div className={styles.line}></div>)}
|
|
|
|
|
+ <div className={styles.dot}></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.item_body}>
|
|
|
|
|
+ <span className={styles.body_title}>
|
|
|
|
|
+ {stringFormat(i18n.t("installBox.shortcut.step_title"),[stepNO])}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <div className={`${styles.body_content} ${bodyClass!=null?bodyClass:""}`}>
|
|
|
|
|
+ {children}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const WShortcutGuide = () => {
|
|
const WShortcutGuide = () => {
|
|
|
const [isShow, setIsShow] = useState(false);
|
|
const [isShow, setIsShow] = useState(false);
|
|
|
- const [iconUrl, setIconUrl] = useState("");
|
|
|
|
|
- const show=()=>{
|
|
|
|
|
- setIsShow(true);
|
|
|
|
|
- }
|
|
|
|
|
- const hide=()=>{
|
|
|
|
|
|
|
+ const [iconUrl, setIconUrl] = useState(window.themeConfig?.icon || "/resources/icons/icon-192.png");
|
|
|
|
|
+
|
|
|
|
|
+ // const isStandalone = checkIsStandalone();
|
|
|
|
|
+ const dispatch = useDispatch();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // pwa:beforeinstallprompt 事件对象(异步到达,必须保存以便后面手动 prompt())
|
|
|
|
|
+ const deferredPromptRef = useRef(null);
|
|
|
|
|
+
|
|
|
|
|
+ const downConf = useSelector(getDownloadConf);
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const handler = (e) => {
|
|
|
|
|
+ e.preventDefault(); // 阻止浏览器自动弹窗
|
|
|
|
|
+ deferredPromptRef.current = e; // 立即存储
|
|
|
|
|
+ global.IsBeforeinstallprompt=1;
|
|
|
|
|
+ //未安装
|
|
|
|
|
+ dispatch(updatePwaInstalled(0));
|
|
|
|
|
+ };
|
|
|
|
|
+ window.addEventListener('beforeinstallprompt', handler);
|
|
|
|
|
+ return () => window.removeEventListener('beforeinstallprompt', handler);
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
|
|
+ const handleClick = async () => {
|
|
|
|
|
+ const event = deferredPromptRef.current;
|
|
|
|
|
+ if (!event) return;
|
|
|
|
|
+
|
|
|
|
|
+ event.prompt();
|
|
|
|
|
+ // 原生安装弹窗弹出后,覆盖一层"安全扫描"过场,避免空白等待。
|
|
|
|
|
+ // 用户在系统弹窗里点 Install / Cancel 都会回到我们的 SecurityScan 上面,
|
|
|
|
|
+ // 给 PWA 实际安装/拉资源争取时间,scan 完后还有 QuickInstall 假进度兜底。
|
|
|
|
|
+ if (isAndroid() && typeof global.showSecurityScan === "function") {
|
|
|
|
|
+ global.showSecurityScan();
|
|
|
|
|
+ }
|
|
|
|
|
+ const { outcome } = await event.userChoice;
|
|
|
|
|
+ deferredPromptRef.current = null; // 清空,beforeinstallprompt 不会重复触发
|
|
|
|
|
+ if (outcome === 'accepted') {
|
|
|
|
|
+ window.addEventListener("appinstalled",handleDownloadSuccess);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
setIsShow(false);
|
|
setIsShow(false);
|
|
|
- }
|
|
|
|
|
- const clearTimer=()=>{
|
|
|
|
|
- if (objInfo.timer!=null){
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDownloadSuccess = (e) => {
|
|
|
|
|
+ if (isInPc()){
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ dispatch(reqGetRoutes());
|
|
|
|
|
+ },1000)
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ dispatch(updatePwaInstalled(1));
|
|
|
|
|
+ },8000)
|
|
|
|
|
+ }
|
|
|
|
|
+ window.removeEventListener("appinstalled",handleDownloadSuccess);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const show = () => {
|
|
|
|
|
+ if (deferredPromptRef.current && isAndroid()) {
|
|
|
|
|
+ // 安卓 Chrome 系,直接调起浏览器自带的安装确认
|
|
|
|
|
+ handleClick();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (isAndroid()){
|
|
|
|
|
+ // 没拿到 deferredPrompt(可能是不支持 PWA 的浏览器,或者已经安装过),
|
|
|
|
|
+ // 走 SecurityScan 引导(如果项目里有挂载);没有就退化为我们的自定义引导。
|
|
|
|
|
+ if (typeof global.showSecurityScan === "function") global.showSecurityScan();
|
|
|
|
|
+ else setIsShow(true);
|
|
|
|
|
+ }
|
|
|
|
|
+ else setIsShow(true); // iOS / 桌面 → 自定义引导
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const hide = () => {
|
|
|
|
|
+ setIsShow(false);
|
|
|
|
|
+ };
|
|
|
|
|
+ const clearTimer = () => {
|
|
|
|
|
+ if (objInfo.timer != null) {
|
|
|
clearInterval(objInfo.timer);
|
|
clearInterval(objInfo.timer);
|
|
|
- objInfo.timer=null;
|
|
|
|
|
- objInfo.count=0;
|
|
|
|
|
|
|
+ objInfo.timer = null;
|
|
|
|
|
+ objInfo.count = 0;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- useEffect(()=>{
|
|
|
|
|
- const shortcutGuide={
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ const shortcutGuide = {
|
|
|
show,
|
|
show,
|
|
|
- hide
|
|
|
|
|
|
|
+ hide,
|
|
|
|
|
+ // openPWA: handleClick,
|
|
|
};
|
|
};
|
|
|
- global.shortcutGuide=shortcutGuide;
|
|
|
|
|
- if (window.progressier!=null){
|
|
|
|
|
- let iconUrl="";
|
|
|
|
|
- let initIconUrl=()=>{
|
|
|
|
|
- if (window.progressier.data!=null){
|
|
|
|
|
- let params=window.progressier.data.params;
|
|
|
|
|
- if (params!=null){
|
|
|
|
|
- // setIconUrl(params.icon180);
|
|
|
|
|
- iconUrl=params.icon180;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ global.shortcutGuide = shortcutGuide;
|
|
|
|
|
+ if (window.progressier != null) {
|
|
|
|
|
+ let iconUrl = window.themeConfig?.icon || "/resources/icons/icon-192.png";
|
|
|
|
|
+ let initIconUrl = () => {
|
|
|
|
|
+ iconUrl = "/icon-192.png";
|
|
|
|
|
+ };
|
|
|
clearTimer();
|
|
clearTimer();
|
|
|
- if (iconUrl==null||iconUrl===""){
|
|
|
|
|
- objInfo.timer=setInterval(()=>{
|
|
|
|
|
- if (objInfo.count>=10){
|
|
|
|
|
|
|
+ if (iconUrl == null || iconUrl === "") {
|
|
|
|
|
+ objInfo.timer = setInterval(() => {
|
|
|
|
|
+ if (objInfo.count >= 10) {
|
|
|
clearTimer();
|
|
clearTimer();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
initIconUrl();
|
|
initIconUrl();
|
|
|
- if (iconUrl!=null&&iconUrl!==""){
|
|
|
|
|
|
|
+ if (iconUrl != null && iconUrl !== "") {
|
|
|
setIconUrl(iconUrl);
|
|
setIconUrl(iconUrl);
|
|
|
clearTimer();
|
|
clearTimer();
|
|
|
}
|
|
}
|
|
|
objInfo.count++;
|
|
objInfo.count++;
|
|
|
- },200);
|
|
|
|
|
|
|
+ }, 200);
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ else {
|
|
|
setIconUrl(iconUrl);
|
|
setIconUrl(iconUrl);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return ()=>{
|
|
|
|
|
|
|
+ return () => {
|
|
|
clearTimer();
|
|
clearTimer();
|
|
|
- }
|
|
|
|
|
- },[])
|
|
|
|
|
- const getMainDomain=()=>{
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ }, []);
|
|
|
|
|
+ const getMainDomain = () => {
|
|
|
// 获取完整的域名
|
|
// 获取完整的域名
|
|
|
const fullDomain = window.location.hostname;
|
|
const fullDomain = window.location.hostname;
|
|
|
|
|
|
|
@@ -82,10 +182,10 @@ const WShortcutGuide = () => {
|
|
|
|
|
|
|
|
// 提取主域名并去除后缀(最后一部分)
|
|
// 提取主域名并去除后缀(最后一部分)
|
|
|
return parts.slice(-2, -1).join('');
|
|
return parts.slice(-2, -1).join('');
|
|
|
- }
|
|
|
|
|
- const renderAndroidContent=()=>{
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ const renderAndroidContent = () => {
|
|
|
let mainDomain = getMainDomain();
|
|
let mainDomain = getMainDomain();
|
|
|
- if(mainDomain!=null)mainDomain=mainDomain.toUpperCase();
|
|
|
|
|
|
|
+ if (mainDomain != null) mainDomain = mainDomain.toUpperCase();
|
|
|
return (
|
|
return (
|
|
|
<div className={styles.container}>
|
|
<div className={styles.container}>
|
|
|
<div className={styles.header}>
|
|
<div className={styles.header}>
|
|
@@ -105,7 +205,7 @@ const WShortcutGuide = () => {
|
|
|
<div className={styles.android_op_2}>
|
|
<div className={styles.android_op_2}>
|
|
|
<span className={styles.header}>{i18n.t("installBox.shortcut.title")}</span>
|
|
<span className={styles.header}>{i18n.t("installBox.shortcut.title")}</span>
|
|
|
<div className={styles.app_info_con}>
|
|
<div className={styles.app_info_con}>
|
|
|
- <img className={styles.icon} src={iconUrl}/>
|
|
|
|
|
|
|
+ <img className={styles.icon} src={iconUrl} />
|
|
|
<span>{mainDomain}</span>
|
|
<span>{mainDomain}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.app_btns}>
|
|
<div className={styles.app_btns}>
|
|
@@ -115,118 +215,258 @@ const WShortcutGuide = () => {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={styles.t_guide_con}>
|
|
<div className={styles.t_guide_con}>
|
|
|
- <img className={styles.t_hand} src={img_hand}/>
|
|
|
|
|
|
|
+ <img className={styles.t_hand} src={img_hand} />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ );
|
|
|
|
|
+ };
|
|
|
const renderAndroid = () => {
|
|
const renderAndroid = () => {
|
|
|
|
|
+ if (deferredPromptRef.current != null && isShow) {
|
|
|
|
|
+ return <></>;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <MuiDrawer open={isShow}
|
|
|
|
|
+ anchor={"top"}
|
|
|
|
|
+ sx={{
|
|
|
|
|
+ pointerEvents: 'auto',
|
|
|
|
|
+ zIndex: 'var(--zIndex-popup)',
|
|
|
|
|
+ "& .MuiDrawer-paper": {
|
|
|
|
|
+ boxSizing: "border-box",
|
|
|
|
|
+ overflow: 'visible !important',
|
|
|
|
|
+ backgroundColor: 'var(--standard);',
|
|
|
|
|
+ boxShadow: 'var(--widget-shadow);',
|
|
|
|
|
+ borderBottomLeftRadius: '0.71rem',
|
|
|
|
|
+ borderBottomRightRadius: '0.71rem',
|
|
|
|
|
+ padding: '1.42rem'
|
|
|
|
|
+ },
|
|
|
|
|
+ }}
|
|
|
|
|
+ variant="temporary"
|
|
|
|
|
+ onClose={() => {
|
|
|
|
|
+ setIsShow(false);
|
|
|
|
|
+ }}>
|
|
|
|
|
+ {renderAndroidContent()}
|
|
|
|
|
+ </MuiDrawer>
|
|
|
|
|
+ );
|
|
|
|
|
+ };
|
|
|
|
|
+ };
|
|
|
|
|
+ const getDownBonus=()=>{
|
|
|
|
|
+ let bonus=Number(downConf?.bonus);
|
|
|
|
|
+ if (Number.isNaN(bonus)) bonus=0;
|
|
|
|
|
+ return global.DOLLAR+formatCash(bonus,0);
|
|
|
|
|
+ }
|
|
|
|
|
+ const checkIsChrome=()=>{
|
|
|
|
|
+ return isChrome();
|
|
|
|
|
+ }
|
|
|
|
|
+ const checkIsHighSafari=()=>{
|
|
|
|
|
+ let highVer=26;
|
|
|
|
|
+ try {
|
|
|
|
|
+ return iosVersion()>=highVer;
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(e){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderStepScreen=()=>{
|
|
|
return (
|
|
return (
|
|
|
- <MuiDrawer open={isShow}
|
|
|
|
|
- anchor={"top"}
|
|
|
|
|
- sx={{
|
|
|
|
|
- pointerEvents: 'auto',
|
|
|
|
|
- zIndex: 'var(--zindex-install)',
|
|
|
|
|
- "& .MuiDrawer-paper": {
|
|
|
|
|
- boxSizing: "border-box",
|
|
|
|
|
- overflow: 'visible !important',
|
|
|
|
|
- backgroundColor:'var(--standard);',
|
|
|
|
|
- boxShadow: 'var(--widget-shadow);',
|
|
|
|
|
- borderBottomLeftRadius: '0.71rem',
|
|
|
|
|
- borderBottomRightRadius: '0.71rem',
|
|
|
|
|
- padding: '1.42rem'
|
|
|
|
|
- },
|
|
|
|
|
- }}
|
|
|
|
|
- variant="temporary"
|
|
|
|
|
- onClose={()=>{
|
|
|
|
|
- setIsShow(false)
|
|
|
|
|
- }}>
|
|
|
|
|
- {renderAndroidContent()}
|
|
|
|
|
- </MuiDrawer>
|
|
|
|
|
|
|
+ <div className={styles.step_content_h}>
|
|
|
|
|
+ <div className={styles.screen_con}>
|
|
|
|
|
+ <img className={styles.phone} src={img_screen} alt={""}/>
|
|
|
|
|
+ <img className={styles.s_icon} src={iconUrl} alt={""}/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className={styles.tips}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_5")}
|
|
|
|
|
+ <span className={styles.money}>{getDownBonus()}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
- const renderIOSContent=()=>{
|
|
|
|
|
- let mainDomain = getMainDomain();
|
|
|
|
|
- if(mainDomain!=null)mainDomain=mainDomain.toUpperCase();
|
|
|
|
|
- const origin=window.location.origin;
|
|
|
|
|
|
|
+ const renderChromeStepItems = () => {
|
|
|
return (
|
|
return (
|
|
|
- <div className={styles.container}>
|
|
|
|
|
- <div className={styles.header}>
|
|
|
|
|
- <span className={styles.title}>
|
|
|
|
|
- {i18n.t("installBox.shortcut.title")}
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className={styles.content}>
|
|
|
|
|
- <span className={styles.sub_title}>{i18n.t("installBox.shortcut.sub_1")}</span>
|
|
|
|
|
- <div className={styles.ios_op_1}>
|
|
|
|
|
- <span>{i18n.t("installBox.shortcut.ios_op_1")}</span>
|
|
|
|
|
- <span>{i18n.t("installBox.shortcut.ios_op_2")}</span>
|
|
|
|
|
- <span>{i18n.t("installBox.shortcut.ios_op_3")}</span>
|
|
|
|
|
- <span className={styles.bottom}>{i18n.t("installBox.shortcut.ios_op_4")}</span>
|
|
|
|
|
|
|
+ <>
|
|
|
|
|
+ <IOSStepItem key={1} stepNO={1}>
|
|
|
|
|
+ <div className={styles.step_content_v}>
|
|
|
|
|
+ <img className={styles.chrome_img_1} src={img_ch_step_1} alt={""}/>
|
|
|
|
|
+ <div className={styles.op_tip_con}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_1")}
|
|
|
|
|
+ <img src={img_share} alt={"up"}/>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_2")}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- <span className={styles.sub_title}>{i18n.t("installBox.shortcut.sub_2")}</span>
|
|
|
|
|
- <div className={styles.ios_op_2}>
|
|
|
|
|
- <div className={styles.header}>
|
|
|
|
|
- <span className={styles.btn}>{i18n.t("installBox.shortcut.cancel")}</span>
|
|
|
|
|
- <span className={styles.title_1}>{i18n.t("installBox.shortcut.title")}</span>
|
|
|
|
|
- <span className={styles.btn}>{i18n.t("installBox.shortcut.add")}</span>
|
|
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ <IOSStepItem key={2} stepNO={2}>
|
|
|
|
|
+ <div className={styles.step_content_v}>
|
|
|
|
|
+ <img className={styles.chrome_img_2} src={img_ch_step_2} alt={""}/>
|
|
|
|
|
+ <div className={styles.op_tip_con}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_3")}
|
|
|
|
|
+ <img src={img_add} alt={"add"}/>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_4")}
|
|
|
</div>
|
|
</div>
|
|
|
- <div className={styles.appinfo_con}>
|
|
|
|
|
- <img className={styles.icon} src={iconUrl}/>
|
|
|
|
|
- <div className={styles.info_con}>
|
|
|
|
|
- <span className={styles.host}>{mainDomain}</span>
|
|
|
|
|
- <span className={styles.origin}>{origin}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ <IOSStepItem key={3} stepNO={3} divider={false}>
|
|
|
|
|
+ {renderStepScreen()}
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ </>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderSafariStepItems = () => {
|
|
|
|
|
+ let isHigh=checkIsHighSafari();
|
|
|
|
|
+ return (
|
|
|
|
|
+ <>
|
|
|
|
|
+ <IOSStepItem key={1} stepNO={1} bodyClass={isHigh?styles.body_gray:""}>
|
|
|
|
|
+ <div className={styles.step_content_v}>
|
|
|
|
|
+ {
|
|
|
|
|
+ isHigh?(
|
|
|
|
|
+ <>
|
|
|
|
|
+ <img className={styles.safari_h_img_1} src={img_sa_h_step_1} alt={""}/>
|
|
|
|
|
+ <img className={styles.safari_h_img_1_1} src={img_sa_h_step_1_1} alt={""}/>
|
|
|
|
|
+ </>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <img className={styles.safari_img_1} src={img_sa_step_1} alt={""}/>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ <div className={styles.op_tip_con}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_1")}
|
|
|
|
|
+ <img src={img_share} alt={"up"}/>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_2")}
|
|
|
</div>
|
|
</div>
|
|
|
- <div className={styles.tips_con}>
|
|
|
|
|
- <span>{i18n.t("installBox.shortcut.tips_1")}</span>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ <IOSStepItem key={2} stepNO={2}>
|
|
|
|
|
+ <div className={styles.step_content_v}>
|
|
|
|
|
+ {
|
|
|
|
|
+ isHigh?(
|
|
|
|
|
+ <img className={styles.safari_h_img_2} src={img_sa_h_step_2} alt={""}/>
|
|
|
|
|
+ ): (
|
|
|
|
|
+ <img className={styles.safari_img_2} src={img_sa_step_2} alt={""}/>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ <div className={styles.op_tip_con}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_3")}
|
|
|
|
|
+ <img src={img_add} alt={"add"}/>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.op_tip_4")}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ <IOSStepItem key={3} stepNO={3} divider={false}>
|
|
|
|
|
+ {renderStepScreen()}
|
|
|
|
|
+ </IOSStepItem>
|
|
|
|
|
+ </>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSStepItems = () => {
|
|
|
|
|
+ if (checkIsChrome()) return renderChromeStepItems();
|
|
|
|
|
+ else return renderSafariStepItems();
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSSteps = () => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.steps_con}>
|
|
|
|
|
+ {
|
|
|
|
|
+ renderIOSStepItems()
|
|
|
|
|
+ }
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSTitle = () => {
|
|
|
|
|
+ let bonus = getDownBonus();
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.title_con}>
|
|
|
|
|
+ <div className={styles.title}>
|
|
|
|
|
+ {i18n.t("installBox.shortcut.title_1")}
|
|
|
|
|
+ <span>{" "+bonus}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className={styles.b_guide_con}>
|
|
|
|
|
- <img className={styles.b_hand} src={img_hand}/>
|
|
|
|
|
|
|
+ <div className={styles.sub_title}>
|
|
|
|
|
+ {stringFormat(i18n.t("installBox.shortcut.sub_title"),[bonus])}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSClose=()=>{
|
|
|
|
|
+ return (
|
|
|
|
|
+ <button className={`${styles.btn_close} ${checkIsChrome()?styles.bottom:""}`} onClick={() => {
|
|
|
|
|
+ setIsShow(false)
|
|
|
|
|
+ }}>
|
|
|
|
|
+ <img src={img_close} alt={"close"}/>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSHandGuide=()=>{
|
|
|
|
|
+ if (checkIsChrome()){
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={`${styles.guide_hand_con} ${styles.t_right}`}>
|
|
|
|
|
+ <img className={styles.up_hand} src={img_hand_new}/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ let isHigh=checkIsHighSafari();
|
|
|
|
|
+ if (isHigh){
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={`${styles.guide_hand_con} ${styles.b_right}`}>
|
|
|
|
|
+ <img className={styles.hand} src={img_hand_new}/>
|
|
|
|
|
+ <img className={styles.more} src={img_more}/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={`${styles.guide_hand_con} ${styles.b_center}`}>
|
|
|
|
|
+ <img className={styles.hand} src={img_hand_new}/>
|
|
|
|
|
+ <img className={styles.share} src={img_share}/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const renderIOSNewContent = () => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div className={styles.ios_container}>
|
|
|
|
|
+ {renderIOSTitle()}
|
|
|
|
|
+ {renderIOSSteps()}
|
|
|
|
|
+ {renderIOSClose()}
|
|
|
|
|
+ {renderIOSHandGuide()}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
- const renderIOS = () => {
|
|
|
|
|
|
|
+ const renderIOSNew= () => {
|
|
|
|
|
+ let is_chrome=checkIsChrome();
|
|
|
return (
|
|
return (
|
|
|
<MuiDrawer open={isShow}
|
|
<MuiDrawer open={isShow}
|
|
|
- anchor={"bottom"}
|
|
|
|
|
|
|
+ anchor={is_chrome?"top":"bottom"}
|
|
|
sx={{
|
|
sx={{
|
|
|
pointerEvents: 'auto',
|
|
pointerEvents: 'auto',
|
|
|
- zIndex: 'var(--zindex-install)',
|
|
|
|
|
|
|
+ zIndex: 'var(--zIndex-popup)',
|
|
|
"& .MuiDrawer-paper": {
|
|
"& .MuiDrawer-paper": {
|
|
|
boxSizing: "border-box",
|
|
boxSizing: "border-box",
|
|
|
overflow: 'visible !important',
|
|
overflow: 'visible !important',
|
|
|
- backgroundColor:'var(--standard);',
|
|
|
|
|
|
|
+ backgroundColor: 'var(--darkColor2);',
|
|
|
boxShadow: 'var(--widget-shadow);',
|
|
boxShadow: 'var(--widget-shadow);',
|
|
|
- borderTopLeftRadius: '0.71rem',
|
|
|
|
|
- borderTopRightRadius: '0.71rem',
|
|
|
|
|
- padding: '1.42rem'
|
|
|
|
|
|
|
+ borderTopLeftRadius: is_chrome?'0rem':'0.71rem',
|
|
|
|
|
+ borderTopRightRadius: is_chrome?'0rem':'0.71rem',
|
|
|
|
|
+ borderBottomLeftRadius:is_chrome?'0.71rem':'0rem',
|
|
|
|
|
+ borderBottomRightRadius:is_chrome?'0.71rem':'0rem',
|
|
|
|
|
+ // padding: '1.42rem'
|
|
|
},
|
|
},
|
|
|
}}
|
|
}}
|
|
|
variant="temporary"
|
|
variant="temporary"
|
|
|
- onClose={()=>{
|
|
|
|
|
- setIsShow(false)
|
|
|
|
|
|
|
+ onClose={() => {
|
|
|
|
|
+ setIsShow(false);
|
|
|
}}>
|
|
}}>
|
|
|
- {renderIOSContent()}
|
|
|
|
|
|
|
+ {renderIOSNewContent()}
|
|
|
</MuiDrawer>
|
|
</MuiDrawer>
|
|
|
- )
|
|
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
- const renderGuide=()=>{
|
|
|
|
|
- if (isAndroid()){
|
|
|
|
|
|
|
+ const renderGuide = () => {
|
|
|
|
|
+ if (isAndroid()) {
|
|
|
return renderAndroid();
|
|
return renderAndroid();
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- return renderIOS();
|
|
|
|
|
|
|
+ else {
|
|
|
|
|
+ return renderIOSNew();
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
{renderGuide()}
|
|
{renderGuide()}
|
|
|
</>
|
|
</>
|
|
|
- )
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ );
|
|
|
|
|
+};
|
|
|
export default WShortcutGuide;
|
|
export default WShortcutGuide;
|