Commit ca37e119 by Jansa Jose

dc

parent 506244f8
...@@ -1722,6 +1722,11 @@ ...@@ -1722,6 +1722,11 @@
"bootstrap": "^4.0.0-alpha.6" "bootstrap": "^4.0.0-alpha.6"
} }
}, },
"angularx-social-login": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/angularx-social-login/-/angularx-social-login-1.2.7.tgz",
"integrity": "sha512-ymzYuuYfWeIywVmswKYFMwC9n3oFxeIr3OpjL62afZig7rpVDvVGsxqFR3Kfjc2dThMRCvDVoq/vvGgO33fWKQ=="
},
"ansi-colors": { "ansi-colors": {
"version": "3.2.4", "version": "3.2.4",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz",
...@@ -4948,14 +4953,12 @@ ...@@ -4948,14 +4953,12 @@
}, },
"handlebars": { "handlebars": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.1.tgz", "resolved": "",
"integrity": "sha512-3Zhi6C0euYZL5sM0Zcy7lInLXKQ+YLcF/olbN010mzGQ4XVm50JeyBnMqofHh696GrciGruC7kCcApPDJvVgwA==",
"dev": true, "dev": true,
"requires": { "requires": {
"neo-async": "^2.6.0", "neo-async": "^2.6.0",
"optimist": "^0.6.1", "optimist": "^0.6.1",
"source-map": "^0.6.1", "source-map": "^0.6.1"
"uglify-js": "^3.1.4"
}, },
"dependencies": { "dependencies": {
"source-map": { "source-map": {
...@@ -10297,33 +10300,6 @@ ...@@ -10297,33 +10300,6 @@
"integrity": "sha1-tlQ6g8/Iwr77P0yPumiW9bDJvmg=", "integrity": "sha1-tlQ6g8/Iwr77P0yPumiW9bDJvmg=",
"dev": true "dev": true
}, },
"uglify-js": {
"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": {
"commander": "~2.20.0",
"source-map": "~0.6.1"
},
"dependencies": {
"commander": {
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
"dev": true,
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"optional": true
}
}
},
"ultron": { "ultron": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"@google/maps": "^0.5.5", "@google/maps": "^0.5.5",
"angular-star-rating": "^4.0.0-beta.3", "angular-star-rating": "^4.0.0-beta.3",
"angular-wizard-form": "^0.4.1", "angular-wizard-form": "^0.4.1",
"angularx-social-login": "^1.2.7",
"bootstrap": "^4.3.1", "bootstrap": "^4.3.1",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
......
...@@ -8,9 +8,21 @@ import { PurchaseModule } from './purchase/purchase.module'; ...@@ -8,9 +8,21 @@ import { PurchaseModule } from './purchase/purchase.module';
import { NavbarComponent } from './navbar/navbar.component'; import { NavbarComponent } from './navbar/navbar.component';
import { FooterComponent } from './footer/footer.component'; import { FooterComponent } from './footer/footer.component';
import { ReactiveFormsModule } from '@angular/forms'; import { ReactiveFormsModule } from '@angular/forms';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar'; import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';
import { ForgotComponent } from './forgot/forgot.component'; import { ForgotComponent } from './forgot/forgot.component';
import { SocialLoginModule, AuthServiceConfig, LoginOpt } from "angularx-social-login";
import { FacebookLoginProvider } from "angularx-social-login";
let config = new AuthServiceConfig([
{
id: FacebookLoginProvider.PROVIDER_ID,
provider: new FacebookLoginProvider("350548065653331")
}
]);
export function provideConfig() {
return config;
}
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -26,9 +38,16 @@ import { ForgotComponent } from './forgot/forgot.component'; ...@@ -26,9 +38,16 @@ import { ForgotComponent } from './forgot/forgot.component';
PurchaseModule, PurchaseModule,
ReactiveFormsModule, ReactiveFormsModule,
HttpClientModule, HttpClientModule,
MalihuScrollbarModule.forRoot() MalihuScrollbarModule.forRoot(),
SocialLoginModule
],
providers: [
{
provide: AuthServiceConfig,
useFactory: provideConfig
}
], ],
providers: [],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }
...@@ -853,20 +853,29 @@ ...@@ -853,20 +853,29 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="scheduletiming_listing"> <div class="scheduletiming_listing">
<ul id="scroll_0_{{i}}"> <ul id="scroll_0_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button"> <span *ngFor="let time of mechanic.scheduleTiming">
<li *ngIf="(time > currentTime && ((dateSection[0] | date: 'dd') == currentDate))" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
<li *ngIf="((dateSection[0] | date: 'dd') != currentDate)" id="custom_check_button">
<label> <label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0'); <input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id"> scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p> <p>{{time | date:'hh:mm a'}}</p>
</label> </label>
</li> </li>
</span>
</ul> </ul>
<ul id="scroll_1_{{i}}"> <ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button"> <li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label> <label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1'); <input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id"> scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p> <p>{{time | date:'hh:mm a'}}</p>
</label> </label>
</li> </li>
</ul> </ul>
......
...@@ -75,6 +75,8 @@ export class DashboardComponent implements OnInit { ...@@ -75,6 +75,8 @@ export class DashboardComponent implements OnInit {
step: number; step: number;
today: any = new Date(); today: any = new Date();
currDate: any; currDate: any;
currentDate: any;
currentTime: any;
nextDate: any; nextDate: any;
dateStep: number = 0; dateStep: number = 0;
dateSection: any[] = new Array(); dateSection: any[] = new Array();
...@@ -141,8 +143,9 @@ export class DashboardComponent implements OnInit { ...@@ -141,8 +143,9 @@ export class DashboardComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.currentTime = this.today.getTime();
this.currentDate = this.today.getDate();
this.tab = 'active'; this.tab = 'active';
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
let payStatus = params['status']; let payStatus = params['status'];
let activeTab = params['tab']; let activeTab = params['tab'];
...@@ -224,14 +227,17 @@ export class DashboardComponent implements OnInit { ...@@ -224,14 +227,17 @@ export class DashboardComponent implements OnInit {
} }
getVehicleBrand(){ getVehicleBrand(){
this.loader = true;
this.webService.get_data('getVehicleBrand').subscribe(response => { this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
this.carBrands = response.data; this.carBrands = response.data;
} }
this.loader = false;
}); });
} }
get_model(brand_id) { get_model(brand_id) {
this.loader = true;
const thisObj = this; const thisObj = this;
thisObj.carBrands.forEach(function (brandData,index) { thisObj.carBrands.forEach(function (brandData,index) {
if(brandData.veh_brand_id == brand_id){ if(brandData.veh_brand_id == brand_id){
...@@ -243,6 +249,7 @@ export class DashboardComponent implements OnInit { ...@@ -243,6 +249,7 @@ export class DashboardComponent implements OnInit {
if(response.status == 'success'){ if(response.status == 'success'){
this.carModel = response.data; this.carModel = response.data;
} }
this.loader = false;
}); });
} }
...@@ -251,7 +258,6 @@ export class DashboardComponent implements OnInit { ...@@ -251,7 +258,6 @@ export class DashboardComponent implements OnInit {
this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => { this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => {
if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) { if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) {
let bookings = response.bookData; let bookings = response.bookData;
console.log(bookings);
let successBooking: any[] = new Array(); let successBooking: any[] = new Array();
let bookingDetails: any[] = new Array(); let bookingDetails: any[] = new Array();
...@@ -651,12 +657,10 @@ searchIssues(event){ ...@@ -651,12 +657,10 @@ searchIssues(event){
// if(subIssueCat.search(serRegExp) != -1){ // if(subIssueCat.search(serRegExp) != -1){
// thisObj.defIssuesData['exception'] = '1'; // thisObj.defIssuesData['exception'] = '1';
// data.push(thisObj.defIssuesData[index]); // data.push(thisObj.defIssuesData[index]);
// // console.log(thisObj.defIssuesData[index].sub_categories[index_1])
// } // }
// }) // })
// } // }
// }); // });
// console.log(thisObj.defIssuesData);
// this.issuesData = (data.length > 0)?data:false; // this.issuesData = (data.length > 0)?data:false;
// } // }
...@@ -685,6 +689,7 @@ getQuote(){ ...@@ -685,6 +689,7 @@ getQuote(){
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;
console.log(this.mechanicData)
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)));
...@@ -927,13 +932,14 @@ confirmCallBack(fn_name: string,param: string){ ...@@ -927,13 +932,14 @@ confirmCallBack(fn_name: string,param: string){
} }
acceptQuote(param: any){ acceptQuote(param: any){
this.loader=true;
this.webService.post_data('acceptMechanicQuote',param).subscribe(response => { this.webService.post_data('acceptMechanicQuote',param).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
document.location.href = this.serverUrl+'payNow/'+response.data; document.location.href = this.serverUrl+'payNow/'+response.data;
// this.getCustBookDetails(); // this.getCustBookDetails();
}else{
this.loader = false;
this.failureModelRef.nativeElement.click();
} }
}) })
} }
......
...@@ -591,20 +591,36 @@ ...@@ -591,20 +591,36 @@
<div class="scheduletiming_listing"> <div class="scheduletiming_listing">
<!-- <ul id="scroll_0_{{mechanic.mechanic_id}}" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> --> <!-- <ul id="scroll_0_{{mechanic.mechanic_id}}" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> -->
<ul id="scroll_0_{{i}}"> <ul id="scroll_0_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button"> <!-- <li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p *ngIf="time > currentDate">{{time}}</p>
</label>
</li> -->
<span *ngFor="let time of mechanic.scheduleTiming">
<li *ngIf="(time > currentTime && ((dateSection[0] | date: 'dd') == currentDate))" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
<li *ngIf="((dateSection[0] | date: 'dd') != currentDate)" id="custom_check_button">
<label> <label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0'); <input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id"> scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p> <p>{{time | date:'hh:mm a'}}</p>
</label> </label>
</li> </li>
</span>
</ul> </ul>
<ul id="scroll_1_{{i}}"> <ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button"> <li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label> <label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1'); <input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id"> scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p> <p>{{time | date:'hh:mm a'}}</p>
</label> </label>
</li> </li>
</ul> </ul>
......
...@@ -65,6 +65,8 @@ export class IndexComponent implements OnInit { ...@@ -65,6 +65,8 @@ export class IndexComponent implements OnInit {
step: number; step: number;
today: any = new Date(); today: any = new Date();
currDate: any; currDate: any;
currentDate: any;
currentTime: any;
nextDate: any; nextDate: any;
dateStep: number = 0; dateStep: number = 0;
mechanics: string = ''; mechanics: string = '';
...@@ -110,6 +112,8 @@ export class IndexComponent implements OnInit { ...@@ -110,6 +112,8 @@ export class IndexComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.currentTime = this.today.getTime();
this.currentDate = this.today.getDate();
this.vehicleDataForm = new FormGroup({ this.vehicleDataForm = new FormGroup({
trim: new FormControl(''), milage: new FormControl(''), emgine: new FormControl(''), trim: new FormControl(''), milage: new FormControl(''), emgine: new FormControl(''),
last_date: new FormControl(''), last_date: new FormControl(''),
...@@ -222,7 +226,6 @@ export class IndexComponent implements OnInit { ...@@ -222,7 +226,6 @@ export class IndexComponent implements OnInit {
'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; this.vehicleDataFormSubmit = false;
} }
...@@ -386,7 +389,6 @@ get_newlocaion(lastLoc){ ...@@ -386,7 +389,6 @@ get_newlocaion(lastLoc){
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)
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'){
......
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
CAR OWNERS CAR OWNERS
</div> </div>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item">My Dashboard</a> <a class="dropdown-item" *ngIf="loginDetails" (click)="goToPage('dashboard')">My Dashboard</a>
<a class="dropdown-item">Find parts and accessories</a> <a class="dropdown-item" (click)="goToPage('purchaseHome')">Find parts and accessories</a>
<a class="dropdown-item">Rewards</a> <a class="dropdown-item">Rewards</a>
<a class="dropdown-item">Messages</a> <a class="dropdown-item">Messages</a>
<a class="dropdown-item">Request a Service </a> <a class="dropdown-item">Request a Service </a>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<button class="facebook_btn"> <button class="facebook_btn" (click)="signInWithFB()">
Sign Up with Facebook <img src="assets/images/asset_fb1.png"> Sign Up with Facebook <img src="assets/images/asset_fb1.png">
</button> </button>
</div> </div>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h6><a (click)="resetForm()" data-dismiss="modal" data-toggle="modal" data-target="#login">Sign In</a> OR <a>Continue as guest</a></h6> <h6><a (click)="resetForm()" data-dismiss="modal" data-toggle="modal" data-target="#login">Sign In</a> OR <a (click)="cntueGustBtn()">Continue as guest</a></h6>
</div> </div>
</div> </div>
</div> </div>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
<h3>SIGN IN</h3> <h3>SIGN IN</h3>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<button class="facebook_btn"> <button class="facebook_btn" (click)="signInWithFB()">
Sign in with Facebook <img src="assets/images/asset_fb1.png"> Sign in with Facebook <img src="assets/images/asset_fb1.png">
</button> </button>
</div> </div>
...@@ -285,7 +285,7 @@ ...@@ -285,7 +285,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h6>Do you have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#signup">Sign Up</a> OR <a>Continue as guest</a></h6> <h6>Do you have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#signup">Sign Up</a> OR <a (click)="cntueGustBtn()">Continue as guest</a></h6>
</div> </div>
</div> </div>
</div> </div>
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<select formControlName="shop_id"> <select formControlName="shop_id">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select</option> <option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Mechanic Shop</option>
<option *ngFor="let shop of mechShop" [attr.value]="shop.shop_id">{{shop.shop_name}}</option> <option *ngFor="let shop of mechShop" [attr.value]="shop.shop_id">{{shop.shop_name}}</option>
</select> </select>
</div> </div>
......
...@@ -5,6 +5,9 @@ import { ValidationService } from './../provider/validation.service'; ...@@ -5,6 +5,9 @@ import { ValidationService } from './../provider/validation.service';
import { WebService } from './../provider/web.service'; import { WebService } from './../provider/web.service';
import { SubjectService } from './../provider/subject.service'; import { SubjectService } from './../provider/subject.service';
import { ImageStorage } from '../../environments/server.config'; import { ImageStorage } from '../../environments/server.config';
import { AuthService } from "angularx-social-login";
import { FacebookLoginProvider, GoogleLoginProvider } from "angularx-social-login";
import { SocialUser } from "angularx-social-login";
declare var $; declare var $;
declare const window: any; declare const window: any;
...@@ -14,6 +17,7 @@ declare const window: any; ...@@ -14,6 +17,7 @@ declare const window: any;
templateUrl: './navbar.component.html', templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss'] styleUrls: ['./navbar.component.scss']
}) })
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
data : any; data : any;
...@@ -29,13 +33,16 @@ export class NavbarComponent implements OnInit { ...@@ -29,13 +33,16 @@ export class NavbarComponent implements OnInit {
forgotSubmitClick : boolean; forgotSubmitClick : boolean;
signupSubmitClick : boolean; signupSubmitClick : boolean;
spSignupSubmitClick : boolean; spSignupSubmitClick : boolean;
private user: SocialUser;
private loggedIn: boolean;
constructor ( constructor (
private router : Router, private router : Router,
private route : ActivatedRoute, private route : ActivatedRoute,
public errorMsg : ValidationService, public errorMsg : ValidationService,
public webService : WebService, public webService : WebService,
public subjectService : SubjectService) { public subjectService : SubjectService,
private authService : AuthService) {
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
this.loginDetails = false; this.loginDetails = false;
this.loginSubmitClick = false; this.loginSubmitClick = false;
...@@ -57,6 +64,9 @@ export class NavbarComponent implements OnInit { ...@@ -57,6 +64,9 @@ export class NavbarComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.subjectService.getLoginData().subscribe(loginData => { this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.facebookSignUp();
}
}); });
this.getMechanicShops(); this.getMechanicShops();
...@@ -91,6 +101,48 @@ export class NavbarComponent implements OnInit { ...@@ -91,6 +101,48 @@ export class NavbarComponent implements OnInit {
}); });
} }
signInWithFB(): void {
this.authService.signIn(FacebookLoginProvider.PROVIDER_ID);
}
signOut(): void {
this.authService.signOut();
}
facebookSignUp(){
const This = this;
this.authService.authState.subscribe((user) => {
this.user = user;
let data: any = new Array();
data = {'first_name':this.user.firstName,'last_name':this.user.lastName,'email':this.user.email,'image_url':this.user.photoUrl};
if(this.user){
this.webService.post_data('socialLogin', {'data':data}).subscribe(response => {
if ( response.status == '1') {
this.webService.setLocalStorageItem('userData', JSON.stringify(response.data));
this.subjectService.sendLoginData('logged_in');
this.loginModal.nativeElement.click();
this.signupModal.nativeElement.click();
} else {
response.status = 'error';
response.message = (response.message == '')?this.errorMsg.errorList.req_failure:response.message;
this.loginResponse = response;
}
},error => {
this.loginResponse = {'status':'error','message':this.errorMsg.errorList.req_failure};
},() => {
setTimeout( function() {
This.loginResponse = false;
}, 2000)
});
}
});
}
cntueGustBtn(){
this.loginModal.nativeElement.click();
this.signupModal.nativeElement.click();
}
getMechanicShops(){ getMechanicShops(){
this.loader = true; this.loader = true;
this.webService.get_data('getMechanicShops').subscribe(response => { this.webService.get_data('getMechanicShops').subscribe(response => {
...@@ -257,10 +309,12 @@ export class NavbarComponent implements OnInit { ...@@ -257,10 +309,12 @@ export class NavbarComponent implements OnInit {
} }
logout() { logout() {
this.signOut();
const userData = this.webService.getLocalStorageItem('userData'); const userData = this.webService.getLocalStorageItem('userData');
this.webService.removeLocalStorageItem(userData); this.webService.removeLocalStorageItem(userData);
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.router.navigate(['../index']); this.router.navigate(['../index']);
} }
} }
...@@ -21,7 +21,10 @@ ...@@ -21,7 +21,10 @@
</div> </div>
</ul> </ul>
<ng-template #noAddress> <ng-template #noAddress>
Address is Not Added! <div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>Address is Not Added!</p>
</div>
</ng-template> </ng-template>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -42,7 +42,6 @@ export class AddressComponent implements OnInit { ...@@ -42,7 +42,6 @@ export class AddressComponent implements OnInit {
checkProductId(){ checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails')); this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
console.log(this.prdtData)
if(this.prdtData && this.prdtData['product_id'] > 0){ if(this.prdtData && this.prdtData['product_id'] > 0){
this.product_id = this.prdtData['product_id']; this.product_id = this.prdtData['product_id'];
}else{ }else{
......
...@@ -28,21 +28,24 @@ ...@@ -28,21 +28,24 @@
<h6 href="#ac3" data-toggle="collapse">Vehicle Information</h6> <h6 href="#ac3" data-toggle="collapse">Vehicle Information</h6>
<ul id="ac3" class="collapse in show"> <ul id="ac3" class="collapse in show">
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
<select> <select (change)="get_year($event.target.value)">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Year</option>
<option *ngFor="let date of modelDates">{{date}}</option> <option *ngFor="let date of modelDates">{{date}}</option>
</select> </select>
</h6> </h6>
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
<select> <select (change)="get_model($event.target.value)">
<option> <option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Maker</option>
Model <option *ngFor="let brands of carBrands" value="{{brands.veh_brand_id}}">
{{brands.maker}}
</option> </option>
</select> </select>
</h6> </h6>
<h6 class="backgroundNone borderNone"> <h6 class="backgroundNone borderNone">
<select> <select (change)="getModelResult($event.target.value)" *ngIf="modelShow">
<option> <option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Model</option>
Make <option *ngFor="let models of carModel" value="{{models.veh_modal_id}}">
{{models.model}}
</option> </option>
</select> </select>
</h6> </h6>
...@@ -98,17 +101,6 @@ ...@@ -98,17 +101,6 @@
No Data Found No Data Found
</ng-template> </ng-template>
<hr> <hr>
<!-- <div class="pagination">
<ul>
<li class="prev"><</li>
<li class="select">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li class="next">></li>
</ul>
</div> -->
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
......
...@@ -23,6 +23,9 @@ export class ProductlistComponent implements OnInit { ...@@ -23,6 +23,9 @@ export class ProductlistComponent implements OnInit {
total_page: number = 1; total_page: number = 1;
filterParam: any = new Array(); filterParam: any = new Array();
modelDates: number[] = new Array(); modelDates: number[] = new Array();
carBrands:any;
carModel:any;
modelShow :boolean;
constructor( constructor(
private router : Router, private router : Router,
...@@ -30,6 +33,7 @@ export class ProductlistComponent implements OnInit { ...@@ -30,6 +33,7 @@ export class ProductlistComponent implements OnInit {
public webService : WebService public webService : WebService
){ ){
this.loader = true; this.loader = true;
this.modelShow = false;
this.productArray = []; this.productArray = [];
this.filterParam = {"key":'',"brand_id":Array(),"minPrice":'',"maxPrice":'','page':1}; this.filterParam = {"key":'',"brand_id":Array(),"minPrice":'',"maxPrice":'','page':1};
this.imageServer = ImageStorage; this.imageServer = ImageStorage;
...@@ -52,6 +56,7 @@ export class ProductlistComponent implements OnInit { ...@@ -52,6 +56,7 @@ export class ProductlistComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getBrand(); this.getBrand();
this.getYear(); this.getYear();
this.getVehBrand();
} }
getYear(){ getYear(){
...@@ -60,7 +65,38 @@ export class ProductlistComponent implements OnInit { ...@@ -60,7 +65,38 @@ export class ProductlistComponent implements OnInit {
for (let date = currentYear ; date >= startingYear ; date --) { for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date); this.modelDates.push(date);
} }
console.log(this.modelDates); }
getVehBrand(){
this.loader=true;
this.webService.get_data('getVehicleBrand').subscribe(response => {
if(response.status == 'success'){
this.carBrands = response.data;
}
this.loader = false;
});
}
get_model(brand_id) {
this.page = 1;
this.loader = true;
this.webService.post_data('getVehicleModel',{'vehBrand_id':brand_id}).subscribe(response => {
if(response.status == 'success'){
this.modelShow = true;
this.carModel = response.data;
this.filterParam.page = this.page;
this.filterParam.maker = brand_id;
this.getProductDetails(this.filterParam);
}
this.loader = false;
});
}
getModelResult(modelId){
this.page = 1;
this.filterParam.page = this.page;
this.filterParam.model = modelId;
this.getProductDetails(this.filterParam);
} }
goToPage(path,data=null){ goToPage(path,data=null){
...@@ -135,4 +171,11 @@ export class ProductlistComponent implements OnInit { ...@@ -135,4 +171,11 @@ export class ProductlistComponent implements OnInit {
this.filterParam.maxPrice = top; this.filterParam.maxPrice = top;
this.getProductDetails(this.filterParam); this.getProductDetails(this.filterParam);
} }
get_year(year){
this.page = 1;
this.filterParam.page = this.page;
this.filterParam.year = year;
this.getProductDetails(this.filterParam);
}
} }
...@@ -51,7 +51,6 @@ export class SearchbarComponent implements OnInit { ...@@ -51,7 +51,6 @@ export class SearchbarComponent implements OnInit {
} }
this.webService.post_data('productSearch',{"key":product}).subscribe(response => { this.webService.post_data('productSearch',{"key":product}).subscribe(response => {
if(response.status == 'success'){ if(response.status == 'success'){
console.log(response.data)
this.productArray = response.data; this.productArray = response.data;
} else { } else {
this.productArray = false; this.productArray = false;
......
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