download.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. that.showTip = true;
  31. } else if (u.indexOf('iPhone') > -1) { //苹果手机
  32. this.$queue.showToast('iOS系统请在APPStore搜索“亿职赞”');
  33. }
  34. } else {
  35. if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机
  36. // 小米应用商店
  37. if (ua.match(/xiaomi/i) == 'xiaomi') {
  38. window.location.href = 'https://app.mi.com/details?id=uni.app.UNI0B0096D';
  39. // vivo应用商店
  40. } else if (ua.match(/vivo/i) == 'vivo') {
  41. window.location.href = 'https://h5coml.vivo.com.cn/h5coml/appdetail_h5/browser_v2/index.html?appId=3629014';
  42. return this.$queue.showToast('vivo系统请在应用商店搜索“亿职赞”');
  43. // OPPO应用商店
  44. } else if (ua.match(/oppo/i) == 'oppo') {
  45. window.location.href = 'https://api.appstore.oppomobile.com/app/detail?packageName=uni.app.UNI0B0096D';
  46. // 荣耀应用商店
  47. } else if (ua.match(/honor/i) == 'honor') {
  48. window.location.href = 'https://appgallery.huawei.com/app/C116155907'; // 替换为实际应用ID
  49. // 华为应用市场
  50. } else if (ua.match(/huawei/i) == 'huawei') {
  51. window.location.href = 'https://appgallery.huawei.com/app/C116155907'; // 替换为实际应用ID
  52. // 三星应用商店
  53. } else if (ua.match(/samsung/i) == 'samsung') {
  54. window.location.href = 'https://galaxystore.samsung.com/detail/uni.app.UNI0B0096D';
  55. // 魅族应用商店
  56. } else if (ua.match(/meizu/i) == 'meizu') {
  57. window.location.href = 'https://app.meizu.com/apps/uni.app.UNI0B0096D';
  58. // 默认跳转(Google Play或官方下载页)
  59. } else {
  60. this.$queue.showToast('请在手机应用市场内搜索“亿职赞”')
  61. }
  62. } else if (u.indexOf('iPhone') > -1) { //苹果手机
  63. this.$queue.showToast('iOS系统请在APPStore搜索“亿职赞”')
  64. }
  65. }
  66. },
  67. handleHideTip() {
  68. this.showTip = false
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .download {
  75. min-height: 100vh;
  76. background-image: url('/static/images/bg1.png'), linear-gradient(135deg, #0d27f7, #12c1ea);
  77. background-size: 100%;
  78. background-repeat: repeat;
  79. .box {
  80. padding-top: 40rpx;
  81. }
  82. .logo {
  83. display: block;
  84. width: 136rpx;
  85. height: 136rpx;
  86. margin-left: 64rpx;
  87. }
  88. .img1 {
  89. display: block;
  90. width: 516rpx;
  91. height: 258rpx;
  92. margin: 16rpx auto 68rpx;
  93. }
  94. .img2 {
  95. display: block;
  96. width: 750rpx;
  97. height: 554rpx;
  98. margin-bottom: 80rpx;
  99. }
  100. .download-btn {
  101. width: 700rpx;
  102. height: 88rpx;
  103. color: #016bf6;
  104. font-size: 32rpx;
  105. font-weight: bold;
  106. line-height: 88rpx;
  107. text-align: center;
  108. background-color: #fff;
  109. border-radius: 88rpx;
  110. margin: 0 auto 40rpx;
  111. }
  112. }
  113. </style>