右侧快捷导航购物车优化
parent
3351124c97
commit
4f4ca0fa08
|
|
@ -48,6 +48,14 @@ class Index extends Controller
|
|||
*/
|
||||
public function cart($params = [])
|
||||
{
|
||||
// 当前模块/控制器/方法
|
||||
$module_name = strtolower(request()->module());
|
||||
$controller_name = strtolower(request()->controller());
|
||||
$action_name = strtolower(request()->action());
|
||||
|
||||
// 当前模块/控制器/方法
|
||||
$this->assign('module_controller_action', $module_name.$controller_name.$action_name);
|
||||
|
||||
// 购物车
|
||||
$cart_list = BuyService::CartList(['user'=>session('user')]);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,73 +41,75 @@
|
|||
<div class="cart-count common-cart-total {{if $cart_total gt 0}}am-badge am-badge-danger{{/if}}">{{if $cart_total > 9}}9+{{else /}}{{$cart_total}}{{/if}}</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="mui-mbar-popup am-animation-slide-left cart-content">
|
||||
<!-- 商品列表 -->
|
||||
<div class="cart-items" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
{{if !empty($cart_list)}}
|
||||
<table class="am-table">
|
||||
{{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">
|
||||
<div class="goods-detail">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}">
|
||||
</a>
|
||||
<div class="goods-base">
|
||||
<a href="{{$goods.goods_url}}" target="_blank" class="goods-title">{{$goods.title}}</a>
|
||||
{{if !empty($goods.spec)}}
|
||||
<ul class="goods-attr">
|
||||
{{foreach $goods.spec as $spec}}
|
||||
<li>{{$spec.type}}:{{$spec.value}}</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{if !isset($module_controller_action) or $module_controller_action != 'indexcartindex'}}
|
||||
<div class="mui-mbar-popup am-animation-slide-left cart-content">
|
||||
<!-- 商品列表 -->
|
||||
<div class="cart-items" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
{{if !empty($cart_list)}}
|
||||
<table class="am-table">
|
||||
{{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">
|
||||
<div class="goods-detail">
|
||||
<a href="{{$goods.goods_url}}" target="_blank">
|
||||
<img src="{{$goods.images}}">
|
||||
</a>
|
||||
<div class="goods-base">
|
||||
<a href="{{$goods.goods_url}}" target="_blank" class="goods-title">{{$goods.title}}</a>
|
||||
{{if !empty($goods.spec)}}
|
||||
<ul class="goods-attr">
|
||||
{{foreach $goods.spec as $spec}}
|
||||
<li>{{$spec.type}}:{{$spec.value}}</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="total-price">
|
||||
<strong class="total-price-content">¥{{$goods.total_price}}</strong>
|
||||
<span class="cart-number">x{{$goods.stock}}</span>
|
||||
</td>
|
||||
<td class="operation">
|
||||
<a href="javascript:;" class="submit-delete" data-url="{{:MyUrl('index/cart/delete')}}" data-id="{{$goods.id}}" data-view="fun" data-value="PluginsCartViewDeleteBack" data-is-confirm="0">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
{{/if}}
|
||||
</div>
|
||||
</td>
|
||||
<td class="total-price">
|
||||
<strong class="total-price-content">¥{{$goods.total_price}}</strong>
|
||||
<span class="cart-number">x{{$goods.stock}}</span>
|
||||
</td>
|
||||
<td class="operation">
|
||||
<a href="javascript:;" class="submit-delete" data-url="{{:MyUrl('index/cart/delete')}}" data-id="{{$goods.id}}" data-view="fun" data-value="PluginsCartViewDeleteBack" data-is-confirm="0">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 导航 -->
|
||||
<div class="cart-nav" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<form action="{{:MyUrl('index/buy/index')}}" method="post">
|
||||
<span class="selected-tips">共 <strong>{{$base.cart_count}}</strong> 种商品</span>
|
||||
<span class="total-price-tips">共计:</span>
|
||||
<strong class="nav-total-price">¥{{$base.total_price}}</strong>
|
||||
<input type="hidden" name="ids" value="{{$base.ids}}" />
|
||||
<input type="hidden" name="buy_type" value="cart" />
|
||||
<button type="submit" class="am-btn am-btn-primary separate-submit am-fr">结算</button>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 导航 -->
|
||||
<div class="cart-nav" style="display: {{if !empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<form action="{{:MyUrl('index/buy/index')}}" method="post">
|
||||
<span class="selected-tips">共 <strong>{{$base.cart_count}}</strong> 种商品</span>
|
||||
<span class="total-price-tips">共计:</span>
|
||||
<strong class="nav-total-price">¥{{$base.total_price}}</strong>
|
||||
<input type="hidden" name="ids" value="{{$base.ids}}" />
|
||||
<input type="hidden" name="buy_type" value="cart" />
|
||||
<button type="submit" class="am-btn am-btn-primary separate-submit am-fr">结算</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- 空购物车 -->
|
||||
<div class="mixed-tips" style="display: {{if empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<i class="am-icon-cart-plus am-fl icon"></i>
|
||||
<div class="mixed-tips-content am-fl">
|
||||
<h1>您的购物车还是空的,您可以</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/userfavor/goods')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的收藏夹</a>
|
||||
</li>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/order/index')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的订单</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 空购物车 -->
|
||||
<div class="mixed-tips" style="display: {{if empty($cart_list)}}block{{else /}}none{{/if}};">
|
||||
<i class="am-icon-cart-plus am-fl icon"></i>
|
||||
<div class="mixed-tips-content am-fl">
|
||||
<h1>您的购物车还是空的,您可以</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/userfavor/goods')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的收藏夹</a>
|
||||
</li>
|
||||
<li>
|
||||
<span>看看</span>
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/order/index')}}{{/if}}" class="{{if empty($user)}}login-event{{/if}}">我的订单</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- 二维码 -->
|
||||
|
|
|
|||
|
|
@ -288,6 +288,7 @@
|
|||
.commonrightnavigation-cart .cart-content .goods-attr li {
|
||||
color: #888;
|
||||
line-height: 16px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content strong.total-price-content, .commonrightnavigation-cart .cart-content .nav-total-price {
|
||||
font-weight: 700;
|
||||
|
|
|
|||
Loading…
Reference in New Issue