welfare-service.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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 src="images/fulishe_1.jpg" style="margin: 5%;width: 90%;"/>
  43. <div style="text-align: center; margin-bottom: 20px;">
  44. <button type="button" class="my-btn-receive fulishe" style="width: 168px;height: 38px;padding: 0px;">立即领取</button>
  45. <!--<div class="mui-content-padded">
  46. <h6>你的笑容,我来守护右上角点击,分享给好友,守护他/她的笑容</h6>
  47. </div>-->
  48. </div>
  49. <img src="images/fulishe_2.jpg" class="goToShopping" style="margin: 5%;width: 90%;"/>
  50. <div style="text-align: center;margin-bottom: 20px;">
  51. <button type="button" class="my-btn-receive goToShopping" style="width: 168px;height: 38px;padding: 0px; background: #CEB67D;">立即抢购</button>
  52. </div>
  53. </div>
  54. <!-- 加载ing begin-->
  55. <div class="loading covers">
  56. <div class="loading-bj"></div>
  57. <p>正在加载...</p>
  58. </div>
  59. <!-- 加载ing end -->
  60. <script type="text/javascript" src="js/mui.min.js"></script>
  61. <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
  62. <script type="text/javascript" src="js/main.js"></script>
  63. <script type="text/javascript" src="js/wechat-utils-1.0.js"></script>
  64. <script type="text/javascript">
  65. window.addEventListener('pageshow', function(e) {
  66. // 通过persisted属性判断是否存在 BF Cache
  67. if(e.persisted) {
  68. location.reload();
  69. }
  70. });
  71. var notReceive=null; //先判断是否领取过
  72. mui.ready(function(){
  73. console.log("页面加载完毕");
  74. $(".loading").hide().css("opacity", "0");//隐藏(正在加载...)
  75. var src = location.href;
  76. src = "https://s.iamberry.com/soodo/wechat/welfare-service.html";
  77. window.wxFriend = {
  78. "appId": "",
  79. "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/indexShare.jpg',
  80. "link": src,
  81. "desc": '让你的齿龄停留在18岁',
  82. "title": "【soodo上朵】柔性声波电动牙刷,赠送您60元现金券",
  83. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  84. "shareTimeSuccess": "分享成功",
  85. "shareTimeCancel": "已取消分享",
  86. "shareAppSuccess": "分享成功!",
  87. "shareAppCancel": "已取消分享"
  88. };
  89. });
  90. mui('body').on('tap', '.fulishe', function(event) {
  91. if(notReceive){
  92. addAewPeople();
  93. }else{
  94. mui.openWindow({
  95. url: 'pro-list.html'
  96. });
  97. }
  98. });
  99. mui('body').on('tap', '.goToShopping', function(event) {
  100. location.href="pro-details.html?colorId=44";
  101. });
  102. $.ajax(base_path + '/wechat/coupon/getIsReceive?dates=' + new Date().getTime(), {
  103. data: {},// ajax参数 没有则不写
  104. dataType: 'json',
  105. xhrFields: {
  106. withCredentials: true
  107. },
  108. crossDomain: true,
  109. type: 'get',
  110. timeout: 15000,
  111. success: function(dt) {
  112. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  113. location.href = dt.redirectURL;
  114. } else {
  115. if(dt.status) {//判断接口返回状态status
  116. notReceive=1;
  117. } else {
  118. $(".fulishe").text("已领取 去下单");
  119. }
  120. }
  121. },
  122. error: function(xhr, type, errorThrown) {
  123. console.log(xhr);
  124. mui.alert("领取现金券失败!网络错误");
  125. }
  126. });
  127. //领取新人现金券
  128. function addAewPeople(){
  129. if(notReceive){
  130. $.ajax(base_path + '/wechat/coupon/addAewPeople?dates=' + new Date().getTime(), {
  131. data: {},// ajax参数 没有则不写
  132. dataType: 'json',
  133. xhrFields: {
  134. withCredentials: true
  135. },
  136. crossDomain: true,
  137. type: 'get',
  138. timeout: 15000,
  139. success: function(dt) {
  140. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  141. location.href = dt.redirectURL;
  142. } else {
  143. if(dt.status) {//判断接口返回状态status
  144. mui.alert("领取成功!");
  145. notReceive=null;
  146. $(".fulishe").text("已领取 去下单");
  147. } else {
  148. mui.alert("领取失败!");
  149. }
  150. }
  151. },
  152. error: function(xhr, type, errorThrown) {
  153. console.log(xhr);
  154. mui.alert("领取新人现金券失败!网络错误");
  155. }
  156. });
  157. }
  158. }
  159. </script>
  160. </body>
  161. </html>