📄 shopping.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import= "com.set.appframe.data.GenericValueObject" %>
<%@ page import= "com.set.utils.WebUtils" %>
<%
List list=(List)request.getAttribute("shopping");
%>
<html>
<head>
<title>我的购物车</title>
<LINK href="../css/ie_global.css" type=text/css rel=stylesheet>
<link href="../css/ie_navigation.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
.style2 {
font-size: large;
font-weight: bold;
}
-->
</style>
</head>
<script type="text/javascript">
function onRemove(entity){
if(confirm("确定删除此商品吗?")){
document.location.href="/shopping/ShoppingAction.do?dispatch=remove&id="+entity;
}
}
function onRemoveAll(){
if(confirm("确定清空购物车吗?")){
document.location.href="/shopping/ShoppingAction.do?dispatch=removeAll";
}
}
function onBalance(){
document.location.href="/shopping/ShoppingAction.do?dispatch=search&key=balance";
}
</script>
<body>
<form action="/shopping/ShoppingAction.do?dispatch=modify" method=post name="shopping">
<input type=hidden name="dispatch" value="modify">
<div align="center">
<font size="4"><span class="style2"> 我的购物车 </span></font> </div>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td width="20%" height="30" align="center"><span class="style1">商品型号</span></td>
<td width="15%" align="center"><span class="style1">单价</span></td>
<td width="15%" align="center"><span class="style1">数量</span></td>
<td width="15%" align="center"><span class="style1">总价</span></td>
<td width="15%" align="center"><span class="style1">删除</span></td>
</tr>
<%
int numbers=0;
int totalsPrice=0;
int pnumbers=0;
if(list!=null){
pnumbers=list.size();
for(int i=0;i<list.size();i++){
GenericValueObject gvo = (GenericValueObject)list.get(i);
numbers=numbers+Integer.parseInt(gvo.getItemString("NUMBER"));
totalsPrice=totalsPrice+Integer.parseInt(gvo.getItemString("TOTALPRICE"));
%>
<tr>
<td height=30 align=center><%=gvo.getItemString("PRODUCTMODEL") %></td>
<td height=30 align=center><%=gvo.getItemString("PRICE") %>元</td>
<td height=30 align=center>
<input type=hidden name="ID"+"<%=i %>" value="<%=gvo.getItemString("ID") %>">
<input name="NUMBER"+"<%=i %>" value="<%=gvo.getItemString("NUMBER") %>"></td>
<td height=30 align=center><%=gvo.getItemString("TOTALPRICE") %>元</td>
<td height=30 align=center><a href="javascript:onRemove('<%=gvo.getItemString("ID") %>')"><img src="../image/attc_del.gif" border=0></a></td>
</tr>
<%
}
}
%>
<tr bgcolor="#FFFFFF">
<td height="30" colspan="5" align="center">
<input type=button class=button value=" 继续购物" onclick="window.close()">
<input type=submit class=button value=" 修改数量" >
<input type="button" class="button" value="清空购物车" onclick="onRemoveAll()">
<input type=button class=button value=" 收银台 " onclick="onBalance()">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" colspan="5" align="center"><font size="3"><strong>您的购物车里有商品:<%=pnumbers %>件 总数:<%=numbers %>件 共计:<%=totalsPrice %>元 </strong></font></td>
</tr>
</table>
</form>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -