index-2018-618.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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>
  27. <!-- 加载ing -->
  28. <div class="loading covers">
  29. <div class="loading-bj"></div>
  30. <p>加载中...</p>
  31. </div>
  32. <!-- 加载ing END -->
  33. <script src="js/mui.min.js"></script>
  34. <script src="js/jquery-2.1.1.min.js"></script>
  35. <script src="js/main.js"></script>
  36. <script>
  37. window.addEventListener('pageshow', function(e) {
  38. // 通过persisted属性判断是否存在 BF Cache
  39. if(e.persisted) {
  40. location.reload();
  41. }
  42. });
  43. mui.ready(function() {
  44. $.ajax(base_path + '/wechat/activity/get_activity?dates=' + new Date().getTime(), {
  45. data: {},// ajax参数 没有则不写
  46. dataType: 'json',
  47. xhrFields: {
  48. withCredentials: true
  49. },
  50. crossDomain: true,
  51. type: 'get',
  52. timeout: 15000,
  53. success: function(dt) {
  54. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  55. location.href = dt.redirectURL;
  56. } else {
  57. if(dt.status) {//判断接口返回状态status
  58. console.log(dt)
  59. $("#hd-618").attr("src",base_path+"/"+dt.data.activity.activityImg);
  60. } else {
  61. mui.alert(dt.message,function(){
  62. location.href='index-2018-618-list.html';
  63. });
  64. }
  65. }
  66. $(".loading").hide();//隐藏loadilng
  67. },
  68. error: function(xhr, type, errorThrown) {
  69. console.log(xhr);
  70. mui.alert("获取数据失败!网络错误");
  71. }
  72. });
  73. });
  74. </script>
  75. </body>
  76. </html>