down.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="content">
  3. <div class="div">
  4. <img class="img" src="http://ygs.hqgjsmc.com/baseimg/hqyg.png" />
  5. <!-- <a href="#" id="donwa" > -->
  6. <div class="button" @click="goDown">Android版本下载</div>
  7. <!-- </a> -->
  8. </div>
  9. <!-- <image src="../../static/img/live_weixin.png" alt="微信打开" style="width: 750rpx;"/> -->
  10. <div class="weixin-tip" :style="{'display':iswx?'block':'none'}">
  11. <p>
  12. <img src="http://ygs.hqgjsmc.com/baseimg/live_weixin.png" alt="微信打开" />
  13. </p>
  14. </div>
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. getApp,
  20. getconfig
  21. } from "@/api/public";
  22. export default {
  23. data() {
  24. return {
  25. appurl: '',
  26. iswx: false,
  27. }
  28. },
  29. onLoad() {
  30. this.getApp()
  31. this.iswx = this.is_weixin()
  32. console.log(this.iswx)
  33. },
  34. onShow() {
  35. },
  36. onReachBottom() {
  37. },
  38. onReady() {
  39. },
  40. methods: {
  41. getApp() {
  42. getApp().then(res => {
  43. console.log(res)
  44. this.appurl = res.data.apk
  45. })
  46. },
  47. goDown() {
  48. window.location.href = this.appurl
  49. },
  50. is_weixin() {
  51. var ua = navigator.userAgent.toLowerCase();
  52. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  53. return true;
  54. } else {
  55. return false;
  56. }
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .div {
  63. width: 100%;
  64. height: 100%;
  65. position: relative;
  66. }
  67. .button {
  68. margin-left: 10%;
  69. position: fixed;
  70. bottom: 120rpx;
  71. width: 80%;
  72. text-align: center;
  73. z-index: 999;
  74. height: 140rpx;
  75. font-size: 32rpx;
  76. line-height: 140rpx;
  77. letter-spacing: 5rpx;
  78. background-color: #e1004b;
  79. border-radius: 5rpx;
  80. color: white;
  81. }
  82. .img {
  83. position: absolute;
  84. width: 300rpx;
  85. top: 50rpx;
  86. left: 0;
  87. right: 0;
  88. margin: auto;
  89. }
  90. img {
  91. // max-width: 100%;
  92. width: 300rpx;
  93. height: auto;
  94. }
  95. .weixin-tip {
  96. display: none;
  97. position: fixed;
  98. left: 0;
  99. top: 0;
  100. bottom: 0;
  101. background: rgba(0, 0, 0, 0.8);
  102. filter: alpha(opacity=80);
  103. height: 100%;
  104. width: 100%;
  105. z-index: 100;
  106. }
  107. .weixin-tip p {
  108. text-align: center;
  109. margin-top: 10%;
  110. padding: 0 5%;
  111. }
  112. * {
  113. padding: 0;
  114. margin: 0;
  115. box-sizing: border-box
  116. }
  117. </style>