|
|
@ -22,7 +22,7 @@
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="item in products"
|
|
|
|
v-for="item in products"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
@click="onJumpGoodsDetail"
|
|
|
|
@click="onJumpGoodsDetail(item.product.id)"
|
|
|
|
class="header-cart-products__wrap flex flex-middle flex-between"
|
|
|
|
class="header-cart-products__wrap flex flex-middle flex-between"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="cart-products-wrap__left flex felx-middle">
|
|
|
|
<div class="cart-products-wrap__left flex felx-middle">
|
|
|
@ -51,7 +51,7 @@
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="item in failureProducts"
|
|
|
|
v-for="item in failureProducts"
|
|
|
|
:key="item.id"
|
|
|
|
:key="item.id"
|
|
|
|
@click="onJumpGoodsDetail"
|
|
|
|
@click="onJumpGoodsDetail(item.product.id)"
|
|
|
|
class="header-cart-products__wrap flex flex-middle flex-between"
|
|
|
|
class="header-cart-products__wrap flex flex-middle flex-between"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="cart-products-wrap__left flex felx-middle">
|
|
|
|
<div class="cart-products-wrap__left flex felx-middle">
|
|
|
@ -108,6 +108,16 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
token: {
|
|
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
|
|
handler(val) {
|
|
|
|
|
|
|
|
if (val) {
|
|
|
|
|
|
|
|
this.$store.dispatch("getCartProducts");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$store.commit("setCartProducts", []);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
cartProducts: {
|
|
|
|
cartProducts: {
|
|
|
|
immediate: true,
|
|
|
|
immediate: true,
|
|
|
|
deep: true,
|
|
|
|
deep: true,
|
|
|
@ -129,11 +139,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
|
|
|
|
if (this.token) {
|
|
|
|
|
|
|
|
this.$store.dispatch("getCartProducts");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
onJumpCart() {
|
|
|
|
onJumpCart() {
|
|
|
|
if (!this.$isLoginValidate()) {
|
|
|
|
if (!this.$isLoginValidate()) {
|
|
|
|