index-2019-12-12.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  5. <meta name="apple-mobile-web-app-capable" content="yes">
  6. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  7. <title>soodo上朵</title>
  8. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  9. <link rel="stylesheet" type="text/css" href="css/swiper.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. <style>
  13. body{background-image: url(images/20191212/back.jpg);background-repeat:repeat-y;}
  14. .mui-content{background-image: url(images/20191212/back.jpg);background-repeat:repeat-y;}
  15. .color_a {color: #000000;}
  16. .color_a:hover {color: #000000;}
  17. .ul_class>ul>li{float: left;display: block;}
  18. .ul_class>ul>li>img{display: block;width: 100%;}
  19. .ul_class{display: block;width: 100%;}
  20. .ul_li_coupon{width: 34%;}
  21. .ul_li_st{width: 44%;}
  22. .font_js{padding-top: 20px;padding-bottom: 25px;color: #FFFFFF;text-align: center;font-size: 12px;}
  23. </style>
  24. </head>
  25. <script>
  26. var start = new Date(2019,12-1,9,00,00,00);
  27. var end = new Date(2019,12-1,20,23,59,59);
  28. var d = new Date().getTime(); //当前时间戳
  29. if (!(d > start && d <= end)) {
  30. location.href = "index.html?dates="+new Date().getTime();
  31. }
  32. </script>
  33. <body>
  34. <footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
  35. <a class="mui-tab-item mui-active">
  36. <span class="iconfont icon-shouye"></span>
  37. <span class="mui-tab-label">首页</span>
  38. </a>
  39. <a class="mui-tab-item">
  40. <span class="iconfont icon-liebiao"></span>
  41. <span class="mui-tab-label">列表</span>
  42. </a>
  43. <a class="mui-tab-item">
  44. <span class="iconfont icon-gouwuche"></span>
  45. <span class="mui-tab-label">购物车</span>
  46. </a>
  47. <a class="mui-tab-item">
  48. <span class="iconfont icon-huiyuan"></span>
  49. <span class="mui-tab-label">会员</span>
  50. </a>
  51. </footer>
  52. <div class="mui-content" style="overflow:hidden;">
  53. <div><img src="images/20191212/index-ban.jpg" style="width: 100%;"></div>
  54. <div><img src="images/20191212/lingquan.png" style="width: 100%;"></div>
  55. <div class="ul_class" style="overflow: hidden; padding-bottom: 20px;">
  56. <ul>
  57. <li class="ul_li_coupon get_coupon" couponId="90000" style="margin-left: 10%;"><img src="images/20191212/40_coupon.png" style=""></li>
  58. <li class="ul_li_coupon get_coupon" couponId="90001" style="margin-left: 10%;"><img src="images/20191212/90_coupon.png" style=""></li>
  59. </ul>
  60. </div>
  61. <div><img src="images/20191212/baokuan.png" style="width: 100%;"></div>
  62. <div class="go_to_pro" colorId="42"><img src="images/20191212/qinshe.png" style="width: 100%;"></div>
  63. <div class="go_to_pro" colorId="100"><img src="images/20191212/lips.png" style="width: 100%;"></div>
  64. <div><img src="images/20191212/peijian.png" style="width: 100%;"></div>
  65. <div class="ul_class" style="width: 100%;overflow:hidden;">
  66. <ul>
  67. <li class="ul_li_st go_to_pro" colorId="311" style="margin-left: 4%;"><img src="images/20191212/dubang.png" style=""></li>
  68. <li class="ul_li_st go_to_pro" colorId="310" style="margin-left: 3%;"><img src="images/20191212/rouyu.png" style=""></li>
  69. </ul>
  70. </div>
  71. <div class="font_js">*活动最终解释权归上朵所有</div>
  72. <div id="item3" class="mui-control-content">
  73. </div>
  74. </div>
  75. <div class="loading covers">
  76. <div class="loading-bj"></div>
  77. <p>正在加载...</p>
  78. </div>
  79. <!--春节放假通知-->
  80. <div class="year-dalog"></div>
  81. <script src="js/mui.min.js"></script>
  82. <script src="js/jquery-2.1.1.min.js"></script>
  83. <script src="js/swiper.min.js"></script>
  84. <script src="js/main.js"></script>
  85. <script src="js/wechat-utils-1.0.js"></script>
  86. <script>
  87. //ready事件
  88. mui.ready(function() {
  89. //刷新用户信息
  90. refreshUserInfo();
  91. //设置分享
  92. fenxiang();
  93. $(".loading").hide().css("opacity", "0"); //隐藏(正在加载...)
  94. });
  95. mui('body').on('tap', '.go_to_pro', function() {
  96. var colorId = $(this).attr("colorId");
  97. if(isEmpty(colorId)){
  98. mui.openWindow({
  99. url: 'pro-details.html?colorId='+colorId
  100. })
  101. }
  102. });
  103. mui('body').on('tap', '.get_coupon', function() {
  104. var couponId = $(this).attr("couponId");
  105. if(isEmpty(couponId)){
  106. $.ajax(base_path + '/wechat/coupon/re_coupon?dates=' + new Date().getTime(), {
  107. data: {
  108. couponId : couponId //优惠券类型id
  109. },
  110. dataType: 'json',
  111. xhrFields: {
  112. withCredentials: true
  113. },
  114. crossDomain: true,
  115. type: 'get',
  116. timeout: 15000,
  117. success: function(dt) {
  118. if(dt.isRedirect) {//先判断isRedirect,然后跳转redirectURL
  119. location.href = dt.redirectURL;
  120. } else {
  121. if(dt.status) {//判断接口返回状态status
  122. mui.toast('领取成功');
  123. // mui.alert("领取成功!", function() {
  124. // location.href = "index.html?dates=" + new Date().getTime(); // 前往首页
  125. // });
  126. return false;
  127. } else {
  128. if(dt.resultCode == "500" || dt.resultCode == "502" || dt.resultCode == "503"){
  129. mui.toast(dt.message);
  130. // mui.alert(dt.message, function() {
  131. // //刷新
  132. // WeixinJSBridge.call('closeWindow');
  133. // wx.closeWindow();
  134. // });
  135. return false;
  136. }else{
  137. mui.toast("领取失败!");
  138. // var myjson = JSON.stringify(dt);
  139. // mui.alert("领取失败!" + myjson);
  140. return false;
  141. }
  142. }
  143. }
  144. },
  145. error: function(xhr, type, errorThrown) {
  146. console.log(xhr);
  147. mui.alert("领取优惠券失败!网络错误");
  148. }
  149. });
  150. }
  151. });
  152. //更新用户信息
  153. function refreshUserInfo(){
  154. var oldrefreshUserInfo = null;
  155. if (!window.localStorage) {
  156. console.log("您的浏览器不支持localStorage");
  157. } else {
  158. oldrefreshUserInfo = localStorage.getItem('refreshUserDate');
  159. }
  160. var nowdate = new Date();
  161. var nowrefreshUserDate = nowdate.format("yyyy-MM-dd");
  162. if(nowrefreshUserDate != oldrefreshUserInfo){
  163. $.ajax(base_path + '/wechat/getUserInfo?dates=' + new Date().getTime(), {
  164. dataType: 'json',
  165. type: 'post',
  166. timeout: 15000,
  167. xhrFields: {
  168. withCredentials: true
  169. },
  170. crossDomain: true,
  171. success: function(dt) {
  172. if(dt.isRedirect) {
  173. location.href = dt.redirectURL;
  174. } else {
  175. if (!window.localStorage) {
  176. console.log("您的浏览器不支持localStorage");
  177. } else {
  178. //自定义json数据
  179. var date = new Date();
  180. var refreshUserDate = date.format("yyyy-MM-dd");
  181. localStorage.setItem('refreshUserDate', refreshUserDate);
  182. }
  183. }
  184. },
  185. error: function(xhr, type, errorThrown) {
  186. console.log(xhr)
  187. }
  188. });
  189. }
  190. }
  191. /**
  192. * 该方法用于将Undefined转换为空值
  193. * @param val
  194. */
  195. function convertUndefinedToEmpty(val) {
  196. if (undefined == val || null == val||typeof val == undefined || typeof val == 'undefined'|| 'undefined' == val) {
  197. val = "";
  198. }
  199. return val;
  200. }
  201. /**
  202. * 该方法用于将Undefined转换为空值
  203. * @param val
  204. */
  205. function cufte(val) {
  206. return convertUndefinedToEmpty(val);
  207. }
  208. /**
  209. * 空值返回0,其他值返回原值
  210. * @param val
  211. */
  212. function cufteInt(val) {
  213. if(convertUndefinedToEmpty(val) == "")
  214. return 0;
  215. return val;
  216. }
  217. /**
  218. * 空值返回false
  219. * @param val
  220. */
  221. function isEmpty(val) {
  222. if(convertUndefinedToEmpty(val) == "")
  223. return false;
  224. return true;
  225. }
  226. //分享
  227. function fenxiang(){
  228. var src = location.href;
  229. src = "https://s.iamberry.com/soodo/wechat/index.html";
  230. window.wxFriend = {
  231. "appId": "",
  232. "imgUrl": 'https://s.iamberry.com/soodo/wechat/images/product_fenxiang.jpg',
  233. "link": src,
  234. "desc": '让你的齿龄停留在18岁',
  235. "title": 'soodo上朵',
  236. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  237. "shareTimeSuccess": "分享成功",
  238. "shareTimeCancel": "已取消分享",
  239. "shareAppSuccess": "分享成功!",
  240. "shareAppCancel": "已取消分享"
  241. };
  242. getConfig();
  243. }
  244. </script>
  245. </body>
  246. </html>