<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telphone=no, email=no" />
		<title>Aiberle爱贝源</title>
		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<style>
			.year-dalog{background:url(images/year-dalog.png) center center no-repeat rgba(0,0,0,.7);background-size: 80% auto; position: fixed;left: 0;top: 0;right: 0;bottom: 0;width: 100%; height: 100%;z-index: 99;display: none;-webkit-transform: translateY(-100%);transform: translateY(-100%); -webkit-transition: .5s;transition: .5s;}
			.year-dalog.active{-webkit-transform: translateY(0%);transform: translateY(0%);}
			.year-dalog img{width: 100%;}
			div{color: #000000;}
			/* .header { padding: 10px 0 7px 0; height: 65px; box-shadow: 0 0 0 #fff; background: #fff; } 
			.header h6 { text-indent: 12px; color: #999; letter-spacing: 2px; } 
			.go-index { width: 30%; margin-right: 1%; float: none; } 
			.go-index img { width: 80%; padding-top: 5px; margin-left: 12px; max-width: 100px; } 
			.swiper-container-horizontal>.swiper-pagination-bullets { bottom: 0; } 
			.swiper-pagination-bullet-active { background: #63ccde; } 
			.index-title { padding: 7px 12px 7px 12px; display: block; position: relative; } 
			.index-title strong { font-size: 17px; } 
			.index-title .mui-pull-right { color: #333; } 
			.index-title font { display: inline-block; -webkit-transform: translateY(-1px); transform: translateY(-1px); }
 			.pro-list .mui-media-object { background: #f2f2f2; border-radius: 5px; display: block; }
			.pro-list:before,.pro-list:after {display: none;} */
			 /* .pro-list.mui-table-view.mui-grid-view>li:nth-child(odd) {padding: 10px 8px 0 14px;} */
			/* .pro-list.mui-table-view.mui-grid-view>li:nth-child(even) {padding: 10px 0 0 22px;} */
			.pro-list.mui-table-view.mui-grid-view>li:nth-child(odd){padding: 0px;}
			.pro-list.mui-table-view.mui-grid-view>li:nth-child(even){padding: 0px;}
			.mui-table-view.mui-grid-view {padding: 0px;}
			.mui-table-view{}
			.pro-list h6 {margin: 7px 0;color: #bbb;}
			.pro-list .pro-price {font-size: 14px;margin-top: 8px;}
			.pro-list .pro-price span {color: #db3f53;}
			.pro-list .pro-price s {color: #bbb;margin-left: 15px;}
			 body{padding: 0px;margin: 0px;background-color: #FFFFFF;}
			.coupon_class{padding-top:12px ;}
			.ul_class>ul>li{float: left;display: block;}
			.ul_class>ul>li>img{display: block;width: 100%;}
			.ul_class{display: block;width: 100%;}
		</style>
	</head>
	<script>
		var start = new Date(2019,9,24,8,00,00);
		var end = new Date(2019,10,11,23,59,59);
		var d = new Date().getTime(); //当前时间戳
		if (!(d > start && d <= end)) {
			location.href = "index.html";
		}
	</script>
	<body>
		<footer class="mui-bar mui-bar-tab" id="footer-bar-tab">
			<a class="mui-tab-item mui-active">
				<span class="iconfont icon-shouye"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item">
				<span class="iconfont icon-gouwuche"></span>
				<span class="mui-tab-label">购物车</span>
			</a>
			<a class="mui-tab-item">
				<span class="iconfont icon-dingdan"></span>
				<span class="mui-tab-label">订单</span>
			</a>
			<a class="mui-tab-item">
				<span class="iconfont icon-wode"></span>
				<span class="mui-tab-label">我的</span>
			</a>
		</footer>
		
		<div class="" style="background-color: #fff2f3;">
			<img width="100%" src="images/20191024/banner.jpg" />

		</div>
		
		<div class="coupon_class ul_class" style="height: 90px;background-color:#fff2f3 ;">
			<ul>
				<li style="width: 28%;margin-left: 5%;" couponId="31000"><img src="images/20191024/q_10.png" /></li>
				<li style="width: 28%;margin-left: 3%;" couponId="31001"><img src="images/20191024/q_20.png" /></li>
				<li style="width: 28%;margin-left: 3%;" couponId="31002"><img src="images/20191024/q_50.png" /></li>
			</ul>
		</div>
		
		<div class="slogan_class ul_class" style="height: 65px;padding-top:15px ;">
			<ul>
				<li style="width: 48%;"><img style="margin-left: 3%;" src="images/20191024/box_ms.jpg" /></li>
				<li style="width: 48%;"><img style="margin-left: 5%" src="images/20191024/box_xsg.jpg" /></li>
			</ul>
		</div>
		
		<div class="ms_class ul_class" style="height: 210px;padding-top:5px ;">
			<ul>
				<li style="width: 48%;margin-left: 1%;">
					<img id="ms_01" style="display: none;height: 205px;" src="images/20191024/ms_before.jpg" />
					<img id="ms_02" style="display: none;height: 205px;" class="mui-media-object to_new_slt"  src="images/20191024/ms_after_02.jpg">
					<img id="ms_03" style="display: none;height: 205px;" class="mui-media-object"  src="images/20191024/ms_after_03.jpg">
				</li>
				<li style="width: 48%;margin-left: 1%;">
					<img id="xs_01" style="display: none;height: 205px;" src="images/20191024/ms_before_zp.jpg" />
					<img id="xs_02" style="display: none;height: 205px;" class="mui-media-object to_new_xs" src="images/20191024/ms_after_zp.jpg">
					<img id="xs_03" style="display: none;height: 205px;" src="images/20191024/ms_end_zp.jpg" />
				</li>
			</ul>
			<div style="position: relative; top: -104px; left: 20%; font-weight: bold; color: #FF666B;width: 80px; height: 20px; float: left;">
				<div id="sj_01" style="display: none;color: #FF666B;" >23:59:59</div>
				<div id="sj_02" style="display: none;color: #FF666B;" >23:59:59</div>
			</div>
		</div>
		
		<div class="slogan_class ul_class" style="height: 53px;padding-top:0px ;margin-top: 10px;">
			<ul>
				<li style="width: 97%;"><img style="margin-left: 1.5%;" src="images/20191024/box_zj.jpg" /></li>
			</ul>
		</div>
		
		<div class="mui-content" style="background: #fff;padding-top:15px ;">
			<!--list结束-->
			
			
			<div class="index-title go_web_shop"  style="margin-top: 0px;">
				<strong>Aiberle</strong><span class="mui-pull-right go_pro_list" type="aiberle"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
			</div>
			
			<div class="chanpin-box" style="padding-bottom: 5px;">
				<ul class="mui-table-view mui-grid-view my-view-no to_goods" >
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;" >
						<a proid="33"  class="go_chanpin_details" style="width: 96%;padding-left: 3%;padding-right: 1%;margin: 0px;">
							<img class="mui-media-object"  src="images/20191024/wb_1_sj.jpg">
						</a>
					</li>
					
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="39"  class="go_chanpin_details"   style="width: 96%;padding-left: 2%;padding-right: 2%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/lv_sj.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="46"  class="go_chanpin_details"   style="width: 96%;padding-left: 1%;padding-right: 3%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/fg_sj.jpg">
						</a>
					</li>
				</ul>
				<ul class="mui-table-view mui-grid-view my-view-no to_goods" style="margin-top: 3px;">
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;" >
						<a proid="58"  class="go_chanpin_details" style="width: 96%;padding-left: 3%;padding-right: 1%;margin: 0px;">
							<img class="mui-media-object"  src="images/20191024/new_s3.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="54"  class="go_chanpin_details"   style="width: 96%;padding-left: 2%;padding-right: 2%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/rsj.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="52"  class="go_chanpin_details"   style="width: 96%;padding-left: 1%;padding-right: 3%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/new_hs.jpg">
						</a>
					</li>
				</ul>
				<ul class="mui-table-view mui-grid-view my-view-no to_goods" style="margin-top: 3px;">
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;" >
						<a proid="41"  class="go_chanpin_details" style="width: 96%;padding-left: 3%;padding-right: 1%;margin: 0px;">
							<img class="mui-media-object"  src="images/20191024/old_hs.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="40"  class="go_chanpin_details"   style="width: 96%;padding-left: 2%;padding-right: 2%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/longtou_new.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="36"  class="go_chanpin_details"   style="width: 96%;padding-left: 1%;padding-right: 3%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/lv_tz.jpg">
						</a>
					</li>
				</ul>
			</div>
			
			<div class="index-title go_web_shop2" style="">
				<strong>WaterO</strong><span class="mui-pull-right go_pro_list" type="watero"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
			</div>
			
			<div class="chanpin-box">
				<ul class="mui-table-view mui-grid-view my-view-no to_goods" id="index-pro-list2" style="padding-bottom: 0;">
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;" >
						<a proid="47"  class="go_chanpin_details" style="width: 96%;padding-left: 3%;padding-right: 1%;margin: 0px;">
							<img class="mui-media-object"  src="images/20191024/zqj.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="48"  class="go_chanpin_details"   style="width: 96%;padding-left: 2%;padding-right: 2%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/hei_sj.jpg">
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4" style="margin: 0px;padding: 0px;">
						<a proid="60"  class="go_chanpin_details"   style="width: 96%;padding-left: 1%;padding-right: 3%;margin: 0px;">
							<img class="mui-media-object" src="images/20191024/watero_tz.jpg">
						</a>
					</li>
				</ul>
			</div>
			
			<div class="mui-content-padded my-content-padded" id="advs_banner" style="display: block;">
				<!--<a><img src="images/fuqing-1.png"></a>-->
			</div>
			<!--商城首页end-->
		</div>
		<!--春节放假通知-->
		<div class="year-dalog"></div>
		<script src="js/mui.min.js"></script>
		<script src="js/jquery-2.1.1.min.js"></script>
		<script src="js/jquery.autocompleter.js"></script>
		<script src="js/main.js"></script>
		<script src="js/wechat-utils-1.0.js"></script>
	</body>
	<script>
		// 读取值
		var colors = [];
		var histoty = JSON.parse(localStorage.getItem('search_histoty'));
		var clickdate = JSON.parse(localStorage.getItem('clickdate'));
		//console.log(histoty)
		if (histoty != null) {
			var str = histoty.text;
			for (i = 0; i < str.length; i++) {
				var childTypeId = ''
				if (typeof(str[i].childTypeId) != "undefined") {
					childTypeId = 'childTypeid=' + str[i].childTypeId;
				}
				$("#history").append('<button type="button" class="mui-btn" name="' + str[i].id + '" typeid="' + str[i].typeId +
					'" ' + childTypeId + '>' + str[i].label + '</button>');
			}
		}
		
		mui.ready(function() {
			calculatingTime();
			
			$.ajax(base_path + '/wechat/indexData?dates=' + new Date().getTime(), {
				data: {},
				dataType: 'json',
				xhrFields: {
					withCredentials: true
				},
				crossDomain: true,
				type: 'post',
				timeout: 15000,
				success: function(dt) {
					//判断一下
					if (dt.isRedirect) {
						location.href = dt.redirectURL;
					} 
				},
				error: function(xhr, type, errorThrown) {
					console.log(xhr);
					mui.alert("获取数据失败!网络错误");
				}
			});
		
			//搜索框焦点事件
			$('#search').on('focus', function(e) {
				window.scrollTo(0, 0, 500);
				$(".icon-caidan").hide();
				$('.my-btn-cancel').show();
				if ($(this).val().length > 0) {
					$('#search-hot').hide(500);
					$(".autocompleter-list").css("height", $(document).height())
				} else {
					$("#search-hot").css("height", $(document.body).height()).show();
					$("body").css("overflow", "hidden");
				}
			});
			//搜索框失去焦点事件
			$('#search').on('blur', function(e) {
				setTimeout(function() {
					$('#search-hot,.my-btn-cancel').hide();
					$("body").css("overflow", "auto");
					$(".icon-caidan").show();
				}, 700);
		
			});
			//点击后把text赋值到搜索框
			$(document).on('tap', '#history button', function() {
				$('#search').val($(this).text());
				console.log($(this).text())
				$('#search-hot').hide();
				$("body").css("overflow", "auto");
				var parameter = {};
				parameter["id"] = $(this).attr("name");
				parameter["label"] = $(this).text();
				parameter["typeId"] = $(this).attr("typeid");
				if (typeof($(this).attr("childtypeId")) != "undefined") {
					parameter["childTypeId"] = $(this).attr("childtypeid");
				}
				search(parameter);
			});
			//搜索框本地缓存
			function search(selected) {
				if (!window.localStorage) {
					mui.alert("您的浏览器不支持localStorage");
				} else {
					//自定义json数据
					var obj = {},
						searchobj = {};
					if (histoty != null) {
						var str = histoty.text;
						if (str.length > 2) {
							str.splice(2, 1)
						}
						str.splice(0, 0, selected)
						obj = {
							text: str
						}
					} else {
						obj = {
							text: [selected]
						};
					}
					searchobj = {
						text: [selected]
					}
					//json格式化插入    
					localStorage.setItem('search_histoty', JSON.stringify(obj));
					sessionStorage.setItem('search_data', JSON.stringify(searchobj));
					mui.openWindow({
						url: 'pro-list.html?productId=' + selected.typeId
					});
				}
			}
			//监听搜索框值改变事件
			$('#search').on('input', function(e) {
				if ($(this).val().length > 0) {
					$('#search-hot').hide();
					$(".autocompleter-list").css("height", $(document).height());
				} else {
					$('#search-hot').show();
					$("body").css("overflow", "hidden");
					$(".autocompleter-list").css("height", "auto");
				}
			});
			$(".loading").hide().css("opacity", "0");
		});
		
		//取消搜索
		$(document).on('tap', '.my-btn-cancel', function() {
			$(this).hide();
			$('#search-hot').hide();
			$("body").css("overflow", "auto");
			$('#search').autocompleter("close");
			$(".autocompleter-list").empty().css("height", "auto");
			$('.autocompleter-hint').removeClass('autocompleter-hint-show').empty();
			$(".icon-caidan").show();
			$('#search').blur();
		});
		//打开菜单
		$(document).on('tap', '.icon-caidan', function() {
			$("#menu").css("height", $(window).height());
			$("#menu>li").addClass("active");
		});
		//关闭菜单
		$(document).on('tap', '.icon-guanbi', function() {
			$("#menu>li").removeClass("active");
			$("#menu").css("height", "0px");
		});
		//精选产品详情
		$(document).on('tap', '#index-pro-list .mui-table-view-cell>a', function() {
			location.href = 'pro-details.html?productId=' + $(this).attr("name")
		});
		//精选产品详情2
		$(document).on('tap', '.to_goods>li>a', function() {
			location.href = 'pro-details.html?productId=' + $(this).attr("proid")
		});
		mui('body').on('tap', '.to_new_slt', function() {
		   location.href = 'pro-details.html?productId=59'
		});
		mui('body').on('tap', '.to_new_xs', function() {
		   	location.href = "pro-list.html?productId=13";
		});
		//产品详情-配件
		$(document).on('tap', '#index-pro-items>.mui-control-item', function() {
			location.href = 'pro-list.html?productId=' + $(this).attr("name") + '&childTypeId=' + $(this).attr("item");
		});
		//more更多产品		
		$(document).on('tap', '.go_pro_list', function() {
			if ($(this).attr("type") == "aiberle") {
				location.href = "pro-list.html?productId=13";
			} else {
				location.href = "pro-list.html?productId=14";
			}
		});
		//菜单跳转
		$(document).on('tap', '#menu>.line>a', function() {
			location.href = 'pro-list.html?productId=' + $(this).attr("name") + '&childTypeId=' + $(this).attr("item");
		});
		
		$(document).on('tap', '.coupon_class>ul>li', function() {
			var couponId = this.getAttribute("couponId");
			$.ajax(base_path + '/wechat/coupon/receive_coupon_end?dates=' + new Date().getTime(), {
				data: {
					"couponId": couponId
				},
				dataType: 'json',
				xhrFields: {
					withCredentials: true
				},
				crossDomain: true,
				type: 'post',
				timeout: 15000,
				success: function(dt) {
					if(dt.isRedirect) {
						location.href = dt.redirectURL;
					} else {
						if(dt.status) {
							mui.toast(dt.message);
						} else {
							mui.toast(dt.message);
						}
					}
				},
				error: function(xhr, type, errorThrown) {
					console.log(xhr);
					mui.alert("领取失败!网络出小差了", function() {
						
					});
				}
			});
		});
		
		/**
		 * 
		 */
		var msStartDate = new Date(2019,10,10,00,00,00);	//秒杀
		var msEndDate = new Date(2019,10,11,00,00,00);	//秒杀结束
		var limitPurchaseDate = new Date(2019,10,11,11,00,00);	//限时购
		var limitPurchaseEndDate = new Date(2019,10,11,12,00,00);	//限时购-结束
		// var msStartDate = new Date(2019,10,01,15,42,00);	//秒杀开始 
		// var msEndDate = new Date(2019,10,01,15,43,00);	//秒杀结束
		// var limitPurchaseDate = new Date(2019,10,01,15,43,00);	//限时购
		function calculatingTime(){
			  var jetLag = getJetLag(msStartDate);
			  if(jetLag.dateDiff > 0){	//未开始
				   $("#sj_01").show();
				   $("#ms_01").show();
				   $("#sj_01").text(jetLag.allHours+":"+jetLag.minutes+":"+jetLag.seconds)
			  }else{
				  //已开始
				  $("#ms_01").hide();
				  $("#sj_01").hide();
				  
				  var msEndJetLeg = getJetLag(msEndDate);
				  if(msEndJetLeg.dateDiff >= 0){	//已开始
					  $("#ms_02").show();
					  $("#sj_02").show();
					  $("#sj_02").text(msEndJetLeg.allHours+":"+msEndJetLeg.minutes+":"+msEndJetLeg.seconds)
				  }else{	//一结束
					  $("#ms_02").hide();
					  $("#ms_03").show();
					  $("#sj_02").hide();
				  }
			  }
			  
			 var limitPurchaseEndDateJetlag = getJetLag(limitPurchaseEndDate);
			 if(limitPurchaseEndDateJetlag.dateDiff < 0){
			 				  $("#xs_01").hide();
			 				  $("#xs_02").hide();
			 				  $("#xs_03").show();
			 }else{
			 				 var lPDjetLag = getJetLag(limitPurchaseDate);
			 				 if(lPDjetLag.dateDiff > 0){
			 				 				   $("#xs_01").show();
			 				 				   $("#xs_02").hide();
			 				 }else{
			 				 				   $("#xs_01").hide();
			 				 				   $("#xs_02").show();
			 				 } 
			 }
		}
		$(document).ready(function() {
			//一秒刷新一次显示时间 
			setInterval(function(){
				calculatingTime();
			},1000)
		 })
		 
		 function getJetLag(scfDate){
			 var newdate = new Date();//获取当前时间
			 var dateDiff = scfDate.getTime() - newdate;//时间差的毫秒数
			 var dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000));//计算出相差天数
			 var leave1=dateDiff%(24*3600*1000)  //计算天数后剩余的毫秒数
			 var hours=Math.floor(leave1/(3600*1000))//计算出小时数
			 var allHours = hours + dayDiff*24;	//计算总小时数
			 //计算相差分钟数
			 var leave2=leave1%(3600*1000)  //计算小时数后剩余的毫秒数
			 var minutes=Math.floor(leave2/(60*1000))//计算相差分钟数
			 //计算相差秒数
			 var leave3=leave2%(60*1000)   //计算分钟数后剩余的毫秒数
			 var seconds=Math.round(leave3/1000)
			 //console.log("总小时:"+ allHours +";相差天数:"+dayDiff+";小时:"+hours+";分钟"+minutes+";秒数"+seconds);
			
			if(hours < 10){
			  hours = "0"+hours;
			}
			if(allHours < 10){
			  allHours = "0"+allHours;
			}
			if(minutes < 10){
			  minutes = "0"+minutes;
			}
			if(seconds < 10){
			  seconds = "0"+seconds;
			}
			
			var jetLag = new Object();
			jetLag.dateDiff = dateDiff;
			jetLag.dayDiff = dayDiff;
			jetLag.hours = hours;
			jetLag.allHours = allHours;
			jetLag.minutes = minutes;
			jetLag.seconds = seconds;
			return jetLag;
		 }
	</script>

</html>