index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="cache-control" content="no-cache">
  8. <meta http-equiv="expires" content="0">
  9. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
  10. <meta name="apple-mobile-web-app-capable" content="yes">
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  12. <meta name="format-detection" content="telphone=no, email=no" />
  13. <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
  14. <link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
  15. <link rel="stylesheet" type="text/css" href="css/iconfont.css" />
  16. <link rel="stylesheet" type="text/css" href="css/style.css" />
  17. <style>
  18. .year-dalog {
  19. background: url(images/year-dalog.png) center center no-repeat rgba(0, 0, 0, .7);
  20. background-size: 80% auto;
  21. position: fixed;
  22. left: 0;
  23. top: 0;
  24. right: 0;
  25. bottom: 0;
  26. width: 100%;
  27. height: 100%;
  28. z-index: 99;
  29. display: none;
  30. -webkit-transform: translateY(-100%);
  31. transform: translateY(-100%);
  32. -webkit-transition: .5s;
  33. transition: .5s;
  34. }
  35. .year-dalog.active {
  36. -webkit-transform: translateY(0%);
  37. transform: translateY(0%);
  38. }
  39. .year-dalog img {
  40. width: 100%;
  41. }
  42. .header {
  43. padding: 10px 0 7px 0;
  44. height: 65px;
  45. box-shadow: 0 0 0 #fff;
  46. background: #fff;
  47. }
  48. .header h6 {
  49. text-indent: 12px;
  50. color: #999;
  51. letter-spacing: 2px;
  52. }
  53. .go-index {
  54. width: 30%;
  55. margin-right: 1%;
  56. float: none;
  57. }
  58. .go-index img {
  59. width: 80%;
  60. padding-top: 5px;
  61. margin-left: 12px;
  62. max-width: 100px;
  63. }
  64. .swiper-container-horizontal>.swiper-pagination-bullets {
  65. bottom: 0;
  66. }
  67. .swiper-pagination-bullet-active {
  68. background: #63ccde;
  69. }
  70. .index-title {
  71. padding: 7px 12px 7px 12px;
  72. display: block;
  73. position: relative;
  74. }
  75. .index-title strong {
  76. font-size: 17px;
  77. }
  78. .index-title .mui-pull-right {
  79. color: #333;
  80. }
  81. .index-title font {
  82. display: inline-block;
  83. -webkit-transform: translateY(-1px);
  84. transform: translateY(-1px);
  85. }
  86. .pro-list .mui-media-object {
  87. background: #f2f2f2;
  88. border-radius: 5px;
  89. display: block;
  90. }
  91. .pro-list:before,
  92. .pro-list:after {
  93. display: none;
  94. }
  95. .pro-list.mui-table-view.mui-grid-view>li:nth-child(odd) {
  96. padding: 10px 8px 0 14px;
  97. }
  98. .pro-list.mui-table-view.mui-grid-view>li:nth-child(even) {
  99. padding: 10px 0 0 22px;
  100. }
  101. .pro-list h6 {
  102. margin: 7px 0;
  103. color: #bbb;
  104. }
  105. .pro-list .pro-price {
  106. font-size: 14px;
  107. margin-top: 8px;
  108. }
  109. .pro-list .pro-price span {
  110. color: #db3f53;
  111. }
  112. .pro-list .pro-price s {
  113. color: #bbb;
  114. margin-left: 15px;
  115. }
  116. </style>
  117. </head>
  118. <script>
  119. var d = new Date().getTime(); //当前时间戳
  120. if (d > 1558627200000 && d <= 1560873599000) {
  121. location.href = "20190618.html";
  122. }
  123. </script>
  124. <body>
  125. <div class="loading-bg">
  126. <div class="mui-loading">
  127. <div class="mui-spinner">
  128. </div>
  129. &nbsp;&nbsp;加载中...
  130. </div>
  131. </div>
  132. <nav class="mui-bar mui-bar-tab" id="footer-bar">
  133. <a class="mui-tab-item mui-active">
  134. <div class="iconfont icon-home"></div>
  135. <span class="mui-tab-label">首页</span>
  136. </a>
  137. <a class="mui-tab-item go_gwc">
  138. <div class="iconfont icon-gouwuche"><span class="mui-badge">0</span></div>
  139. <span class="mui-tab-label">购物车</span>
  140. </a>
  141. <a class="mui-tab-item">
  142. <div class="iconfont icon-dingdan"></div>
  143. <span class="mui-tab-label">订单</span>
  144. </a>
  145. <a class="mui-tab-item">
  146. <div class="iconfont icon-vip"></div>
  147. <span class="mui-tab-label">我的</span>
  148. </a>
  149. </nav>
  150. <!--header 开始-->
  151. <header class="mui-bar mui-bar-nav header">
  152. <div class="go-index go_index">
  153. <img src="images/logo.png">
  154. </div>
  155. <h6>Ta 是一种生活方式</h6>
  156. </header>
  157. <!--header 结束-->
  158. <div class="mui-content" style="background: #fff;">
  159. <!--商城首页begin-->
  160. <div class="mui-content-padded">
  161. <!--banner 开始-->
  162. <div class="swiper-container" style="padding:10px 0 20px 0;">
  163. <div class="swiper-wrapper">
  164. <div class="swiper-slide"><img width="100%" src="images/banner-20190101.png" /></div>
  165. </div>
  166. <!-- 如果需要分页器 -->
  167. <div class="swiper-pagination mui-text-center"></div>
  168. </div>
  169. <!--banner 结束-->
  170. </div>
  171. <div class="index-title go_web_shop">
  172. <strong>经典款净水机</strong><span class="mui-pull-right"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
  173. </div>
  174. <!--list开始-->
  175. <div class="chanpin-box">
  176. <ul class="mui-table-view mui-grid-view pro-list">
  177. <!--<li class="mui-table-view-cell mui-media mui-col-xs-6">
  178. <a proid="34" colorid="1" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-blue.png">
  179. <div class="mui-text-left">
  180. <div class="mui-media-body">WA-1桌面净水机</div>
  181. <h6>即净即饮、5档控温</h6>
  182. <div class="pro-price"><span>¥2999</span><s>¥5680</s></div>
  183. </div>
  184. </a>
  185. </li>
  186. <li class="mui-table-view-cell mui-media mui-col-xs-6">
  187. <a proid="34" colorid="2" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-black.png">
  188. <div class="mui-text-left">
  189. <div class="mui-media-body">WA-1桌面净水机</div>
  190. <h6>即净即饮、5档控温</h6>
  191. <div class="pro-price"><span>¥2999</span><s>¥5680</s></div>
  192. </div>
  193. </a>
  194. </li>
  195. <li class="mui-table-view-cell mui-media mui-col-xs-6">
  196. <a proid="34" colorid="4" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-red.png">
  197. <div class="mui-text-left">
  198. <div class="mui-media-body">WA-1桌面净水机</div>
  199. <h6>即净即饮、5档控温</h6>
  200. <div class="pro-price"><span>¥2999</span><s>¥5680</s></div>
  201. </div>
  202. </a>
  203. </li>
  204. <li class="mui-table-view-cell mui-media mui-col-xs-6">
  205. <a proid="58" colorid="40" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/pro-white.png">
  206. <div class="mui-text-left">
  207. <div class="mui-media-body">WB-1 桌面净水机</div>
  208. <h6>4级RO净化、3秒即热</h6>
  209. <div class="pro-price"><span>¥1999</span><s>¥3999</s></div>
  210. </div>
  211. </a>
  212. </li>-->
  213. </ul>
  214. </div>
  215. <!--list结束-->
  216. <div class="index-title go_web_shop2" style="margin-top: 20px;">
  217. <strong>制氢款净水机</strong><span class="mui-pull-right go_pro_list"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
  218. </div>
  219. <div class="mui-content-padded my-content-padded" id="advs_banner" style="display: block;">
  220. <!--<a><img src="images/fuqing-1.png"></a>-->
  221. </div>
  222. <!--商城首页end-->
  223. </div>
  224. <!--春节放假通知-->
  225. <div class="year-dalog"></div>
  226. <script src="js/mui.min.js"></script>
  227. <script src="js/jquery-2.1.1.min.js"></script>
  228. <script src="js/swiper.min.js"></script>
  229. <script src="js/main.js"></script>
  230. <script src="js/page/wechat-utils-1.0.js"></script>
  231. </body>
  232. <script>
  233. var clickdate = JSON.parse(localStorage.getItem('clickdate'));
  234. mui.ready(function() {
  235. //springFestivalPop();
  236. marquee_Show();
  237. getCartNum();
  238. $.ajax(base_path + '/indexData?dates=' + new Date().getTime(), {
  239. dataType: 'json',
  240. type: 'post',
  241. timeout: 15000,
  242. xhrFields: {
  243. withCredentials: true
  244. },
  245. crossDomain: true,
  246. success: function(dt) {
  247. if(dt.isRedirect) {
  248. location.href = dt.redirectURL;
  249. } else {
  250. var bannerstr = "",
  251. prostr = "",
  252. dian = "",
  253. advsstr = "";
  254. if(dt.status) {
  255. var banner_data = dt.data.banners,autoplay=false;
  256. mui(banner_data).each(function(index) {
  257. bannerstr += '<div class="swiper-slide" name="' + this.bannerImageCheckOutUrl + '"><img width="100%" src="' + (this.bannerImageUrl) + '" /></div>';
  258. });
  259. if(banner_data.length>1){
  260. autoplay=true;
  261. }
  262. $(".swiper-wrapper").html(bannerstr);
  263. /*dc('mui-slider-loop').innerHTML = bannerstr;
  264. dc('my-slider-indicator').innerHTML = dian;
  265. $("<div id='banner-slide.swiper-wrapperr' class='mui-slider'><div class='mui-slider-group mui-slider-loop' id='mui-slider-loop'>" + bannerstr + "</div><div id='my-slider-indicator' class='mui-slider-indicator my-slider-indicator'>" + dian + "</div></div>").insertBefore(".chanpin-box");*/
  266. // var advs_data = dt.data.advs;
  267. //mui(advs_data).each(function(index) {
  268. // advsstr += '<a href="' + this.bannerImageCheckOutUrl + '"><img src="' + this.bannerImageUrl + '" /></a>'
  269. //});
  270. //dc('advs_banner').innerHTML = advsstr;
  271. dc('advs_banner').style.display = 'block';
  272. mui.each(document.querySelectorAll('.swiper-wrapper .swiper-slide'), function(index, el) {
  273. el.addEventListener('tap', function() {
  274. //document.querySelector('.loading-bg').style.display = 'block';
  275. var str = this.getAttribute('name');
  276. console.log(this.getAttribute('name'));
  277. if(str != "#" && str != '') {
  278. location.href = str
  279. }
  280. }, false)
  281. });
  282. // mui.each(document.querySelectorAll('#advs_banner a'), function(index, el) {
  283. // el.addEventListener('tap', function() {
  284. // location.href = 'chanpin_list.html?proType=2';
  285. // }, false)
  286. // });
  287. //banner 初始化
  288. var swiper = new Swiper('.swiper-container', {
  289. autoplay: {
  290. delay: 5000, //5秒切换一次
  291. },
  292. effect: 'slide',
  293. loop: autoplay,
  294. grabCursor: true,
  295. pagination: {
  296. el: '.swiper-pagination',
  297. },
  298. });
  299. var shareOpenid = dt.data.memberOpenid;
  300. var link = domanUrl + "/wateroWechat/index.html?shareOpenid=" + shareOpenid;
  301. window.repleFlag = false;
  302. window.wxFriend = {
  303. "appId": "",
  304. "imgUrl": domanUrl + '/wateroWechat/images/index.jpg',
  305. "link": link,
  306. "desc": "WaterO水时代商城,开启优雅生活",
  307. "title": "WaterO水时代商城,好水,好茶,生活不将就!",
  308. "netError": "您的网络异常,请刷新重试!如多次刷新无效,请向我们反应 ~",
  309. "shareTimeSuccess": "分享成功",
  310. "shareTimeCancel": "已取消分享",
  311. "shareAppSuccess": "分享成功!",
  312. "shareAppCancel": "已取消分享"
  313. };
  314. getConfig();
  315. document.querySelector('.loading-bg').style.display = 'none'
  316. } else {
  317. mui.alert(dt.message, ' ', '我知道了', function() {
  318. mui.openWindow({
  319. url: "index.html?dates=" + new Date().getTime()
  320. })
  321. })
  322. }
  323. }
  324. },
  325. error: function(xhr, type, errorThrown) {
  326. console.log(xhr)
  327. }
  328. });
  329. if(marquee != '') {
  330. $('body').append('<div class="marquee-show"><div></div></div>')
  331. }
  332. $.ajax(base_path + '/product/productIndexSellWell?dates=' + new Date().getTime(), {
  333. data: {},
  334. dataType: 'json',
  335. type: 'post',
  336. timeout: 15000,
  337. xhrFields: {
  338. withCredentials: true
  339. },
  340. crossDomain: true,
  341. success: function(dt) {
  342. if(dt.isRedirect) {
  343. location.href = dt.redirectURL;
  344. } else {
  345. if(dt.status) {
  346. var chanpin_data = [],chanpin_data1 = [];
  347. chanpin_data = dt.data.firColuProductList;
  348. chanpin_data1 = dt.data.SecColuProductList;
  349. var table = document.body.querySelector('.pro-list');
  350. var table1 = document.body.querySelector('#advs_banner');
  351. mui(chanpin_data).each(function(index) {
  352. var pro_color = this.colorName;
  353. var li = document.createElement('li');
  354. li.className = 'mui-table-view-cell mui-media mui-col-xs-6';
  355. var yuanjia = '<s>¥' + accDiv(this.colorPrice, 100) + '</s>';
  356. if(marquee != '' && this.colorDiscount == '328000') {
  357. yuanjia = '<span class="mui-h6">购买即赠3年滤芯</span>'
  358. }
  359. li.innerHTML = '<a proid="' + this.productId + '" colorid="' + this.colorId + '" class="go_chanpin_details"><img class="mui-media-object" src="' + this.indeProdImg + '"><div class="mui-text-left"><div class="mui-media-body">' + this.productName + '</div><h6>' + this.productColorDes + '</h6><div class="pro-price"><span>¥' + accDiv(this.colorDiscount, 100) + '</span><s>' + yuanjia + '</s></div></div></a>';
  360. table.appendChild(li)
  361. });
  362. mui(chanpin_data1).each(function(index) {
  363. var li = document.createElement('a');
  364. li.setAttribute("proid",this.productId);
  365. li.setAttribute("colorid",this.colorId);
  366. li.className='go_chanpin_details';
  367. li.innerHTML='<img src="' + this.indeProdImg + '">';
  368. table1.appendChild(li);
  369. });
  370. } else {
  371. }
  372. }
  373. },
  374. error: function(xhr, type, errorThrown) {
  375. console.log(xhr)
  376. }
  377. });
  378. });
  379. $(document).on('tap', '.go_web_shop2', function() {
  380. location.href = 'chanpin_list.html?proType=16';
  381. });
  382. //春节放假通知弹窗点击事件
  383. $(document).on('tap', '.year-dalog', function() {
  384. if(!window.localStorage) {
  385. mui.alert("您的浏览器不支持localStorage");
  386. } else {
  387. //自定义json数据
  388. var obj = {};
  389. obj = {
  390. text: new Date().getTime()
  391. };
  392. //json格式化插入 点击时间
  393. localStorage.setItem('clickdate', JSON.stringify(obj));
  394. }
  395. $(".year-dalog").removeClass("active");
  396. setTimeout(function() {
  397. $(".year-dalog").hide();
  398. }, 500);
  399. });
  400. $(document).ready(function() {
  401. var d = new Date().getTime(); //当前时间戳
  402. //弹窗提示时间为1月18日-2月13日
  403. if(d > 1547740800000 && d < 1550073599000) {
  404. if(!window.localStorage) {
  405. mui.alert("您的浏览器不支持localStorage");
  406. } else {
  407. if(clickdate != null) {
  408. var oldDate = new Date(clickdate.text).getDay();
  409. //如果本地存储的getDay比当前时间的getDay大则显示弹窗
  410. if(new Date().getDay() > oldDate) {
  411. $(".year-dalog").addClass("active").show();
  412. }
  413. } else {
  414. //本地没有存储时间也显示弹窗
  415. $(".year-dalog").addClass("active").show();
  416. }
  417. }
  418. }
  419. });
  420. </script>
  421. </html>