Commit 54e31d19 by Jansa Jose

index page and design issues

parent 7247e745
...@@ -379,8 +379,7 @@ ...@@ -379,8 +379,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -401,14 +400,12 @@ ...@@ -401,14 +400,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
...@@ -423,20 +420,17 @@ ...@@ -423,20 +420,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -553,8 +547,7 @@ ...@@ -553,8 +547,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -566,7 +559,6 @@ ...@@ -566,7 +559,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -581,7 +573,6 @@ ...@@ -581,7 +573,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -595,7 +586,6 @@ ...@@ -595,7 +586,6 @@
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -694,8 +684,7 @@ ...@@ -694,8 +684,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
...@@ -707,7 +696,6 @@ ...@@ -707,7 +696,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -793,8 +781,7 @@ ...@@ -793,8 +781,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -830,7 +817,6 @@ ...@@ -830,7 +817,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -850,7 +836,6 @@ ...@@ -850,7 +836,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -894,14 +879,12 @@ ...@@ -894,14 +879,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -2593,7 +2576,7 @@ ...@@ -2593,7 +2576,7 @@
}, },
"camelcase-keys": { "camelcase-keys": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"requires": { "requires": {
"camelcase": "^2.0.0", "camelcase": "^2.0.0",
...@@ -6398,7 +6381,7 @@ ...@@ -6398,7 +6381,7 @@
}, },
"load-json-file": { "load-json-file": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": { "requires": {
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
...@@ -6410,7 +6393,7 @@ ...@@ -6410,7 +6393,7 @@
"dependencies": { "dependencies": {
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
} }
} }
...@@ -6748,7 +6731,7 @@ ...@@ -6748,7 +6731,7 @@
}, },
"meow": { "meow": {
"version": "3.7.0", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"requires": { "requires": {
"camelcase-keys": "^2.0.0", "camelcase-keys": "^2.0.0",
...@@ -6765,7 +6748,7 @@ ...@@ -6765,7 +6748,7 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
} }
} }
...@@ -7175,7 +7158,7 @@ ...@@ -7175,7 +7158,7 @@
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "5.3.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
} }
} }
...@@ -7259,7 +7242,7 @@ ...@@ -7259,7 +7242,7 @@
}, },
"chalk": { "chalk": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"requires": { "requires": {
"ansi-styles": "^2.2.1", "ansi-styles": "^2.2.1",
...@@ -7276,7 +7259,7 @@ ...@@ -7276,7 +7259,7 @@
}, },
"supports-color": { "supports-color": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
} }
} }
...@@ -7571,7 +7554,7 @@ ...@@ -7571,7 +7554,7 @@
}, },
"os-locale": { "os-locale": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": { "requires": {
"lcid": "^1.0.0" "lcid": "^1.0.0"
...@@ -8437,7 +8420,7 @@ ...@@ -8437,7 +8420,7 @@
}, },
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
} }
} }
...@@ -8861,7 +8844,7 @@ ...@@ -8861,7 +8844,7 @@
"dependencies": { "dependencies": {
"source-map": { "source-map": {
"version": "0.4.4", "version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"requires": { "requires": {
"amdefine": ">=0.0.4" "amdefine": ">=0.0.4"
...@@ -10315,9 +10298,9 @@ ...@@ -10315,9 +10298,9 @@
"dev": true "dev": true
}, },
"uglify-js": { "uglify-js": {
"version": "3.5.15", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
"integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
......
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}"> <select (change)="get_model($event.target.value)" formControlName="maker" [ngClass]="{'input_error': !vehicleDataForm.controls['maker'].valid && vehicleDataFormSubmit}">
<option value="" class="hide">MAKE</option> <option value="" class="hide">MAKE</option>
<option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{key}}">{{car_date.brand}}</option> <option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select> </select>
</div> </div>
</div> </div>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select formControlName="modelName" [ngClass]="{'input_error': !vehicleDataForm.controls['modelName'].valid && vehicleDataFormSubmit}"> <select formControlName="modelName" [ngClass]="{'input_error': !vehicleDataForm.controls['modelName'].valid && vehicleDataFormSubmit}">
<option value="" class="hide">MODEL</option> <option value="" class="hide">MODEL</option>
<option *ngFor="let car_models of carModel">{{car_models}}</option> <option *ngFor="let car_models of carModel">{{car_models.model}}</option>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -18,23 +18,22 @@ declare const google: any; ...@@ -18,23 +18,22 @@ declare const google: any;
styleUrls: ['./index.component.scss'] styleUrls: ['./index.component.scss']
}) })
export class IndexComponent implements OnInit { export class IndexComponent implements OnInit {
public featuredOn: NgxCarousel; public featuredOn: NgxCarousel;
public carouselTile: NgxCarousel; public carouselTile: NgxCarousel;
@ViewChild('wizardModal') wizardModalTrrigerInput; @ViewChild('wizardModal') wizardModalTrrigerInput;
//Default Map Location //Default Map Location
lat: number = 51.678418; lat: number = 51.678418;
lng: number = 7.809007; lng: number = 7.809007;
wizardData: any; wizardData: any;
loginDetails: any; loginDetails: any;
//Basic Location Search: TAB 1 //Basic Location Search: TAB 1
autocomplete: any; autocomplete: any;
cfautocomplete: any; cfautocomplete: any;
searchLocError: boolean; searchLocError: boolean;
...@@ -48,20 +47,20 @@ export class IndexComponent implements OnInit { ...@@ -48,20 +47,20 @@ export class IndexComponent implements OnInit {
@ViewChild("addressLocSearch") public addressElementRef: ElementRef; @ViewChild("addressLocSearch") public addressElementRef: ElementRef;
@ViewChild("indexLoginModal") loginModalRef: ElementRef; @ViewChild("indexLoginModal") loginModalRef: ElementRef;
@ViewChild("closeQuoteWizard") closeQuoteWizardRef: ElementRef; @ViewChild("closeQuoteWizard") closeQuoteWizardRef: ElementRef;
//Vehicle Details: TAB 2 //Vehicle Details: TAB 2
vehicleDataForm; vehicleDataForm;
vehicleDataFormSubmit; vehicleDataFormSubmit;
//Service Details: TAB 3 //Service Details: TAB 3
loader: boolean; loader: boolean;
issuesData: any; issuesData: any;
defIssuesData: any[] = new Array(); defIssuesData: any[] = new Array();
selectedIssues: any[] = new Array(); selectedIssues: any[] = new Array();
monthArray: any[] = new Array(12); monthArray: any[] = new Array(12);
public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' }; public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' };
//Quote Page //Quote Page
step: number; step: number;
today: any = new Date(); today: any = new Date();
...@@ -79,13 +78,13 @@ export class IndexComponent implements OnInit { ...@@ -79,13 +78,13 @@ export class IndexComponent implements OnInit {
estimatedPrice: number; estimatedPrice: number;
scheduleDateInit: boolean; scheduleDateInit: boolean;
scheduleMechanic: any; scheduleMechanic: any;
carModel: any; carModel: any;
modelDates: number[] = new Array(); modelDates: number[] = new Array();
carSearchJsonData: any; carSearchJsonData: any;
optionalImges: any = new Array({1:false,2:false,3:false,4:false}); optionalImges: any = new Array({1:false,2:false,3:false,4:false});
optionalDescription: string; optionalDescription: string;
constructor( constructor(
private router : Router, private router : Router,
public ngZone : NgZone, public ngZone : NgZone,
...@@ -108,78 +107,92 @@ export class IndexComponent implements OnInit { ...@@ -108,78 +107,92 @@ export class IndexComponent implements OnInit {
this.optionalDescription = ''; this.optionalDescription = '';
this.vehicleDataFormSubmit = false; this.vehicleDataFormSubmit = false;
} }
ngOnInit() {
this.vehicleDataForm = new FormGroup({
trim: new FormControl(''), milage: new FormControl(''), emgine: new FormControl(''),
last_date: new FormControl(''),
maintanence_interval: new FormControl(''),
maker: new FormControl('', [Validators.required]),
modelYear: new FormControl('', [Validators.required]),
modelName: new FormControl('', [Validators.required])
});
this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
this.carSearchJsonData = response;
});
let currentYear = Number((new Date()).getFullYear()); ngOnInit() {
let startingYear = currentYear - 50; this.vehicleDataForm = new FormGroup({
for (let date = currentYear ; date >= startingYear ; date --) { trim: new FormControl(''), milage: new FormControl(''), emgine: new FormControl(''),
this.modelDates.push(date); last_date: new FormControl(''),
} maintanence_interval: new FormControl(''),
maker: new FormControl('', [Validators.required]),
this.subjectService.getLoginData().subscribe(loginData => { modelYear: new FormControl('', [Validators.required]),
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData')); modelName: new FormControl('', [Validators.required])
});
if(this.loginDetails && this.autoSchedule){
this.confirmBooking(); // this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
// this.carSearchJsonData = response;
// });
this.getVehicleBrand();
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 50;
for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date);
} }
});
this.subjectService.getLoginData().subscribe(loginData => {
this.mapsAPILoader.load().then(() => { this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
this.autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, {
types: ["address"] if(this.loginDetails && this.autoSchedule){
this.confirmBooking();
}
}); });
this.cfautocomplete = new google.maps.places.Autocomplete(this.addressElementRef.nativeElement, {
types: ["address"] this.mapsAPILoader.load().then(() => {
this.autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.nativeElement, {
types: ["address"]
});
this.cfautocomplete = new google.maps.places.Autocomplete(this.addressElementRef.nativeElement, {
types: ["address"]
});
}); });
});
this.featuredOn = {grid: {xs: 1, sm: 2 , md: 5, lg: 6, all: 0},slide: 1, speed: 400, animation: 'lazy',point: { visible: false },load: 2, touch: true, easing: 'ease'}
this.featuredOn = {grid: {xs: 1, sm: 2 , md: 5, lg: 6, all: 0},slide: 1, speed: 400, animation: 'lazy',point: { visible: false },load: 2, touch: true, easing: 'ease'} this.carouselTile = {grid: {xs: 1, sm: 2 , md: 3, lg: 3, all: 0},slide: 1, speed: 400, animation: 'lazy',point: { visible: false },load: 2, touch: true, easing: 'ease'}
this.carouselTile = {grid: {xs: 1, sm: 2 , md: 3, lg: 3, all: 0},slide: 1, speed: 400, animation: 'lazy',point: { visible: false },load: 2, touch: true, easing: 'ease'} this.nextDate.setDate(this.nextDate.getDate() + 1);
this.nextDate.setDate(this.nextDate.getDate() + 1);
$('.modal-backdrop').remove();
$('.modal-backdrop').remove(); $('body').attr('class','');
$('body').attr('class',''); $('body').attr('style','');
$('body').attr('style',''); }
}
getVehicleBrand(){
get_model(event) { this.webService.get_data('getVehicleBrand').subscribe(response => {
this.carModel = this.carSearchJsonData[event].models; if(response.status == 'success'){
} this.carSearchJsonData = response.data;
}
});
}
getVehicleLoc(lastLoc){ get_model(event) {
if(lastLoc == ''){ this.webService.post_data('getVehicleModel',{'vehBrand_id':event}).subscribe(response => {
this.searchLocError = true; if(response.status == 'success'){
return; this.carModel = response.data;
}
});
// this.carModel = this.carSearchJsonData[event].models;
} }
this.ngZone.run(() => {
let place: google.maps.places.PlaceResult = this.autocomplete.getPlace(); getVehicleLoc(lastLoc){
if (place == undefined || place == null || place === undefined || place === null || if(lastLoc == ''){
place.geometry == undefined || place.geometry == null || place.geometry === undefined || place.geometry === null || this.searchLocError = true;
place.formatted_address == undefined || place.formatted_address == null || place.formatted_address === undefined || place.formatted_address === null) {
this.searchLocError = true;
return; return;
} }
this.wizardData = {'pickup_data': this.ngZone.run(() => {
{'disp_loc':place.name, let place: google.maps.places.PlaceResult = this.autocomplete.getPlace();
'pickup_loc':place.formatted_address, if (place == undefined || place == null || place === undefined || place === null ||
'pickup_lat':place.geometry.location.lat(), place.geometry == undefined || place.geometry == null || place.geometry === undefined || place.geometry === null ||
'pickup_lng':place.geometry.location.lng() place.formatted_address == undefined || place.formatted_address == null || place.formatted_address === undefined || place.formatted_address === null) {
} this.searchLocError = true;
}; return;
}
this.wizardData = {'pickup_data':
{'disp_loc':place.name,
'pickup_loc':place.formatted_address,
'pickup_lat':place.geometry.location.lat(),
'pickup_lng':place.geometry.location.lng()
}
};
this.searchLocError = false; this.searchLocError = false;
this.lat = place.geometry.location.lat(); this.lat = place.geometry.location.lat();
this.lng = place.geometry.location.lng(); this.lng = place.geometry.location.lng();
...@@ -188,89 +201,89 @@ export class IndexComponent implements OnInit { ...@@ -188,89 +201,89 @@ export class IndexComponent implements OnInit {
this.getIssueData(); this.getIssueData();
}); });
} }
getVehicleData(vehicleData){ getVehicleData(vehicleData){
if(this.vehicleDataForm.invalid){ if(this.vehicleDataForm.invalid){
this.vehicleDataFormSubmit = true; this.vehicleDataFormSubmit = true;
return false; return false;
} }
this.wizardData['vechile_info'] = {'trim':vehicleData['trim'], this.wizardData['vechile_info'] = {'trim':vehicleData['trim'],
'lastMaintanceDate':(vehicleData['last_date'])?(formatDate(vehicleData['last_date'],'MM/dd/yyyy','en')):'', 'lastMaintanceDate':(vehicleData['last_date'])?(formatDate(vehicleData['last_date'],'MM/dd/yyyy','en')):'',
'maker':this.carSearchJsonData[vehicleData['maker']]['brand'], 'maker':this.carSearchJsonData[vehicleData['maker']]['brand'],
'milage':vehicleData['milage'],'emgine':vehicleData['emgine'], 'milage':vehicleData['milage'],'emgine':vehicleData['emgine'],
'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'], 'modelName':vehicleData['modelName'],'modelYear':vehicleData['modelYear'],
'maintanenceInterval':vehicleData['maintanence_interval'] 'maintanenceInterval':vehicleData['maintanence_interval']
}
console.log(this.wizardData['vechile_info'])
this.vehicleDataFormSubmit = false;
} }
//console.log(this.wizardData['vechile_info'])
this.vehicleDataFormSubmit = false;
}
getIssueData(){ getIssueData(){
const This = this; const This = this;
this.loader = true; this.loader = true;
this.webService.get_data('getGeneralIssues').subscribe(response => { this.webService.get_data('getGeneralIssues').subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
this.issuesData = response.issue_data; this.issuesData = response.issue_data;
this.defIssuesData = this.issuesData; this.defIssuesData = this.issuesData;
this.loader = false;
} else {
this.loader = false;
return false;
}
},error => {
this.loader = false; this.loader = false;
return false;
});
}
searchIssues(event){
if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
this.issuesData = this.defIssuesData;
} else { } else {
const thisObj = this; this.loader = false;
let subCatArr: any; return false;
let data: any[] = new Array();
let serRegExp = new RegExp(event.target.value,"gi");
thisObj.defIssuesData.forEach(function (issues,index) {
let issueCat = issues.issue;
if(issueCat.search(serRegExp) != -1){
data.push(thisObj.defIssuesData[index]);
} else {
subCatArr = issues.sub_categories;
subCatArr.forEach(function (issues_cat) {
let sub_issue_cat = issues_cat.issue_category;
if(sub_issue_cat.search(serRegExp) != -1){
data.push(thisObj.defIssuesData[index]);
}
});
}
});
this.issuesData = (data.length > 0)?data:false;
} }
},error => {
this.loader = false;
return false;
});
}
setTimeout(()=>{ searchIssues(event){
this.selectedIssues.forEach(function (issues) { if(event.target.value == '' || event.target.value == 'undefined' || event.target.value == undefined || event.target.value == 'null' || event.target.value == null ){
$('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true); this.issuesData = this.defIssuesData;
}); } else {
},500); const thisObj = this;
let subCatArr: any;
let data: any[] = new Array();
let serRegExp = new RegExp(event.target.value,"gi");
thisObj.defIssuesData.forEach(function (issues,index) {
let issueCat = issues.issue;
if(issueCat.search(serRegExp) != -1){
data.push(thisObj.defIssuesData[index]);
} else {
subCatArr = issues.sub_categories;
subCatArr.forEach(function (issues_cat) {
let sub_issue_cat = issues_cat.issue_category;
if(sub_issue_cat.search(serRegExp) != -1){
data.push(thisObj.defIssuesData[index]);
}
});
}
});
this.issuesData = (data.length > 0)?data:false;
} }
get_newlocaion(lastLoc){
this.cfautocomplete.addListener("place_changed", () => { setTimeout(()=>{
this.ngZone.run(() => { this.selectedIssues.forEach(function (issues) {
let places: google.maps.places.PlaceResult = this.cfautocomplete.getPlace(); $('[id="issue_'+issues.issue_id+'_'+issues.sub_issue_id+'"]').prop('checked', true);
if (places == undefined || places == null || places === undefined || places === null || });
places.geometry == undefined || places.geometry == null || places.geometry === undefined || places.geometry === null || },500);
places.formatted_address == undefined || places.formatted_address == null || places.formatted_address === undefined || places.formatted_address === null) { }
this.addresssearchLocError = true; get_newlocaion(lastLoc){
this.cfautocomplete.addListener("place_changed", () => {
this.ngZone.run(() => {
let places: google.maps.places.PlaceResult = this.cfautocomplete.getPlace();
if (places == undefined || places == null || places === undefined || places === null ||
places.geometry == undefined || places.geometry == null || places.geometry === undefined || places.geometry === null ||
places.formatted_address == undefined || places.formatted_address == null || places.formatted_address === undefined || places.formatted_address === null) {
this.addresssearchLocError = true;
return; return;
} }
this.wizardData['pickup_data'] = { this.wizardData['pickup_data'] = {
'disp_loc':places.name, 'disp_loc':places.name,
'pickup_loc':places.formatted_address, 'pickup_loc':places.formatted_address,
'pickup_lat':places.geometry.location.lat(), 'pickup_lat':places.geometry.location.lat(),
'pickup_lng':places.geometry.location.lng() 'pickup_lng':places.geometry.location.lng()
}; };
this.addresssearchLocError = false; this.addresssearchLocError = false;
this.lat = places.geometry.location.lat(); this.lat = places.geometry.location.lat();
this.lng = places.geometry.location.lng(); this.lng = places.geometry.location.lng();
...@@ -281,19 +294,19 @@ export class IndexComponent implements OnInit { ...@@ -281,19 +294,19 @@ export class IndexComponent implements OnInit {
get_newdate(lastdate){ get_newdate(lastdate){
this.wizardData['vechile_info']['lastMaintanceDate']=formatDate(lastdate,'MM/dd/yyyy','en'); this.wizardData['vechile_info']['lastMaintanceDate']=formatDate(lastdate,'MM/dd/yyyy','en');
} }
get_newmilage(milage){ get_newmilage(milage){
this.wizardData['vechile_info']['milage']=milage; this.wizardData['vechile_info']['milage']=milage;
} }
get_newmaintanence_date(newdate){ get_newmaintanence_date(newdate){
this.wizardData['vechile_info']['maintanenceInterval']=newdate.target.value; this.wizardData['vechile_info']['maintanenceInterval']=newdate.target.value;
} }
setIssueSelected(event){ setIssueSelected(event){
let issue_id = event.target.attributes.issue_id.value; let issue_id = event.target.attributes.issue_id.value;
let sub_issue_id = event.target.attributes.sub_issue_id.value; let sub_issue_id = event.target.attributes.sub_issue_id.value;
const thisObj = this; const thisObj = this;
let index = thisObj.selectedIssues.findIndex(x => x.sub_issue_id == sub_issue_id); let index = thisObj.selectedIssues.findIndex(x => x.sub_issue_id == sub_issue_id);
if(index > -1){ if(index > -1){
...@@ -304,12 +317,12 @@ export class IndexComponent implements OnInit { ...@@ -304,12 +317,12 @@ export class IndexComponent implements OnInit {
issData.sub_categories.forEach(function (subIssData) { issData.sub_categories.forEach(function (subIssData) {
if(subIssData.issue_cat_id == sub_issue_id){ if(subIssData.issue_cat_id == sub_issue_id){
let issue = issData.issue, let issue = issData.issue,
issue_image = issData.issue_image, issue_image = issData.issue_image,
issue_category = subIssData.issue_category, issue_category = subIssData.issue_category,
issue_cat_image = subIssData.issue_cat_image, issue_cat_image = subIssData.issue_cat_image,
default_service_fee = subIssData.default_service_fee, default_service_fee = subIssData.default_service_fee,
default_description = subIssData.default_description; default_description = subIssData.default_description;
thisObj.selectedIssues.push({issue_id,sub_issue_id,issue,issue_image,issue_category,issue_cat_image,default_service_fee,default_description}); thisObj.selectedIssues.push({issue_id,sub_issue_id,issue,issue_image,issue_category,issue_cat_image,default_service_fee,default_description});
} }
}); });
...@@ -318,7 +331,7 @@ export class IndexComponent implements OnInit { ...@@ -318,7 +331,7 @@ export class IndexComponent implements OnInit {
} }
this.calculateEstimate(); this.calculateEstimate();
} }
calculateEstimate(){ calculateEstimate(){
const thisObj = this; const thisObj = this;
thisObj.estimatedPrice = 0; thisObj.estimatedPrice = 0;
...@@ -326,12 +339,12 @@ export class IndexComponent implements OnInit { ...@@ -326,12 +339,12 @@ export class IndexComponent implements OnInit {
thisObj.estimatedPrice = thisObj.estimatedPrice + Number(selIssues.default_service_fee); thisObj.estimatedPrice = thisObj.estimatedPrice + Number(selIssues.default_service_fee);
}); });
} }
removeSelectedItem(issue_id,sub_issue_id){ removeSelectedItem(issue_id,sub_issue_id){
let index = this.selectedIssues.findIndex(x => x.sub_issue_id == sub_issue_id); let index = this.selectedIssues.findIndex(x => x.sub_issue_id == sub_issue_id);
if(index > -1){ if(index > -1){
this.selectedIssues.splice(index, 1); this.selectedIssues.splice(index, 1);
$('[id="issue_'+issue_id+'_'+sub_issue_id+'"]').prop('checked', false); $('[id="issue_'+issue_id+'_'+sub_issue_id+'"]').prop('checked', false);
} }
if(this.selectedIssues.length == 0){ if(this.selectedIssues.length == 0){
...@@ -339,40 +352,40 @@ export class IndexComponent implements OnInit { ...@@ -339,40 +352,40 @@ export class IndexComponent implements OnInit {
} }
this.calculateEstimate(); this.calculateEstimate();
} }
resetQuoteWizard(){ resetQuoteWizard(){
this.jumpToStep0(); this.jumpToStep0();
this.searchElementRef.nativeElement.value = ''; this.searchElementRef.nativeElement.value = '';
this.selectedIssues = []; this.selectedIssues = [];
this.vehicleDataForm.reset({ this.vehicleDataForm.reset({
trim: '', milage: '', emgine: '', maker: '', modelYear: '', modelName: '' trim: '', milage: '', emgine: '', maker: '', modelYear: '', modelName: ''
}); });
this.optionalImges[1] = false; this.optionalImges[1] = false;
this.optionalImges[2] = false; this.optionalImges[2] = false;
this.optionalImges[3] = false; this.optionalImges[3] = false;
this.optionalImges[4] = false; this.optionalImges[4] = false;
this.optionalDescription = ''; this.optionalDescription = '';
} }
getQuote(){ getQuote(){
const thisObj = this; const thisObj = this;
this.loader = true; this.loader = true;
let selSubIssues: any[] = new Array(); let selSubIssues: any[] = new Array();
thisObj.selectedIssues.forEach(function (selIssues) { thisObj.selectedIssues.forEach(function (selIssues) {
selSubIssues.push(selIssues.sub_issue_id); selSubIssues.push(selIssues.sub_issue_id);
}); });
console.log(this.wizardData) //console.log(this.wizardData)
let searchData = {'pickup_data':this.wizardData.pickup_data,'sub_issues':selSubIssues} let searchData = {'pickup_data':this.wizardData.pickup_data,'sub_issues':selSubIssues}
this.webService.post_data('getNearByMechanics',searchData).subscribe(response => { this.webService.post_data('getNearByMechanics',searchData).subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
this.mechanicData = response.mechanic_data; this.mechanicData = response.mechanic_data;
this.dateSection.push(new Date(this.today.setDate(this.today.getDate()))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate())));
this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1))); this.dateSection.push(new Date(this.today.setDate(this.today.getDate() + 1)));
this.loader = false; this.loader = false;
} else { } else {
this.loader = false; this.loader = false;
...@@ -383,21 +396,21 @@ export class IndexComponent implements OnInit { ...@@ -383,21 +396,21 @@ export class IndexComponent implements OnInit {
return false; return false;
}); });
} }
onMouseOver(infoWindow, gm) { onMouseOver(infoWindow, gm) {
if (gm.lastOpen != null) { if (gm.lastOpen != null) {
gm.lastOpen.close(); gm.lastOpen.close();
} }
gm.lastOpen = infoWindow; gm.lastOpen = infoWindow;
infoWindow.open(); infoWindow.open();
} }
onMouseOut(gm){ onMouseOut(gm){
if (gm.lastOpen != null) { if (gm.lastOpen != null) {
gm.lastOpen.close(); gm.lastOpen.close();
} }
} }
next(event) { next(event) {
if(this.dateStep > 30){ if(this.dateStep > 30){
this.showLeftArrow = true; this.showLeftArrow = true;
...@@ -413,7 +426,7 @@ export class IndexComponent implements OnInit { ...@@ -413,7 +426,7 @@ export class IndexComponent implements OnInit {
this.dateSection[1] = new Date(this.nextDate); this.dateSection[1] = new Date(this.nextDate);
this.dateStep += 1; this.dateStep += 1;
} }
prev(event) { prev(event) {
if(this.dateStep <= 0){ if(this.dateStep <= 0){
this.showLeftArrow = false; this.showLeftArrow = false;
...@@ -429,11 +442,11 @@ export class IndexComponent implements OnInit { ...@@ -429,11 +442,11 @@ export class IndexComponent implements OnInit {
this.dateSection[1] = new Date(this.nextDate); this.dateSection[1] = new Date(this.nextDate);
this.dateStep -= 1; this.dateStep -= 1;
} }
getSchedule(time,index){ getSchedule(time,index){
this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time}; this.wizardData['schedule_date'] = {'date':this.formatDate(this.dateSection[index]),'time':time};
} }
formatDate(date) { formatDate(date) {
const d = new Date(date); const d = new Date(date);
let day = '' + d.getDate(); let day = '' + d.getDate();
...@@ -443,10 +456,10 @@ export class IndexComponent implements OnInit { ...@@ -443,10 +456,10 @@ export class IndexComponent implements OnInit {
if (month.length < 2) { month = '0'+month; } if (month.length < 2) { month = '0'+month; }
return [year,month,day].join('-'); return [year,month,day].join('-');
} }
scheduleNow(mechanic_id,cost){ scheduleNow(mechanic_id,cost){
this.wizardData['mechanic_id'] = mechanic_id+':'+cost; this.wizardData['mechanic_id'] = mechanic_id+':'+cost;
if(!this.loginDetails){ if(!this.loginDetails){
this.autoSchedule = true; this.autoSchedule = true;
this.loginModalRef.nativeElement.click(); this.loginModalRef.nativeElement.click();
...@@ -457,7 +470,7 @@ export class IndexComponent implements OnInit { ...@@ -457,7 +470,7 @@ export class IndexComponent implements OnInit {
this.wizardData['cost'] = cost; this.wizardData['cost'] = cost;
this.confirmBooking(); this.confirmBooking();
} }
scheduleMultipleRequest(){ scheduleMultipleRequest(){
if(!this.loginDetails){ if(!this.loginDetails){
this.autoSchedule = true; this.autoSchedule = true;
...@@ -476,24 +489,24 @@ export class IndexComponent implements OnInit { ...@@ -476,24 +489,24 @@ export class IndexComponent implements OnInit {
this.wizardData['multiple'] ='1'; this.wizardData['multiple'] ='1';
this.confirmBooking(); this.confirmBooking();
} }
confirmBooking(){ confirmBooking(){
this.wizardData['customer_id'] = this.loginDetails.customer_id; this.wizardData['customer_id'] = this.loginDetails.customer_id;
this.wizardData['selected_issues'] = this.selectedIssues; this.wizardData['selected_issues'] = this.selectedIssues;
this.wizardData['optionalDescription'] = this.optionalDescription; this.wizardData['optionalDescription'] = this.optionalDescription;
let formData: FormData = new FormData(); let formData: FormData = new FormData();
formData.append('data', JSON.stringify(this.wizardData)); formData.append('data', JSON.stringify(this.wizardData));
this.optionalImges.forEach(function (imgData,index) { this.optionalImges.forEach(function (imgData,index) {
if(!imgData){ if(!imgData){
return true; return true;
} }
formData.append("optFile_" + (index), imgData.file); formData.append("optFile_" + (index), imgData.file);
}); });
this.webService.multipart_post('scheduleNow', formData).subscribe(response => { this.webService.multipart_post('scheduleNow', formData).subscribe(response => {
// this.webService.post_data('scheduleNow',this.wizardData).subscribe(response => { // this.webService.post_data('scheduleNow',this.wizardData).subscribe(response => {
if(response.status == '1'){ if(response.status == '1'){
this.closeWizardRef.nativeElement.click(); this.closeWizardRef.nativeElement.click();
this.closeQuoteWizardRef.nativeElement.click(); this.closeQuoteWizardRef.nativeElement.click();
...@@ -507,17 +520,17 @@ export class IndexComponent implements OnInit { ...@@ -507,17 +520,17 @@ export class IndexComponent implements OnInit {
return false; return false;
}); });
} }
jumpToStep0(){ jumpToStep0(){
this.goTostep0Ref.nativeElement.click(); this.goTostep0Ref.nativeElement.click();
} }
jumpToStep1(){ jumpToStep1(){
if(!this.vehicleDataForm.invalid){ if(!this.vehicleDataForm.invalid){
this.goTostep1Ref.nativeElement.click(); this.goTostep1Ref.nativeElement.click();
} }
} }
jumpToStep2(){ jumpToStep2(){
if(this.selectedIssues.length > 0){ if(this.selectedIssues.length > 0){
this.goTostep2Ref.nativeElement.click(); this.goTostep2Ref.nativeElement.click();
...@@ -527,26 +540,26 @@ export class IndexComponent implements OnInit { ...@@ -527,26 +540,26 @@ export class IndexComponent implements OnInit {
optImgUpload(image_id,event){ optImgUpload(image_id,event){
let reader = new FileReader(); let reader = new FileReader();
let optionalImg: any = event.target.files[0]; let optionalImg: any = event.target.files[0];
reader.onloadend = () => { reader.onloadend = () => {
switch (image_id){ switch (image_id){
case 1: case 1:
this.optionalImges[1] = {'file':event.target.files[0],'file_url':reader.result}; this.optionalImges[1] = {'file':event.target.files[0],'file_url':reader.result};
break; break;
case 2: case 2:
this.optionalImges[2] = {'file':event.target.files[0],'file_url':reader.result}; this.optionalImges[2] = {'file':event.target.files[0],'file_url':reader.result};
break; break;
case 3: case 3:
this.optionalImges[3] = {'file':event.target.files[0],'file_url':reader.result}; this.optionalImges[3] = {'file':event.target.files[0],'file_url':reader.result};
break; break;
case 4: case 4:
this.optionalImges[4] = {'file':event.target.files[0],'file_url':reader.result}; this.optionalImges[4] = {'file':event.target.files[0],'file_url':reader.result};
break; break;
} }
} }
reader.readAsDataURL(optionalImg); reader.readAsDataURL(optionalImg);
} }
checkboxChange(index,mechanic_id,event,estimate){ checkboxChange(index,mechanic_id,event,estimate){
if (event.target.checked) { if (event.target.checked) {
this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate}); this.selMechanics.push({id:index,mechanic_id:mechanic_id,amount:estimate});
...@@ -557,15 +570,15 @@ export class IndexComponent implements OnInit { ...@@ -557,15 +570,15 @@ export class IndexComponent implements OnInit {
} }
} }
} }
scrollToBottom(id){ scrollToBottom(id){
$('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500); $('#'+id).stop().animate({scrollTop: $('#'+id)[0].scrollHeight}, 1500);
} }
scrollToTop(id){ scrollToTop(id){
$('#'+id).stop().animate({scrollTop: 0}, 800); $('#'+id).stop().animate({scrollTop: 0}, 800);
} }
featuredOnLoad() {return ''; } featuredOnLoad() {return ''; }
carouselTileLoad(){ return ''; } carouselTileLoad(){ return ''; }
} }
...@@ -24,14 +24,19 @@ ...@@ -24,14 +24,19 @@
HOME HOME
</a> </a>
</li> </li>
<li class="nav-item" *ngIf="loginDetails">
<a class="nav-link" (click)="goToPage('dashboard')">
DASHBOARD
</a>
</li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" (click)="goToPage('purchaseHome')"> <a class="nav-link" (click)="goToPage('purchaseHome')">
PURCHASE PURCHASE
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link base_arrow dropdown"> <a class="nav-link base_arrow dropdown" data-toggle="dropdown">
<div class="dropdown-toggle" data-toggle="dropdown"> <div class="dropdown-toggle">
CAR OWNERS CAR OWNERS
</div> </div>
<div class="dropdown-menu"> <div class="dropdown-menu">
...@@ -73,8 +78,6 @@ ...@@ -73,8 +78,6 @@
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" (click)="goToPage('dashboard')">
My Dashboard</a>
<a class="dropdown-item" (click)="logout()">Logout</a> <a class="dropdown-item" (click)="logout()">Logout</a>
</div> </div>
</a> </a>
...@@ -384,9 +387,10 @@ ...@@ -384,9 +387,10 @@
'input_success': autospsignupForm.controls['password'].valid}" (click)="spSignupSubmitClick = false"> 'input_success': autospsignupForm.controls['password'].valid}" (click)="spSignupSubmitClick = false">
<div class="s_error" *ngIf="autospsignupForm.controls['password'].invalid && (autospsignupForm.controls['password'].touched || spSignupSubmitClick)"> <div class="s_error" *ngIf="autospsignupForm.controls['password'].invalid && (autospsignupForm.controls['password'].touched || spSignupSubmitClick)">
<div class="s_validation" *ngIf="autospsignupForm.controls['password'].hasError('required')">{{errorMsg.errorList.required}} </div> <div class="s_validation" *ngIf="autospsignupForm.controls['password'].hasError('required')">{{errorMsg.errorList.required}} </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<input class="" type="email" placeholder="Email" formControlName="email" <input class="" type="email" placeholder="Email" formControlName="email"
...@@ -410,6 +414,14 @@ ...@@ -410,6 +414,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12">
<select formControlName="shop_id">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select</option>
<option *ngFor="let shop of mechShop" [attr.value]="shop.shop_id">{{shop.shop_name}}</option>
</select>
</div>
</div>
<div *ngIf="spSignupResponse" class="s_alert" [ngClass]="(spSignupResponse.status == 'success') ? 'alert-success' : 'alert-danger'"> <div *ngIf="spSignupResponse" class="s_alert" [ngClass]="(spSignupResponse.status == 'success') ? 'alert-success' : 'alert-danger'">
<strong>{{spSignupResponse.message}}<br></strong> <strong>{{spSignupResponse.message}}<br></strong>
</div> </div>
......
...@@ -213,6 +213,27 @@ ...@@ -213,6 +213,27 @@
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
select{
border: 1px solid #1e1e1e;
height: 40px;
width: 100%;
border-radius: 10px;
font-size: 16px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius:10px;
-o-border-radius: 10px;
text-align: center;
option{
text-align: center;
}
&::placeholder {
color: #bbbbbb;
}
&:focus {
outline: none;
}
}
input { input {
border: 1px solid #1e1e1e; border: 1px solid #1e1e1e;
height: 40px; height: 40px;
......
...@@ -17,13 +17,14 @@ declare const window: any; ...@@ -17,13 +17,14 @@ declare const window: any;
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
data : any; data : any;
loader : boolean;
imageServer : any; imageServer : any;
loginDetails : any; loginDetails : any;
loginResponse : any; loginResponse : any;
forgotResponse : any; forgotResponse : any;
signupResponse : any; signupResponse : any;
spSignupResponse : any; spSignupResponse : any;
mechShop : any;
loader : boolean;
loginSubmitClick : boolean; loginSubmitClick : boolean;
forgotSubmitClick : boolean; forgotSubmitClick : boolean;
signupSubmitClick : boolean; signupSubmitClick : boolean;
...@@ -58,6 +59,7 @@ export class NavbarComponent implements OnInit { ...@@ -58,6 +59,7 @@ export class NavbarComponent implements OnInit {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
}); });
this.getMechanicShops();
this.loginForm = new FormGroup({ this.loginForm = new FormGroup({
email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]), email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')]),
password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]) password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)])
...@@ -83,10 +85,24 @@ export class NavbarComponent implements OnInit { ...@@ -83,10 +85,24 @@ export class NavbarComponent implements OnInit {
phone: new FormControl('', [Validators.required, Validators.pattern("^[0-9\ ( ) + , - ]+$")]), phone: new FormControl('', [Validators.required, Validators.pattern("^[0-9\ ( ) + , - ]+$")]),
password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]), password: new FormControl('', [Validators.required, Validators.maxLength(16), Validators.minLength(6)]),
last_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]), last_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]),
first_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]) first_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]),
shop_id: new FormControl('')
}); });
} }
getMechanicShops(){
this.loader = true;
this.webService.get_data('getMechanicShops').subscribe(response => {
if(response.status == 'success'){
this.mechShop = response.data;
}else{
this.mechShop = false;
}
this.loader = false;
})
}
loginSubmit(data) { loginSubmit(data) {
if(this.loginForm.invalid){ if(this.loginForm.invalid){
return false; return false;
......
...@@ -47,13 +47,13 @@ export class AddaddressComponent implements OnInit { ...@@ -47,13 +47,13 @@ export class AddaddressComponent implements OnInit {
this.address_id = params['address_id']; this.address_id = params['address_id'];
}); });
}); });
if(this.address_id != ''){
this.getUserAddressById(this.address_id);
}
this.checkUserLogin(); this.checkUserLogin();
this.checkProductId(); this.checkProductId();
this.buildAddressForm(); this.buildAddressForm();
if(this.address_id > 0){
this.getUserAddressById(this.address_id);
}
} }
buildAddressForm(){ buildAddressForm(){
...@@ -69,14 +69,6 @@ export class AddaddressComponent implements OnInit { ...@@ -69,14 +69,6 @@ export class AddaddressComponent implements OnInit {
}); });
} }
// checkProductId(product_id){
// if(product_id > 0){
// this.product_id = product_id;
// }else{
// this.goToPage('purchaseHome','');
// }
// }
checkProductId(){ checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails')); this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData"> <ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData">
<li (click)="latestPrdtDtls(prdt.product_id)"> <li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<div class="product_details"> <div class="product_details">
<h1>{{productDetails.product_name}}</h1> <h1>{{productDetails.product_name}}</h1>
<h2>{{productDetails.short_description}}</h2> <h2>{{productDetails.short_description}}</h2>
<h4><div>Brand</div><span>{{productDetails.brand_name}}</span></h4> <h2>Brand : </h2><h4>{{productDetails.brand_name}}</h4>
<h4><div>Part ID</div><span>PRD152685425</span></h4> <div *ngIf="productDetails.part_id"><h2>Part ID : </h2><h4>{{productDetails.part_id}}</h4></div>
<h3>$ {{productDetails.amount}}</h3> <h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating"> <div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click"> <fieldset class="rating prevent-click">
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="trendingProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData" > <ngx-tile NgxCarouselItem *ngFor="let prdt of trendingProductData" >
<li (click)="latestPrdtDtls(prdt.product_id)"> <li (click)="latestPrdtDtls(prdt.product_id)">
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
......
...@@ -52,7 +52,6 @@ export class ProductdetailsComponent implements OnInit { ...@@ -52,7 +52,6 @@ export class ProductdetailsComponent implements OnInit {
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.product_id = params['product_id']; this.product_id = params['product_id'];
}); });
this.getProductDetails();
}); });
if(!this.product_id){ if(!this.product_id){
...@@ -70,6 +69,7 @@ export class ProductdetailsComponent implements OnInit { ...@@ -70,6 +69,7 @@ export class ProductdetailsComponent implements OnInit {
this.designModules(); this.designModules();
this.checkUserLogin(); this.checkUserLogin();
this.trendingProducts(); this.trendingProducts();
this.getProductDetails();
} }
checkUserLogin(){ checkUserLogin(){
...@@ -81,7 +81,11 @@ export class ProductdetailsComponent implements OnInit { ...@@ -81,7 +81,11 @@ export class ProductdetailsComponent implements OnInit {
getProductDetails(){ getProductDetails(){
this.loader = true; this.loader = true;
this.webService.post_data('SingleProductSearch',{"product_id":this.product_id,'page':this.page}).subscribe(response => { let user_id: number = 0;
if(this.loginDetails && this.loginDetails.customer_id){
user_id = this.loginDetails.customer_id;
}
this.webService.post_data('SingleProductSearch',{"product_id":this.product_id,'page':this.page,'user_id':user_id}).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
let image: string = ''; let image: string = '';
let imageArr: any[] = new Array(); let imageArr: any[] = new Array();
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
<ul id="ac3" class="collapse in show"> <ul id="ac3" class="collapse in show">
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
<select> <select>
<option> <option *ngFor="let date of modelDates">{{date}}</option>
Year
</option>
</select> </select>
</h6> </h6>
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
...@@ -66,7 +64,7 @@ ...@@ -66,7 +64,7 @@
</div> </div>
</div> </div>
<div class="loader_overlay" *ngIf="loader"></div> <div class="loader_overlay" *ngIf="loader"></div>
<div class="search_listing_content" *ngIf="productArray && productArray.length > 0;else noProductData"> <div class="search_listing_content cpoint" *ngIf="productArray && productArray.length > 0;else noProductData">
<ul infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll"> <ul infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let prdt of productArray"> <li *ngFor="let prdt of productArray">
<div class="inner_div_product cpoint" (click)="getSingleProductDetails(prdt.product_id)"> <div class="inner_div_product cpoint" (click)="getSingleProductDetails(prdt.product_id)">
...@@ -76,7 +74,7 @@ ...@@ -76,7 +74,7 @@
<h5>{{prdt.product_name}}</h5> <h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p> <p>{{prdt.short_description}}</p>
<div class="star_ratting"> <div class="star_ratting">
<fieldset class="rating prevent-click hide"> <fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label> <input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label> <input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label> <input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
.rating { .rating {
border: none; border: none;
float: left; float: left;
position: relative;
} }
.rating > input { display: none; } .rating > input { display: none; }
......
...@@ -22,6 +22,7 @@ export class ProductlistComponent implements OnInit { ...@@ -22,6 +22,7 @@ export class ProductlistComponent implements OnInit {
page: number = 1; page: number = 1;
total_page: number = 1; total_page: number = 1;
filterParam: any = new Array(); filterParam: any = new Array();
modelDates: number[] = new Array();
constructor( constructor(
private router : Router, private router : Router,
...@@ -50,6 +51,16 @@ export class ProductlistComponent implements OnInit { ...@@ -50,6 +51,16 @@ export class ProductlistComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getBrand(); this.getBrand();
this.getYear();
}
getYear(){
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 110;
for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date);
}
console.log(this.modelDates);
} }
goToPage(path,data=null){ goToPage(path,data=null){
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<div class="loader_overlay" *ngIf="loader"></div> <div class="loader_overlay" *ngIf="loader"></div>
<ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="latestProductData"> <ngx-carousel [inputs]="carouselTile" (carouselLoad)="carouselTileLoad()" *ngIf="latestProductData">
<ngx-tile NgxCarouselItem *ngFor="let prdt of latestProductData"> <ngx-tile NgxCarouselItem *ngFor="let prdt of latestProductData">
<li (click)="latestPrdtDtls(prdt.product_id)" > <li (click)="latestPrdtDtls(prdt.product_id)" >
<div class="inner_div_product"> <div class="inner_div_product cpoint">
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
...@@ -52,15 +52,15 @@ ...@@ -52,15 +52,15 @@
<div class="loader_overlay" *ngIf="trend_loader"></div> <div class="loader_overlay" *ngIf="trend_loader"></div>
<ul *ngIf="trendingProductData" <ul *ngIf="trendingProductData"
infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll"> infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li (click)="latestPrdtDtls(prdt.product_id)" *ngFor="let prdt of trendingProductData" > <li *ngFor="let prdt of trendingProductData" >
<div class="inner_div_product"> <div class="inner_div_product cpoint" (click)="latestPrdtDtls(prdt.product_id)" >
<div class="product_wrapper"> <div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'"> <img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div> </div>
<h5>{{prdt.product_name}}</h5> <h5>{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p> <p>{{prdt.short_description}}</p>
<div class="star_ratting"> <div class="star_ratting">
<fieldset class="rating prevent-click hide"> <fieldset class="rating prevent-click">
<input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label> <input type="radio" [checked]="(prdt.rating >= 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_5'" [attr.name]="'usrReviewName_'+prdt.product_id" value="5" /><label class = "full" for="secondStar5"></label>
<input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label> <input type="radio" [checked]="(prdt.rating >= 4.25 && prdt.rating < 4.75) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4half'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4.5" /><label class="half" for="secondStar4half"></label>
<input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label> <input type="radio" [checked]="(prdt.rating >= 3.75 && prdt.rating < 4.25) ? 'true':''" [attr.id]="'usrReviewId_'+prdt.product_id+'_4'" [attr.name]="'usrReviewName_'+prdt.product_id" value="4" /><label class = "full" for="secondStar4"></label>
......
...@@ -289,6 +289,7 @@ ...@@ -289,6 +289,7 @@
.rating { .rating {
border: none; border: none;
float: left; float: left;
position: relative;
} }
.rating > input { display: none; } .rating > input { display: none; }
...@@ -302,7 +303,7 @@ ...@@ -302,7 +303,7 @@
.rating > .half:before { .rating > .half:before {
content: "\f089"; content: "\f089";
position: absolute; position: absolute;
} }
.rating > label { .rating > label {
......
...@@ -20,6 +20,7 @@ export class PurchaseHomeComponent implements OnInit { ...@@ -20,6 +20,7 @@ export class PurchaseHomeComponent implements OnInit {
trend_loader:boolean; trend_loader:boolean;
latestProductData:any; latestProductData:any;
trendingProductData:any; trendingProductData:any;
loginDetails:any;
@ViewChild("failureModel") public failureModelRef: ElementRef; @ViewChild("failureModel") public failureModelRef: ElementRef;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="purchase_other"> <div class="purchase_other" *ngIf="loginDetails">
<ul> <ul>
<li (click)="goToPage('orders')"> <li (click)="goToPage('orders')">
<img src="assets/images/asset_cart.png"> <img src="assets/images/asset_cart.png">
......
...@@ -2,6 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router'; import { Router,ActivatedRoute } from '@angular/router';
import { WebService } from '../../provider/web.service'; import { WebService } from '../../provider/web.service';
import { ImageStorage } from '../../../environments/server.config'; import { ImageStorage } from '../../../environments/server.config';
import { SubjectService } from '../../provider/subject.service';
@Component({ @Component({
selector: 'app-searchbar', selector: 'app-searchbar',
...@@ -13,17 +14,29 @@ export class SearchbarComponent implements OnInit { ...@@ -13,17 +14,29 @@ export class SearchbarComponent implements OnInit {
productArray: any; productArray: any;
SingleProductData:any; SingleProductData:any;
imageServer: string; imageServer: string;
loginDetails:any;
public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' }; public scrollbarOptions = { axis: 'y', theme: 'minimal-dark' };
@ViewChild("productSearch") public productSearchRef: ElementRef; @ViewChild("productSearch") public productSearchRef: ElementRef;
constructor(private router : Router, private route: ActivatedRoute, public webService: WebService) { constructor(private router : Router,
private route: ActivatedRoute,
public webService: WebService,
public subjectService : SubjectService) {
this.productArray = true; this.productArray = true;
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
} }
ngOnInit() { ngOnInit() {
this.checkUserLogin();
}
checkUserLogin(){
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
} }
goToPage(path,data=null){ goToPage(path,data=null){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment