fixes
This commit is contained in:
parent
3441d0c0fa
commit
bbb14e698d
|
@ -80,13 +80,14 @@
|
|||
<v-btn
|
||||
:disabled="inProgress"
|
||||
block
|
||||
size="x-large"
|
||||
size="large"
|
||||
v-bind="props"
|
||||
:variant="isHovering ? 'outlined' : 'outlined'"
|
||||
:class="
|
||||
isHovering ? ' bg-white text-primary' : 'bg-primary'
|
||||
"
|
||||
class="text-uppercase ls-0 body productpage-button"
|
||||
rounded="0"
|
||||
@click="addToCart(product.sku, product.mq)"
|
||||
>
|
||||
<v-progress-circular
|
||||
|
@ -170,7 +171,7 @@ export default {
|
|||
menu: false,
|
||||
showDrawarFilter: false,
|
||||
noProducts: "No products found.",
|
||||
snackbar: {
|
||||
snackbarVal: {
|
||||
show: false,
|
||||
message: null,
|
||||
color: null,
|
||||
|
@ -183,9 +184,10 @@ export default {
|
|||
return with2Decimals;
|
||||
},
|
||||
async addToCart(sku, qty) {
|
||||
|
||||
if (sku) {
|
||||
if (this.userAuth) {
|
||||
debugger;
|
||||
try{
|
||||
await this.$store
|
||||
.dispatch("userCartProduct/addToCart", {
|
||||
sku: sku,
|
||||
|
@ -193,27 +195,29 @@ export default {
|
|||
ccid: null,
|
||||
price: null,
|
||||
personalizeDetails: null,
|
||||
})
|
||||
.then(() => {
|
||||
this.snackbar = {
|
||||
});
|
||||
this.snackbarVal = {
|
||||
message: "Product Added Successfully",
|
||||
color: "success",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
this.$store.dispatch("userCartProduct/cartProductList");
|
||||
this.$emit("actionClose", this.snackbar);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$emit("action-close", this.snackbarVal);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
console.log("error", error);
|
||||
this.snackbar = {
|
||||
this.snackbarVal = {
|
||||
message: error.message,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
this.$emit("actionClose", this.snackbar);
|
||||
});
|
||||
this.$emit("action-close", this.snackbarVal);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
this.errorMessage = "Please Select Quantity";
|
||||
|
|
|
@ -9,3 +9,11 @@
|
|||
background-color: rgb(248, 220, 220);
|
||||
color: red;
|
||||
}
|
||||
.v-menu-position-relative
|
||||
{
|
||||
position:relative;
|
||||
}
|
||||
.v-menu-top.v-overlay__content{
|
||||
top:0!important;
|
||||
|
||||
}
|
|
@ -20,7 +20,6 @@
|
|||
>
|
||||
<v-col cols="12" sm="12" md="12">
|
||||
<v-col cols="12" sm="12" md="8">
|
||||
|
||||
<v-text-field
|
||||
id="menu-activator"
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
|
@ -33,10 +32,10 @@
|
|||
v-bind="props"
|
||||
>
|
||||
</v-text-field>
|
||||
<v-menu activator="#menu-activator" contained location-strategy='connected' attach>
|
||||
<v-menu activator="#menu-activator" class="v-menu-position-relative" content-class="v-menu-top" contained origin="auto" attach>
|
||||
<v-card tile flat v-if="searchData">
|
||||
<v-container>
|
||||
<RetailerSearchProducts @actionClose="showSnackBarMessage"/>
|
||||
<RetailerSearchProducts @action-close="showSnackBarMessage"/>
|
||||
</v-container>
|
||||
</v-card>
|
||||
<v-card v-else>
|
||||
|
@ -360,4 +359,4 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
<style src="./cart_products.scss" lang="scss" scoped />
|
||||
<style src="./cart_products.scss" lang="scss" />
|
Loading…
Reference in New Issue