cash-coupon-2019.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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="apple-mobile-web-app-status-bar-style" content="black">
  8. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  9. <meta http-equiv="Pragma" content="no-cache" />
  10. <meta http-equiv="Expires" content="0" />
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. <meta http-equiv="X-UA-Compatible" content="IE=8">
  13. <meta http-equiv="Cache" content="no-cache">
  14. <title>soodo上朵-年货节</title>
  15. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  16. <link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
  17. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  18. <link rel="stylesheet" type="text/css" href="css/main.css" />
  19. <style>
  20. .color_a {color: #000000;}
  21. .color_a:hover {color: #000000;}
  22. .dalog {position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0, 0, 0, .7);display: none;z-index: 99;}
  23. .dalog>div {position: absolute;width: 270px;height: 290px;left: 50%;margin-left: -135px;top: 50%;margin-top: -150px;text-align: center;}
  24. .dalog ul{padding-top: 12px;}
  25. .dalog ol{width: 185px;display: block;margin: 0 auto;text-align: left;padding-bottom: 4px;}
  26. .dalog ol>li{font-size: 12px;margin:0;white-space: nowrap;}
  27. .dalog ul>li {margin:0 0 16px 0;color: #727171;}
  28. .dalog ul>li:last-child{margin-bottom: 10px;}
  29. .dalog ul li p {color: #666;}
  30. .dalog .btn-see-integral {border-radius: 25px;background: #727171;color: #fff;padding: 5px 22px;border: 0;font-size: 14px;}
  31. .dalog .icon-guanbicha {color: #fff;font-size: 26px;}
  32. .dalog strong {font-size: 22px;letter-spacing: 4px;}
  33. .dalog .icon-A-zhucewancheng {font-size: 40px;}
  34. .mui-content{background: url(images/20200103/20200103_back.jpg);background-size: 100%; background-repeat:no-repeat;}
  35. .helping_people{height: 40px;margin: 0 auto;width: 70%;margin-top: 20px;}
  36. .helping_people>ul>li{float: left;background: url(images/20200103/20200103_head_back.png);background-size: 99%; background-repeat:no-repeat; margin-left: 5%;width: 14%;height: 40px;display: block;}
  37. .helping_people>ul>li>img{border-radius: 50%; width: 100%;height: 40px;}
  38. .dalog_layer{background: url(images/20200103/20200103_tc_back.png);background-size: 100%; background-repeat:no-repeat;}
  39. .mui-text-center{padding-top: 210px;margin: 0 auto;width: 73%;}
  40. .active_rule>p{font-size: 12px;padding-left: 8px;padding-right: 8px;}
  41. </style>
  42. </head>
  43. <script>
  44. // var start = new Date(2019,12-1,10,00,00,00);
  45. // var end = new Date(2019,12-1,20,23,59,59);
  46. // var d = new Date().getTime(); //当前时间戳
  47. // if (d > start && d <= end) {
  48. // location.href = "index-2019-12-12.html?dates="+new Date().getTime();
  49. // }
  50. </script>
  51. <body>
  52. <div class="mui-content" style="height: 550px;">
  53. <div style="height: 45%;"></div>
  54. <div style="margin-left: 20px;font-size: 12px;color:#989898">已有<span class="help_people">0</span>位好友获得<span style="color:#EE5F71;background-color: #FFF3F3;">刷头9折券</span></div>
  55. <div class="helping_people help_people_show_01">
  56. <ul>
  57. <li></li>
  58. <li></li>
  59. <li></li>
  60. <li></li>
  61. <li></li>
  62. </ul>
  63. </div>
  64. <div class="helping_people help_people_show_02">
  65. <ul>
  66. <li></li>
  67. <li></li>
  68. <li></li>
  69. <li></li>
  70. <li></li>
  71. </ul>
  72. </div>
  73. <div class="fx_class" style="width: 60%;margin: 0 auto;padding-top: 20px;"><img src="images/20200103/20200103_fx.png" style="width: 100%;" alt=""></div>
  74. <div class="go_to_coupon" style="width: 60%;margin: 0 auto;padding-top: 12px;"><img src="images/20200103/20200103_to_coupon.png" style="width: 100%;" alt=""></div>
  75. </div>
  76. <div>
  77. <img src="images/20200103/20200103_active.jpg" alt="" style="width: 94%; margin: 0 3% 3% 3%;">
  78. </div>
  79. <!-- <div class="active_rule" style="width: 93%; margin: 0 auto; border: 0.5px solid #CCCCCC;border-style:dashed;margin-bottom: 20px;">
  80. <p style="padding-top: 5px; font-weight: bold;">活动规则:</p>
  81. <p>1.分享给1位朋友并且领取刷头优惠券,即可获得电动牙刷8折优惠券</p>
  82. <p>2.分享给3位朋友并且领取刷头优惠券,则刷头优惠券变为8.5折</p>
  83. <p>3.分享给5位朋友并且领取刷头优惠券,则刷头优惠券变为8折</p>
  84. <p>4.分享给10位朋友并且领取刷头优惠券,则刷头优惠券变为7.5折</p>
  85. <p>注:优惠券数量不累计,根据分享的完成度,保留最新的优惠券</p>
  86. </div> -->
  87. <div class="loading covers">
  88. <div class="loading-bj"></div>
  89. <p>正在加载...</p>
  90. </div>
  91. <div class="dalog">
  92. <div class="dalog_layer">
  93. <div class="mui-text-center get_coupon_id">
  94. <img src="images/20200103/20200103_tc_re.png" alt="" style="width: 100%;">
  95. </div>
  96. </div>
  97. </div>
  98. <div class="share-dalog">
  99. <img src="images/share.png" />
  100. </div>
  101. <script src="js/mui.min.js"></script>
  102. <script src="js/jquery-2.1.1.min.js"></script>
  103. <script src="js/main.js"></script>
  104. <script src="js/wechat-utils-1.0.js"></script>
  105. <script>
  106. var openid = getParam("openid"); //opendId
  107. var useropenid = getParam("useropenid"); //useropenid
  108. //ready事件
  109. mui.ready(function() {
  110. //刷新用户信息
  111. refreshUserInfo();
  112. if(!isEmpty(openid)){
  113. openid = "X";
  114. }
  115. //查询是否参与活动
  116. $.ajax(base_path + '/wechat/festival/to_festival?dates=' + new Date().getTime(), {
  117. dataType: 'json',
  118. type: 'post',
  119. timeout: 15000,
  120. xhrFields: {
  121. withCredentials: true
  122. },
  123. crossDomain: true,
  124. success: function(dt) {
  125. if(dt.isRedirect) {
  126. location.href = dt.redirectURL;
  127. }
  128. if(dt.data.status == 2){
  129. //弹窗领取优惠券
  130. $('.dalog').show();
  131. }else{
  132. $('.dalog').hide();
  133. $('.help_people').text(dt.data.festivalHelpList.length);
  134. for(let i=0;i<dt.data.festivalHelpList.length;i++){
  135. var festivalHelp = dt.data.festivalHelpList[i];
  136. if(i < 5){
  137. $('.help_people_show_01').find('li').eq(i).html('<img src="'+ festivalHelp.userHead +'" style="width: 100%;" alt="">');
  138. }else{
  139. $('.help_people_show_02').find('li').eq(i-5).html('<img src="'+ festivalHelp.userHead +'" style="width: 100%;" alt="">');
  140. }
  141. }
  142. }
  143. },
  144. error: function(xhr, type, errorThrown) {
  145. console.log(xhr)
  146. }
  147. });
  148. $(".loading").hide().css("opacity", "0"); //隐藏(正在加载...).
  149. //设置分享
  150. fenxiang();
  151. });
  152. //领取优惠券
  153. $(document).on('tap', '.get_coupon_id', function() {
  154. if(!isEmpty(openid)){
  155. mui.toast("链接出错,请重试");
  156. }
  157. $.ajax(base_path + '/wechat/festival/receive_activity?dates=' + new Date().getTime(), {
  158. data:{
  159. openid:openid
  160. },
  161. dataType: 'json',
  162. type: 'post',
  163. timeout: 15000,
  164. xhrFields: {
  165. withCredentials: true
  166. },
  167. crossDomain: true,
  168. success: function(dt) {
  169. if(dt.isRedirect) {
  170. location.href = dt.redirectURL;
  171. }
  172. if(dt.status){
  173. //弹窗领取优惠券
  174. location.reload();
  175. }else{
  176. mui.alert(dt.message);
  177. }
  178. },
  179. error: function(xhr, type, errorThrown) {
  180. console.log(xhr)
  181. }
  182. });
  183. });
  184. //更新用户信息
  185. function refreshUserInfo(){
  186. $.ajax(base_path + '/wechat/getUserInfo?dates=' + new Date().getTime(), {
  187. dataType: 'json',
  188. type: 'post',
  189. timeout: 15000,
  190. xhrFields: {
  191. withCredentials: true
  192. },
  193. crossDomain: true,
  194. success: function(dt) {
  195. if(dt.isRedirect) {
  196. location.href = dt.redirectURL;
  197. }
  198. if(!isEmpty(useropenid)){
  199. useropenid = dt.data.openId;
  200. location.href="cash-coupon-2019.html?openid="+openid+"&useropenid="+useropenid;
  201. }
  202. },
  203. error: function(xhr, type, errorThrown) {
  204. console.log(xhr)
  205. }
  206. });
  207. }
  208. //分享
  209. function fenxiang(){
  210. var src = "https://s.iamberry.com/soodo/wechat/cash-coupon-2019.html?openid="+useropenid;
  211. window.wxFriend = {
  212. "appId": "",
  213. "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
  214. "link": src,
  215. "desc": '点击领取9折优惠券',
  216. "title": 'soodo上朵 | 你的好友邀请你领取优惠券',
  217. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  218. "shareTimeSuccess": "分享成功",
  219. "shareTimeCancel": "已取消分享",
  220. "shareAppSuccess": "分享成功!",
  221. "shareAppCancel": "已取消分享"
  222. };
  223. getConfig();
  224. }
  225. //分享弹窗
  226. $(document).on('tap', '.fx_class', function() {
  227. $(".share-dalog").show();
  228. });
  229. //关闭分享弹窗
  230. $(document).on('tap', '.share-dalog', function() {
  231. $(this).hide();
  232. });
  233. //去优惠券
  234. $(document).on('tap', '.go_to_coupon', function() {
  235. location.href="coupon_list.html";
  236. });
  237. </script>
  238. </body>
  239. </html>