Commit 6cbd7354 by Tobin

Merge branch 'jensa' into 'master'

Jensa See merge request !46
parents 1576e39f 98b712b8
......@@ -26,6 +26,7 @@
"@google/maps": "^0.5.5",
"angular-star-rating": "^4.0.0-beta.3",
"angular-wizard-form": "^0.4.1",
"angularx-social-login": "^1.2.7",
"bootstrap": "^4.3.1",
"core-js": "^2.5.4",
"font-awesome": "^4.7.0",
......
......@@ -8,9 +8,21 @@ import { PurchaseModule } from './purchase/purchase.module';
import { NavbarComponent } from './navbar/navbar.component';
import { FooterComponent } from './footer/footer.component';
import { ReactiveFormsModule } from '@angular/forms';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { MalihuScrollbarModule } from 'ngx-malihu-scrollbar';
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({
declarations: [
......@@ -26,9 +38,16 @@ import { ForgotComponent } from './forgot/forgot.component';
PurchaseModule,
ReactiveFormsModule,
HttpClientModule,
MalihuScrollbarModule.forRoot()
MalihuScrollbarModule.forRoot(),
SocialLoginModule
],
providers: [
{
provide: AuthServiceConfig,
useFactory: provideConfig
}
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
......@@ -269,7 +269,7 @@
<td>
<div class="floatLeft">
<div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button>
<button class="{{bookData.status === '1' ? 'btn btn-success btn-sm' : 'btn btn-primary btn-sm'}}btn btn-primary btn-sm">{{bookData.status === '1' ? 'Accepted' : 'Pending'}}</button>
<button (click)="cnfCancelBook(bookData.booking_id)" class="btn btn-danger btn-sm">Cancel</button>
</div>
</div>
......@@ -298,8 +298,8 @@
<td>{{mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount}}</td>
<td>
<div class="btn-group btn-group-justified">
<button class="btn btn-default btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-default btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button>
<button class="btn btn-success btn-sm" *ngIf="bookData.status == '1' && !mechdata.custom_service_quote">Accepted</button>
<button class="btn btn-info btn-sm" *ngIf="mechdata.status == '0'">Waiting for Approval</button>
<button class="btn btn-success btn-sm" [attr.bookAmount]="mechdata.custom_amount > 0 ?mechdata.custom_amount:mechdata.mechanic_amount" *ngIf="mechdata.status == '1' && bookData.status != '1'" (click)="mechanicQuoteAccept($event,bookData.booking_id,mechdata.mechanic_id)">Accept</button>
<button class="btn btn-info btn-sm" (click)="showCustQuote(bookData.booking_id,mechdata.mechanic_id,1)" data-toggle="modal" data-target="#quote" *ngIf="mechdata.status =='1' && mechdata.custom_service_quote">View Quote</button>
</div>
......@@ -523,7 +523,7 @@
<select (change)="get_model($event.target.value)" class="vehicle_input_select" placeholder="Choose Make"
formControlName="maker" [ngClass]="{'input_error': !vehicleDetailsAddForm.controls['maker'].valid && vehicleDetailsFormSubmitClick}">
<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 carBrands; let key = index" value="{{car_date.veh_brand_id}}">{{car_date.maker}}</option>
</select>
</div>
</div>
......@@ -532,7 +532,7 @@
<select class="vehicle_input_select" placeholder="Choose Model" formControlName="modelName"
[ngClass]="{'input_error': !vehicleDetailsAddForm.controls['modelName'].valid && vehicleDetailsFormSubmitClick}">
<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">
......@@ -926,20 +926,29 @@
<div class="col-md-6">
<div class="scheduletiming_listing">
<ul id="scroll_0_{{i}}">
<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>{{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>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</span>
</ul>
<ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</ul>
......
......@@ -725,7 +725,7 @@
padding: 30px;
padding-top: 50px;
position: relative;
top: 85px;
top: 15px;
.login_modal_inner {
width: 90%;
margin: 0 auto;
......@@ -827,7 +827,7 @@
}
}
.active{
background-color: #f2f2f2;
background-color: #b9b9b9;
padding:8px;
padding-left: 15px;
border-radius: 8px;
......
......@@ -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 carBrands; 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">
......@@ -591,20 +591,36 @@
<div class="scheduletiming_listing">
<!-- <ul id="scroll_0_{{mechanic.mechanic_id}}" malihu-scrollbar [scrollbarOptions]="scrollbarOptions"> -->
<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>{{time}}</p>
<p *ngIf="time > currentDate">{{time}}</p>
</label>
</li>
</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>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'0');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</span>
</ul>
<ul id="scroll_1_{{i}}">
<li *ngFor="let time of mechanic.scheduleTiming" id="custom_check_button">
<label>
<input type="radio" name="scheduleTime" (click)="getSchedule(time,'1');
scheduleDateInit = true; scheduleMechanic = mechanic.mechanic_id">
<p>{{time}}</p>
<p>{{time | date:'hh:mm a'}}</p>
</label>
</li>
</ul>
......
......@@ -395,7 +395,7 @@
padding: 30px;
padding-top: 50px;
position: relative;
top: 85px;
top:15px;
.login_modal_inner {
width: 90%;
margin: 0 auto;
......@@ -498,7 +498,7 @@
}
}
.active{
background-color: #f2f2f2;
background-color: #b9b9b9;
padding:8px;
padding-left: 15px;
border-radius: 8px;
......
......@@ -24,19 +24,24 @@
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">
<a class="dropdown-item">My Dashboard</a>
<a class="dropdown-item">Find parts and accessories</a>
<a class="dropdown-item" *ngIf="loginDetails" (click)="goToPage('dashboard')">My Dashboard</a>
<a class="dropdown-item" (click)="goToPage('purchaseHome')">Find parts and accessories</a>
<a class="dropdown-item">Rewards</a>
<a class="dropdown-item">Messages</a>
<a class="dropdown-item">Request a Service </a>
......@@ -78,8 +83,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>
......@@ -110,7 +113,7 @@
</div>
<div class="row">
<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">
</button>
</div>
......@@ -203,7 +206,7 @@
<div class="row">
<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>
......@@ -232,7 +235,7 @@
<h3>SIGN IN</h3>
<div class="row">
<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">
</button>
</div>
......@@ -287,7 +290,7 @@
</div>
<div class="row">
<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>
......@@ -389,9 +392,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"
......@@ -415,6 +419,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 Mechanic Shop</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;
......
......@@ -5,6 +5,9 @@ import { ValidationService } from './../provider/validation.service';
import { WebService } from './../provider/web.service';
import { SubjectService } from './../provider/subject.service';
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 const window: any;
......@@ -14,27 +17,32 @@ declare const window: any;
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss']
})
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;
spSignupSubmitClick : boolean;
private user: SocialUser;
private loggedIn: boolean;
constructor (
private router : Router,
private route : ActivatedRoute,
public errorMsg : ValidationService,
public webService : WebService,
public subjectService : SubjectService) {
public subjectService : SubjectService,
private authService : AuthService) {
this.imageServer = ImageStorage;
this.loginDetails = false;
this.loginSubmitClick = false;
......@@ -56,8 +64,12 @@ export class NavbarComponent implements OnInit {
ngOnInit() {
this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.webService.getLocalStorageItem('userData'));
if(!this.loginDetails){
this.facebookSignUp();
}
});
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 +95,66 @@ 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('')
});
}
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(){
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;
......@@ -241,10 +309,12 @@ export class NavbarComponent implements OnInit {
}
logout() {
this.signOut();
const userData = this.webService.getLocalStorageItem('userData');
this.webService.removeLocalStorageItem(userData);
this.subjectService.sendLoginData(false);
this.router.navigate(['../index']);
}
}
......@@ -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'));
......
......@@ -21,7 +21,10 @@
</div>
</ul>
<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>
<div class="row">
<div class="col-md-6">
......
......@@ -42,7 +42,6 @@ export class AddressComponent implements OnInit {
checkProductId(){
this.prdtData = JSON.parse(this.webService.getLocalStorageItem('productDetails'));
console.log(this.prdtData)
if(this.prdtData && this.prdtData['product_id'] > 0){
this.product_id = this.prdtData['product_id'];
}else{
......
......@@ -43,7 +43,11 @@
</li>
</ul>
<ng-template #noCart>
No Data Found
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template>
</div>
</div>
......@@ -57,7 +61,7 @@
<div class="product_wrapper">
<img src="{{imageServer + prdt.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting prevent-click">
<fieldset class="rating">
......
......@@ -236,7 +236,7 @@
padding: 10px;
img{
height: 180px;
width: auto;
max-width: 100%;
}
}
h5{
......
......@@ -4,7 +4,7 @@
</app-searchbar>
<div class="loader_overlay" *ngIf="loader"></div>
<div class="myorder_wrapper">
<ul *ngIf="bookedData" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<ul *ngIf="bookedData;else noOrders" infiniteScroll [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false" style="max-height: 700px; overflow: scroll">
<li *ngFor="let book of bookedData">
<div class="row">
<div class="col-md-6">
......@@ -12,7 +12,7 @@
<img src="{{imageServer + book.product_image}}" onerror="this.src='assets/images/user_avatar.jpg'">
</div>
<div class="auto_part_detail">
<h2>{{book.product_name}}</h2>
<h2 class="text_truncate" data-toggle="pill" tooltip="{{book.product_name}}" placement="top" show-delay="500" z-index="99999">{{book.product_name}}</h2>
<h3>{{book.short_description}}</h3>
<div class="others">
<!-- <h4><div>Color</div><span>Black</span></h4> -->
......@@ -45,6 +45,13 @@
</div>
</li>
</ul>
<ng-template #noOrders>
<div class="cmn_nodata">
<img src="../../../assets/images/no_result.png">
<p>No Data Found</p>
</div>
</ng-template>
</div>
</div>
<div class="bottom_product_list">
......@@ -53,11 +60,11 @@
<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>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating prevent-click">
......
......@@ -191,7 +191,7 @@
padding: 10px;
img{
height: 180px;
width: auto;
max-width: 100%;
}
}
h5{
......
......@@ -18,10 +18,11 @@
</div>
<div class="col-md-8" *ngIf="productDetails">
<div class="product_details">
<h1>{{productDetails.product_name}}</h1>
<h1 class="text_truncate" data-toggle="pill" tooltip="{{productDetails.product_name}}" placement="top" show-delay="500" z-index="99999">{{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><strong>Brand : </strong>{{productDetails.brand_name}}</h2>
<div *ngIf="productDetails.part_id">
<h2><strong>Part ID : </strong>{{productDetails.part_id}}</h2></div>
<h3>$ {{productDetails.amount}}</h3>
<div class="rating_div" *ngIf="productDetails.rating">
<fieldset class="rating prevent-click">
......@@ -113,7 +114,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();
......
......@@ -28,23 +28,24 @@
<h6 href="#ac3" data-toggle="collapse">Vehicle Information</h6>
<ul id="ac3" class="collapse in show">
<h6 class="backgroundNone borderNone">
<select>
<option>
Year
</option>
<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>
</select>
</h6>
<h6 class="backgroundNone borderNone">
<select>
<option>
Model
<select (change)="get_model($event.target.value)">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Maker</option>
<option *ngFor="let brands of carBrands" value="{{brands.veh_brand_id}}">
{{brands.maker}}
</option>
</select>
</h6>
<h6 class="backgroundNone borderNone">
<select>
<option>
Make
<select (change)="getModelResult($event.target.value)" *ngIf="modelShow">
<option [attr.value]="0" [attr.selected]=true [attr.disabled]="true">Select Model</option>
<option *ngFor="let models of carModel" value="{{models.veh_modal_id}}">
{{models.model}}
</option>
</select>
</h6>
......@@ -66,7 +67,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 +77,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>
......@@ -100,17 +101,6 @@
No Data Found
</ng-template>
<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 class="clear"></div>
</div>
......
......@@ -282,6 +282,7 @@
.rating {
border: none;
float: left;
position: relative;
}
.rating > input { display: none; }
......
......@@ -22,6 +22,10 @@ export class ProductlistComponent implements OnInit {
page: number = 1;
total_page: number = 1;
filterParam: any = new Array();
modelDates: number[] = new Array();
carBrands:any;
carModel:any;
modelShow :boolean;
constructor(
private router : Router,
......@@ -29,6 +33,7 @@ export class ProductlistComponent implements OnInit {
public webService : WebService
){
this.loader = true;
this.modelShow = false;
this.productArray = [];
this.filterParam = {"key":'',"brand_id":Array(),"minPrice":'',"maxPrice":'','page':1};
this.imageServer = ImageStorage;
......@@ -50,6 +55,48 @@ export class ProductlistComponent implements OnInit {
ngOnInit() {
this.getBrand();
this.getYear();
this.getVehBrand();
}
getYear(){
let currentYear = Number((new Date()).getFullYear());
let startingYear = currentYear - 110;
for (let date = currentYear ; date >= startingYear ; date --) {
this.modelDates.push(date);
}
}
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){
......@@ -124,4 +171,11 @@ export class ProductlistComponent implements OnInit {
this.filterParam.maxPrice = top;
this.getProductDetails(this.filterParam);
}
get_year(year){
this.page = 1;
this.filterParam.page = this.page;
this.filterParam.year = year;
this.getProductDetails(this.filterParam);
}
}
......@@ -11,12 +11,12 @@
<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>
<h5>{{prdt.product_name}}</h5>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{prdt.product_name}}</h5>
<p>{{prdt.short_description}}</p>
<div class="star_ratting">
<fieldset class="rating prevent-click">
......@@ -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>
<h5 class="text_truncate" data-toggle="pill" tooltip="{{prdt.product_name}}" placement="top" show-delay="500" z-index="99999">{{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){
......@@ -38,7 +51,6 @@ export class SearchbarComponent implements OnInit {
}
this.webService.post_data('productSearch',{"key":product}).subscribe(response => {
if(response.status == 'success'){
console.log(response.data)
this.productArray = response.data;
} else {
this.productArray = false;
......
src/assets/images/asset_login_bg.png

508 KB | W: | H:

src/assets/images/asset_login_bg.png

60.8 KB | W: | H:

src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
src/assets/images/asset_login_bg.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/images/order_banner.png

139 KB | W: | H:

src/assets/images/order_banner.png

25.1 KB | W: | H:

src/assets/images/order_banner.png
src/assets/images/order_banner.png
src/assets/images/order_banner.png
src/assets/images/order_banner.png
  • 2-up
  • Swipe
  • Onion skin
let apiConfigUrl,imageStorageUrl;
// // Localhost
// apiConfigUrl = 'http://localhost/dcarfixers/Webservices/';
// imageStorageUrl = 'http://localhost/dcarfixers/';
// Localhost
apiConfigUrl = 'http://localhost/dcarfixers/Webservices/';
imageStorageUrl = 'http://localhost/dcarfixers/';
// // Techlabz
apiConfigUrl = 'https://techlabz.in/dcarfixers/Webservices/';
imageStorageUrl = 'https://techlabz.in/dcarfixers/';
// apiConfigUrl = 'https://techlabz.in/dcarfixers/Webservices/';
// imageStorageUrl = 'https://techlabz.in/dcarfixers/';
// carfixxers.com
// // carfixxers.com
// apiConfigUrl = 'https://carfixxers.com/admin/Webservices/';
// imageStorageUrl = 'https://carfixxers.com/admin/';
......
......@@ -852,3 +852,19 @@ bs-datepicker-container{
padding-bottom: 50px;
}
.cmn_nodata{
text-align: center;
padding-top:10%;
padding-bottom: 10%;
img{
width: 200px;
margin-bottom:50px;
}
p{
text-align: center;
color: #a8a8a8;
font-size: 24px;
font-weight: 300;
}
}
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