Authored by 毕凯

购物车 圆点数字显示

... ... @@ -78,8 +78,14 @@ $.ajax({
type: 'GET',
url: '/cart/index/count',
success: function(data) {
var count;
if (data.code === 200) {
$cart.find('.num-tag').html(data.data.cart_goods_count).removeClass('hide');
count = data.data.cart_goods_count || 0;
if (count > 99) {
count = '99+';
}
$cart.find('.num-tag').html(count).removeClass('hide');
}
}
});
... ...
... ... @@ -480,16 +480,19 @@ $basicBtnC:#eb0313;
}
}
.num-tag {
position: absolute;
left: pxToRem(66px);
height: pxToRem(20px);
display: block;
width: pxToRem(36px);
height: pxToRem(36px);
background-color: $basicBtnC;
border-radius: 50%;
position: absolute;
top: 0;
left: pxToRem(48px);
width: pxToRem(72px);
height: pxToRem(72px);
font-size: pxToRem(40px);
line-height: pxToRem(72px);
color: #fff;
font-size: pxToRem(24px);
background: $basicBtnC;
text-align: center;
border-radius: 50%;
@include transform(scale(0.5));
&.hide{
display: none;
}
... ...