index2.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <style>
  2. </style>
  3. <template>
  4. <div class="download-index2">
  5. <div class="logo-wrap">
  6. <h1>饭盒视频</h1>
  7. <p>发现更精彩的游戏世界</p>
  8. </div>
  9. <p class="intro">海量优质游戏短视频 ,好玩好看尽在饭盒</p>
  10. <div v-if="isInit==1" class="dl-btns">
  11. <a :href='url' v-if="phoneType==1" class="btn btn-ios">iOS版</a>
  12. <a :href='url' v-if="phoneType==2" class="btn btn-android">Anroid版</a>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import Vue from 'vue';
  18. import $ from 'jquery';
  19. import lib from 'lib';
  20. import swiper from '../../depend/swiper/swiper';
  21. export default {
  22. data() {
  23. return {
  24. isInit : 0,
  25. phoneType : 0,
  26. url : "http://a.app.qq.com/o/simple.jsp?pkgname=com.ouj.fhvideo"
  27. }
  28. },
  29. mounted() {
  30. this.initDownloadUrl();
  31. },
  32. beforeDestroy() {
  33. },
  34. methods: {
  35. initDownloadUrl(){
  36. var u = navigator.userAgent;
  37. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  38. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  39. this.isInit = 1;
  40. if (isiOS) {
  41. this.phoneType = 1;
  42. } else if(isAndroid) {
  43. this.phoneType = 2;
  44. }
  45. },
  46. wxHandler: function () {
  47. let self = this;
  48. if (!navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
  49. return;
  50. }
  51. var url = 'http://m.hiyd.com/weixin/getJsSign',
  52. data = {
  53. url: location.href,
  54. appid: 7
  55. };
  56. $.ajax({
  57. type: "get",
  58. url: url,
  59. data: data,
  60. dataType: "jsonp",
  61. success: function (ret) {
  62. ret.data.debug = false;
  63. ret.data.jsApiList = ["onMenuShareTimeline", "onMenuShareAppMessage"];
  64. wx.config(ret.data);
  65. wx.ready(function () {
  66. //分享到朋友圈
  67. wx.onMenuShareTimeline({
  68. title: self.shareObj.desc, //分享标题
  69. imgUrl: self.shareObj.img, //分享图标
  70. success: function () {
  71. },
  72. cancel: function () {
  73. // 用户取消分享后执行的回调函数
  74. }
  75. });
  76. //分享给朋友
  77. wx.onMenuShareAppMessage({
  78. title: self.shareObj.title, //分享标题
  79. desc: self.shareObj.desc,
  80. imgUrl: self.shareObj.img, //分享图标
  81. success: function () {
  82. },
  83. cancel: function () {
  84. // 用户取消分享后执行的回调函数
  85. }
  86. });
  87. });
  88. }
  89. });
  90. }
  91. }
  92. }
  93. </script>