commit
99896cad89
1 changed files with 22 additions and 14 deletions
|
|
@ -264,8 +264,13 @@ export default {
|
||||||
model
|
model
|
||||||
);
|
);
|
||||||
this.styleOptions = result?.data;
|
this.styleOptions = result?.data;
|
||||||
if (this.styleOptions.length === 1) this.selectedStyle = this.styleOptions[0];
|
if (this.styleOptions.length === 1) {
|
||||||
else this.selectedStyle = null;
|
const sameStyle = this.selectedStyle === this.styleOptions[0];
|
||||||
|
this.selectedStyle = this.styleOptions[0];
|
||||||
|
if (sameStyle) {
|
||||||
|
this.getVehicleDetails();
|
||||||
|
}
|
||||||
|
} else this.selectedStyle = null;
|
||||||
} else {
|
} else {
|
||||||
this.styleOptions = [];
|
this.styleOptions = [];
|
||||||
this.selectedStyle = null;
|
this.selectedStyle = null;
|
||||||
|
|
@ -273,18 +278,7 @@ export default {
|
||||||
},
|
},
|
||||||
async selectedStyle(style) {
|
async selectedStyle(style) {
|
||||||
if (style) {
|
if (style) {
|
||||||
this.carId = null;
|
this.getVehicleDetails();
|
||||||
const result = await this.getVehicle(
|
|
||||||
this.selectedYear,
|
|
||||||
this.selectedMake,
|
|
||||||
this.selectedModel,
|
|
||||||
style
|
|
||||||
);
|
|
||||||
this.carId = result?.data.carId;
|
|
||||||
this.category = result?.data.category;
|
|
||||||
this.imageUrl = result?.data.imageUrl;
|
|
||||||
this.imageVifNumber = result?.data.imageVifNumber;
|
|
||||||
this.imageVifColor = result?.data.imageVifColor;
|
|
||||||
} else {
|
} else {
|
||||||
this.imageUrl = null;
|
this.imageUrl = null;
|
||||||
}
|
}
|
||||||
|
|
@ -318,6 +312,20 @@ export default {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
async getVehicleDetails() {
|
||||||
|
this.carId = null;
|
||||||
|
const result = await this.getVehicle(
|
||||||
|
this.selectedYear,
|
||||||
|
this.selectedMake,
|
||||||
|
this.selectedModel,
|
||||||
|
this.selectedStyle
|
||||||
|
);
|
||||||
|
this.carId = result?.data.carId;
|
||||||
|
this.category = result?.data.category;
|
||||||
|
this.imageUrl = result?.data.imageUrl;
|
||||||
|
this.imageVifNumber = result?.data.imageVifNumber;
|
||||||
|
this.imageVifColor = result?.data.imageVifColor;
|
||||||
|
},
|
||||||
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
this.dispatchStoreAction(
|
this.dispatchStoreAction(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue