welfare-service.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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="css/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  11. <link rel="stylesheet" type="text/css" href="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 = "https://s.iamberry.com/soodo/wechat/pro-details.html?colorId="+colorId;
  24. window.wxFriend = {
  25. "appId": "",
  26. "imgUrl": 'https://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. window.addEventListener('pageshow', function(e) {
  62. // 通过persisted属性判断是否存在 BF Cache
  63. if(e.persisted) {
  64. location.reload();
  65. }
  66. });
  67. var notReceive=null; //先判断是否领取过
  68. mui.ready(function(){
  69. console.log("页面加载完毕");
  70. $(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
  71. var src = location.href;
  72. src = "https://s.iamberry.com/soodo/wechat/welfare-service.html";
  73. window.wxFriend = {
  74. "appId": "",
  75. "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/indexShare.jpg',
  76. "link": src,
  77. "desc": '让你的“笑容停留在18岁”',
  78. "title": "【soodo上朵】柔性声波电动牙刷,赠送您60元现金券",
  79. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  80. "shareTimeSuccess": "分享成功",
  81. "shareTimeCancel": "已取消分享",
  82. "shareAppSuccess": "分享成功!",
  83. "shareAppCancel": "已取消分享"
  84. };
  85. });
  86. mui('body').on('tap', '.my-btn-receive', function(event) {
  87. if(notReceive){
  88. addAewPeople();
  89. }else{
  90. mui.openWindow({
  91. url: 'pro-list.html'
  92. });
  93. }
  94. });
  95. $.ajax(base_path + '/wechat/coupon/getIsReceive?dates=' + new Date().getTime(), {
  96. data: {},// ajax参数 没有则不写
  97. dataType: 'json',
  98. xhrFields: {
  99. withCredentials: true
  100. },
  101. crossDomain: true,
  102. type: 'get',
  103. timeout: 15000,
  104. success: function(dt) {
  105. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  106. location.href = dt.redirectURL;
  107. } else {
  108. if(dt.status) {//判断接口返回状态status
  109. notReceive=1;
  110. } else {
  111. $("button").text("已领取 去下单");
  112. }
  113. }
  114. },
  115. error: function(xhr, type, errorThrown) {
  116. console.log(xhr);
  117. mui.alert("领取优惠券失败!网络错误");
  118. }
  119. });
  120. //领取新人优惠券
  121. function addAewPeople(){
  122. if(notReceive){
  123. $.ajax(base_path + '/wechat/coupon/addAewPeople?dates=' + new Date().getTime(), {
  124. data: {},// ajax参数 没有则不写
  125. dataType: 'json',
  126. xhrFields: {
  127. withCredentials: true
  128. },
  129. crossDomain: true,
  130. type: 'get',
  131. timeout: 15000,
  132. success: function(dt) {
  133. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  134. location.href = dt.redirectURL;
  135. } else {
  136. if(dt.status) {//判断接口返回状态status
  137. mui.alert("领取成功!");
  138. notReceive=null;
  139. $("button").text("已领取 去下单");
  140. } else {
  141. mui.alert("领取失败!");
  142. }
  143. }
  144. },
  145. error: function(xhr, type, errorThrown) {
  146. console.log(xhr);
  147. mui.alert("领取新人优惠券失败!网络错误");
  148. }
  149. });
  150. }
  151. }
  152. </script>
  153. </body>
  154. </html>