Update vehicle.vue
This commit is contained in:
parent
27fc4162b4
commit
0d5a8d1564
1 changed files with 24 additions and 13 deletions
|
|
@ -112,7 +112,7 @@ export default {
|
|||
selectedMake: this.selectedMakefromStore(),
|
||||
selectedModel: this.selectedModelfromStore(),
|
||||
selectedStyle: this.selectedStylefromStore(),
|
||||
carId: null,
|
||||
carId: this.getCarIdFromStore(),
|
||||
category: null,
|
||||
imageUrl: this.getImagefromStore(),
|
||||
imageVifNumber: null,
|
||||
|
|
@ -121,7 +121,7 @@ export default {
|
|||
makeOptions: [],
|
||||
modelOptions: [],
|
||||
styleOptions: [],
|
||||
displayGeneric: this.displayGenericFromStore(),
|
||||
//displayGeneric: this.displayGenericFromStore(),
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -280,6 +280,7 @@ export default {
|
|||
},
|
||||
async selectedStyle(style) {
|
||||
if (style) {
|
||||
this.imageUrl = "";
|
||||
const result = await this.getVehicle(
|
||||
this.selectedYear,
|
||||
this.selectedMake,
|
||||
|
|
@ -291,10 +292,10 @@ export default {
|
|||
this.imageUrl = result?.data.imageUrl;
|
||||
this.imageVifNumber = result?.data.imageVifNumber;
|
||||
this.imageVifColor = result?.data.imageVifColor;
|
||||
if (this.imageUrl == null) this.displayGeneric = false;
|
||||
//if (this.imageUrl == null) this.displayGeneric = false;
|
||||
} else {
|
||||
this.imageUrl = null;
|
||||
this.displayGeneric = true;
|
||||
// this.displayGeneric = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
@ -303,6 +304,13 @@ export default {
|
|||
if (this.imageUrl == null) return true;
|
||||
else return false;
|
||||
},
|
||||
displayGeneric() {
|
||||
if (this.imageUrl !== null && this.imageUrl !== "") return false;
|
||||
else if(!this.selectedStyle) return true;
|
||||
else if (this.imageUrl == null && this.carId !== null)
|
||||
return false;
|
||||
else return true;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getVehicle(year, make, model, style) {
|
||||
|
|
@ -313,15 +321,15 @@ export default {
|
|||
style: style,
|
||||
});
|
||||
},
|
||||
displayGenericFromStore() {
|
||||
if (store.getters.vehicle.imageUrl !== null) return false;
|
||||
else if (
|
||||
store.getters.vehicle.imageUrl === null &&
|
||||
store.getters.vehicle.carId !== null
|
||||
)
|
||||
return false;
|
||||
else return true;
|
||||
},
|
||||
// displayGenericFromStore() {
|
||||
// if (store.getters.vehicle.imageUrl !== null) return false;
|
||||
// else if (
|
||||
// store.getters.vehicle.imageUrl === null &&
|
||||
// store.getters.vehicle.carId !== null
|
||||
// )
|
||||
// return false;
|
||||
// else return true;
|
||||
// },
|
||||
arePagePrerequisitesValid() {
|
||||
return true;
|
||||
},
|
||||
|
|
@ -387,6 +395,9 @@ export default {
|
|||
getImagefromStore() {
|
||||
return store.getters.vehicle.imageUrl;
|
||||
},
|
||||
getCarIdFromStore() {
|
||||
return store.getters.vehicle.carId;
|
||||
},
|
||||
},
|
||||
|
||||
components: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue