struts标签处理map中包含list 展示

来源:互联网 发布:淘宝良心二手手机店铺 编辑:程序博客网 时间:2024/06/10 18:42

代码:

<table cellspacing="0" cellpadding="0">

<tr>
<th style="width: 100px;">订单号</th>
<th style="width: 130px;">下单时间</th>
<th style="width: 90px;">订单金额</th>
<th style="width: 120px;">交易号</th>
<th style="width: 195px;">商品</th>
<th style="width: 100px;">商品状态</th>
<th>操作</th>
</tr>
<s:iterator value="#request.mapList" id="orderMap">
<s:set name="total" value="#orderMap.value.size"/>  
<s:iterator value="#orderMap.value" status="s"> 
<tr>
<s:if test="#s.first"><td rowspan="${total}"><s:property value="orderInfo.code"/></td></s:if> 
<td ><s:date name="orderInfo.createTime" format="yyyy-MM-dd HH:mm:ss" /></td>
<td ><s:property value="priceNormal"/></td>
<td ><s:property value="goodsTxnCode"/></td>
<td class="txt"><p style='overflow: hidden;display: inline-block;width: 150px;height: 22px;' title='<s:property value="kpiDesc"/>' ><s:property value="kpiDesc"/></p></td>
<td >
<s:if test="state<7">
<label class="green">
<s:if test="state==1">未支付</s:if>
<s:elseif test="state==2">已支付</s:elseif>
<s:elseif test="state==3">已消费</s:elseif>
<s:elseif test="state==4">已返现</s:elseif>
<s:elseif test="state==5">退货中</s:elseif>
<s:elseif test="state==6">已退货</s:elseif>
<s:elseif test="state==7">已关闭</s:elseif>
</label>
</s:if>
<s:elseif test="state==7">
<label class="gray">已关闭</label>
</s:elseif>
</td>
<td><s:if test="state==2">
<p><a href="javascript:;" class="consume blue"  onclick="getInfo(this,'<s:property value="id"/>')">确认消费</a></p></s:if>
<s:if test="state==5">
<p><a href="javascript:;" class="receipt blue" onclick="getInfo(this,'<s:property value="id"/>')" >确认收货</a></p>
<p><a href="javascript:;" class="unreceipt blue" onclick="getInfo(this,'<s:property value="id"/>')">拒绝退货</a></p>
</s:if>
<a href="showOrderDetail.action?id=<s:property value='id'/>" class="blue" target="_blank">查看详情</a></td>
</tr>
 </s:iterator>
  </s:iterator>

</table>

结果图:




0 0
原创粉丝点击