Merge branch 'feature/task1.0.0_xg' into 'feature/task1.0.0'

feat: 无购物车商品信息时隐藏面板

See merge request yanxuan-frontend/shop-pc!46
merge-requests/47/head
肖广 3 years ago
commit 1e2240b692

@ -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: {

@ -182,10 +182,6 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.layout-header-popover {
&__cart-content {
}
}
.sticky-bar-header { .sticky-bar-header {
position: fixed; position: fixed;
top: 0; top: 0;

Loading…
Cancel
Save