remove extra code

This commit is contained in:
rakesh 2022-01-28 18:20:14 +05:30
parent bb6a9d39dd
commit df18b3bcef
15 changed files with 42 additions and 198 deletions

View File

@ -165,9 +165,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return this.$store.state.guestInfo.guestQuoteId;
},
userName: function () {
return this.$store.state.accountOne.one.firstname;
},
@ -329,16 +327,11 @@ export default {
this.$store.dispatch("headerCategoryList/fetchCategoryList");
}
this.$store.dispatch("block/fetchHeaderPromoBanner", this.blockId);
// this.$store.dispatch("block/fetchHeaderPromoBanner", this.blockId);
if (this.userAuth) {
this.$store.dispatch("userCartProduct/cartProductList");
// this.$store.dispatch("userCartProduct/productTotalAmt");
this.$store.dispatch("accountOne/basicInfo");
} else {
if (this.guestQuoteId) {
this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId);
this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId);
}
}
},
};

View File

@ -359,9 +359,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return this.$store.state.guestInfo.guestQuoteId;
},
userName: function () {
return this.$store.state.accountOne.one.firstname;
},
@ -695,12 +693,7 @@ export default {
this.$store.dispatch("userCartProduct/cartProductList");
// this.$store.dispatch("userCartProduct/productTotalAmt");
this.$store.dispatch("accountOne/basicInfo");
} else {
if (this.guestQuoteId) {
this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId);
this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId);
}
}
}
if (this.userVisits) {
let userVisits = Number(this.userVisits) + 1;
localStorage.setItem("cr_userVisitCount", userVisits);

View File

@ -733,14 +733,14 @@ export default {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartProductsProgress;
} else {
return this.$store.state.cartProduct.cartProductsProgress;
return '';
}
},
inProgress: function () {
if (this.userAuth) {
return this.$store.state.userCartProduct.inProgress;
} else {
return this.$store.state.cartProduct.inProgress;
return '';
}
},
isDesktop: function () {
@ -781,14 +781,12 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return this.$store.state.guestInfo.guestQuoteId;
},
cartProductsItem() {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartProductList;
} else {
return this.$store.state.cartProduct.cartProductList;
return ''
}
},
@ -858,9 +856,7 @@ export default {
showCartDrawer(flag) {
if (this.userAuth) {
this.$store.dispatch("userCartProduct/cartDrawer", flag);
} else {
this.$store.dispatch("cartProduct/cartDrawer", flag);
}
}
},
showMessage(obj) {

View File

@ -135,15 +135,13 @@ export default {
userAuth: function() {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function() {
return this.$store.state.guestInfo.guestQuoteId;
},
cartDrawer: {
get() {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartDrawer;
} else {
return this.$store.state.cartProduct.cartDrawer;
return ''
}
},
set() {}
@ -152,14 +150,14 @@ export default {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartProductsProgress;
} else {
return this.$store.state.cartProduct.cartProductsProgress;
return ''
}
},
inProgress: function() {
if (this.userAuth) {
return this.$store.state.userCartProduct.inProgress;
} else {
return this.$store.state.cartProduct.inProgress;
return ''
}
},
cartTotalAmtProgress() {
@ -173,14 +171,14 @@ export default {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartProductList;
} else {
return this.$store.state.cartProduct.cartProductList;
return '';
}
},
cartProductTotalAmt() {
if (this.userAuth) {
return this.$store.state.userCartProduct.productTotalAmt;
} else {
return this.$store.state.cartProduct.productTotalAmt;
return ''
}
},
@ -217,9 +215,7 @@ export default {
goToCheckout() {
if (this.userAuth) {
this.$store.dispatch("userCartProduct/cartDrawer", false);
} else {
this.$store.dispatch("cartProduct/cartDrawer", false);
}
}
let pagePath = this.$route.path;
let isGateModulePage = pagePath.includes("/gate/");
if (isGateModulePage) {
@ -249,9 +245,7 @@ export default {
// this.cartDrawer=false;
if (this.userAuth) {
this.$store.dispatch("userCartProduct/cartDrawer", false);
} else {
this.$store.dispatch("cartProduct/cartDrawer", false);
}
}
},
stopPropogation(event) {
event.stopPropagation();
@ -259,9 +253,7 @@ export default {
closeCartDrawer(flag) {
if (this.userAuth) {
this.$store.dispatch("userCartProduct/cartDrawer", flag);
} else {
this.$store.dispatch("cartProduct/cartDrawer", flag);
}
}
},
resizeCart() {
return this.sideBarHeight() && this.productListHeight();

View File

@ -42,9 +42,7 @@ export default {
verifyAddress: function() {
if (this.userAuth) {
return this.$store.state.accountOne.address;
} else {
return this.$store.state.guestInfo.address;
}
}
},
countryAndStatesList() {
return this.$store.state.accountOne.allCountries;

View File

@ -66,16 +66,12 @@ export default {
verifyAddress: function() {
if (this.userAuth) {
return this.$store.state.accountOne.address;
} else {
return this.$store.state.guestInfo.address;
}
}
},
fetchInProgress() {
if (this.userAuth) {
return this.$store.state.accountOne.inProgress;
} else {
return this.$store.state.guestInfo.fetchInProgress;
}
}
},
countryAndStatesList() {
return this.$store.state.accountOne.allCountries;
@ -91,8 +87,6 @@ export default {
userSelectedState: function() {
if (this.userAuth) {
return this.$store.state.accountOne.address.regionId;
} else {
return this.$store.state.guestInfo.address.regionId;
}
},
},

View File

@ -119,14 +119,14 @@ export default {
if (this.userAuth) {
return this.$store.state.accountOne.address;
} else {
return this.$store.state.guestInfo.address;
return ''
}
},
fetchInProgress() {
if (this.userAuth) {
return this.$store.state.accountOne.inProgress;
} else {
return this.$store.state.guestInfo.fetchInProgress;
return ''
}
},
countryAndStatesList() {
@ -144,7 +144,7 @@ export default {
if (this.userAuth) {
return this.$store.state.accountOne.address.regionId;
} else {
return this.$store.state.guestInfo.address.regionId;
return ''
}
},
},

View File

@ -613,9 +613,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return this.$store.state.guestInfo.guestQuoteId;
},
/*productAttributes: function() {
return this.$store.state.productOne.productAttributes;
},*/
@ -649,11 +647,7 @@ export default {
calledListrakCartList() {
if (this.userAuth) {
this.$store.dispatch("userCartProduct/setListrakCartList");
} else {
if (this.guestQuoteId) {
this.$store.dispatch("cartProduct/setListrakCartList");
}
}
}
},
changeCheckoutFlag(flag) {
this.$emit("stockFlag", flag);
@ -1158,7 +1152,6 @@ export default {
await this.$store.dispatch(
"cartProduct/removeCartProduct",
this.productId
//guestQuoteId: this.guestQuoteId
);
googleAanalyticsEventRemoveCart('remove_from_cart',this.productDetails)
removeCookieByName(this.productId);

View File

@ -245,9 +245,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return this.$store.state.guestInfo.guestQuoteId;
},
categoryList: function () {
return this.$store.state.headerCategoryList.categoryList;
},

View File

@ -517,9 +517,7 @@ export default {
userAuth: function() {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function() {
return this.$store.state.guestInfo.guestQuoteId;
},
inProgress: function() {
if (this.userAuth) {
return this.$store.state.userCartProduct.inProgress;
@ -736,7 +734,6 @@ export default {
.dispatch("cartProduct/updateToConfiguredCart", {
sku: sku,
qty: this.selectedQty,
//guestQuote: this.guestQuoteId,
itemId: this.itemId,
typeId: typeId,
optionId: optionId,

View File

@ -646,9 +646,7 @@ export default {
userAuth: function() {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function() {
return this.$store.state.guestInfo.guestQuoteId;
},
inProgress: function() {
if (this.userAuth) {
return this.$store.state.userCartProduct.inProgress;
@ -774,31 +772,7 @@ export default {
timeout: 3000
};
}
} else {
try{
await this.$store.dispatch("cartProduct/updateToGiftCart", {
sku: sku,
qty: this.selectedQty,
guestQuote: this.guestQuoteId,
itemId: this.itemId
})
this.snackbar = {
message: "Product Updated Successfully",
color: "success",
show: true,
timeout: 3000
};
}
catch(error){
this.snackbar = {
message: error.message,
color: "error",
show: true,
timeout: 3000
};
}
}
}
if(this.$route.name == productName)
this.$router.push({
name: productName,
@ -831,12 +805,7 @@ export default {
await this.$store.dispatch("userCartProduct/fetchGiftMessage", {
itemId: this.itemId
});
} else {
this.$store.dispatch("cartProduct/fetchGiftMessage", {
guestQuote: this.guestQuoteId,
itemId: this.itemId
});
}
}
}
}
},

View File

@ -582,9 +582,7 @@ export default {
userAuth: function() {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function() {
return this.$store.state.guestInfo.guestQuoteId;
},
inProgress: function() {
if (this.userAuth) {
return this.$store.state.userCartProduct.inProgress;
@ -761,7 +759,6 @@ export default {
.dispatch("cartProduct/updateToCart", {
sku: sku,
qty: this.selectedQty,
//guestQuote: this.guestQuoteId,
itemId: this.itemId,
ccid: null,
price: null,

View File

@ -190,7 +190,6 @@ import CartProductList from "@/components/retailer/cart-product/CartProductList"
import RetailerSearchProducts from "@/components/retailer/retailer-search/RetailerSearchProducts";
import SnackbarComponent from "@/components/common/SnackbarComponent";
import { getCookieByName } from "@/services/auth";
import { priceFormatter } from "@/services/util.service";
export default {
name: "CartProducts",
@ -230,9 +229,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return getCookieByName("cr_guestQuoteId");
},
cartProductsItem() {
if (this.userAuth) {
return this.$store.state.userCartProduct.cartProductList;
@ -293,10 +290,6 @@ export default {
calledCriteoViewBasket() {
if (this.userAuth) {
this.$store.dispatch("userCartProduct/setCriteoViewBasket");
} else {
if (this.guestQuoteId) {
this.$store.dispatch("cartProduct/setCriteoViewBasket");
}
}
},
removeMinus(val) {

View File

@ -39,7 +39,7 @@
justify="center"
class="py-5"
no-gutters
v-if="cartProductsItem.length && (guestQuoteId || userAuth)"
v-if="cartProductsItem.length && ( userAuth)"
>
<v-col cols="12">
<v-tabs hide-slider fixed-tabs v-model="tabs" :height="35">
@ -1161,7 +1161,7 @@
/* eslint-disable */
var client = require("braintree-web/client");
const baseUrl = process.env.VUE_APP_BASE_URL;
const paypalCheckout = require("braintree-web/paypal-checkout");
//const paypalCheckout = require("braintree-web/paypal-checkout");
import SnackbarComponent from "@/components/common/SnackbarComponent";
import CartProductList from "@/components/retailer/cart-product/CartProductList";
import ShippingAddressFormComponent from "@/components/retailer/address/ShippingAddressFormComponent";
@ -1170,12 +1170,11 @@ import BillingAddressComponent from "@/components/retailer/address/BillingAddres
import VerifyAddressComponent from "@/components/retailer/address/VerifyAddressComponent";
import CardPayment from "@/components/retailer/payment/CardPayment";
import { createHelpers } from "vuex-map-fields";
import { getCookieByName } from "@/services/auth";
import { VueTelInput } from "vue-tel-input";
import { VueTelInput } from "vue-tel-input";
import {
googleAanalyticsPurchase,
googleAanalyticsCheckout,
checkEncodeURI,
// checkEncodeURI,
priceFormatter,
fetchStates,
googleAanalyticsCheckoutAddShippingInfo,
@ -1364,10 +1363,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return getCookieByName("cr_guestQuoteId");
// return this.$store.state.guestInfo.guestQuoteId;
},
fetchSeletedAddress: function () {
return this.$store.state.accountOne.seletedAddress;
},
@ -1638,33 +1634,8 @@ export default {
timeout: 2000,
};
});
} else {
this.$store
.dispatch("cartProduct/applyDiscountCode", {
discountTextCode: this.discountTextCode,
guestQuoteId: this.guestQuoteId,
})
.then(() => {
this.snackbar = {
message: "Your coupon was successfully applied",
color: "success",
show: true,
timeout: 2000,
};
this.$store.dispatch("guestInfo/setShippingInformation", {
method: this.estimatedShipping,
email: this.email,
});
})
.catch((error) => {
this.snackbar = {
message: error.message,
color: "error",
show: true,
timeout: 2000,
};
});
}
}
}
},
removeDiscountCode() {
@ -1695,32 +1666,6 @@ export default {
timeout: 2000,
};
});
} else {
this.$store
.dispatch("cartProduct/removeDiscountCode", {
discountTextCode: this.discountTextCode,
guestQuoteId: this.guestQuoteId,
})
.then(() => {
this.snackbar = {
message: "Your coupon was successfully removed",
color: "success",
show: true,
timeout: 2000,
};
this.$store.dispatch("guestInfo/setShippingInformation", {
method: this.estimatedShipping,
email: this.email,
});
})
.catch((error) => {
this.snackbar = {
message: error.message,
color: "error",
show: true,
timeout: 2000,
};
});
}
}
},
@ -1918,11 +1863,6 @@ export default {
}*/
if (vm.userAuth) {
await vm.$store.dispatch("accountOne/setEstimatedShipping");
} else if (vm.guestQuoteId) {
await vm.$store.dispatch(
"guestInfo/setEstimatedShipping",
vm.email
);
}
this.addressInProgress = false;
}

View File

@ -152,10 +152,7 @@ export default {
userAuth: function () {
return this.$store.state.auth.userAuth;
},
guestQuoteId: function () {
return getCookieByName("cr_guestQuoteId");
// return this.$store.state.guestInfo.guestQuoteId;
},
orderNo: function () {
return this.$route.params.orderNumber;
},
@ -237,13 +234,7 @@ export default {
this.$store.dispatch("userCartProduct/cartProductList");
// this.$store.dispatch("userCartProduct/productTotalAmt");
this.$store.dispatch("meProductOne/fetchOrderProduct", this.orderNo);
} else {
if (this.guestQuoteId) {
this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId);
this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId);
}
this.$store.dispatch("meProductOne/fetchOrderProduct", this.orderNo);
}
}
},
};
</script>