📄 cyd_product_list.jsp
字号:
<%@page contentType="text/html;charset=GBK" %>
<html:form method="post" action="/fg/product/fgproductSearch">
<jsp:useBean id="pager" class="com.keyshop.pub.util.Pager" scope="request"/>
<input type="hidden" name="maxRecNoPerPage" value="<%=pager.getRowsPerPage()%>"/>
<input type="hidden" name="recordNumber" value="<%=pager.getTotalRow()%>"/>
<%
parentCategoryList = (List)request.getAttribute("categoryList");
if(parentCategoryList != null && parentCategoryList.size() >0 ) {
%>
<table width="640" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" colspan="2">
<table width="95%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<!--商品类型导航开始-->
<%
for(int i=parentCategoryList.size()-1; i>=0; i--) {
String[] cs = (String[])parentCategoryList.get(i);
if(i != parentCategoryList.size()-1) {
%>
>
<%
}
if(i == 0 && !StringUtil.isEmpty(cs[1]) && !StringUtil.isEmpty(cs[0])) {
%>
<a class="leftIndex_txt01" href="<%=PRODUCTLIST%>&categoryId=<%=cs[0]%>"> <%=cs[1]%> </a>
<%
} else if(!StringUtil.isEmpty(cs[1]) && !StringUtil.isEmpty(cs[0])){
String url = PRODUCTLIST + "&categoryId=" + cs[0];
if (!StringUtil.isEmpty(cs[2])) {
url = CONTEXT + "/" + cs[2];
}
%>
<a class="leftIndex_txt01" href="<%=url%>"> <%=cs[1]%> </a>
<%
}
}
%>
<!--商品类型导航结束-->
</td>
</tr>
</table>
<!--子分类列表开始-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" >
<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
<%
//显示子分类
int cols=7;
int widthnumber=1/cols*100;
String subcategoryId = request.getParameter("categoryId");
String parentCategoryId = request.getParameter("parentCategoryId");
if(StringUtil.isEmpty(parentCategoryId)) {
parentCategoryId = subcategoryId;
}
List subCategorys = ProductHelper.getSubProductCategorys(parentCategoryId);
if(subCategorys != null && subCategorys.size() > 0 ) {
double treeRows = subCategorys.size() /7.0;
for(int i=0; i<Math.ceil(subCategorys.size()/7.0); i++) {
%>
<tr align="center">
<%
for(int j=0; j< cols && (i * cols + j) < subCategorys.size();j++){
ProductCategory subCategory = (ProductCategory)subCategorys.get(i * cols + j);
String url = PRODUCTLIST + "&categoryId=" + subCategory.getId();
url = url + "&init=true";
Channel subChannel = subCategory.getChannel();
if(subChannel != null) {
if(ChannelConst.CHANNEL_HTML_PAGE.equals(subChannel.getPageType()) && subChannel.isStatus()) {
url = CONTEXT + "/" + subChannel.getPageName() + "?channelId=" + subChannel.getId();
}else if(ChannelConst.CHANNEL_LINK_PAGE.equals(subChannel.getPageType())){
url = subChannel.getLinkUrl();
} else {
url = CONTEXT + "/" + subChannel.getJspModel().getFileName() + "?channelId=" + subChannel.getId();
}
}
if(subCategory.getChannel() != null) {
url = url + "&channelId=" + subCategory.getChannel().getId();
}
url = url + "&parentCategoryId=" + parentCategoryId;
%>
<td width="<%=widthnumber%>%" height="30" align="center" >
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD>
<IMG SRC="<%=CONTEXT%>/img/taobao_1.gif" WIDTH=3 HEIGHT=3 ALT=""></TD>
<TD background="<%=CONTEXT%>/img/taobao_2.gif"></TD>
<TD >
<IMG SRC="<%=CONTEXT%>/img/taobao_3.gif" WIDTH=3 HEIGHT=3 ALT=""></TD>
</TR>
<TR>
<TD WIDTH=3 background="<%=CONTEXT%>/img/taobao_4.gif">
<IMG SRC="<%=CONTEXT%>/img/taobao_4.gif" WIDTH=3 HEIGHT=15 ALT=""></TD>
<TD algin=center >
<a href="<%=url%>" class=Category_sub_css>
<%=subCategory.getCategoryName()%>
</a>
</TD>
<TD WIDTH=3 background="<%=CONTEXT%>/img/taobao_6.gif">
</TD>
</TR>
<TR>
<TD>
<IMG SRC="<%=CONTEXT%>/img/taobao_7.gif" WIDTH=3 HEIGHT=3 ALT=""></TD>
<TD HEIGHT=3 background="<%=CONTEXT%>/img/taobao_8.gif">
</TD>
<TD>
<IMG SRC="<%=CONTEXT%>/img/taobao_9.gif" WIDTH=3 HEIGHT=3 ALT=""></TD>
</TR>
</TABLE>
</td>
<%
}
%>
</tr>
<tr>
<%if(i<treeRows){
for(int j=0; j<cols;j++){
%>
<td class=Catalogue_product01_line></td>
<%
}
}
%>
</tr>
<%
}
}
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
}
%>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i01.gif" width="10" height="10"></td>
<td background="<%=CONTEXT%>/img/QQ/i03.gif"></td>
<td width="10" height="10"><img src="<%=CONTEXT%>/img/QQ/i02.gif" width="10" height="10"></td>
</tr>
<tr>
<td background="<%=CONTEXT%>/img/QQ/i04.gif"> </td>
<td>
<table width="620" border="0" cellpadding="0" cellspacing="0">
<tr >
<td height="25" colspan="2">
<table width="100%" height="41" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td align="right">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>共<%=pager.getTotalPage()%>页 当前位于第 <%=fgProductSearchForm.getCurrentPageNo()%> 页
<a class="Category_sub_css" href="javascript:jump('1')">首页</a>
<% if(pager.getCurrentPage()>1){%>
<a class="Category_sub_css" href="javascript:select('prev')">上 一 页</a>
<%
} else {
%>上一页
<%
}
%>
<% if(pager.getTotalPage()>pager.getCurrentPage()){
%>
<a class="Category_sub_css" href="javascript:select('next')">下 一 页</a>
<%
} else {
%> 下一 页
<%
}
%>
<a class="Category_sub_css" href="javascript:jump('<%=pager.getTotalPage()%>')">末页</a>
第<input name="toPage" type="text" size="2" value="<%=fgProductSearchForm.getCurrentPageNo()%>" maxlength="5"/> 页
<input type="button" onclick="javascript:jump(document.all['toPage'].value)" value="GO">
</td>
<td align="right">
<select name="orderby1" onChange='javascript:orderby(this.value)'>
<option value='1' <%="1".equals(fgProductSearchForm.getOrderbyType()) ? "selected":""%>>按价格由低至高</option>
<option value='2' <%="2".equals(fgProductSearchForm.getOrderbyType()) ? "selected":""%>>按价格由高至低</option>
<option value='3' <%="3".equals(fgProductSearchForm.getOrderbyType()) ? "selected":""%>>按名称正向</option>
<option value='4' <%="4".equals(fgProductSearchForm.getOrderbyType()) ? "selected":""%>>按名称逆向</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<input type="hidden" name="recordNumber" value="<%=pager.getTotalRow()%>"/>
<%
categoryId = request.getParameter("categoryId");
if(categoryId == null) {
categoryId = "";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -