|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
|
<head>
|
|
|
{% load static %}
|
|
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
|
<title>天天生鲜-首页</title>
|
|
|
<link rel="stylesheet" type="text/css" href="{% static 'css/reset.css' %}">
|
|
|
<link rel="stylesheet" type="text/css" href="{% static 'css/main.css' %}">
|
|
|
<script type="text/javascript" src="{% static 'js/jquery-1.12.4.min.js' %}"></script>
|
|
|
<script type="text/javascript" src="{% static 'js/jquery-ui.min.js' %}"></script>
|
|
|
<script type="text/javascript" src="{% static 'js/slide.js' %}"></script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="header_con">
|
|
|
<div class="header">
|
|
|
<div class="welcome fl">欢迎来到天天生鲜!</div>
|
|
|
<div class="fr">
|
|
|
{% if user.is_authenticated %}
|
|
|
<div class="login_btn fl">
|
|
|
欢迎您:<em>{{ user.username }}</em>
|
|
|
<span>|</span>
|
|
|
<a href="{% url 'user:logout' %}">退出</a>
|
|
|
</div>
|
|
|
{% else %}
|
|
|
<div class="login_btn fl">
|
|
|
<a href="{% url 'user:login' %}">登录</a>
|
|
|
<span>|</span>
|
|
|
<a href="{% url 'user:register' %}">注册</a>
|
|
|
</div>
|
|
|
{% endif %}
|
|
|
<div class="user_link fl">
|
|
|
<span>|</span>
|
|
|
<a href="{% url 'user:user' %}">用户中心</a>
|
|
|
<span>|</span>
|
|
|
<a href="{% url 'cart:show' %}">我的购物车</a>
|
|
|
<span>|</span>
|
|
|
<a href="{% url 'user:order' 1 %}">我的订单</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="search_bar clearfix">
|
|
|
<a href="{% url 'goods:index' %}" class="logo fl"><img src="{% static 'images/logo.png' %}" alt=""></a>
|
|
|
<div class="search_con fl">
|
|
|
<form action="/search" method="get">
|
|
|
<input type="text" class="input_text fl" name="q" placeholder="搜索商品">
|
|
|
<input type="submit" class="input_btn fr" name="" value="搜索">
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="guest_cart fr">
|
|
|
<a href="{% url 'cart:show' %}" class="cart_name fl">我的购物车</a>
|
|
|
<div class="goods_count fl" id="show_count">{{ cart_count }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="navbar_con">
|
|
|
<div class="navbar">
|
|
|
<h1 class="fl">全部商品分类</h1>
|
|
|
<ul class="navlist fl">
|
|
|
<li><a href="{% url 'goods:index' %}">首页</a></li>
|
|
|
<li class="interval">|</li>
|
|
|
<li><a href="">手机生鲜</a></li>
|
|
|
<li class="interval">|</li>
|
|
|
<li><a href="">抽奖</a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="center_con clearfix">
|
|
|
<ul class="subnav fl">
|
|
|
{% for type in types %}
|
|
|
<li><a href="#model0{{ forloop.counter }}" class="{{ type.logo }}">{{ type.name }}</a></li>
|
|
|
{% endfor %}
|
|
|
</ul>
|
|
|
<div class="slide fl">
|
|
|
<ul class="slide_pics">
|
|
|
{% for banner in goods_banners %}
|
|
|
<li><a href="{% url 'goods:detail' banner.sku.id %}"><img src="{{ banner.image.url }}" alt="幻灯片"></a></li>
|
|
|
{% endfor %}
|
|
|
</ul>
|
|
|
<div class="prev"></div>
|
|
|
<div class="next"></div>
|
|
|
<ul class="points"></ul>
|
|
|
</div>
|
|
|
<div class="adv fl">
|
|
|
{% for banner in promotion_banners %}
|
|
|
<a href="{{ banner.url }}"><img src="{{ banner.image.url }}"></a>
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
{% for type in types %}
|
|
|
<div class="list_model">
|
|
|
<div class="list_title clearfix">
|
|
|
<h3 class="fl" id="model0{{ forloop.counter }}">{{ type.name }}</h3>
|
|
|
<div class="subtitle fl">
|
|
|
<span>|</span>
|
|
|
{% for font in type.font_goods_banners %}
|
|
|
<a href="{% url 'goods:detail' font.sku.id %}">{{ font.sku.name }}</a>
|
|
|
{% endfor %}
|
|
|
</div>
|
|
|
<a href="{% url 'goods:list' type.id 1 %}" class="goods_more fr" id="{{ type.logo }}">查看更多 ></a>
|
|
|
</div>
|
|
|
|
|
|
<div class="goods_con clearfix">
|
|
|
<div class="goods_banner fl"><img src="{{ type.image.url }}"></div>
|
|
|
<ul class="goods_list fl">
|
|
|
{% for image in type.image_goods_banners %}
|
|
|
<li>
|
|
|
<h4><a href="#">{{ image.sku.name }}</a></h4>
|
|
|
<a href="{% url 'goods:detail' image.sku.id %}?sort=default"><img src="{{ image.sku.image.url }}"></a>
|
|
|
<div class="prize">¥ {{ image.sku.price }}</div>
|
|
|
</li>
|
|
|
{% endfor %}
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
{% endfor %}
|
|
|
|
|
|
<div class="footer">
|
|
|
<div class="foot_link">
|
|
|
<a href="#">关于我们</a>
|
|
|
<span>|</span>
|
|
|
<a href="#">联系我们</a>
|
|
|
<span>|</span>
|
|
|
<a href="#">招聘人才</a>
|
|
|
<span>|</span>
|
|
|
<a href="#">友情链接</a>
|
|
|
</div>
|
|
|
<p>CopyRight © 2024 天天生鲜信息技术有限公司 All Rights Reserved</p>
|
|
|
<p>电话:010-****888 京ICP备*******8号</p>
|
|
|
</div>
|
|
|
<script type="text/javascript" src="{% static 'js/slideshow.js' %}"></script>
|
|
|
<script type="text/javascript">
|
|
|
BCSlideshow('focuspic');
|
|
|
var oFruit = document.getElementById('fruit_more');
|
|
|
var oShownum = document.getElementById('show_count');
|
|
|
|
|
|
var hasorder = localStorage.getItem('order_finish');
|
|
|
|
|
|
if(hasorder)
|
|
|
{
|
|
|
oShownum.innerHTML = '2';
|
|
|
}
|
|
|
|
|
|
oFruit.onclick = function(){
|
|
|
window.location.href = 'list.html';
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |