welfare-service.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>福利社</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="http://s.iamberry.com/soodo/wechat/css/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="http://s.iamberry.com/soodo/wechat/css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="http://s.iamberry.com/soodo/wechat/css/main.css" />
  12. <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
  13. <!--<script>
  14. window.repleFlag = true;
  15. window.repleWxData = {
  16. "imgUrl":'https://w.iamberry.com/tooth/common/images/soodoShare.jpg',
  17. "link":window.location.href.split("#")[0],
  18. "desc":"让你的“笑容停留在18岁”",
  19. "title":"【soodo上朵】柔性声波电动牙刷,赠送您60元现金券",
  20. };
  21. function fenxiang(){
  22. var src = location.href;
  23. src = "http://s.iamberry.com/soodo/wechat/pro-details.html?colorId="+colorId;
  24. window.wxFriend = {
  25. "appId": "",
  26. "imgUrl": 'http://s.iamberry.com/soodo/wechat/images/indexShare.jpg',
  27. "link": src,
  28. "desc": '让你的“笑容停留在18岁”',
  29. "title": "【soodo上朵】柔性声波电动牙刷,赠送您60元现金券",
  30. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  31. "shareTimeSuccess": "分享成功",
  32. "shareTimeCancel": "已取消分享",
  33. "shareAppSuccess": "分享成功!",
  34. "shareAppCancel": "已取消分享"
  35. };
  36. getConfig();
  37. }
  38. </script>-->
  39. </head>
  40. <body>
  41. <div class="mui-content">
  42. <img width="100%" src="images/youhuiquan-details.jpg" />
  43. <div style="padding: 40px 0;text-align: center;">
  44. <button type="button" class="my-btn-receive">立即领取</button>
  45. <div class="mui-content-padded">
  46. <h6>右上角点击“...”分享给好友哟!</h6>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- 加载ing begin-->
  51. <div class="loading covers">
  52. <div class="loading-bj"></div>
  53. <p>正在加载...</p>
  54. </div>
  55. <!-- 加载ing end -->
  56. <script type="text/javascript" src="js/mui.min.js"></script>
  57. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
  58. <script type="text/javascript" src="js/main.js"></script>
  59. <script type="text/javascript" src="js/wechat-utils-1.0.js"></script>
  60. <script type="text/javascript">
  61. var notReceive=null; //先判断是否领取过
  62. mui.ready(function(){
  63. console.log("页面加载完毕");
  64. $(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
  65. var src = location.href;
  66. src = "http://s.iamberry.com/soodo/wechat/welfare-service.html";
  67. window.wxFriend = {
  68. "appId": "",
  69. "imgUrl": 'http://s.iamberry.com/soodo/wechat/images/indexShare.jpg',
  70. "link": src,
  71. "desc": '让你的“笑容停留在18岁”',
  72. "title": "【soodo上朵】柔性声波电动牙刷,赠送您60元现金券",
  73. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  74. "shareTimeSuccess": "分享成功",
  75. "shareTimeCancel": "已取消分享",
  76. "shareAppSuccess": "分享成功!",
  77. "shareAppCancel": "已取消分享"
  78. };
  79. });
  80. mui('body').on('tap', '.my-btn-receive', function(event) {
  81. if(notReceive){
  82. addAewPeople();
  83. }else{
  84. mui.openWindow({
  85. url: 'pro-list.html'
  86. });
  87. }
  88. });
  89. $.ajax(base_path + '/wechat/coupon/getIsReceive?dates=' + new Date().getTime(), {
  90. data: {},// ajax参数 没有则不写
  91. dataType: 'json',
  92. xhrFields: {
  93. withCredentials: true
  94. },
  95. crossDomain: true,
  96. type: 'get',
  97. timeout: 15000,
  98. success: function(dt) {
  99. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  100. location.href = dt.redirectURL;
  101. } else {
  102. if(dt.status) {//判断接口返回状态status
  103. notReceive=1;
  104. } else {
  105. $("button").text("已领取 去下单");
  106. }
  107. }
  108. },
  109. error: function(xhr, type, errorThrown) {
  110. console.log(xhr);
  111. mui.alert("领取优惠券失败!网络错误");
  112. }
  113. });
  114. //领取新人优惠券
  115. function addAewPeople(){
  116. if(notReceive){
  117. $.ajax(base_path + '/wechat/coupon/addAewPeople?dates=' + new Date().getTime(), {
  118. data: {},// ajax参数 没有则不写
  119. dataType: 'json',
  120. xhrFields: {
  121. withCredentials: true
  122. },
  123. crossDomain: true,
  124. type: 'get',
  125. timeout: 15000,
  126. success: function(dt) {
  127. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  128. location.href = dt.redirectURL;
  129. } else {
  130. if(dt.status) {//判断接口返回状态status
  131. mui.alert("领取成功!");
  132. notReceive=null;
  133. $("button").text("已领取 去下单");
  134. } else {
  135. mui.alert("领取失败!");
  136. }
  137. }
  138. },
  139. error: function(xhr, type, errorThrown) {
  140. console.log(xhr);
  141. mui.alert("领取新人优惠券失败!网络错误");
  142. }
  143. });
  144. }
  145. }
  146. </script>
  147. </body>
  148. </html>