看看标题,我想大家会觉得有一点云里雾里的感觉,不要慌张,先来看看一些实例。
多拿网购物车全选情况:
在购物车中取消一个:
取消商家选项:
只选择一个商家情况:
下面是淘宝网的购物车:
看来这些,大家知道我要说啥了吧...
===========================================================
代码部分:
===========================================================
显示页面:
1 <h1 class="userTitle w1000 auto mb20 tl"> 2 <strong class="userTitle_strong fl f18 white fb yh t1">我的购物车</strong> 3 <span></span> 4 </h1> 5 <div class="w1000 auto tl buyCar oh pb50"> 6 <dl class="oh ml30 mt30 mr30 buyCar_steps"> 7 <dd class="fl"> 8 <ul class="buyCar_steps_ul f16"> 9 <li class="fl white buyCar_steps_ul_finished pl10 pr30 pr">1.我的购物车<em class="pa"></em><span class="pa"></span></li> 10 <li class="fl pl50 pr30 buyCar_steps_ul_unfinished pr">2.确认订单信息<em class="pa"></em><span class="pa"></span></li> 11 <li class="fl pl50 pr30">3.成功提交订单</li> 12 </ul> 13 </dd> 14 <dd class="fr"> 15 <a href="javascript:void(0)" onclick="keepingShopping();" class="red f14">返回 >></a> 16 </dd> 17 </dl> 18 <table class="ml30 mt30 mr30 buyCar_data yh"> 19 <thead class="f14 fb gray"> 20 <tr> 21 <th class="pb10 w50 pr30"> 22 <input type="checkbox" id="check_all_top" value="-1" checked="checked"/> 23 <span class="pl5">全选</span> 24 </th> 25 <th class="pb10">优惠券名称</th> 26 <th class="pb10">未消费退款支持</th> 27 <th class="pb10">原价(元)</th> 28 <th class="pb10">购买价(元)</th> 29 <th class="pb10">数量</th> 30 <th class="pb10">小计(元)</th> 31 <th class="pb10">操作</th> 32 </tr> 33 </thead> 34 <!-- 节省值 --> 35 <c:set var="total" value="0"/> 36 <!-- 支付值 --> 37 <c:set var="pay" value="0"/> 38 <c:forEach items="${qr}" var="map"> 39 <tbody class="f14 pb10" id="business_bar_${map.key.id }"> 40 <tr> 41 <td colspan="7" class="pt10 pb10 f14"> 42 <input type="checkbox" id="check_all_business_${map.key.id}" onclick="check_business_all('${map.key.id }');" name="myBusiness" value="-1" checked="checked"/> 43 <span class="pl5">商家:</span><a href="${pageContext.request.contextPath}${map.key.businessIntroduceUI}" class="red">${map.key.name }</a></td> 44 </tr> 45 <c:set var="cashticket_number_for_business" value="0"/> 46 <c:forEach items="${map.value }" var="cashTicket"> 47 <tr class="buyCar_data_tiket t2" id="cashTicket_${cashTicket.id}"> 48 <td><input type="checkbox" id="check_cashticket_${cashTicket.id }" onclick="check_cashticket('${cashTicket.id }','${map.key.id }');" value="${cashTicket.id }" checked="checked"/></td> 49 <td><a href="${pageContext.request.contextPath}${cashTicket.cashCouponIntroduceUI}" class="buyCar_data_tiket_name">${cashTicket.title }</a></td> 50 <td>${cashTicket.ticketType.value }</td> 51 <td>¥${cashTicket.oldPrice }</td> 52 <td>¥${cashTicket.nowPrice }</td> 53 <td> 54 <a href="javascript:void(0)" onclick="subNumber('${cashTicket.id}','${cashTicket.oldPrice }','${cashTicket.nowPrice }','${cashTicket.number }','${cashTicket.amount }');" id="sub_number_${cashTicket.id }">-</a> 55 <input type="text" value="${cashTicket.number }" name="cashTicket.number" id="cashTicketNumber_${cashTicket.id }" class="w20"/> 56 <a href="javascript:void(0)" onclick="addNumber('${cashTicket.id}','${cashTicket.oldPrice }','${cashTicket.nowPrice }','${cashTicket.number }','${cashTicket.amount }');">+</a> 57 </td> 58 <td class="red" id="cashticket_sum_${cashTicket.id }"> 59 ¥${cashTicket.number*cashTicket.nowPrice } 60 </td> 61 <td class="f12"> 62 <!-- <p><a href="javascript:void(0)" class="blue">移入收藏夹</a></p> --> 63 <p><a href="javascript:void(0)" onclick="delMyShoppingCart('${cashTicket.id}','${cashTicket.oldPrice }','${cashTicket.nowPrice }','${map.key.id }')" class="blue">删除</a></p> 64 </td> 65 </tr> 66 <!-- 节省值 --> 67 <c:set var="total" value="${total + (cashTicket.number*cashTicket.oldPrice) }"/> 68 <!-- 支付值 --> 69 <c:set var="pay" value="${pay + (cashTicket.number*cashTicket.nowPrice ) }"/> 70 <!-- --> 71 <c:set var="cashticket_number_for_business" value="${cashticket_number_for_business + 1 }"/> 72 </c:forEach> 73 </tbody> 74 <!-- 商家的现金券数目 --> 75 <input type="hidden" id="cashticket_number_for_business_${map.key.id }" value="${cashticket_number_for_business }"/> 76 </c:forEach> 77 <tfoot> 78 <tr> 79 <td colspan="7" class="oh pt10 pb10"> 80 <p class="fl gray"> 81 <input type="checkbox" id="check_all_foot" value="-1" checked="checked"/><span class="pl5 pr50">全选</span> 82 <a href="javascript:void(0)" id="del_checked" class="gray">批量删除</a> 83 </p> 84 <p class="fr f14"> 85 <span>已节省:</span> 86 <input type="hidden" id="value_save" value="${total - pay }"/> 87 <strong class="red f16 fb pr20" id="show_value_save">¥${total - pay }</strong> 88 <span>您总共需要支付:</span> 89 <input type="hidden" id="value_pay" value="${pay }"/> 90 <strong class="red f16 fb pr20" id="show_value_pay">¥${pay }</strong> 91 </p> 92 </td> 93 </tr> 94 </tfoot> 95 </table> 96 <p class="tr mr30 mt30"> 97 <input type="button" onclick="keepingShopping();" value="继续购物" class="pl10 pr10 pt5 pb5"/> 98 <input type="button" onclick="submitOrder();" value="提交订单" class="ml30 mr20 pl10 pr10 pt5 pb5"/> 99 </p> 100 101 </div>
转载自原文链接, 如需删除请联系管理员。
原文链接:java web开发_多拿网/淘宝网购物车选择操作,转载请注明来源!
相关推荐