downloadCaigong2.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. import React, { Component } from 'react';
  2. import { connect } from "react-redux";
  3. import './downloadCaigong2.css'
  4. const mapStateToProps = (state) => ({
  5. });
  6. const mapDispatchToProps = (dispatch) => ({
  7. });
  8. class LoginViews extends Component {
  9. /*
  10. * 构造函数
  11. *
  12. * */
  13. constructor() {
  14. super();
  15. this.state = {
  16. };
  17. }
  18. is_weixin() {
  19. var ua = navigator.userAgent.toLowerCase();
  20. if (ua.match(/MicroMessenger/i) === "micromessenger") {
  21. return true;
  22. } else {
  23. return false;
  24. }
  25. }
  26. openWxDownloadTip() {
  27. document.getElementById('tip').style.display = 'block'
  28. }
  29. /*
  30. *
  31. * 生命周期一
  32. *
  33. * */
  34. componentWillMount() {
  35. /*
  36. *
  37. * 如果是ios设备默认第一次不是播放状态,android没事
  38. *
  39. * */
  40. /*
  41. *
  42. * 请求数据
  43. *
  44. *
  45. * */
  46. }
  47. /*
  48. *
  49. * 生命周期二
  50. *
  51. * */
  52. componentDidMount() {
  53. if (this.is_weixin()) {
  54. document.querySelectorAll('#app a')[0].style.display = 'none'
  55. document.querySelectorAll('#app a')[1].style.display = 'none'
  56. }
  57. else {
  58. document.querySelectorAll('#app a')[2].style.display = 'none'
  59. document.querySelectorAll('#app a')[3].style.display = 'none'
  60. }
  61. }
  62. /*
  63. * 渲染
  64. * */
  65. render() {
  66. return (
  67. <div id="app">
  68. <div id="tip">
  69. <img class="tip" src="./assets/tip.png" alt='' />
  70. </div>
  71. <div class="title">
  72. <img style={{ width: '72vw' }} src="./assets/财仝驾考APP2.png" alt='' />
  73. </div>
  74. <div class="subtitle">
  75. <span style={{ color: '#656565' }}>一款为驾考学员打造的专业软件</span>
  76. </div>
  77. <img class="bg" src="./assets/bg2.png" alt='' />
  78. <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
  79. <div class="download1">
  80. 点击下载1
  81. </div>
  82. </a>
  83. <a href="https://ys.zzxcx.net/apk/sdjkAndroid1.2.2.apk">
  84. <div class="download2">
  85. 点击下载(备用)
  86. </div>
  87. </a>
  88. <a onclick={this.openWxDownloadTip().bind(this)}>
  89. <div class="download1">
  90. 点击下载1
  91. </div>
  92. </a>
  93. <a onclick={this.openWxDownloadTip().bind(this)}>
  94. <div class="download2">
  95. 点击下载(备用)
  96. </div>
  97. </a>
  98. </div>
  99. )
  100. }
  101. componentWillUnmount() {
  102. }
  103. }
  104. export default connect(mapStateToProps, mapDispatchToProps)(LoginViews);