<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>{echo:$this->_siteConfig->name}</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	{js:jquery}
	{js:form}
	{js:validate}
	{js:dialog}
	{js:artTemplate}
	<!--[if IE]><script src="{theme:javascript/html5.js}"></script><![endif]-->
	<script src='{theme:javascript/site.js}'></script>
	<link rel="stylesheet" href="{skin:style/style.css}">
	<script type='text/javascript' src='{webroot:public/javascript/public.js}'></script>
</head>
<body class="index">
<header>
	<div class="header_top">
		<div class="web">
			<div class="welcome">
				欢迎您来到 {echo:$this->_siteConfig->name}！
				{if:$this->user}
					<a href="{url:/ucenter/index}">个人中心</a>
					<a href="{url:/simple/logout}">退出</a>
				{else:}
					<a href="{url:/simple/login}">登录</a>
					<a class="reg" href="{url:/simple/reg}">免费注册</a>
				{/if}
			</div>
			<div class="header_cart" name="mycart">
				<a href="{url:/simple/cart}" class="go_cart">
					<i class="icon-shopping-cart"></i>
					购物车（<em class="count" name="mycart_count"]>0</em>）
				</a>
				<div class="cart_simple" id="div_mycart"></div>
			</div>
			<!--购物车模板 开始-->
			<script type='text/html' id='cartTemplete'>
			<div class='cart_panel'>
				<ul class='cart_list'>
					<%for(var item in goodsData){%>
					<%var data = goodsData[item]%>
					<li id="site_cart_dd_<%=item%>">
						<em>共<%=data['count']%>件</em>
						<a target="_blank" href="{url:/site/products/id/<%=data['goods_id']%>}">
							<img src="<%=webroot(data['img'])%>">
							<h5><%=data['name']%></h5>
						</a>
						<span>￥ <%=data['sell_price']%></span>
						<del onclick="removeCart('<%=data['id']%>','<%=data['type']%>');$('#site_cart_dd_<%=item%>').hide('slow');">删除</del>
					</li>
					<%}%>
					<%if(goodsCount){%>
					<div class="cart_total">
						<p>共<span name="mycart_count"><%=goodsCount%></span>件商品</p>
						<p>商品总额：<em name="mycart_sum">￥<%=goodsSum%></em></p>
						<a href="{url:simple/cart}">去购物车结算</a>
					</div>
					<%}else{%>
					<div class='cart_no'>购物车空空如也~</div>
					<%}%>
				</ul>
			</div>
			</script>
			<ul class="top_tool">
				<li><a href="{url:ucenter/index}">个人中心</a></li>
				<li><a href="{url:/simple/seller}">申请开店</a></li>
				<li><a href="{url:/seller/index}">商家管理</a></li>
				<li><a href="{url:/site/help_list}">使用帮助</a></li>
			</ul>
		</div>
	</div>
	<div class="container">
        <!-- logo与搜索 -->
        <div class="body_wrapper">
            <!-- logo -->
            <a title="{$this->_siteConfig->name}" href="{url:}" class="logo">
				<img src="{if:$this->_siteConfig->logo}{webroot:$this->_siteConfig->logo}{else:}{skin:image/logo.png}{/if}">
            </a>
            <!-- 搜索框 -->
            <div class="search_box">
                <!-- 搜索内容 -->
				<form method='get' action='{url:/}'>
					<input type='hidden' name='controller' value='site'>
					<input type='hidden' name='action' value='search_list'>
					<div class="search">
                        <i class="icon-search"></i>
                        <input type="text" name='word' placeholder="输入关键词" class="search_keyword" autocomplete="off" style="color: rgb(204, 204, 204);">
                        <button class="search_submit" type="submit">搜索</button>
	                </div>
				</form>
                <!-- 热门搜索 -->
                <div class="search_hotwords">
					{foreach:items=Api::run('getKeywordList',2) }
					{set:$tmpWord = urlencode($item['word']);}
					<a href="{url:/site/search_list/word/$tmpWord}">{$item['word']}</a>
					{/foreach}
                </div>
            </div>
        </div>
        <!-- 导航栏 -->
        <div class="nav_bar">
            <!-- 分类列表 -->
            <div class="category_list">
                <a class="all_goods_sort" href="" target="_blank">
                    <span>全部商品分类</span>
                </a>
				<!-- 分类列表-详情none -->
				<ul class="cat_list none">
					{foreach:items=Api::run('getCategoryListTop')  item=$first}
					<li>
						<h3><a href="{url:/site/pro_list/cat/$first[id]}">{$first['name']}</a></h3>
						<div class="cat_more">
							{foreach:items=Api::run('getCategoryByParentid',array('#parent_id#',$first['id']))  item=$second}
							<dl>
								<dt><a href="{url:/site/pro_list/cat/$second[id]}">{$second['name']}</a></dt>
								<dd>
									{foreach:items=Api::run('getCategoryByParentid',array('#parent_id#',$second['id']))  item=$third}
									<a href="{url:/site/pro_list/cat/$third[id]}">{$third['name']}</a>
									{/foreach}
								</dd>
							</dl>
							{/foreach}
						</div>
					</li>
					{/foreach}
				</ul>
				<!-- 分类列表-详情 -->
			</div>
			<!-- 分类列表 -->
			<!-- 导航索引 -->
			<div class="nav_index">
				<ul class="nav">
					<li><a href="{url:/site/index}">首页</a></li>
					{foreach:items=Api::run('getGuideList')}
					<li><a href="{url:$item[link]}">{$item['name']}</a></li>
					{/foreach}
				</ul>
			</div>
		</div>
	</div>
</header>

<!-- 内容显示 -->
{viewcontent}
<!-- 底部 -->
<footer class="foot">
	<section class="service">
		<ul>
			<li class="item1">
				<img src="{skin:image/a1.png}" alt="">
				<div>
					<p><strong>正品保障</strong></p>
					<p>正品保障，提供发票</p>
				</div>
			</li>
			<li class="item2">
				<img src="{skin:image/a2.png}" alt="">
				<div>
					<p><strong>急速物流</strong></p>
					<p>急速物流，急速送达</p>
				</div>
			</li>
			<li class="item3">
				<img src="{skin:image/a3.png}" alt="">
				<div>
					<p><strong>无忧售后</strong></p>
					<p>7天无理由退换货</p>
				</div>
			</li>
			<li class="item4">
				<img src="{skin:image/a4.png}" alt="">
				<div>
					<p><strong>特色服务</strong></p>
					<p>私人订制家电套餐</p>
				</div>
			</li>
			<li class="item5">
				<img src="{skin:image/a5.png}" alt="">
				<div>
					<p><strong>帮助中心</strong></p>
					<p>您的购物指南</p>
				</div>
			</li>
		</ul>
	</section>
	<section class="help">
		{set:$catIco = array('help-new','help-delivery','help-pay','help-user','help-service')}
		{foreach:items=Api::run('getHelpCategoryFoot') item=$helpCat}
		<dl class="help_{echo:$key+1}">
			<dt>{$helpCat['name']}</dt>
			{foreach:items=Api::run('getHelpListByCatidAll',array('#cat_id#',$helpCat['id']))}
			<dd><a href="{url:/site/help/id/$item[id]}">{$item['name']}</a></dd>
			{/foreach}
		</dl>
		{/foreach}
		<div class="contact">
			<em>400-888-8888</em>
			<span>周一到周日 8:00-18:00</span>
			<span>（仅收市话费）</span>
			<div><i class="icon-comments"></i> 24小时在线客服</div>
		</div>
	</section>
	<section class="copy">
		{echo:IFilter::stripSlash($this->_siteConfig->site_footer_code)}
	</section>
</footer>
<script type='text/javascript'>
//当首页时隐藏分类
{if:IWeb::$app->getController()->getId() == 'site' && IWeb::$app->getController()->getAction()->getId() == 'index'}
$('.cat_list').removeClass('none');
$('.back_home').removeClass('back_home_block');
{/if}
$(function()
{
	//搜索框填充默认数据
	$('input:text[name="word"]').val("{$this->word}");
});
</script>
</body>
</html>
