import React, { Component } from 'react';
import { connect } from "react-redux";
import './downloadCaigong1.css'
const mapStateToProps = (state) => ({

});

const mapDispatchToProps = (dispatch) => ({

});

class LoginViews extends Component {
    /*
    * 构造函数
    *
    * */
    constructor() {
        super();
        this.state = {


        };
    }





    /*
    *
    * 生命周期一
    *
    * */
    componentWillMount() {
        /*
        *
        * 如果是ios设备默认第一次不是播放状态，android没事
        *
        * */


        /*
        *
        *  请求数据
        *
        *
        * */

    

    }

    is_weixin=()=> {
        var ua = navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) === "micromessenger") {
            return true;
        } else {
            return false;
        }
    }
    openWxDownloadTip=()=> {
        // document.getElementById('tip').style.display = 'block'

    }



    /*
    *
    * 生命周期二
    *
    * */
    componentDidMount() {
        if (this.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'

        }

    }

    /*
    * 渲染
    * */
    render() {
        return (
            <div id="app">
                <div id="tip">
                    <img class="tip" src="./assets/tip.png" alt='' />

                </div>
                <div class="title">
                    <img style={{ width: '72vw' }} src="./assets/财仝驾考APP1.png" alt='' />
                </div>
                <div class="subtitle">
                    <img style={{ width:'56.5vw'}} src="./assets/文字1.png" alt='' />
                </div>
                <img class="bg" src="./assets/bg1.png" alt='' />
                <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
                    <div class="download1">
                        点击下载1
                    </div>
                </a>
                <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
                    <div class="download2">
                        点击下载(备用)
                    </div>
                </a>
                <a onClick={this.openWxDownloadTip()}>
                    <div class="download1">
                        点击下载1
                    </div>
                </a>
                <a onClick={this.openWxDownloadTip()}>
                    <div class="download2">
                        点击下载(备用)
                    </div>
                </a>

            </div>

        )
    }

    componentWillUnmount() {

    }
}

export default connect(mapStateToProps, mapDispatchToProps)(LoginViews);