import './index.less'
import React, { useEffect, useState } from "react";
import utils from '~/utils/utils';
export const DownloadCaigong2: React.FC = (props: any) => {
    const [tip, setTip] = useState('none')
    const is_weixin = () => {
        var ua = navigator.userAgent.toLowerCase();
        if (ua.search('micromessenger') !== -1) {
            return true;
        } else {
            return false;
        }
    }
    const openWxDownloadTip = () => {
        setTip('block')


    }
    const closeWxDownloadTip = () => {
        setTip('none')


    }
    useEffect(()=>{
        if (is_weixin()) {
            document.querySelectorAll('#app a')[0].style.display = 'none'
            document.querySelectorAll('#app a')[1].style.display = 'none'

        }
        else {
            document.querySelectorAll('#app a')[2].style.display = 'none'
            document.querySelectorAll('#app a')[3].style.display = 'none'

        }

    })
    return (
        <div id="app">
            <div style={{ display: tip }} id="tip">
                <img onClick={() => {
                    closeWxDownloadTip()
                }} className="tip" src={utils.getAssetsFile('./../../assets/images/tip.png')} alt='' />

            </div>
            <div className="title">
                <img style={{ width: '72vw', margin: '0 auto' }} src={utils.getAssetsFile('./../../assets/images/财仝驾考APP2.png')} alt='' />
            </div>
            <div className="subtitle">
                <span style={{ color: '#656565' }}>一款为驾考学员打造的专业软件</span>
            </div>
            <img className="bg" src={utils.getAssetsFile('./../../assets/images/bg2.png')} alt='' />
            <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
                <div className="download1">
                    点击下载1
                </div>
            </a>
            <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
                <div className="download2">
                    点击下载(备用)
                </div>
            </a>
            <a onClick={() => openWxDownloadTip()}>
                <div className="download1">
                    点击下载1
                </div>
            </a>
            <a onClick={() => openWxDownloadTip()}>
                <div className="download2">
                    点击下载(备用)
                </div>
            </a>

        </div>
    )

}