Authored by 毕凯

悬浮购物车数字大于99 显示99+

... ... @@ -12,8 +12,14 @@ $.ajax({
type: 'GET',
url: '/cart/index/count',
success: function(data) {
var count;
if (data.code === 200) {
$cart.find('.cart-count').html(data.data.cart_goods_count).removeClass('hide');
count = data.data.cart_goods_count;
if (count > 99) {
count = '99+';
}
$cart.find('.cart-count').html(count).removeClass('hide');
}
}
});
\ No newline at end of file
});
... ...
... ... @@ -23,13 +23,16 @@
.cart-count {
position: absolute;
width: 18px;
height: 18px;
line-height: 18px;
border-radius: 50%;
background: #f00;
top: 0;
right: 0;
top: -12px;
right: -10px;
width: 36px;
height: 36px;
font-size: 20px;
line-height: 36px;
color: #fff;
background: #f03d35;
text-align: center;
border-radius: 50%;
@include transform(scale(0.5));
}
}
... ...