down.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="page">
  3. <view class="header">
  4. <view class="left">
  5. <!-- <image class="img" mode="widthFix" src="../../static/login/close.png"></image> -->
  6. </view>
  7. </view>
  8. <view class="tbody">
  9. <image style="margin-top: 50rpx;height: 120rpx;" src="../../static/me/img_checkMark.png" mode="heightFix" />
  10. <text style="margin-top: 68rpx;color:#FFFFFF;font-size: 28rpx;">下载APP,遇见更好的TA!</text>
  11. <text class="btn_submit" @click="toDown">下载APP</text>
  12. </view>
  13. <view class="pop_mask" v-if="show_mask">
  14. <view class="body">
  15. <image class="clickT" src="http://c.yujianmate.com/images/v1/wx_mask.png" mode="widthFix" />
  16. </view>
  17. </view>
  18. <view class="blankHeight"></view>
  19. <!-- 提示框 -->
  20. <DialogBox ref="DialogBox"></DialogBox>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. components: {},
  26. data() {
  27. return {
  28. title: '',
  29. show_mask: false,
  30. downurl: 'https://e.zhichao.art/app/web3.0.v3.apk',
  31. }
  32. },
  33. onLoad(params) {
  34. this.ycode = params.ycode || '999999';
  35. this.getDownurl();
  36. },
  37. onShow() {},
  38. methods: {
  39. onBack() {},
  40. toDown() {
  41. var browser = {
  42. versions: function() {
  43. var u = navigator.userAgent,
  44. app = navigator.appVersion;
  45. return { //移动终端浏览器版本信息
  46. trident: u.indexOf('Trident') > -1, //IE内核
  47. presto: u.indexOf('Presto') > -1, //opera内核
  48. webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
  49. gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
  50. mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
  51. ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
  52. android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
  53. iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
  54. iPad: u.indexOf('iPad') > -1, //是否iPad
  55. webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
  56. };
  57. }(),
  58. language: (navigator.browserLanguage || navigator.language).toLowerCase()
  59. };
  60. if (this.is_show_mask()) {
  61. this.show_mask = true;
  62. } else {
  63. if (browser.versions.mobile && browser.versions.ios) {
  64. location.href = "https://e.zhichao.art/web/";
  65. } else {
  66. location.href = this.downurl;
  67. }
  68. }
  69. },
  70. is_show_mask() {
  71. var ua = navigator.userAgent.toLowerCase();
  72. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  73. return true;
  74. } else if ((/(iPhone|iPad|iPod|iOS)/i.test(ua) && /\sQQ/i.test(ua)) || (/(Android)/i.test(ua) &&
  75. /MQQBrowser/i.test(ua) && /\sQQ/i.test((ua).split('MQQBrowser')))) {
  76. return true;
  77. }
  78. return false;
  79. },
  80. getDownurl() {
  81. uni.request({
  82. url: this.$apiHost + '/Web/getdown', //仅为示例,并非真实接口地址。
  83. data: {
  84. skey: this.skey
  85. },
  86. header: {
  87. 'content-type': 'application/json' //自定义请求头信息
  88. },
  89. success: (res) => {
  90. console.log("----", res.data)
  91. this.downurl = res.data.downurl;
  92. }
  93. });
  94. },
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. @import 'down.scss';
  100. </style>