右侧快捷导航新增购物车
parent
496c5b4c10
commit
08a5eb3fd3
|
|
@ -122,7 +122,19 @@ class Hook extends Controller
|
|||
// 用户信息
|
||||
$this->assign('user', $params['user']);
|
||||
|
||||
// 应用数据
|
||||
$this->assign('data', $ret['data']);
|
||||
|
||||
// 购物车
|
||||
$cart_list = BuyService::CartList(['user'=>$params['user']]);
|
||||
$this->assign('cart_list', $cart_list['data']);
|
||||
$base = [
|
||||
'total_price' => empty($cart_list['data']) ? 0 : array_sum(array_column($cart_list['data'], 'total_price')),
|
||||
'cart_count' => empty($cart_list['data']) ? 0 : count($cart_list['data']),
|
||||
'ids' => empty($cart_list['data']) ? '' : implode(',', array_column($cart_list['data'], 'id')),
|
||||
];
|
||||
$this->assign('base', $base);
|
||||
|
||||
return $this->fetch('../../../plugins/view/commonrightnavigation/index/content');
|
||||
} else {
|
||||
return $ret['msg'];
|
||||
|
|
|
|||
|
|
@ -33,15 +33,82 @@
|
|||
</a>
|
||||
|
||||
<!-- 购物车 -->
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}" class="cart-content {{$login_event_class}} {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1 and $module_controller_action eq 'indexgoodsindex'}} cart-show{{/if}}">
|
||||
<div class="base-nav cart">
|
||||
<div class="base-nav cart commonrightnavigation-cart">
|
||||
<a href="{{if empty($user)}}javascript:;{{else /}}{{:MyUrl('index/cart/index')}}{{/if}}" class="nav-a {{$login_event_class}} {{if isset($data['is_goods_page_show_cart']) and $data['is_goods_page_show_cart'] eq 1 and $module_controller_action eq 'indexgoodsindex'}} cart-show{{/if}}">
|
||||
<i class="am-icon-opencart"></i>
|
||||
<div class="cart-text">
|
||||
购物车
|
||||
<div class="cart-count common-cart-total am-badge am-badge-danger">{{if $cart_total > 9}}9+{{else /}}{{$cart_total}}{{/if}}</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="mui-mbar-popup am-animation-slide-left cart-content">
|
||||
{{if !empty($cart_list)}}
|
||||
<!-- 商品列表 -->
|
||||
<div class="cart-items">
|
||||
<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>
|
||||
</td>
|
||||
<td class="total-price am-hide-sm-only">
|
||||
<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="reload">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 导航 -->
|
||||
<div class="cart-nav">
|
||||
<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>
|
||||
{{/if}}
|
||||
{{if empty($cart_list)}}
|
||||
<div class="mixed-tips">
|
||||
<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>
|
||||
{{/if}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- 二维码 -->
|
||||
<div class="base-nav qrcode-content">
|
||||
|
|
|
|||
|
|
@ -43,34 +43,6 @@ dt + dd {margin-top: 0;}
|
|||
text-align: center;float:none}
|
||||
.items-nav-title h3,.items-nav-title .today-brands,.items-nav-title .more{display: none;}
|
||||
|
||||
/*导航*/
|
||||
.absolute{position:absolute;}
|
||||
.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;_width:100%;}
|
||||
.underline,.hover-underline{text-decoration:underline;}
|
||||
.block{display:block;}
|
||||
.inline-block{display:inline-block;}
|
||||
.inline{display:inline;}
|
||||
.bold{font-weight:700;}
|
||||
.am-modal {width: 100%;left:0 ;margin-left:0 ;top:0;background: #fefefe;}
|
||||
|
||||
|
||||
/*推荐*/
|
||||
.recommendation{text-align: center;padding:10px 0px;background:#fff ;}
|
||||
.clock{display: none;color:#fff ;text-align: center;z-index:11 ;}
|
||||
.recommendationMain{width: 100%;position: relative;height:85px;padding:5px 0px 0px;}
|
||||
.recommendationMain img{width:80px;position: absolute;right: 50%;margin-right: -40px;}
|
||||
|
||||
/*活动*/
|
||||
.activity {min-height:180px ;}
|
||||
.activity .am-g{background:#fff ;padding: 10px 0px;}
|
||||
.activity .am-u-sm-3{padding:0px 2px;}
|
||||
.activity .info{margin-top: 5px;}
|
||||
.activity .icon-sale{position: absolute; width: 0;height: 0;border-top: 40px solid #0087e5;border-right: 40px solid transparent;}
|
||||
.activity .icon-sale.one{border-top-color: #9b0d5f;}
|
||||
.activity .icon-sale.two{border-top-color: #b48c66;}
|
||||
.activity .icon-sale.three{border-top-color: #7fb113;}
|
||||
.activity .am-g h4{position: absolute;color: #fff;top:5px;left: 2px;}
|
||||
|
||||
|
||||
/*第二套各类活动*/
|
||||
.row {padding: 10px 0px;overflow: hidden;}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@
|
|||
position: absolute;
|
||||
width: 100%;
|
||||
color: #ccc;
|
||||
}
|
||||
.commonrightnavigation-right-nav .base-nav .nav-a {
|
||||
color: #ccc;
|
||||
}
|
||||
.commonrightnavigation-right-nav .base-nav a {
|
||||
cursor: pointer;
|
||||
}
|
||||
.commonrightnavigation-right-nav .base-nav [class*="am-icon-"]:before {
|
||||
|
|
@ -59,6 +64,10 @@
|
|||
background: #d2364c;
|
||||
color: #fff;
|
||||
}
|
||||
.commonrightnavigation-right-nav .base-nav:hover .nav-a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.commonrightnavigation-right-nav .base-nav:hover .mui-mbar-tab-tip, .commonrightnavigation-right-nav .base-nav:hover .mui-mbar-popup {
|
||||
display: block;
|
||||
}
|
||||
|
|
@ -174,6 +183,15 @@
|
|||
.commonrightnavigation-right-nav .answer-content .am-form-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.commonrightnavigation-right-nav .cart-content {
|
||||
bottom: 0;
|
||||
width: 400px;
|
||||
min-height: 100px;
|
||||
max-height: 300px;
|
||||
background: #fff;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width:640px) {
|
||||
|
|
@ -206,7 +224,7 @@
|
|||
.cart-show {
|
||||
display: block !important;
|
||||
}
|
||||
.commonrightnavigation-right-nav .cart-show .cart {
|
||||
.commonrightnavigation-right-nav .cart-show {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: calc(50% - 50px);
|
||||
|
|
@ -221,4 +239,104 @@
|
|||
border-bottom-left-radius: 3px;
|
||||
z-index: 1000;
|
||||
}
|
||||
}
|
||||
.commonrightnavigation-right-nav a.cart-show {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*/
|
||||
.commonrightnavigation-cart .cart-content {
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .cart-items {
|
||||
min-height: 60px;
|
||||
max-height: 260px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-detail img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-detail {
|
||||
position: relative;
|
||||
min-height: 60px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-title {
|
||||
display: block;
|
||||
max-height: 36px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 12px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-title:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-base {
|
||||
float: left;
|
||||
top: 0;
|
||||
margin-left: 65px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-attr {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .goods-attr li {
|
||||
color: #888;
|
||||
line-height: 16px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content strong.total-price-content, .commonrightnavigation-cart .cart-content .nav-total-price {
|
||||
font-weight: 700;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .cart-nav label {
|
||||
cursor: pointer;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .selected-tips strong, .commonrightnavigation-cart .cart-content .nav-total-price {
|
||||
font-size: 14px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content strong.total-price-content, .commonrightnavigation-cart .cart-content .selected-tips strong, .commonrightnavigation-cart .cart-content .nav-total-price {
|
||||
color: #d2364c;
|
||||
font-family: Verdana,Tahoma,arial;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .am-table {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .am-table > tbody > tr > td {
|
||||
border-top: 1px solid #F5F5F5;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content table td.base input[type="checkbox"] {
|
||||
float: left;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .cart-nav {
|
||||
background: #eee;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .cart-nav .separate-submit {
|
||||
height: 40px;
|
||||
width: 100px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .selected-tips {
|
||||
margin-right: 15px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content table tr .base {
|
||||
width: 60%;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content table tr .total-price {
|
||||
width: 26%;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content table tr .operation {
|
||||
width: 12%;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .cart-nav .nav-total-price {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.commonrightnavigation-cart .cart-content .mixed-tips .icon {
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue