index-2018-618.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="format-detection" content="telephone=no">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <title>soodo上朵</title>
  10. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  11. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  12. <link rel="stylesheet" type="text/css" href="css/main.css" />
  13. <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
  14. <script>
  15. //屏蔽分享
  16. document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  17. WeixinJSBridge.call('hideOptionMenu');
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <div class="mui-content" style="padding-bottom: 50px;">
  23. <div class="mui-content-padded">
  24. <img width="100%" id="hd-618" src="" />
  25. </div>
  26. <div class="mui-content-padded">
  27. <h6>请保存至手机,发送给好友助力,即可免费领取soodo上朵刷头。</h6>
  28. </div>
  29. </div>
  30. <!-- 加载ing -->
  31. <div class="loading covers">
  32. <div class="loading-bj"></div>
  33. <p>加载中...</p>
  34. </div>
  35. <!-- 加载ing END -->
  36. <script src="js/mui.min.js"></script>
  37. <script src="js/jquery-2.1.1.min.js"></script>
  38. <script src="js/main.js"></script>
  39. <script>
  40. window.addEventListener('pageshow', function(e) {
  41. // 通过persisted属性判断是否存在 BF Cache
  42. if(e.persisted) {
  43. location.reload();
  44. }
  45. });
  46. mui.ready(function() {
  47. mui.alert("活动已过期!", function() {
  48. location.href = "index.html?dates=" + new Date().getTime(); // 前往首页
  49. });
  50. return false;
  51. $.ajax(base_path + '/wechat/activity/get_activity?dates=' + new Date().getTime(), {
  52. data: {},// ajax参数 没有则不写
  53. dataType: 'json',
  54. xhrFields: {
  55. withCredentials: true
  56. },
  57. crossDomain: true,
  58. type: 'get',
  59. timeout: 15000,
  60. success: function(dt) {
  61. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  62. location.href = dt.redirectURL;
  63. } else {
  64. if(dt.status) {//判断接口返回状态status
  65. console.log(dt)
  66. $("#hd-618").attr("src",base_path+"/"+dt.data.activity.activityImg);
  67. } else {
  68. mui.alert(dt.message,function(){
  69. location.href='index-2018-618-list.html';
  70. });
  71. }
  72. }
  73. $(".loading").hide();//隐藏loadilng
  74. },
  75. error: function(xhr, type, errorThrown) {
  76. console.log(xhr);
  77. mui.alert("获取数据失败!网络错误");
  78. }
  79. });
  80. });
  81. </script>
  82. </body>
  83. </html>