购物车优化
parent
3beec8f459
commit
da04170160
|
|
@ -34,7 +34,9 @@
|
|||
{{foreach $cart_list as $goods}}
|
||||
<tr id="data-list-{{$goods.id}}" data-id="{{$goods.id}}" data-goods-id="{{$goods.goods_id}}" class="{{if $goods['is_shelves'] neq 1}}am-warning{{/if}} {{if $goods['is_delete_time'] neq 0}}am-danger{{/if}}">
|
||||
<td class="base">
|
||||
<input type="checkbox" value="{{$goods.id}}" {{if $goods['is_shelves'] neq 1 or $goods['is_delete_time'] neq 0}}disabled{{/if}} />
|
||||
<label class="am-checkbox-inline am-success am-fl">
|
||||
<input type="checkbox" value="{{$goods.id}}" {{if $goods['is_shelves'] neq 1 or $goods['is_delete_time'] neq 0}}disabled{{/if}} data-am-ucheck />
|
||||
</label>
|
||||
<div class="goods-detail">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}">
|
||||
|
|
@ -90,12 +92,12 @@
|
|||
|
||||
<!-- 导航 -->
|
||||
<div class="cart-nav">
|
||||
<div class="am-fl nav-left">
|
||||
<label>
|
||||
<input type="checkbox" value="3" class="select-all-event" />
|
||||
<span>全选</span>
|
||||
<div class="am-fl nav-left am-margin-left-xs">
|
||||
<label class="am-checkbox-inline am-success select-all-event">
|
||||
<input type="checkbox" value="1" data-am-ucheck />
|
||||
<span class="el-text">全选</span>
|
||||
</label>
|
||||
<a href="javascript:;" class="submit-ajax" data-url="{{:MyUrl('index/cart/delete')}}" data-id="{{$base.ids}}" data-view="reload" data-msg="清空后不可恢复、确认操作吗?">清空</a>
|
||||
<a href="javascript:;" class="am-margin-left-sm submit-ajax" data-url="{{:MyUrl('index/cart/delete')}}" data-id="{{$base.ids}}" data-view="reload" data-msg="清空后不可恢复、确认操作吗?">清空</a>
|
||||
</div>
|
||||
<div class="am-fr nav-right">
|
||||
<form action="{{:MyUrl('index/buy/index')}}" method="post">
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ class GoodsService
|
|||
'is_backend' => true,
|
||||
'params' => &$params,
|
||||
'goods' => &$v,
|
||||
'goods_id' => $v['id']
|
||||
'goods_id' => isset($v['id']) ? $v['id'] : 0,
|
||||
]);
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
|
|
@ -425,7 +425,7 @@ class GoodsService
|
|||
'is_backend' => true,
|
||||
'params' => &$params,
|
||||
'goods' => &$v,
|
||||
'goods_id' => $v['id']
|
||||
'goods_id' => isset($v['id']) ? $v['id'] : 0,
|
||||
]);
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,15 +17,12 @@
|
|||
strong.total-price-content, .selected-tips strong, .nav-total-price { color: #d2364c; font-family: Verdana,Tahoma,arial; }
|
||||
.am-table { margin-bottom: 10px; }
|
||||
.am-table > tbody > tr > td { border-top: 1px solid #F5F5F5; }
|
||||
.cart-content table td.base input[type="checkbox"] { float: left; }
|
||||
|
||||
.cart-nav { background: #eee; height: 50px; line-height: 46px; }
|
||||
.cart-nav .separate-submit { height: 50px; width: 100px; font-size: 20px; font-weight: 500; }
|
||||
.selected-tips { margin-right: 15px; }
|
||||
.cart-nav label { font-weight: 500; margin: 0; }
|
||||
.cart-nav input[type="checkbox"] { vertical-align: inherit; }
|
||||
.cart-nav .nav-left { margin-left: 5px; }
|
||||
.cart-nav .nav-left a { margin-left: 10px; }
|
||||
|
||||
@media only screen and (min-width:640px) {
|
||||
.cart-content table tr .base { width: 30%; }
|
||||
|
|
|
|||
|
|
@ -108,25 +108,13 @@ $(function()
|
|||
// 全选/反选
|
||||
$('.select-all-event').on('click', function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
if($(this).find('input').is(':checked'))
|
||||
{
|
||||
$(this).next().text('取消');
|
||||
$('.am-table input[type="checkbox"]').each(function(k, v)
|
||||
{
|
||||
if(!$(this).prop('disabled'))
|
||||
{
|
||||
this.checked = true;
|
||||
}
|
||||
});
|
||||
$(this).find('span.el-text').text('反选');
|
||||
$('.am-table').find('input[type="checkbox"]').uCheck('check');
|
||||
} else {
|
||||
$(this).next().text('全选');
|
||||
$('.am-table input[type="checkbox"]').each(function(k, v)
|
||||
{
|
||||
if(!$(this).prop('disabled'))
|
||||
{
|
||||
this.checked = false;
|
||||
}
|
||||
});
|
||||
$(this).find('span.el-text').text('全选');
|
||||
$('.am-table').find('input[type="checkbox"]').uCheck('uncheck');
|
||||
}
|
||||
|
||||
// 计算选择的商品总数和总价
|
||||
|
|
|
|||
Loading…
Reference in New Issue