<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>{$catearr['name']}</title>
		<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">
		<link rel="stylesheet" href="__STATIC__/mui/css/mui.css">
		<link rel="stylesheet" href="__STATIC__/css/swiper.css">
		<link rel="stylesheet" href="__STATIC__/css/reset.css">
		<link rel="stylesheet" href="__STATIC__/css/vip.css">
		<script src="__STATIC__/js/jquery-2.1.0.js"></script>
		<script src="__STATIC__/js/flexible.min.js"></script>
		<script src="__STATIC__/js/swiper.js"></script>
	</head>
	<style>
		html,
		body {
			background-color: #f7f7f7;
		}
		
		.mui-content {
			overflow: hidden;
		}
.swiper-pagination-bullet-active {
	    opacity: 1 !important;
	    background: #EFF2F5 !important;
	}
	.swiper-pagination-bullet {
	    width: 8px;
	    height: 8px;
	    display: inline-block;
	    border-radius: 100%;
	    background: #000;
	    opacity: 0.2;
	}
	#swiper1 .swiper-slide img{
        width: 100vw;
        height: 40vw;
    }
	</style>

	<body>
			
		<div class="mui-content" style="overflow:hidden;">
			<?php if(!empty($adv)){ ?>
			  <div class="swiper-container" id="swiper1">
			        <div class="swiper-wrapper">
			            <?php foreach($adv['img'] as $k=>$v){?>
			            <div class="swiper-slide"><a href="{$adv['link'][$k]}"><img src="{$Think.session.addr}/public/uploads/{$v}" /></a></div>
			            <?php }?>
			        </div>
			        <!-- 如果需要分页器 -->
			        <div class="swiper-pagination"></div>
			    </div>
			<?php }?>
			<div class="dd_search">
				<div class="dd_sar">
					<form action="" class="input-kw-form">
	                	<input class="dd_sar_in" type="text" value="<?php if($goodsname != ''){echo $goodsname;} ?>" placeholder="查询商品">
					</form>
				</div>
				<div class="dd_sar_btn" id="select">搜索</div>
				<script>
					$("#select").click(function(){
						var name = $(".dd_sar_in").val();
						if(name != ""){
							$(".dd_sar_in").val(name);
						}
						var levelid = "{$levelid}";
						var cateid = "{$cateid}";
						if(name !== ""){
							window.location.href= '/index.php/Mobile/Goods/goodslist?goodsname='+name+'&levelid='+levelid+'&cateid='+cateid;
						}else{
							window.location.href= '/index.php/Mobile/Goods/goodslist?levelid='+levelid+'&cateid='+cateid;
						}
					})
					/* $(".dd_sar_in").focus(function() {
						$(this).addClass("active");
					});
					$(".dd_sar_in").blur(function() {
						$(this).removeClass("active");
					}); */
				</script>
			</div>

			<div class="pro-list">
				<div class="mui-col-xs-3">
					<div id="segmentedControls" class="mui-segmented-control mui-segmented-control-inverted mui-segmented-control-vertical">
						<foreach name='brandarr' item="xx">
						<assign name="$brandid" value="$xx['id']"/>
							<a class="mui-control-item <if condition='$key eq 0'>mui-active</if>" href="#content{$xx['id']}"><img src="{$xx['logo']}"/></a>
						</foreach>
						
					</div>
				</div>
				<div id="segmentedControlContents" class="mui-col-xs-9 bk_right">
					<foreach name="brandarr" item="x">
					<div id="content{$x['id']}" class="mui-control-content "> 
						<ul class="pro-ul">
						<foreach name="goodsarr" item="v">
							<if condition="$v['brand_id'] eq $x['id']">
								<li>  
		                    		<a href="{:U('Mobile/Goods/goodsInfo',array('id'=>$v[goods_id]))}" title="{$v.goods_name}">
			                            <div class="pro-img">
			 	                          	<img src="{$v[goods_id]|goods_thum_images=400,400}">
			                            </div>
			                            <div class="pro-tit">
			                            	<font color='black'><span class="similar-product-text">{$v[goods_name]|getSubstr=0,20}</span></font>
			                            </div>
										<div class="pro-price">
			                            	<strong>￥{$v['shop_price']}</strong><br>
			                            	<if condition="$v['exchange_integral'] gt -1">
			                            	<strong class="s_bp_jf">{$v['shop_price']*$duihuan}</strong>
			                            	</if>
			                            </div>
		                            </a>
								</li>
							</if>
						</foreach>
						</ul>
					</div>
					</foreach>
				</div>
			</div>
		</div>
		<!-- <div class="nav">
			<span class="navd"><a href="{$Think.session.addr}/front/index/index" style='color:black'>会员专区</a></span>
            <span class="navd"><a href="{$Think.session.addr}/front/index/newactivity" style='color:black'>最新活动</a></span>
            <span class="navd active"><a href="/Mobile/Index/index" style='color:black'>积分商城</a></span>
            <span class="navd"><a href="{$Think.session.addr}/front/index/myCenter" style='color:black'>个人中心</a></span>
		</div> -->
		<include file="./public/commonality" />
		<script src="__STATIC__/mui/js/mui.min.js"></script>
		<script type="text/javascript" charset="utf-8">
			// swiper 初始设置
			var mySwiper = new Swiper('#swiper1',{
			    direction: 'horizontal',
			    loop: true,
			    autoplay:true,
			    autoHeight: true,
			    // 如果需要分页器
			    pagination: {
			        el: '.swiper-pagination',
			    },
			});
			var gallery = mui('.mui-slider');
			gallery.slider({
				interval: 4000 //自动轮播周期，若为0则不自动播放，默认为0；
			});
			//gallery.slider().gotoItem(0);
			$('.mui-control-content:first').addClass('mui-active');
			var setListHeight=function(){
				var h=$(window).height()-$("#slider").height()-$(".dd_search").height()-$(".nav").height()-20;
				$(".pro-list").css("height",h);
			}
			setListHeight();
		</script>
		{$oauthScript}
	</body>

</html>