This commit is contained in:
rakesh 2022-01-20 14:50:12 +05:30
parent 7f61304766
commit aecadf3107
5 changed files with 23 additions and 23 deletions

1
git_info.json Normal file
View File

@ -0,0 +1 @@
{"branch_name":"beta","last_commit_date":"2022-01-19T16:45:44.000Z","last_commit_author":"sidharth","last_commit_hash":"7f61304766a9347d1adbea8794f6276df2d35e68"}

View File

@ -104,7 +104,7 @@ margin-bottom: 0px !important;
.me-header-search-field .theme--dark.v-label { .me-header-search-field .theme--dark.v-label {
color:#1d1d1d; color:#1d1d1d;
} }
.v-menu__content,.v-list{ /*.v-menu__content,.v-list{
border-radius: 0px !important; border-radius: 0px !important;
top: 64px !important; top: 64px !important;
} }*/

View File

@ -76,7 +76,7 @@
class="text-uppercase ls-0 body productpage-button" class="text-uppercase ls-0 body productpage-button"
tile tile
depressed depressed
@click="addToCart(product.sku)" @click="addToCart(product.sku,product.mq)"
> >
<v-progress-circular <v-progress-circular
align="center" align="center"
@ -107,19 +107,16 @@
</v-col> </v-col>
</v-row> </v-row>
<SnackbarComponent :snackbar="snackbar"></SnackbarComponent>
</div> </div>
</template> </template>
<script> <script>
/* eslint-disable no-alert, no-console , no-debugger */ /* eslint-disable no-alert, no-console , no-debugger */
//import * as easings from "vuetify/es5/services/goto/easing-patterns"; //import * as easings from "vuetify/es5/services/goto/easing-patterns";
import { mapState } from "vuex"; import { mapState } from "vuex";
import SnackbarComponent from "@/components/common/SnackbarComponent";
export default { export default {
name: "RetailerSearchProducts", name: "RetailerSearchProducts",
components: { components: {
SnackbarComponent
}, },
props: [ props: [
"criteria", "criteria",
@ -172,28 +169,28 @@ export default {
var with2Decimals = num.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0]; var with2Decimals = num.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0];
return with2Decimals; return with2Decimals;
}, },
addToCart(sku) { async addToCart(sku,qty) {
if (sku) { if (sku) {
this.errorMessage = ""; debugger
if (this.userAuth) { if (this.userAuth) {
this.$store await this.$store
.dispatch("userCartProduct/addToCart", { .dispatch("userCartProduct/addToCart", {
sku: sku, sku: sku,
qty: 1, qty:qty,
ccid: null, ccid: null,
price: null, price: null,
personalizeDetails: null personalizeDetails: null
}) })
.then(() => { .then(() => {
this.$store.dispatch("userCartProduct/cartProductList");
this.$store.dispatch("userCartProduct/cartDrawer", true);
this.snackbar = { this.snackbar = {
message: "Product Added Successfully", message: "Product Added Successfully",
color: "success", color: "success",
show: true, show: true,
timeout: 2000 timeout: 2000
}; };
debugger
this.$store.dispatch("userCartProduct/cartProductList");
this.$emit("actionClose", this.snackbar);
}) })
.catch(() => { .catch(() => {
@ -203,7 +200,7 @@ export default {
show: true, show: true,
timeout: 2000 timeout: 2000
}; };
this.$emit("actionClose", this.snackbar);
}); });
} }

View File

@ -31,7 +31,9 @@
</template> </template>
<div> <div>
<v-card tile flat v-if="searchData"> <v-card tile flat v-if="searchData">
<RetailerSearchProducts /> <RetailerSearchProducts
@actionClose="showSnackBarMessage"
/>
</v-card> </v-card>
</div> </div>
</v-menu> </v-menu>
@ -360,12 +362,12 @@ export default {
this.$store.dispatch("catalogBrowser/index", { this.$store.dispatch("catalogBrowser/index", {
productsCatalog: window.craneCatalog.products, productsCatalog: window.craneCatalog.products,
}); });
if (this.userAuth) { /* if (this.userAuth) {
this.$store.dispatch("userCartProduct/fetchCartCoupon"); this.$store.dispatch("userCartProduct/fetchCartCoupon");
this.calledCriteoViewBasket(); this.calledCriteoViewBasket();
} }
this.stockFlagHideShow(); this.stockFlagHideShow();*/
}, },
}; };
</script> </script>

View File

@ -11,7 +11,7 @@ export const fetchStates = (countryId, countryWiseStates) => {
return states.id == countryId; return states.id == countryId;
} }
); );
if (oneCountry.length > 0) { if (oneCountry.length > 0 && oneCountry[0].availableRegions) {
let allStates = oneCountry[0].availableRegions.map(val => { let allStates = oneCountry[0].availableRegions.map(val => {
return { return {
value: val.id, value: val.id,