Commit 73d3cc08 by Tobin

daily commit

parent 7e19ab0f
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@agm/core": "^1.0.0-beta.5",
"@angular/animations": "~7.1.0", "@angular/animations": "~7.1.0",
"@angular/common": "~7.1.0", "@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0", "@angular/compiler": "~7.1.0",
...@@ -19,11 +20,15 @@ ...@@ -19,11 +20,15 @@
"@angular/platform-browser": "~7.1.0", "@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0", "@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0", "@angular/router": "~7.1.0",
"angular-star-rating": "^4.0.0-beta.3",
"angular-wizard-form": "^0.4.1", "angular-wizard-form": "^0.4.1",
"bootstrap": "^4.1.3", "bootstrap": "^4.1.3",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"ng2-archwizard": "^2.1.0", "ng2-archwizard": "^2.1.0",
"ngx-carousel": "^1.3.5",
"ngx-google-places-autocomplete": "^2.0.3",
"ngx-slick": "^0.2.1", "ngx-slick": "^0.2.1",
"node-sass": "^4.11.0", "node-sass": "^4.11.0",
"rebuild": "^0.1.2", "rebuild": "^0.1.2",
...@@ -33,13 +38,14 @@ ...@@ -33,13 +38,14 @@
"zone.js": "~0.8.26" "zone.js": "~0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.11.0", "@angular-devkit/build-angular": "^0.11.4",
"@angular/cli": "~7.1.2", "@angular/cli": "~7.1.2",
"@angular/compiler-cli": "~7.1.0", "@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0", "@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4", "@types/googlemaps": "^3.30.16",
"@types/jasmine": "~2.8.8", "@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "^8.9.5",
"codelyzer": "~4.5.0", "codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1", "jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~4.2.1",
......
<div class="main_wrapper">
<section class="module parallax parallax_title">
<div class="title_banner_overlay">
<div class="title_banner">
<div class="container">
</div>
</div>
</div>
</section>
<section class="dashboard_tabs">
<div class="container-fluid">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active profile" data-toggle="tab" href="#profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link vehicle" data-toggle="tab" href="#vehicle">My Vehicle</a>
</li>
<li class="nav-item">
<a class="nav-link estimate" data-toggle="tab" href="#estimate">Estimates</a>
</li>
<li class="nav-item">
<a class="nav-link appointment" data-toggle="tab" href="#appointment">Appointments</a>
</li>
<li class="nav-item">
<a class="nav-link time" data-toggle="tab" href="#service">
Service History
</a>
</li>
</ul>
</div>
</section>
<section class="dashboard_tab_content">
<div class="container-fluid">
<div class="tab-content">
<div class="tab-pane container active" id="profile">
<div class="row">
<div class="col-md-7">
<div class="row line_row">
<div class="col-md-12">
<h3>Personal Information</h3>
<hr>
</div>
</div>
<div class="row line_row">
<div class="col-md-12">
<p>Profile Picture</p>
<div class="profile_pic">
<div class="edit">
<input type="file">
</div>
</div>
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<p>First Name</p>
<input class="text_input" placeholder="" type="text">
</div>
<div class="col-md-6">
<p>Last Name</p>
<input class="text_input" placeholder="" type="text">
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<p>Email</p>
<input class="text_input" placeholder="" type="text">
</div>
<div class="col-md-6">
<p>Zip Code</p>
<input class="text_input" placeholder="" type="text">
</div>
</div>
<p>Contact Details</p>
<div class="row line_row">
<div class="col-md-6">
<input class="text_input" placeholder="House Name" type="text">
</div>
<div class="col-md-6">
<input class="text_input" placeholder="Street name" type="text">
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<input class="text_input" placeholder="State" type="text">
</div>
<div class="col-md-6">
<input class="text_input" placeholder="Region" type="text">
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<input class="text_input" placeholder="Country" type="text">
</div>
<div class="col-md-6">
<input class="text_input" placeholder="Phone Number" type="number">
</div>
</div>
<div class="row line_row">
<div class="col-md-12">
<h3>Login Information</h3>
<hr>
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<p>User Name</p>
<input class="text_input" placeholder="" type="text">
</div>
<div class="col-md-6">
<p>Email Address</p>
<input class="text_input" placeholder="" type="mail">
</div>
</div>
<div class="row line_row">
<div class="col-md-12">
<h3>Change Password</h3>
<hr>
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<p>Current Password</p>
<input class="text_input" placeholder="" type="password">
</div>
<div class="col-md-6">
<p>New Password</p>
<input class="text_input" placeholder="" type="password">
</div>
</div>
<div class="row line_row">
<div class="col-md-6">
<p>Confirm new Password</p>
<input class="text_input" placeholder="" type="password">
</div>
<div class="col-md-6">
</div>
</div>
<div class="row line_row">
<div class="col-md-12">
<button class="save_btn">Save</button>
</div>
</div>
</div>
<div class="col-md-5"></div>
</div>
</div>
<div class="tab-pane container fade" id="vehicle">
<div class="row">
<div class="col-md-12">
<div class="row line_row">
<div class="col-md-12">
<h3>Vechicles and Information</h3>
<hr>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane container fade" id="estimate">3</div>
<div class="tab-pane container fade" id="appointment">4</div>
<div class="tab-pane container fade" id="service">5</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
.parallax_title {
background: url("/assets/images/asset_landing_background.png");
}
.title_banner {
width: 100%;
background: rgba(0, 0, 0, 0.5);
height: 300px;
}
.dashboard_tabs {
background: rgba(0, 0, 0, 0.9);
.container-fluid {
width: calc(100% - 15%);
ul {
margin: 0px;
padding: 0px;
border: none;
li {
list-style: none;
display: inline-block;
width: 20%;
color: #fff;
background: transparent;
cursor: pointer;
a.active {
background-color: rgba(273, 273, 273, 0.2) !important;
}
a.profile {
background-image: url("/assets/images/asset_dashboard.png");
}
a.vehicle {
background-image: url("/assets/images/asset_car.png");
}
a.estimate {
background-image: url("/assets/images/asset_doc.png");
}
a.appointment {
background-image: url("/assets/images/asset_calender.png");
}
a.time {
background-image: url("/assets/images/asset_time.png");
}
a {
color: #fff;
padding: 20px;
font-size: 18px;
font-weight: 500;
cursor: pointer;
border: 1px solid transparent;
border-radius: 0px;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
-ms-border-radius: 0px;
-o-border-radius: 0px;
background: transparent;
background-size: 30px;
background-repeat: no-repeat;
background-position: 20px;
padding-left: 65px;
&:focus {
background-color: rgba(273, 273, 273, 0.2);
}
&:hover {
background-color: rgba(273, 273, 273, 0.2);
}
}
}
}
}
}
.dashboard_tab_content {
padding-bottom: 80px;
.container-fluid {
width: calc(100% - 15%);
.tab-content {
.container {
max-width: 100%;
.line_row {
margin-bottom: 20px;
}
h3 {
font-weight: 400;
padding-top: 60px;
}
hr {}
.save_btn {
height: 45px;
border-radius: 0px;
padding-left: 10%;
padding-right: 10%;
color: #fff;
background: #2655bf;
border: none;
font-size: 20px;
font-weight: 300;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
-ms-border-radius: 0px;
-o-border-radius: 0px;
}
.profile_pic {
width: 120px;
height: 120px;
background: #a8a8a8;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
object-fit: cover;
object-position: center;
margin-top: 20px;
position: relative;
.edit {
width: 35px;
height: 35px;
cursor: pointer;
background-color: #1e1e1e;
background-image: url("/assets/images/asset_edit.png");
background-position: center;
background-repeat: no-repeat;
background-size: 20px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
position: absolute;
top: 0px;
right: 0px;
input {
position: absolute;
top: 0px;
width: 35px;
cursor: pointer;
height: 35px;
left: 0px;
right: 0px;
bottom: 0px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
opacity: 0;
}
}
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
}
}
p {
margin: 0px;
padding-bottom: 10px;
color: #1e1e1e;
font-weight: 600;
font-size: 16px;
}
.text_input {
width: 100%;
border: 1px solid #1e1e1e;
height: 40px;
padding-left: 15px;
border-radius: 0px;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
-ms-border-radius: 0px;
-o-border-radius: 0px;
}
}
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DashboardComponent } from './dashboard.component';
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DashboardComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -3,13 +3,31 @@ import { CommonModule } from '@angular/common'; ...@@ -3,13 +3,31 @@ import { CommonModule } from '@angular/common';
import { IndexComponent } from './index/index.component'; import { IndexComponent } from './index/index.component';
import { moduleRouting } from './home.routing'; import { moduleRouting } from './home.routing';
import { ArchwizardModule } from 'ng2-archwizard'; import { ArchwizardModule } from 'ng2-archwizard';
import { NgxCarouselModule } from 'ngx-carousel';
import { AgmCoreModule } from '@agm/core';
import { StarRatingModule } from 'angular-star-rating';
import 'hammerjs';
import { DashboardComponent } from './dashboard/dashboard.component';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
@NgModule({ @NgModule({
declarations: [IndexComponent], declarations: [
IndexComponent,
DashboardComponent
],
imports: [ imports: [
FormsModule,
CommonModule, CommonModule,
moduleRouting, moduleRouting,
ArchwizardModule StarRatingModule,
ArchwizardModule,
NgxCarouselModule,
ReactiveFormsModule,
AgmCoreModule.forRoot({
apiKey: 'AIzaSyCcc-YDSJyDpehNE6qfntfWpEQ4uS4aq6A',
libraries: ["places"]
})
] ]
}) })
export class HomeModule { } export class HomeModule { }
import { ModuleWithProviders } from '@angular/core'; import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { IndexComponent } from './index/index.component'; import { IndexComponent } from './index/index.component';
import { DashboardComponent } from './dashboard/dashboard.component';
const ModuleRoutes: Routes = [ const ModuleRoutes: Routes = [
{ path: 'index', component: IndexComponent} { path: 'index', component: IndexComponent},
{path: 'dashboard', component: DashboardComponent}
]; ];
export const moduleRouting: ModuleWithProviders = RouterModule.forChild(ModuleRoutes) export const moduleRouting: ModuleWithProviders = RouterModule.forChild(ModuleRoutes)
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, NgZone, ViewChild, ElementRef } from '@angular/core';
import { WebService } from '../../provider/web.service';
import { NgxCarousel } from 'ngx-carousel';
import { MapsAPILoader } from '@agm/core';
import { SubjectService } from '../../provider/subject.service';
declare const google: any;
@Component({ @Component({
selector: 'app-index', selector: 'app-index',
templateUrl: './index.component.html', templateUrl: './index.component.html',
styleUrls: ['./index.component.scss'] styleUrls: ['./index.component.scss']
}) })
export class IndexComponent implements OnInit { 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;
searchLocError: boolean;
@ViewChild("googleLocSearch") public searchElementRef: ElementRef;
constructor() { } //Vehicle Details: TAB 2
@ViewChild("trim") public trim: ElementRef;
@ViewChild("maker") public maker: ElementRef;
@ViewChild("emgine") public emgine: ElementRef;
@ViewChild("milage") public milage: ElementRef;
@ViewChild("modelName") public modelName: ElementRef;
@ViewChild("modelYear") public modelYear: ElementRef;
carModel: any;
carSearchJsonData: any;
modelDates: number[] = new Array();
constructor(
public ngZone : NgZone,
public webService : WebService,
public mapsAPILoader : MapsAPILoader,
public subjectService : SubjectService,) {
this.loginDetails = false;
this.searchLocError = false;
}
ngOnInit() { ngOnInit() {
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 = startingYear ; date <= currentYear ; date ++) {
this.modelDates.push(date);
}
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
this.mapsAPILoader.load().then(() => {
this.autocomplete = new google.maps.places.Autocomplete(this.searchElementRef.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'}
}
get_model(event) {
this.carModel = this.carSearchJsonData[event].models;
}
getVehicleLoc(lastLoc){
if(lastLoc == ''){
this.searchLocError = true;
return;
}
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':
{'pickup_loc':place.formatted_address,
'pickup_lat':place.geometry.location.lat(),
'pickup_lng':place.geometry.location.lng()
}
};
this.searchLocError = false;
this.wizardModalTrrigerInput.nativeElement.click();
});
}
nextStep2(){
console.log(this.trim.nativeElement.value+' '+this.maker+' '+this.emgine+' '+this.milage+' '+this.modelName+' '+this.modelYear);
} }
featuredOnLoad() {return ''; }
carouselTileLoad(){ return ''; }
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
width: 100%; width: 100%;
padding-top: 15px; padding-top: 15px;
padding-bottom: 15px; padding-bottom: 15px;
z-index: 999;
.container-fluid { .container-fluid {
max-width: calc(100% - 15%); max-width: calc(100% - 15%);
.navbar-brand { .navbar-brand {
...@@ -20,6 +21,15 @@ ...@@ -20,6 +21,15 @@
margin-right: 30px; margin-right: 30px;
a { a {
color: #fff; color: #fff;
position: relative;
top: 5px;
.dropdown-menu {
a {
top: 0px;
padding-top: 5px;
padding-bottom: 5px;
}
}
} }
.sign_btn { .sign_btn {
background: transparent; background: transparent;
...@@ -46,21 +56,65 @@ ...@@ -46,21 +56,65 @@
outline: none; outline: none;
} }
} }
.account_div.dropdown-toggle::after {
display: none;
}
.dropdown-menu {
border: none;
margin: 0px;
padding: 0px;
border-radius: 0px;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
-ms-border-radius: 0px;
-o-border-radius: 0px;
background: #2655bf;
cursor: pointer;
a {
&:hover {
color: #2655bf;
}
}
}
.account_div {
cursor: pointer;
.account_name {
float: left;
font-weight: 400;
margin-right: 10px;
}
.account_pic {
float: left;
width: 40px;
height: 40px;
background: #fff;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
position: relative;
bottom: 10px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
}
}
}
} }
} }
} }
} }
.input_error {
border: 1px solid red !important;
}
.input_success {
border: 1px solid rgb(51, 211, 118) !important;
}
.scrolled_navbar { .scrolled_navbar {
background: rgba(44, 71, 196, 1) !important; background: #2655bf;
transition-duration: 1s; transition-duration: 1s;
transition-timing-function: ease; transition-timing-function: ease;
.navbar-brand { .navbar-brand {
...@@ -82,7 +136,7 @@ ...@@ -82,7 +136,7 @@
width: 50px; width: 50px;
height: 50px; height: 50px;
border: 1px solid #fff; border: 1px solid #fff;
position: absolute; position: fixed;
top: 10px; top: 10px;
right: 10px; right: 10px;
border-radius: 50%; border-radius: 50%;
...@@ -113,7 +167,7 @@ ...@@ -113,7 +167,7 @@
position: relative; position: relative;
top: 85px; top: 85px;
.login_modal_inner { .login_modal_inner {
width: 75%; width: 85%;
margin: 0 auto; margin: 0 auto;
h3 { h3 {
text-align: center; text-align: center;
...@@ -127,7 +181,7 @@ ...@@ -127,7 +181,7 @@
color: #fff; color: #fff;
text-align: center; text-align: center;
width: 100%; width: 100%;
height: 45px; height: 40px;
border-radius: 20px; border-radius: 20px;
-webkit-border-radius: 20px; -webkit-border-radius: 20px;
-moz-border-radius: 20px; -moz-border-radius: 20px;
...@@ -151,10 +205,10 @@ ...@@ -151,10 +205,10 @@
} }
input { input {
border: 1px solid #1e1e1e; border: 1px solid #1e1e1e;
height: 45px; height: 40px;
width: 100%; width: 100%;
border-radius: 25px; border-radius: 25px;
font-size: 20px; font-size: 16px;
-webkit-border-radius: 25px; -webkit-border-radius: 25px;
-moz-border-radius: 25px; -moz-border-radius: 25px;
-ms-border-radius: 25px; -ms-border-radius: 25px;
...@@ -211,4 +265,3 @@ ...@@ -211,4 +265,3 @@
} }
} }
} }
import { Component, OnInit, HostListener } from '@angular/core'; import { Component, OnInit, HostListener, ElementRef, ViewChild } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router'; import { Router,ActivatedRoute } from '@angular/router';
import { FormGroup, FormControl, Validators, ValidationErrors } from '@angular/forms'; import { FormGroup, FormControl, Validators, ValidationErrors } from '@angular/forms';
import { ValidationService } from './../provider/validation.service'; 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';
declare var $; declare var $;
declare const window: any; declare const window: any;
...@@ -15,11 +16,16 @@ declare const window: any; ...@@ -15,11 +16,16 @@ declare const window: any;
}) })
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
data: any; data : any;
loader : boolean; loader : boolean;
loginResponse: any; imageServer : any;
loginDetails : any;
loginSubmitClick : boolean; loginResponse : any;
forgotResponse : any;
signupResponse : any;
loginSubmitClick : boolean;
forgotSubmitClick : boolean;
signupSubmitClick : boolean;
constructor ( constructor (
private router : Router, private router : Router,
...@@ -27,45 +33,140 @@ export class NavbarComponent implements OnInit { ...@@ -27,45 +33,140 @@ export class NavbarComponent implements OnInit {
public errorMsg : ValidationService, public errorMsg : ValidationService,
public webService : WebService, public webService : WebService,
public subjectService : SubjectService) { public subjectService : SubjectService) {
this.loginSubmitClick = false; this.imageServer = ImageStorage;
this.loginDetails = false;
this.loginSubmitClick = false;
this.forgotSubmitClick = false;
this.signupSubmitClick = false;
} }
email;
password;
loginForm; loginForm;
emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'; forgotForm;
signupForm;
@ViewChild('loginModal') loginModal: ElementRef;
@ViewChild('signupModal') signupModal: ElementRef;
ngOnInit() { ngOnInit() {
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
});
this.loginForm = new FormGroup({ this.loginForm = new FormGroup({
email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)]), 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)])
}) });
this.forgotForm = new FormGroup({
email: new FormControl('', [Validators.required, Validators.maxLength(50), Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')])
});
this.signupForm = 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)]),
phone: new FormControl('', [Validators.pattern("^[0-9\ ( ) + , - ]+$")]),
promocode: new FormControl('', [Validators.pattern("^[a-zA-Z0-9\ _ - ]+$")]),
last_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")]),
first_name: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-Z\ _ - ' \/]+$")])
});
} }
loginSubmit(data) { loginSubmit(data) {
const This = this; if(this.loginForm.invalid){
this.loginSubmitClick = true;
if(!this.loginForm.valid){
return false; return false;
} }
const This = this;
this.loader = true; this.loader = true;
let funcName = 'customer_login'; let funcName = 'customer_login';
const userObj = this.loginForm.value; this.webService.post_data(funcName, data).subscribe(response => {
this.webService.post_data(funcName, userObj).subscribe(response => {
this.loader = false; this.loader = false;
if ( response.status == '1') { if ( response.status == '1') {
this.webService.setLocalStorageItem('userData', JSON.stringify(response.data)); this.webService.setLocalStorageItem('userData', JSON.stringify(response.data));
this.subjectService.sendLoginData('logged_in'); this.subjectService.sendLoginData('logged_in');
this.loginModal.nativeElement.click();
} else {
response.status = 'error';
response.message = (response.message == '')?this.errorMsg.errorList.req_failure:response.message;
this.loginResponse = response;
} }
this.loginResponse = response; },error => {
this.loginResponse = {'status':'error','message':this.errorMsg.errorList.req_failure};
},() => {
setTimeout( function() { setTimeout( function() {
This.loginResponse = false; This.loginResponse = false;
}, 2000) }, 2000)
}); });
} }
forgotSubmit(data){
if(this.forgotForm.invalid){
return false;
}
const This = this;
this.loader = true;
let funcName = 'customer_forgot_password';
this.webService.post_data(funcName, data).subscribe(response => {
this.loader = false;
response.status = (response.status == '1')?'success':'error';
response.message = (response.message == '')?this.errorMsg.errorList.req_failure:response.message;
this.forgotResponse = response;
},error => {
this.forgotResponse = {'status':'error','message':this.errorMsg.errorList.req_failure};
},() => {
setTimeout( function() {
This.forgotResponse = false;
}, 2000)
});
}
signupSubmit(data){
if(this.signupForm.invalid){
return false;
}
const This = this;
this.loader = true;
let funcName = 'customer_registration';
this.webService.post_data(funcName, data).subscribe(response => {
this.loader = false;
if ( response.status == '1') {
this.webService.setLocalStorageItem('userData', JSON.stringify(response.data));
this.subjectService.sendLoginData('logged_in');
this.signupModal.nativeElement.click();
} else {
response.status = 'error';
response.message = (response.message == '')?this.errorMsg.errorList.req_failure:response.message;
this.signupResponse = response;
}
},error => {
this.signupResponse = {'status':'error','message':this.errorMsg.errorList.req_failure};
},() => {
setTimeout( function() {
This.signupResponse = false;
}, 2000)
});
}
resetForm(){ resetForm(){
//Login Form
this.loginForm.reset(); this.loginForm.reset();
this.loginResponse = false;
this.loginSubmitClick = false;
//Forgot Form
this.forgotForm.reset();
this.forgotResponse = false;
this.forgotSubmitClick = false;
//SignUP Form
this.signupForm.reset();
this.signupResponse = false;
this.signupSubmitClick = false;
} }
//Design //Design
...@@ -75,14 +176,21 @@ export class NavbarComponent implements OnInit { ...@@ -75,14 +176,21 @@ export class NavbarComponent implements OnInit {
const number = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; const number = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
$(window).scroll(function() { $(window).scroll(function() {
var sticky = $('.navbar'), var sticky = $('.navbar'),
scroll = $(window).scrollTop(); scroll = $(window).scrollTop();
if (scroll > 100) sticky.addClass('scrolled_navbar'); if (scroll > 100) sticky.addClass('scrolled_navbar');
else sticky.removeClass('scrolled_navbar'); else sticky.removeClass('scrolled_navbar');
}); });
} }
goToPage(path,data=null){ goToPage(path,data=null){
this.router.navigateByUrl(path,{queryParams:data}); this.router.navigateByUrl(path,{queryParams:data});
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
logout() {
const userData = this.webService.getLocalStorageItem('userData');
this.webService.removeLocalStorageItem(userData);
this.subjectService.sendLoginData(false);
this.router.navigate(['../index']);
}
} }
...@@ -6,11 +6,10 @@ import { Injectable } from '@angular/core'; ...@@ -6,11 +6,10 @@ import { Injectable } from '@angular/core';
export class ValidationService { export class ValidationService {
constructor() { } constructor() { }
errorList = { errorList = {
'valid': 'Please enter a valid',
'required': 'This field is required', 'required': 'This field is required',
'email': 'Please enter a valid email',
'phone': 'Please enter a valid phone number',
'password': 'Please enter a valid password',
'minLength': 'Minimum characters length is', 'minLength': 'Minimum characters length is',
'maxLength': 'Maximum characters length is' 'maxLength': 'Maximum characters length is',
'req_failure': 'Something went wrong..!'
}; };
} }
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, catchError } from 'rxjs/operators'; import { map, catchError } from 'rxjs/operators';
import { apiConfig, serverApiDev } from '../../environments/server.config'; import { apiConfig, serverApiDev } from '../../environments/server.config';
...@@ -42,4 +43,7 @@ export class WebService { ...@@ -42,4 +43,7 @@ export class WebService {
online_service(url: string ) { online_service(url: string ) {
return this.http.post(`${serverApiDev + url}`, null).pipe(map((response: any) => response)); return this.http.post(`${serverApiDev + url}`, null).pipe(map((response: any) => response));
} }
} get_stored_json(json_file: string) {
return this.http.get("assets/json_data/" + json_file);
}
}
\ No newline at end of file
...@@ -72,7 +72,23 @@ ...@@ -72,7 +72,23 @@
/* 07.0 Desktops and laptops ----------- */ /* 07.0 Desktops and laptops ----------- */
@media only screen and (min-width: 1224px) {} @media only screen and (min-width: 1000px) and (max-device-width: 1280px) {
.login_modal_content {
top: 0px !important;
}
.how_it_works h4 {
height: 70px;
}
.how_it_works p {
height: 100px;
}
.service_check h4 {
height: 70px;
}
.service_check p {
height: 100px;
}
}
/* 08.0 Large screens ----------- */ /* 08.0 Large screens ----------- */
......
<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="star-empty" viewBox="0 0 34 32">
<title>star-empty</title>
<path class="path-star-empty"
d="M33.412 12.395l-11.842-1.021-4.628-10.904-4.628 10.92-11.842 1.005 8.993 7.791-2.701 11.579 10.179-6.144 10.179 6.144-2.685-11.579 8.976-7.791zM16.941 22.541l-6.193 3.739 1.647-7.049-5.468-4.744 7.214-0.626 2.8-6.638 2.816 6.654 7.214 0.626-5.468 4.744 1.647 7.049-6.209-3.755z"/>
</symbol>
<symbol id="star-half" viewBox="0 0 34 32">
<title>star-half</title>
<path class="path-star-half"
d="M 33.412,12.395 21.57,11.374 16.942,0.47 12.314,11.39 0.472,12.395 9.465,20.186 6.764,31.765 16.943,25.621 27.122,31.765 24.437,20.186 33.413,12.395 Z M 16.941,22.541 c 0,0 -0.297971,-14.6455833 0,-15.318 l 2.816,6.654 7.214,0.626 -5.468,4.744 1.647,7.049 z"/>
</symbol>
<symbol id="star-filled" viewBox="0 0 34 32">
<title>star-filled</title>
<path class="path-star-filled"
d="M16.941 25.621l10.179 6.144-2.701-11.579 8.993-7.791-11.842-1.005-4.628-10.92-4.628 10.92-11.842 1.005 8.993 7.791-2.701 11.579z"/>
</symbol>
</defs>
</svg>
\ No newline at end of file
export const apiConfig = 'http://localhost/dcarfixers/Webservices/'; export const apiConfig = 'http://localhost/dcarfixers/Webservices/';
export const ImageStorage = 'http://techlabz.in/client/truebus-andrew/'; export const ImageStorage = 'http://localhost/dcarfixers/';
export const serverApiDev = 'http://devapp.ticketgoose.com/bookbustickets/rest/json/2.0/'; export const serverApiDev = 'http://devapp.ticketgoose.com/bookbustickets/rest/json/2.0/';
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>CarFixers</title> <title>CarFixers</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
...@@ -10,5 +11,6 @@ ...@@ -10,5 +11,6 @@
</head> </head>
<body> <body>
<app-root></app-root> <app-root></app-root>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCcc-YDSJyDpehNE6qfntfWpEQ4uS4aq6A&libraries=places"></script>
</body> </body>
</html> </html>
...@@ -183,6 +183,14 @@ body { ...@@ -183,6 +183,14 @@ body {
background: #D94350; background: #D94350;
} }
.tile {
box-shadow: none !important;
}
.horizontal .steps-indicator {
display: none !important;
}
/*------------------------------- /*-------------------------------
...@@ -435,3 +443,15 @@ section.module.parallax { ...@@ -435,3 +443,15 @@ section.module.parallax {
background-attachment: fixed !important; background-attachment: fixed !important;
background-size: cover !important; background-size: cover !important;
} }
.input_error {
border: 1px solid red !important;
}
.input_success {
border: 1px solid rgb(51, 211, 118) !important;
}
.error{
border:2px solid red !important;
}
\ No newline at end of file
{
"globalDependencies": {
"google.maps": "registry:dt/google.maps#3.25.0+20161208205818"
}
}
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