welfare-service.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 class="fulishe" 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/product_fenxiang.jpg',
  80. "link": src,
  81. "desc": '让你的齿龄停留在18岁',
  82. "title": "【soodo上朵】柔性声波牙刷,智柔刷牙.新体验",
  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. if(dt.resultCode == "505"){
  119. mui.alert("需要成为会员才能领取该优惠券", function() {
  120. location.href = "my-center.html?dates=" + new Date().getTime(); // 前往个人中心
  121. });
  122. }else{
  123. mui.alert("已经领取该优惠券了,去下单", function() {
  124. location.href = "pro-list.html?dates=" + new Date().getTime(); // 前往产品列表
  125. });
  126. }
  127. }
  128. }
  129. },
  130. error: function(xhr, type, errorThrown) {
  131. console.log(xhr);
  132. mui.alert("领取现金券失败!网络错误");
  133. }
  134. });
  135. //领取新人现金券
  136. function addAewPeople(){
  137. if(notReceive){
  138. $.ajax(base_path + '/wechat/coupon/addAewPeople?dates=' + new Date().getTime(), {
  139. data: {},// ajax参数 没有则不写
  140. dataType: 'json',
  141. xhrFields: {
  142. withCredentials: true
  143. },
  144. crossDomain: true,
  145. type: 'get',
  146. timeout: 15000,
  147. success: function(dt) {
  148. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  149. location.href = dt.redirectURL;
  150. } else {
  151. if(dt.status) {//判断接口返回状态status
  152. notReceive=null;
  153. mui.alert("领取成功,去下单", function() {
  154. location.href = "pro-list.html?dates=" + new Date().getTime(); // 前往产品列表
  155. });
  156. return false;
  157. //$(".fulishe").text("已领取 去下单");
  158. } else {
  159. if(dt.resultCode == "505"){
  160. mui.alert("需要成为会员才能领取该优惠券", function() {
  161. location.href = "my-center.html?dates=" + new Date().getTime(); // 前往个人中心
  162. });
  163. }else{
  164. mui.alert("领取失败!");
  165. }
  166. }
  167. }
  168. },
  169. error: function(xhr, type, errorThrown) {
  170. console.log(xhr);
  171. mui.alert("领取新人现金券失败!网络错误");
  172. }
  173. });
  174. }
  175. }
  176. </script>
  177. </body>
  178. </html>