download.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="content" v-bind:style="{backgroundImage:'url(' + bg + ')'}" iud="body">
  3. <img v-show="show_wx" :src="wx" width="100%" />
  4. <!-- <img :src="logo" style="margin:100px auto auto 150px;text-align:center; height:100px; width:85px;" /> -->
  5. <img style="margin:90% auto auto 25%; height:8%; width:50%;" :src="btn" id="btn_img" @click="download()"/>
  6. </div>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. type : "android",
  13. // logo:require('@/assets/img/logoApp.png'),
  14. wx:require('@/assets/download/image.png'),
  15. btn:require('@/assets/download/down.png'),
  16. show_wx :false,
  17. bg: require('@/assets/download/login.png'),
  18. };
  19. },
  20. created() {
  21. let ua = navigator.userAgent.toLowerCase();
  22. if (/iphone|ipad|ipod/.test(ua)) {
  23. this.type = "ios";
  24. } else if (/android/.test(ua)) {
  25. this.type = "android";
  26. }
  27. if(isWeixinBrowser()){
  28. this.show_wx = true;
  29. }
  30. function isWeixinBrowser() {
  31. return (/micromessenger/.test(ua)) ? true : false;
  32. }
  33. },
  34. methods: {
  35. download() {
  36. const that = this;
  37. if(that.type == 'android') {
  38. window.location.href = 'https://wl.dasteel.cn:32322 /%E6%95%B0%E8%A3%81%E7%89%A9%E6%B5%81.apk';
  39. } else {
  40. window.location.href = 'IOS下载地址';
  41. }
  42. },
  43. }
  44. };
  45. </script>
  46. <style>
  47. .content {
  48. position:relative;
  49. margin:0px auto;
  50. background-size: cover;
  51. width: 100%;
  52. height: 100%;
  53. }
  54. div img:first-of-type {
  55. position: absolute;
  56. }
  57. </style>