购物车规格失效商品处理

feat/task1-c-wallet
Devil 2019-10-09 23:25:07 +08:00
parent 411049daa7
commit 4727b294eb
3 changed files with 14 additions and 8 deletions

View File

@ -32,10 +32,10 @@
</thead>
<tbody>
{{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}}">
<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 or (isset($goods['is_invalid']) and $goods['is_invalid'] eq 1)}}am-danger{{/if}}">
<td class="base">
<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 />
<input type="checkbox" value="{{$goods.id}}" {{if $goods['is_shelves'] neq 1 or $goods['is_delete_time'] neq 0 or (isset($goods['is_invalid']) and $goods['is_invalid'] eq 1)}}disabled{{/if}} data-am-ucheck />
</label>
<div class="goods-detail">
<a href="{{$goods.goods_url}}" target="_blank">
@ -73,10 +73,13 @@
<span class="am-input-group-label {{if $goods['is_shelves'] eq 1 and $goods['is_delete_time'] eq 0}}stock-submit{{/if}}" data-type="add">+</span>
</div>
{{if $goods['is_shelves'] neq 1}}
<p>商品已下架</p>
<p class="am-text-danger">商品已下架</p>
{{/if}}
{{if $goods['is_delete_time'] neq 0}}
<p>商品已作废</p>
<p class="am-text-danger">商品已作废</p>
{{/if}}
{{if isset($goods['is_invalid']) and $goods['is_invalid'] eq 1}}
<p class="am-text-danger">商品已失效</p>
{{/if}}
</td>
<td class="total-price am-hide-sm-only">

View File

@ -195,7 +195,6 @@ class BuyService
$field = 'c.*, g.inventory_unit, g.is_shelves, g.is_delete_time, g.buy_min_number, g.buy_max_number, g.model';
$data = Db::name('Cart')->alias('c')->join(['__GOODS__'=>'g'], 'g.id=c.goods_id')->where($where)->field($field)->order('c.id desc')->select();
// 数据处理
if(!empty($data))
{
@ -215,7 +214,11 @@ class BuyService
$v['spec_coding'] = $goods_base['data']['spec_base']['coding'];
$v['spec_barcode'] = $goods_base['data']['spec_base']['barcode'];
} else {
return $goods_base;
$v['is_invalid'] = 1;
$v['inventory'] = 0;
$v['spec_weight'] = 0;
$v['spec_coding'] = '';
$v['spec_barcode'] = '';
}
// 基础信息

View File

@ -111,10 +111,10 @@ $(function()
if($(this).find('input').is(':checked'))
{
$(this).find('span.el-text').text('反选');
$('.am-table').find('input[type="checkbox"]').uCheck('check');
$('.am-table').find('input[type="checkbox"]').not(':disabled').uCheck('check');
} else {
$(this).find('span.el-text').text('全选');
$('.am-table').find('input[type="checkbox"]').uCheck('uncheck');
$('.am-table').find('input[type="checkbox"]').not(':disabled').uCheck('uncheck');
}
// 计算选择的商品总数和总价