123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- ##tlayout("wap/layout.htm",{head_title:"购物车"}){
- <section class="body">
- <div class="cart">
- ##if(cart_list!=null && cart_list.~size!=0){
- <form method="post" action="javascript:void(0)" id="submit_form" style="margin-bottom: 50px;">
- ##for(_item in cart_list){
- <div class="goods_items">
- <div class="goods_items_base">
- <div class="goods_items_img" style="background-image:url(${_item.diy_img_url!})"></div>
- <div class="goods_items_content">
- <h3>${_item.diy_title!}</h3>
- <div class="goods_peice_wrap" style="margin: 0px;height: 20px;overflow: hidden;line-height: 20px;">${_item.diy_remark!}</div>
- <div class="goods_peice_wrap select_form_wrap">
- ${_item.bottle_title!}
- <select onchange="changeType(${_item.cart_id!}, this)" class="select_form">
- ##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>
- </div>
- <div class="goods_peice_wrap" style="margin: 0px;">
- <span class="price">¥${_item.bottle_price!}</span>
- <span class="goods_number">
- <div class="jian">
- <img src="/wap/image/jian_icon.png" onclick="changeStep(${_item.cart_id!}, 0)" />
- </div>
- <div class="middle_num">
- <input type="text" name="number_${_item.cart_id!}" value="${_item.cart_number!}" onchange="changeNumber(${_item.cart_id!})" />
- </div>
- <div class="jia">
- <img src="/wap/image/jia_icon.png" onclick="changeStep(${_item.cart_id!}, 1)" />
- </div>
- </span>
- </div>
- </div>
- <div class="del_cart_wrap">
- <img src="/wap/image/del_icon.png" onclick="deleteCart(${_item.cart_id!})" />
- </div>
- </div>
- </div>
- ##}
- <div class="goods_items">
- <div class="goods_items_base" style="font-weight: bold;color:red;">
- 注意:数量单位为箱,1箱=24瓶
- </div>
- </div>
- </form>
- ##}else{
- <div class="kong">
- <img src="/wap/image/cart_kong_icon.png" class="kong_img" />
- <p>购物车为空</p>
- <div class="kong_btn_area">
- <a href="/wap" class="btn">继续购物</a>
- </div>
- </div>
- ##}
- </div>
- </section>
- ##if(cart_list!=null && cart_list.~size!=0){
- <div class="cart_bottom">
- <div class="cart_bottom_content">
- <span class="total_price">小计:<span class="color_red">¥${subtotal!0}</span></span>
- <a href="/wap/shop/ordersMsg" class="go_link">立即购买</a>
- </div>
- </div>
- ##}
- <#_wapFooter />
- <script>
- function deleteCart(id){
-
- $.post("/wap/shop/deleteCart",{id:id},function(data){
- if(data.success){
- location.reload();
- }else{
- alert(data.msg);
- }
- });
- }
- 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("/wap/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("/wap/shop/changeType",{id:id, btid:$(object).val()},function(data){
- if(data.success){
- location.reload();
- }else{
- alert(data.msg);
- }
- });
- }
- </script>
- ##}
|