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