index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <style>
  2. </style>
  3. <template>
  4. <div class="download-index">
  5. <div class="download-header">
  6. <h1>饭盒视频</h1>
  7. </div>
  8. <div class="download-body">
  9. <div class="dl-slide-wrap">
  10. <div class="swiper-container" data-role="slide-primary">
  11. <ul class="swiper-wrapper" data-switchable-role="content">
  12. <li class="swiper-slide slide-pic01"></li>
  13. <li class="swiper-slide slide-pic02"></li>
  14. <li class="swiper-slide slide-pic03"></li>
  15. </ul>
  16. </div>
  17. </div>
  18. </div>
  19. <footer class="download-footer">
  20. <a :href='url' class='footer-link'>
  21. <section class="f-left-content">
  22. <i class="icon-logo"></i>
  23. </section>
  24. <section class="f-middle-content">
  25. <strong>饭盒视频</strong>
  26. </section>
  27. <section class="f-right-content">
  28. <span class="btn-dl">立即下载</span>
  29. </section>
  30. </a>
  31. </footer>
  32. </div>
  33. </template>
  34. <script>
  35. import Vue from 'vue';
  36. import $ from 'jquery';
  37. import lib from 'lib';
  38. import swiper from '../../depend/swiper/swiper';
  39. export default {
  40. data() {
  41. return {
  42. // url : this.initDownloadUrl()
  43. url : "http://a.app.qq.com/o/simple.jsp?pkgname=com.ouj.fhvideo"
  44. }
  45. },
  46. mounted() {
  47. this.initSwrpe();
  48. },
  49. beforeDestroy() {
  50. },
  51. methods: {
  52. initSwrpe(){
  53. var mySwiper = new Swiper('.swiper-container', {
  54. autoplay: 2000
  55. })
  56. },
  57. initDownloadUrl(){
  58. var u = navigator.userAgent;
  59. var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  60. var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  61. if (isAndroid) {
  62. return 'http://www.hiyd.com/static/apkDownload?appid=12';
  63. } else if(isiOS) {
  64. return 'https://itunes.apple.com/us/app/%E9%A5%AD%E7%9B%92%E8%A7%86%E9%A2%91/id1237446875?l=zh&ls=1&mt=8';
  65. }
  66. },
  67. wxHandler: function () {
  68. let self = this;
  69. if (!navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
  70. return;
  71. }
  72. var url = 'http://m.hiyd.com/weixin/getJsSign',
  73. data = {
  74. url: location.href,
  75. appid: 7
  76. };
  77. $.ajax({
  78. type: "get",
  79. url: url,
  80. data: data,
  81. dataType: "jsonp",
  82. success: function (ret) {
  83. ret.data.debug = false;
  84. ret.data.jsApiList = ["onMenuShareTimeline", "onMenuShareAppMessage"];
  85. wx.config(ret.data);
  86. wx.ready(function () {
  87. //分享到朋友圈
  88. wx.onMenuShareTimeline({
  89. title: self.shareObj.desc, //分享标题
  90. imgUrl: self.shareObj.img, //分享图标
  91. success: function () {
  92. },
  93. cancel: function () {
  94. // 用户取消分享后执行的回调函数
  95. }
  96. });
  97. //分享给朋友
  98. wx.onMenuShareAppMessage({
  99. title: self.shareObj.title, //分享标题
  100. desc: self.shareObj.desc,
  101. imgUrl: self.shareObj.img, //分享图标
  102. success: function () {
  103. },
  104. cancel: function () {
  105. // 用户取消分享后执行的回调函数
  106. }
  107. });
  108. });
  109. }
  110. });
  111. }
  112. }
  113. }
  114. </script>