-
+
@@ -27,11 +28,6 @@ import {
import {
settleAllPromises
} from "@/helpers/layout-helper";
-import {
- storeActions
-} from "@/constants/store-actions";
-import store from "@/store";
-import baseMixin from "@/mixins/base-mixin";
export default {
name: "vehicle-parts",
@@ -42,14 +38,13 @@ export default {
// Settle promises and get results
const promiseResultMap = [{
resultKey: "cmsContent",
- promise: cmsContentPromise,
+ promise: cmsContentPromise
}];
const resultMap = await settleAllPromises(promiseResultMap);
// Call the "next" function to complete the transition to this page.
next((vm) => {
-
vm.$refs.funnelHeader.initializeComponent(
resultMap.cmsContent.FunnelHeaderWidget
);
@@ -64,98 +59,102 @@ export default {
);
// Part Question dynamic component
- Object.keys(vm.$refs).filter(r => r.includes(vm.refPrefix) && vm.$refs[r][0] !== undefined).forEach(c => vm.$refs[c][0].initializeComponent());
-
-
+ Object.keys(vm.$refs)
+ .filter((r) => r.includes(vm.refPrefix) && vm.$refs[r][0] !== undefined)
+ .forEach((c) => vm.$refs[c][0].initializeComponent({
+ ColorQuestionWidget: resultMap.cmsContent.ColorQuestionWidget,
+ FeatureQuestionWidget: resultMap.cmsContent.FeatureQuestionWidget
+ }));
});
},
data() {
return {
- Parts: [{
- glassLocation: 'Rear',
- glassName: 'Stationary',
- colorAnswers: [{
- ColorAnswerText: 'Green Tint',
- FeatureAnswers: [{
- FeatureAnswerText: 'Backglass - heated glass, solar, 1 hole',
- PartNumber: 'test-backglass-green-tint-1-hole',
- }]
- },
- {
- ColorAnswerText: 'Green Tint',
- FeatureAnswers: [{
- FeatureAnswerText: 'Backglass - heated glass, solar, 2 hole',
- PartNumber: 'test-backglass-green-tint-2-hole'
- }]
- },
- {
- ColorAnswerText: 'Gray Tint Privacy',
- FeatureAnswers: [{
- FeatureAnswerText: 'Backglass - heated glass, solar, 3 hole',
- PartNumber: 'test-backglass-gray-tint-privacy-3-hole'
- }]
- },
- {
- ColorAnswerText: 'Gray Tint Privacy',
- FeatureAnswers: [{
- FeatureAnswerText: 'Backglass - heated glass, solar, 4 hole',
- PartNumber: 'test-backglass-blue-tint-4-hole'
- }]
- },
- ]
- },
- {
- glassLocation: 'Windshield',
- glassName: 'Single',
- colorAnswers: [{
- ColorAnswerText: 'Blue Tint',
- FeatureAnswers: [{
- FeatureAnswerText: 'Windshield - heated glass, solar, 1 hole',
- PartNumber: 'test-windshield-blue-tint-1-hole'
- }]
- },
- {
- ColorAnswerText: 'Blue Tint',
- FeatureAnswers: [{
- FeatureAnswerText: 'Windshield -heated glass, solar, 2 hole',
- PartNumber: 'test-blue-tint-windshield-2-hole'
- }]
- },
- {
- ColorAnswerText: 'Gray Tint Privacy',
- FeatureAnswers: [{
- FeatureAnswerText: 'Windshield -heated glass, solar, 3 hole',
- PartNumber: 'test-gray-tint-privacy-windshield-3-hole'
- }]
- },
- {
- ColorAnswerText: 'Gray Tint Privacy',
- FeatureAnswers: [{
- FeatureAnswerText: 'Windshield -heated glass, solar, 4 hole',
- PartNumber: 'test-brown-tint-windshield-4-hole'
- }]
- },
- ]
- },
- ],
glassParts: {},
- refPrefix: 'partQuestion'
- }
+ refPrefix: "partQuestion",
+ };
},
components: {
partQuestion,
funnelHeader,
vehicleBanner,
funnelSubHeader,
- funnelFooter
+ funnelFooter,
},
- mounted() {
- console.log("mounted!");
+ computed: {
+ Parts() {
+ return [{
+ glassLocation: "Rear",
+ glassName: "Stationary",
+ colorAnswers: [{
+ ColorAnswerText: "Green Tint",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Backglass - heated glass, solar, 1 hole",
+ PartNumber: "test-backglass-green-tint-1-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Green Tint",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Backglass - heated glass, solar, 2 hole",
+ PartNumber: "test-backglass-green-tint-2-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Gray Tint Privacy",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Backglass - heated glass, solar, 3 hole",
+ PartNumber: "test-backglass-gray-tint-privacy-3-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Gray Tint Privacy",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Backglass - heated glass, solar, 4 hole",
+ PartNumber: "test-backglass-blue-tint-4-hole",
+ }, ],
+ },
+ ],
+ },
+ {
+ glassLocation: "Windshield",
+ glassName: "Single",
+ colorAnswers: [{
+ ColorAnswerText: "Blue Tint",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Windshield - heated glass, solar, 1 hole",
+ PartNumber: "test-windshield-blue-tint-1-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Blue Tint",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Windshield -heated glass, solar, 2 hole",
+ PartNumber: "test-blue-tint-windshield-2-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Gray Tint Privacy",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Windshield -heated glass, solar, 3 hole",
+ PartNumber: "test-gray-tint-privacy-windshield-3-hole",
+ }, ],
+ },
+ {
+ ColorAnswerText: "Gray Tint Privacy",
+ FeatureAnswers: [{
+ FeatureAnswerText: "Windshield -heated glass, solar, 4 hole",
+ PartNumber: "test-brown-tint-windshield-4-hole",
+ }, ],
+ },
+ ],
+ },
+ ]
+ }
},
methods: {
arePagePrerequisitesValid() {
return true;
},
- }
-}
+ },
+};
diff --git a/src/store/index.js b/src/store/index.js
index c7227de47..7e114cce4 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -239,6 +239,20 @@ export const actions = {
payload: {},
});
},
+
+ // Parts API Actions
+ getPartsOrQuestions(context, { carId, glassArray, zipCode, vin = '' }) {
+ return globalMethods.callHttpClient({
+ method: endpoints.GetRouteInfo.method,
+ endpoint: endpoints.GetRouteInfo.url,
+ payload: {
+ carId: carId,
+ glass: glassArray,
+ zip: zipCode,
+ vin: vin
+ },
+ });
+ }
}
export default createStore({