list.jsp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <%@ page language="java" pageEncoding="UTF-8"%>
  2. <HTML>
  3. <HEAD>
  4. <meta http-equiv="Content-Language" content="zh-cn">
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <link href="${pageContext.request.contextPath}/css/Style1.css" rel="stylesheet" type="text/css" />
  7. <script language="javascript" src="${pageContext.request.contextPath}/js/public.js"></script>
  8. <script type="text/javascript">
  9. function showDetail(oid){
  10. var but = document.getElementById("but"+oid);
  11. var div1 = document.getElementById("div"+oid);
  12. if(but.value == "订单详情"){
  13. // 1.创建异步对象
  14. var xhr = createXmlHttp();
  15. // 2.设置监听
  16. xhr.onreadystatechange = function(){
  17. if(xhr.readyState == 4){
  18. if(xhr.status == 200){
  19. div1.innerHTML = xhr.responseText;
  20. }
  21. }
  22. }
  23. // 3.打开连接
  24. xhr.open("GET","${pageContext.request.contextPath}/adminOrder_findOrderItem.action?oid="+oid+"&time="+new Date().getTime(),true);
  25. // 4.发送
  26. xhr.send(null);
  27. but.value = "关闭";
  28. }else{
  29. div1.innerHTML = "";
  30. but.value="订单详情";
  31. }
  32. }
  33. function createXmlHttp(){
  34. var xmlHttp;
  35. try{ // Firefox, Opera 8.0+, Safari
  36. xmlHttp=new XMLHttpRequest();
  37. }
  38. catch (e){
  39. try{// Internet Explorer
  40. xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  41. }
  42. catch (e){
  43. try{
  44. xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  45. }
  46. catch (e){}
  47. }
  48. }
  49. return xmlHttp;
  50. }
  51. </script>
  52. </HEAD>
  53. <body>
  54. <br>
  55. <form id="Form1" name="Form1" action="${pageContext.request.contextPath}/user/list.jsp" method="post">
  56. <table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
  57. <TBODY>
  58. <tr>
  59. <td class="ta_01" align="center" bgColor="#afd1f3">
  60. <strong>订单列表</strong>
  61. </TD>
  62. </tr>
  63. <tr>
  64. <td class="ta_01" align="center" bgColor="#f5fafe">
  65. <table cellspacing="0" cellpadding="1" rules="all"
  66. bordercolor="gray" border="1" id="DataGrid1"
  67. style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
  68. <tr
  69. style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
  70. <td align="center" width="10%">
  71. 序号
  72. </td>
  73. <td align="center" width="10%">
  74. 订单编号
  75. </td>
  76. <td align="center" width="10%">
  77. 订单金额
  78. </td>
  79. <td align="center" width="10%">
  80. 收货人
  81. </td>
  82. <td align="center" width="10%">
  83. 订单状态
  84. </td>
  85. <td align="center" width="50%">
  86. 订单详情
  87. </td>
  88. </tr>
  89. <s:iterator var="o" value="pageBean.list" status="status">
  90. <tr onmouseover="this.style.backgroundColor = 'white'"
  91. onmouseout="this.style.backgroundColor = '#F5FAFE';">
  92. <td style="CURSOR: hand; HEIGHT: 22px" align="center"
  93. width="18%">
  94. <s:property value="#status.count"/>
  95. </td>
  96. <td style="CURSOR: hand; HEIGHT: 22px" align="center"
  97. width="17%">
  98. <s:property value="#o.oid"/>
  99. </td>
  100. <td style="CURSOR: hand; HEIGHT: 22px" align="center"
  101. width="17%">
  102. <s:property value="#o.total"/>
  103. </td>
  104. <td style="CURSOR: hand; HEIGHT: 22px" align="center"
  105. width="17%">
  106. <s:property value="#o.name"/>
  107. </td>
  108. <td style="CURSOR: hand; HEIGHT: 22px" align="center"
  109. width="17%">
  110. <s:if test="#o.state==1">
  111. 未付款
  112. </s:if>
  113. <s:if test="#o.state==2">
  114. <a href="${ pageContext.request.contextPath }/adminOrder_updateState.action?oid=<s:property value="#o.oid"/>"><font color="blue">发货</font></a>
  115. </s:if>
  116. <s:if test="#o.state==3">
  117. 等待确认收货
  118. </s:if>
  119. <s:if test="#o.state==4">
  120. 订单完成
  121. </s:if>
  122. </td>
  123. <td align="center" style="HEIGHT: 22px">
  124. <input type="button" value="订单详情" id="but<s:property value="#o.oid"/>" onclick="showDetail(<s:property value="#o.oid"/>)"/>
  125. <div id="div<s:property value="#o.oid"/>">
  126. </div>
  127. </td>
  128. </tr>
  129. </s:iterator>
  130. </table>
  131. </td>
  132. </tr>
  133. <tr align="center">
  134. <td colspan="7">
  135. 第<s:property value="pageBean.page"/>/<s:property value="pageBean.totalPage"/>页
  136. <s:if test="pageBean.page != 1">
  137. <a href="${ pageContext.request.contextPath }/adminOrder_findAll.action?page=1">首页</a>|
  138. <a href="${ pageContext.request.contextPath }/adminOrder_findAll.action?page=<s:property value="pageBean.page-1"/>">上一页</a>|
  139. </s:if>
  140. <s:if test="pageBean.page != pageBean.totalPage">
  141. <a href="${ pageContext.request.contextPath }/adminOrder_findAll.action?page=<s:property value="pageBean.page+1"/>">下一页</a>|
  142. <a href="${ pageContext.request.contextPath }/adminOrder_findAll.action?page=<s:property value="pageBean.totalPage"/>">尾页</a>|
  143. </s:if>
  144. </td>
  145. </tr>
  146. </TBODY>
  147. </table>
  148. </form>
  149. </body>
  150. </HTML>