index-2018-618-list.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. <style>
  14. .dalog-618{position: fixed;width: 100%;height: 100%;left: 0;top: 0;background-color: rgba(0,0,0,.7);z-index:99;padding-top:35%;display: none;}
  15. .dalog-618>div{position: relative;width: 300px;height: 265px;margin: 0 auto; background: url(images/dalog-618.png) center center no-repeat;background-size: 100%;}
  16. .dalog-618 .btn-618{position: absolute;bottom: 18px;padding:10px 12px; width: 40%;left: 30%;background-color:#F1436C;color: #fff;border:0;border-radius: 0;}
  17. .dalog-618 .title{width:100px;margin:0 auto;color: #F1436C;text-align: center;padding:38px 0 24px 0;font-size: 22px;}
  18. .dalog-618 .msg{margin: 0 auto;text-align: center;width: 260px;color: #F1436C;font-size: 18px;}
  19. .dalog-618 .mui-icon-close{color: #F1436C;position: absolute;right: 10px;top: 10px;}
  20. </style>
  21. <script>
  22. //屏蔽分享
  23. </script>
  24. </head>
  25. <body>
  26. <div class="mui-content" style="padding-bottom: 50px;">
  27. <div class="vip-user-box">
  28. <div class="user-middle">
  29. <div class="user-head">
  30. <!--头像-->
  31. <img id="headDiv" src="images/tx-1.png" />
  32. <!--等级图标-->
  33. <!--<span class="user-leave"><img src="images/icon-vip-1.png" /></span>-->
  34. </div>
  35. <!--昵称-->
  36. <div class="user-name" id="userNickname" style="font-size: 20px;">name</div>
  37. <!--用户身份-->
  38. <!--<div class="userIdentity"></div>-->
  39. <p>让笑容停留在18岁</p>
  40. </div>
  41. </div>
  42. <div class="mui-content-padded" style="margin: 0 10px;">
  43. <ul class="mui-table-view my-list-618">
  44. <li class="mui-text-center">
  45. 已助力好友列表
  46. </li>
  47. <li class="mui-text-center">
  48. <h6>(共<span id="allCount">0</span>人,还需<span id="nextCount">0</span>人)</h6>
  49. </li>
  50. <!--<li class="mui-table-view-cell mui-media">
  51. <a href="javascript:;">
  52. <img class="mui-media-object mui-pull-left" src="images/tx-1.png">
  53. <div class="name-618">
  54. 木屋
  55. </div>
  56. <h6 class="date-618">2018-06-18 10:10</h6>
  57. </a>
  58. </li>
  59. <li class="mui-table-view-cell mui-media">
  60. <a href="javascript:;">
  61. <img class="mui-media-object mui-pull-left" src="images/tx-1.png">
  62. <div class="name-618">
  63. 木屋
  64. </div>
  65. <h6 class="date-618">2018-06-18 10:10</h6>
  66. </a>
  67. </li>
  68. <li class="mui-table-view-cell mui-media">
  69. <a href="javascript:;">
  70. <img class="mui-media-object mui-pull-left" src="images/tx-1.png">
  71. <div class="name-618">
  72. 木屋
  73. </div>
  74. <h6 class="date-618">2018-06-18 10:10</h6>
  75. </a>
  76. </li>-->
  77. </ul>
  78. </div>
  79. <!--<div class="mui-content-padded">
  80. <h4 class="mui-text-center">活动详情</h4>
  81. </div>-->
  82. <div class="mui-content-padded">
  83. <img width="100%" src="images/hd-618.jpg" />
  84. </div>
  85. </div>
  86. <footer class="mui-bar mui-bar-tab">
  87. <button type="button" class="btn-submit-618" style="display: none;"></button>
  88. </footer>
  89. <div class="dalog-618">
  90. <div>
  91. <div class="title">提示</div>
  92. <div class="msg">此活动仅限soodo上朵会员参与</div>
  93. <button type="button" class="btn-618">去购买</button>
  94. <span class="mui-icon mui-icon-close"></span>
  95. </div>
  96. </div>
  97. <!-- 加载ing -->
  98. <div class="loading covers">
  99. <div class="loading-bj"></div>
  100. <p>加载中...</p>
  101. </div>
  102. <!-- 加载ing END -->
  103. <script src="js/mui.min.js"></script>
  104. <script src="js/jquery-2.1.1.min.js"></script>
  105. <script src="js/main.js"></script>
  106. <script src="js/wechat-utils-1.0.js"></script>
  107. <script>
  108. window.addEventListener('pageshow', function(e) {
  109. // 通过persisted属性判断是否存在 BF Cache
  110. if(e.persisted) {
  111. location.reload();
  112. }
  113. });
  114. mui.ready(function() {
  115. $.ajax(base_path + '/wechat/activity/to_activity?dates=' + new Date().getTime(), {
  116. data: {},// ajax参数 没有则不写
  117. dataType: 'json',
  118. xhrFields: {
  119. withCredentials: true
  120. },
  121. crossDomain: true,
  122. type: 'get',
  123. timeout: 15000,
  124. success: function(dt) {
  125. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  126. location.href = dt.redirectURL;
  127. } else {
  128. $("#headDiv").prop("src",dt.data.member.userHead);
  129. $("#userNickname").text(dt.data.member.userNickname);
  130. if(dt.status) {//判断接口返回状态status
  131. console.log(dt)
  132. if(dt.data.status==-1){
  133. $(".btn-submit-618").attr("name",dt.data.status).text("立即参加").show();
  134. $(".my-list-618").hide();
  135. }else if(dt.data.status==1){
  136. $(".btn-submit-618").attr("name",dt.data.status).text("查看二维码").show();
  137. }else if(dt.data.status==2){
  138. $(".btn-submit-618").attr("name",dt.data.status).text("领取刷头兑换券").show();
  139. }else if(dt.data.status==3){
  140. $(".btn-submit-618").text("已领取刷头兑换券").attr("disabled","disabled").show();
  141. }
  142. var table=document.body.querySelector(".my-list-618");
  143. mui.each(dt.data.activityHelpList, function() {
  144. var li=document.createElement("li");
  145. li.className='mui-table-view-cell mui-media';
  146. li.innerHTML='<a><img class="mui-media-object mui-pull-left" src="'+this.userHead+'"><div class="name-618">'+this.userNickname+'</div><h6 class="date-618">'+this.activityCreateTime+'</h6></a>';
  147. table.appendChild(li);
  148. });
  149. if(typeof(dt.data.activity)!="undefined"){
  150. $("#allCount").text(dt.data.activity.activityAlreadyHelp);
  151. $("#nextCount").text(dt.data.activity.activityAllHelp-dt.data.activity.activityAlreadyHelp);
  152. }
  153. } else {
  154. $(".dalog-618 .msg").text(dt.message);
  155. $(".dalog-618").show();
  156. }
  157. setTimeout(function(){
  158. fenxiang();
  159. $(".loading").hide();//隐藏loadilng
  160. },500);
  161. }
  162. },
  163. error: function(xhr, type, errorThrown) {
  164. console.log(xhr);
  165. mui.alert("加载数据失败!网络错误");
  166. }
  167. });
  168. });
  169. //按钮事件
  170. $(document).on('tap', '.btn-submit-618', function() {
  171. var th=$(this);
  172. var src='';
  173. switch (th.attr("name")){
  174. case "-1":
  175. $.ajax(base_path+'/wechat/activity/participate_activity?dates=' + new Date().getTime(), {
  176. data: {},// ajax参数 没有则不写
  177. dataType: 'json',
  178. xhrFields: {
  179. withCredentials: true
  180. },
  181. crossDomain: true,
  182. type: 'get',
  183. timeout: 20000,
  184. success: function(dt) {
  185. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  186. location.href = dt.redirectURL;
  187. } else {
  188. if(dt.status) {//判断接口返回状态status
  189. //console.log(dt.data.imgPath);
  190. location.href='index-2018-618.html';
  191. } else {
  192. mui.alert(dt.message,function(){
  193. location.href="index-2018-618.html";
  194. });
  195. }
  196. }
  197. },
  198. error: function(xhr, type, errorThrown) {
  199. console.log(xhr);
  200. mui.alert("参加失败!网络错误");
  201. }
  202. });
  203. break;
  204. case "1":
  205. location.href='index-2018-618.html';
  206. break;
  207. case "2":
  208. location.href='cash-coupon-618.html';
  209. break;
  210. case "3":
  211. mui.alert("您已经领取过优惠券,请勿重复操作")
  212. break;
  213. default:
  214. break;
  215. }
  216. });
  217. $(document).on('tap', '.dalog-618 .mui-icon-close', function() {
  218. $(".dalog-618").hide();
  219. });
  220. $(document).on('tap', '.dalog-618 .btn-618', function() {
  221. location.href="pro-list.html";
  222. $(".dalog-618").hide();
  223. });
  224. //分享
  225. function fenxiang(){
  226. var src = location.href;
  227. window.wxFriend = {
  228. "appId": "",
  229. "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/fenxiang-2018-0618.jpg',
  230. "link": src,
  231. "desc": '老会员免费领取刷头福利啦!',
  232. "title": '【soodo上朵】老会员免费领取刷头福利啦!',
  233. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  234. "shareTimeSuccess": "分享成功",
  235. "shareTimeCancel": "已取消分享",
  236. "shareAppSuccess": "分享成功!",
  237. "shareAppCancel": "已取消分享"
  238. };
  239. getConfig();
  240. }
  241. </script>
  242. </body>
  243. </html>