download.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="download">
  3. <view class="box">
  4. <image src="/static/images/logo2.png" class="logo"></image>
  5. </view>
  6. <image src="/static/images/download1.png" class="img1"></image>
  7. <image src="/static/images/download2.png" class="img2"></image>
  8. <view class="download-btn" @click="download">下载亿职赞APP</view>
  9. <view v-if="showTip" @click="handleHideTip" class="downloadbox" style="position: fixed;top: 0;left: 0;width: 100%;height: 100vh;z-index: 1000;background: rgba(000,000,000,0.6);">
  10. <image src="/static/images/tip.png" style="position: fixed;top:30px;right: 30px;width: 80%;" mode="widthFix"/>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. showTip: false
  19. };
  20. },
  21. methods: {
  22. download() {
  23. //#ifndef H5
  24. return;
  25. //#endif
  26. const u = window.navigator.userAgent;
  27. const ua = u.toLowerCase();
  28. if (ua.match(/MicroMessenger/i) == 'micromessenger') {
  29. if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
  30. this.showTip = true;
  31. } else if (u.indexOf('iPhone') > -1) { //苹果手机
  32. // window.location.href = 'https://apps.apple.com/cn/app/%E4%BA%BF%E8%81%8C%E8%B5%9E/id6756013968'
  33. // this.$queue.showToast('iOS系统请在APPStore搜索“亿职赞”');
  34. this.showTip = true;
  35. }
  36. } else {
  37. if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
  38. // 小米应用商店
  39. if (ua.match(/xiaomi/i) == 'xiaomi') {
  40. window.location.href = 'https://app.mi.com/details?id=uni.app.UNI0B0096D';
  41. // vivo应用商店
  42. } else if (ua.match(/vivo/i) == 'vivo') {
  43. window.location.href = 'https://h5coml.vivo.com.cn/h5coml/appdetail_h5/browser_v2/index.html?appId=4424542';
  44. return this.$queue.showToast('vivo系统请在应用商店搜索“亿职赞”');
  45. // OPPO应用商店
  46. } else if (ua.match(/oppo/i) == 'oppo') {
  47. window.location.href = 'https://api.appstore.oppomobile.com/app/detail?packageName=uni.app.UNI0B0096D';
  48. // 荣耀应用商店
  49. } else if (ua.match(/honor/i) == 'honor') {
  50. window.location.href = 'https://appgallery.huawei.com/app/C116155907'; // 替换为实际应用ID
  51. // 华为应用市场
  52. } else if (ua.match(/huawei/i) == 'huawei') {
  53. window.location.href = 'https://appgallery.huawei.com/app/C116155907'; // 替换为实际应用ID
  54. // 三星应用商店
  55. } else if (ua.match(/samsung/i) == 'samsung') {
  56. window.location.href = 'https://galaxystore.samsung.com/detail/uni.app.UNI0B0096D';
  57. // 魅族应用商店
  58. } else if (ua.match(/meizu/i) == 'meizu') {
  59. window.location.href = 'https://app.meizu.com/apps/uni.app.UNI0B0096D';
  60. // 默认跳转(Google Play或官方下载页)
  61. } else {
  62. this.$queue.showToast('请在手机应用市场内搜索“亿职赞”')
  63. }
  64. } else if (u.indexOf('iPhone') > -1) { //苹果手机
  65. window.location.href = 'https://apps.apple.com/cn/app/%E4%BA%BF%E8%81%8C%E8%B5%9E/id6756013968'
  66. // this.$queue.showToast('iOS系统请在APPStore搜索“亿职赞”')
  67. }
  68. }
  69. },
  70. handleHideTip() {
  71. this.showTip = false
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .download {
  78. min-height: 100vh;
  79. background-image: url('/static/images/bg1.png'), linear-gradient(135deg, #0d27f7, #12c1ea);
  80. background-size: 100%;
  81. background-repeat: repeat;
  82. .box {
  83. padding-top: 40rpx;
  84. }
  85. .logo {
  86. display: block;
  87. width: 136rpx;
  88. height: 136rpx;
  89. margin-left: 64rpx;
  90. }
  91. .img1 {
  92. display: block;
  93. width: 516rpx;
  94. height: 258rpx;
  95. margin: 16rpx auto 68rpx;
  96. }
  97. .img2 {
  98. display: block;
  99. width: 750rpx;
  100. height: 554rpx;
  101. margin-bottom: 80rpx;
  102. }
  103. .download-btn {
  104. width: 700rpx;
  105. height: 88rpx;
  106. color: #016bf6;
  107. font-size: 32rpx;
  108. font-weight: bold;
  109. line-height: 88rpx;
  110. text-align: center;
  111. background-color: #fff;
  112. border-radius: 88rpx;
  113. margin: 0 auto 40rpx;
  114. }
  115. }
  116. </style>