<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<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" />
	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/watero/css/mui.min.css?v=2018111001" />
	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/watero/css/swiper.min.css?v=2018111001" />
	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/watero/css/iconfont.css?v=2018111001" />
	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/watero/css/style.css?v=2018111001" />
	<style>
		.year-dalog{background:url(//s.iamberry.com/watero/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%;}
		.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: #999;}
		.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 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;}
	</style>
</head>

<body>
<div class="loading-bg">
	<div class="mui-loading">
		<div class="mui-spinner">
		</div>
		&nbsp;&nbsp;加载中...
	</div>
</div>
<nav class="mui-bar mui-bar-tab" id="footer-bar">
	<a class="mui-tab-item mui-active">
		<div class="iconfont icon-home"></div>
		<span class="mui-tab-label">首页</span>
	</a>
	<a class="mui-tab-item go_gwc">
		<div class="iconfont icon-gouwuche"><span class="mui-badge">0</span></div>
		<span class="mui-tab-label">购物车</span>
	</a>
	<a class="mui-tab-item">
		<div class="iconfont icon-dingdan"></div>
		<span class="mui-tab-label">我的订单</span>
	</a>
	<a class="mui-tab-item">
		<div class="iconfont icon-vip"></div>
		<span class="mui-tab-label">会员中心</span>
	</a>
</nav>
<!--header 开始-->
<header class="mui-bar mui-bar-nav header">
	<div class="go-index go_index">
		<img src="//s.iamberry.com/watero/images/logo.png">
	</div>
	<h6>Ta 是一种生活方式</h6>
</header>
<!--header 结束-->
<div class="mui-content" style="background: #fff;">
	<!--商城首页begin-->
	<div class="mui-content-padded">
		<!--banner 开始-->
		<div class="swiper-container" style="padding:10px 0 20px 0;">
			<div class="swiper-wrapper">
				<!--<div class="swiper-slide"><img width="100%" src="//s.iamberry.com/watero/images/banner-20190102.png" /></div>-->
				<div class="swiper-slide"><img width="100%" src="//s.iamberry.com/watero/images/banner-20190101.png" /></div>
			</div>
			<!-- 如果需要分页器 -->
			<div class="swiper-pagination mui-text-center"></div>
		</div>
		<!--banner 结束-->
	</div>

	<div class="index-title go_web_shop">
		<strong>水机产品</strong><span class="mui-pull-right"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
	</div>
	<!--list开始-->
	<div class="chanpin-box">
		<ul class="mui-table-view mui-grid-view pro-list">
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><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"><div class="mui-text-left"><div class="mui-media-body">WA-1桌面净水机</div><h6>即净即饮、5档控温</h6><div class="pro-price"><span>¥2999</span><s>¥5680</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><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"><div class="mui-text-left"><div class="mui-media-body">WA-1桌面净水机</div><h6>即净即饮、5档控温</h6><div class="pro-price"><span>¥2999</span><s>¥5680</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><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"><div class="mui-text-left"><div class="mui-media-body">WA-1桌面净水机</div><h6>即净即饮、5档控温</h6><div class="pro-price"><span>¥2999</span><s>¥5680</s></div></div></a></li>
			<li class="mui-table-view-cell mui-media mui-col-xs-6"><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"><div class="mui-text-left"><div class="mui-media-body">WB-1 桌面净水机</div><h6>4级RO净化、3秒即热</h6><div class="pro-price"><span>¥1999</span><s>¥3999</s></div></div></a></li>
        </ul>
	</div>
	<!--list结束-->
<!--    <div class="index-title go_web_shop">
        <strong>Aiberle</strong><span class="mui-pull-right"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
    </div>-->
    <!--list开始-->
    <!--<div class="chanpin-box">
        <ul class="mui-table-view mui-grid-view pro-list">
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="62" colorid="45" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/w6_fen.jpg"><div class="mui-text-left"><div class="mui-media-body">Aiberle桌面净水机W6</div><h6>4级RO净化、3秒即热</h6><div class="pro-price"><span>¥3999</span><s>¥5680</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="62" colorid="44" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/w6_lv.jpg"><div class="mui-text-left"><div class="mui-media-body">Aiberle桌面净水机W6</div><h6>4级ro净化、3秒即热</h6><div class="pro-price"><span>¥3999</span><s>¥5680</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="59" colorid="41" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-rsj.jpg"><div class="mui-text-left"><div class="mui-media-body">美容软水机</div><h6>除余氯净水、护肤补水</h6><div class="pro-price"><span>¥799</span><s>¥899</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="60" colorid="42" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-hs.jpg"><div class="mui-text-left"><div class="mui-media-body">美肤SPA净水花洒</div><h6>3级过滤软水、除余氯净水</h6><div class="pro-price"><span>¥399</span><s>¥499</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="61" colorid="43" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-slt.jpg"><div class="mui-text-left"><div class="mui-media-body">水龙头净水器</div><h6>活性炭陶瓷滤芯净水机</h6><div class="pro-price"><span>¥299</span><s>¥399</s></div></div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-6"><a proid="63" colorid="47" class="go_chanpin_details"><img class="mui-media-object" src="http://s.iamberry.com/watero/images/shop/cp-qxj.jpg"><div class="mui-text-left"><div class="mui-media-body">果蔬清洗机</div><h6>活氧杀菌、涡流喷淋清洗</h6><div class="pro-price"><span>¥799</span><s>¥999</s></div></div></a></li>
        </ul>
    </div>-->
    <!--list结束-->
	<div class="index-title go_web_shop2" style="margin-top: 20px;">
		<strong>滤芯配件</strong><span class="mui-pull-right go_pro_list"><font>更多</font><span class="mui-icon mui-icon-arrowright"></span></span>
	</div>
	<div class="mui-content-padded my-content-padded" id="advs_banner" style="display: block;">
		<a><img src="//s.iamberry.com/watero/images/lvxin-4.jpg"></a>
	</div>
	<!--商城首页end-->
</div>
<!--春节放假通知-->
<div class="year-dalog"></div>
<script src="//s.iamberry.com/watero/js/mui.min.js?v=2016111701"></script>
<script src="//s.iamberry.com/watero/js/jquery-2.1.1.min.js"></script>
<script src="//s.iamberry.com/watero/js/swiper.min.js?v=2018010201"></script>
<script src="//s.iamberry.com/watero/js/shop/main.js?v=20170622"></script>
<script src="//s.iamberry.com/watero/js/shop/wechat-utils-1.0.js"></script>
</body>
<script>
    var clickdate = JSON.parse(localStorage.getItem('clickdate'));
    mui.ready(function() {
        //springFestivalPop();
        marquee_Show();
        getCartNum();
        mui.ajax(base_path + '/indexData?dates=' + new Date().getTime(), {
            dataType: 'json',
            type: 'post',
            timeout: 15000,
            success: function(dt) {
                var bannerstr = "",
                    prostr = "",
                    dian = "",
                    advsstr = "";
                if(dt.status) {
                    var banner_data = dt.data.banners;
                    mui(banner_data).each(function(index) {
                        bannerstr+='<div class="swiper-slide" name="' + this.bannerImageCheckOutUrl + '"><img width="100%" src="' + (this.bannerImageUrl) + '" /></div>';
                    });
                    $(".swiper-wrapper").html(bannerstr);
                    /*dc('mui-slider-loop').innerHTML = bannerstr;
                    dc('my-slider-indicator').innerHTML = dian;
                    $("<div id='banner-slider' 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");*/
                    // var advs_data = dt.data.advs;
                    //mui(advs_data).each(function(index) {
                    //   advsstr += '<a href="' + this.bannerImageCheckOutUrl + '"><img src="' + this.bannerImageUrl + '" /></a>'
                    //});
                    //dc('advs_banner').innerHTML = advsstr;
                    dc('advs_banner').style.display = 'block';

                    mui.each(document.querySelectorAll('#banner-slider a'), function(index, el) {
                        el.addEventListener('tap', function() {
                            //document.querySelector('.loading-bg').style.display = 'block';
                            var str=this.getAttribute('href');
                            console.log(this.getAttribute('href'));
                            if(str!="#" && str!=''){
                                location.href = this.getAttribute('href')
                            }
                        }, false)
                    });
                    mui.each(document.querySelectorAll('#advs_banner a'), function(index, el) {
                        el.addEventListener('tap', function() {
                            //document.querySelector('.loading-bg').style.display = 'block';
                            location.href = base_path+'/wxCart/goProductList?proType=2';
                        }, false)
                    });
                    //banner 初始化
                    var swiper = new Swiper('.swiper-container', {
                        autoplay: {
                            delay: 5000,//5秒切换一次
                        },
                        effect: 'slide',
                        loop: true,
                        grabCursor: true,
                        pagination: {
                            el: '.swiper-pagination',
                        },
                    });
                    var shareOpenid = dt.data.memberOpenid;
                    var link = "https:" + domanUrl + base_path + "/index?shareOpenid=" + shareOpenid;
                    window.repleFlag = false;
                    window.wxFriend = {
                        "appId": "",
                        "imgUrl": "https:"+domanUrl + '/watero/common/shop/images/index.jpg',
                        "link": link,
                        "desc": "WaterO水时代商城，开启优雅生活",
                        "title": "WaterO水时代商城，好水，好茶，生活不将就！",
                        "netError": "您的网络异常，请刷新重试!如多次刷新无效，请向我们反应 ~",
                        "shareTimeSuccess": "分享成功",
                        "shareTimeCancel": "已取消分享",
                        "shareAppSuccess": "分享成功!",
                        "shareAppCancel": "已取消分享"
                    };
                    getConfig();
                    document.querySelector('.loading-bg').style.display = 'none'
                } else {
                    mui.alert(dt.message, ' ', '朕知道了', function() {
                        mui.openWindow({
                            url: domanUrl + base_path + "/index?dates=" + new Date().getTime()
                        })
                    })
                }
            },
            error: function(xhr, type, errorThrown) {
                console.log(xhr)
            }
        });
        if(marquee != '') {
            $('body').append('<div class="marquee-show"><div></div></div>')
        }
        mui.ajax(base_path + '/product/productIndex?dates=' + new Date().getTime(), {
            data: {
                "pageSize": 20,
                "pageNO": 1,
                "productType": 1
            },
            dataType: 'json',
            type: 'post',
            timeout: 15000,
            success: function(dt) {
                if(dt.status) {
                    var chanpin_data = [];
                    chanpin_data = dt.data.productList;
                    var table = document.body.querySelector('.pro-list');
                    mui(chanpin_data).each(function(index) {
                        var pro_color = this.productColor;
                        var li = document.createElement('li');
                        li.className='mui-table-view-cell mui-media mui-col-xs-6';
                        var yuanjia = '<s>¥' + accDiv(this.productPrice, 100) + '</s>';
                        if(marquee != '' && this.productDiscount == '328000') {
                            yuanjia = '<span class="mui-h6">购买即赠3年滤芯</span>'
                        }
                        li.innerHTML='<a proid="' + this.productId + '" colorid="'+this.colorId+'" class="go_chanpin_details"><img class="mui-media-object" src="' + this.colorImg + '"><div class="mui-text-left"><div class="mui-media-body">' + this.productName + '</div><h6>' + this.productColorDes + '</h6><div class="pro-price"><span>¥' + accDiv(this.productDiscount, 100) + '</span><s>' + yuanjia + '</s></div></div></a>';
                        //li.innerHTML = '<a proid="' + this.productId + '" colorid="'+this.colorId+'" class="go_chanpin_details"><img class="mui-media-object" src="//s.iamberry.com/watero/images/' + img + '"><div class="mui-media-body gwc-tit">' + this.productName + ' <small class="gwc-pp">(' + pro_color + ')</small></div><div class="mui-ellipsis mui-h6">' + this.productColorDes + '</div><div class="shop-price">' + marquee + '<span class="price-sp">¥' + accDiv(this.productDiscount, 100) + '</span>' + yuanjia + '</div><div class="btn-box"><a class="mui-btn my-btn-danger go-clearing" proid="' + this.productId + '" colorid="'+this.colorId+'">立即购买</a><a class="mui-btn my-btn-joincart iconfont icon-gouwuche go_gwc_pro" proid="' + this.productId + '" colorid="'+this.colorId+'"></a></div></a>'

                        //table.appendChild(li)
                    })
                } else {

                }
            },
            error: function(xhr, type, errorThrown) {
                console.log(xhr)
            }
        });
    });
    $(document).on('tap', '.go_web_shop2', function() {
        location.href = base_path+'/wxCart/goProductList?proType=2';
    });
    //春节放假通知弹窗点击事件
    $(document).on('tap', '.year-dalog', function() {
        if(!window.localStorage) {
            mui.alert("您的浏览器不支持localStorage");
        } else {
            //自定义json数据
            var obj = {};
            obj = {
                text: new Date().getTime()
            };
            //json格式化插入    点击时间
            localStorage.setItem('clickdate', JSON.stringify(obj));
        }
        $(".year-dalog").removeClass("active");
        setTimeout(function(){
            $(".year-dalog").hide();
        },500);
    });
    $(document).ready(function(){
        var d = new Date().getTime();//当前时间戳
        //弹窗提示时间为1月18日-2月13日
        if (d > 1547740800000 && d < 1550073599000) {
            if(!window.localStorage) {
                mui.alert("您的浏览器不支持localStorage");
            } else {
                if(clickdate != null) {
                    var oldDate = new Date(clickdate.text).getDay();
                    //如果本地存储的getDay比当前时间的getDay大则显示弹窗
                    if(new Date().getDay() > oldDate) {
                        $(".year-dalog").addClass("active").show();
                    }
                }else{
                    //本地没有存储时间也显示弹窗
                    $(".year-dalog").addClass("active").show();
                }
            }
        }
    });


</script>
</html>