123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- ##tlayout("www/layout.htm"){
- <section class="container" style="min-height: 600px;">
- ##if(cart_list!=null && cart_list.~size!=0){
- <table class="table shop-cart">
- <thead>
- <tr>
- <th>商品</th>
- <th width="100px;">水源</th>
- <th width="100px;">单价</th>
- <th width="200px;">数量/箱(1箱=24瓶)</th>
- <th width="100px;">小计</th>
- <th width="100px;">操作</th>
- </tr>
- </thead>
- <tbody>
- ##for(_item in cart_list){
- <tr>
- <td>
- <div class="product">
- <div class="pro-img pull-left">
- <a href="${_item.diy_img_url!}" target="_blank">
- <img src="${_item.diy_img_url!}" />
- </a>
- </div>
- <div class="pro-title" style="font-weight: bold;margin-right: 0px;">${_item.diy_title!}</div>
- <div class="pro-title" style="font-size: 12px;margin-right: 0px;">${_item.diy_remark!}</div>
- <div class="pro-title" style="font-size: 12px;margin-right: 0px;">${_item.bottle_title!} | ${_item.bottle_type_title!}</div>
- </div>
- </td>
- <td class="sub">
- <select class="select_border" onchange="changeType(${_item.cart_id!}, this)">
- ##for(_type in _item.type_list!){
- ##if(_type.id==_item.bottle_type_id){
- <option value="${_type.id!}" selected="selected">${_type.title!}|${_type.price!}元</option>
- ##}else{
- <option value="${_type.id!}">${_type.title!}|${_type.price!}元</option>
- ##}
- ##}
- </select>
- </td>
- <td>¥${_item.bottle_price!}</td>
- <td>
- <div class="count">
- <span class="click-btn" onclick="changeStep(${_item.cart_id!}, 0)">-</span>
- <input class="num" type="text" name="number_${_item.cart_id!}" value="${_item.cart_number!}" onchange="changeNumber(${_item.cart_id!})" />
- <span class="click-btn" onclick="changeStep(${_item.cart_id!}, 1)">+</span>
- </div>
- </td>
- <td class="sub">¥${_item.bottle_price * _item.cart_number}</td>
- <td class="del"><a href="javascript:deleteCart(${_item.cart_id!})" class="red">删除</a></td>
- </tr>
- ##}
- <tr>
- <th colspan="6" style="color: red;">注意:数量单位为箱,1箱=24瓶</th>
- </tr>
- </tbody>
- </table>
- <div class="total clearfix">
- <a href="/shop/ordersMsg" class="btn btn-lg btn-lightblue pull-right">去结算</a>
- <div class="pull-right count">小计:<span>¥${subtotal!}</span></div>
- </div>
- ##}else{
- <div class="kong">
- <img src="/www/image/cart_kong_icon.png" class="kong_img" />
- <p>购物车为空</p>
- <div class="kong_btn_area">
- <a href="/" class="btn">继续购物</a>
- </div>
- </div>
- ##}
- </section>
- <script>
- function deleteCart(id){
-
- $.post("/shop/deleteCart",{id:id},function(data){
- alert(data.msg);
- if(data.success){
- location.reload();
- }
- });
- }
- function changeStep(id, status){
-
- if(status==1){
- $("input[name='number_" + id + "']").val($("input[name='number_" + id + "']").val() * 1 + 1);
- }else{
- if($("input[name='number_" + id + "']").val() * 1 > 1){
- $("input[name='number_" + id + "']").val($("input[name='number_" + id + "']").val() * 1 - 1);
- }
- }
- changeNumber(id);
- }
- function changeNumber(id){
-
- $.post("/shop/changeNumber",{id:id, number:$("input[name='number_" + id + "']").val()},function(data){
- if(data.success){
- location.reload();
- }else{
- alert(data.msg);
- }
- });
- }
- function changeType(id, object){
-
- $.post("/shop/changeType",{id:id, btid:$(object).val()},function(data){
- if(data.success){
- location.reload();
- }else{
- alert(data.msg);
- }
- });
- }
- </script>
- ##}
|