Commit 54e31d19 by Jansa Jose

index page and design issues

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