|
|
@ -5,6 +5,7 @@
|
|
|
|
trigger="hover"
|
|
|
|
trigger="hover"
|
|
|
|
placement="bottom"
|
|
|
|
placement="bottom"
|
|
|
|
width="330"
|
|
|
|
width="330"
|
|
|
|
|
|
|
|
:disabled="cartCount === 0"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
slot="reference"
|
|
|
|
slot="reference"
|
|
|
@ -13,8 +14,8 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img src="~/assets/img/layout/icon-shop.png" />
|
|
|
|
<img src="~/assets/img/layout/icon-shop.png" />
|
|
|
|
<span>购物车</span>
|
|
|
|
<span>购物车</span>
|
|
|
|
<div v-if="cartProducts.length > 0" class="wrap-right-cart__tip">
|
|
|
|
<div v-if="cartCount > 0" class="wrap-right-cart__tip">
|
|
|
|
{{ cartProducts.length }}
|
|
|
|
{{ cartCount }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="header-cart-products scrollbar-self">
|
|
|
|
<div class="header-cart-products scrollbar-self">
|
|
|
@ -80,7 +81,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="header-cart-bottom flex flex-middle flex-between">
|
|
|
|
<div class="header-cart-bottom flex flex-middle flex-between">
|
|
|
|
<p>共{{ cartProducts.length }}件商品</p>
|
|
|
|
<p>共{{ cartCount }}件商品</p>
|
|
|
|
<UiButton type="red_panel" :radius="true" @click="onJumCartPage"
|
|
|
|
<UiButton type="red_panel" :radius="true" @click="onJumCartPage"
|
|
|
|
>去购物车</UiButton
|
|
|
|
>去购物车</UiButton
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -102,6 +103,9 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapState(["cartProducts", "token"]),
|
|
|
|
...mapState(["cartProducts", "token"]),
|
|
|
|
|
|
|
|
cartCount() {
|
|
|
|
|
|
|
|
return this.cartProducts.length;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
cartProducts: {
|
|
|
|
cartProducts: {
|
|
|
|