|
|
|
@ -32,7 +32,13 @@
|
|
|
|
|
/>
|
|
|
|
|
<div class="header-wrap-icons__shop" @click="$router.push('/cart')">
|
|
|
|
|
<img src="~/assets/img/layout/icon-shop-sticky.png" />
|
|
|
|
|
<span v-if="cartCount > 0" class="">{{ cartCount }}</span>
|
|
|
|
|
<div
|
|
|
|
|
v-if="cartCount > 0"
|
|
|
|
|
:class="{ 'wrap-icons-shop__tip--more': cartCount > 10 }"
|
|
|
|
|
class="wrap-icons-shop__tip flex flex-middle flex-center"
|
|
|
|
|
>
|
|
|
|
|
{{ cartCount }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="token"
|
|
|
|
@ -123,12 +129,14 @@ export default {
|
|
|
|
|
return {
|
|
|
|
|
searchContent: "",
|
|
|
|
|
tabPath: "/",
|
|
|
|
|
cartCount: 0, // 购物车商品数
|
|
|
|
|
cartProductList: [], // 购物车列表
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState(["userInfo", "token", "seckillTabVisible"]),
|
|
|
|
|
...mapState(["userInfo", "token", "seckillTabVisible", "cartProducts"]),
|
|
|
|
|
cartCount() {
|
|
|
|
|
return this.cartProducts.length;
|
|
|
|
|
},
|
|
|
|
|
tabList() {
|
|
|
|
|
const defaultList = [
|
|
|
|
|
{ label: "首页", value: "/" },
|
|
|
|
@ -215,19 +223,21 @@ export default {
|
|
|
|
|
.header-wrap-icons__shop {
|
|
|
|
|
position: relative;
|
|
|
|
|
margin-left: 14px;
|
|
|
|
|
span {
|
|
|
|
|
.wrap-icons-shop__tip {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: -6px;
|
|
|
|
|
left: 18px;
|
|
|
|
|
top: -4px;
|
|
|
|
|
display: block;
|
|
|
|
|
height: 14px;
|
|
|
|
|
padding: 0 2px;
|
|
|
|
|
line-height: 14px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
width: 14px;
|
|
|
|
|
background: #ff512b;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
&--more {
|
|
|
|
|
width: unset;
|
|
|
|
|
padding: 0 3px;
|
|
|
|
|
border-radius: 7px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.header-wrap-icons__login {
|
|
|
|
|