cart.html 1.5 KB
Newer Older
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			th, td { margin: 0; padding: 0; width: 180px; text-align: left; }
			.name { font-size: 14px; font-weight: bolder; width: 280px; }
			.price { color: red; font-size: 18px; }
			a { display: inline-block; text-align: center; background-color: red; }
			.back { width: 120px; height: 30px; line-height: 30px; }
			.del { width: 60px; height: 20px; line-height: 20px; }
			a:link, a:visited { color: white; text-decoration: none; }
			.left { float: left; width: 1000px;}
			.right { float: right; }
			.total { text-align: right; }
		</style>
	</head>
	<body>
		<div class="left">
			<h1>购物车列表</h1>
			<hr>
		</div>
		<div class="right">
24
			<a href="/" class="back">返回</a>
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
25
		</div>
26
		{% if cart %}
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
27 28 29 30 31 32 33 34
		<table style="clear: both;">
			<tr>
				<th>商品名称</th>
				<th>商品单价</th>
				<th>商品数量</th>
				<th>商品总价</th>
				<th>操作</th>
			</tr>
35
			{% for item in cart %}
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
36
			<tr>
37 38
				<td class="name">{{ item.goods.name }}</td>
				<td class="price">&yen;{{ item.goods.price }}</td>
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
39
				<td>{{ item.amount }}</td>
40
				<td class="price">&yen;{{ item.total }}</td>
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
41 42 43 44 45 46 47 48 49
				<td>
					<a href="" class="del">删除</a>
				</td>
			</tr>
			{% endfor %}
			<tr>
				<td colspan="5" class="total price">&yen;{{ cart.total }}元</td>
			</tr>
		</table>
50
		<a href="" class="back">清空购物车</a>
骆昊的技术专栏's avatar
骆昊的技术专栏 已提交
51 52 53 54 55
		{% else %}
		<h3 style="clear: both;">购物车中暂时没有商品!</h3>
		{% endif %}
	</body>
</html>