Commit 321ee0b9 by kevin

Initial commit

parent b31f8dff
No preview for this file type
1. Remove password in update_profile
2. NEW API for change password (Function No.44)
1. Remove password in update_profile.
2. NEW API for change password (Function No.44).
3.add_newadress is not properly adding address.Remove District from add_newadress . add phonecode in that API. if add_newadress done sucessfully , then please return the id of the saved address.
4.get_deliveryadress is not working.
5.Product Details are missing in prodcut detail API.
......@@ -7,4 +7,4 @@
7.Add user_country in get_userProfile.
8.Remove field user_password in update_profile API.
9.road_assistanceDetail not working. Please mention if any change in the api name.
10.get_mostpurchased Image Missing
\ No newline at end of file
10.get_mostpurchased Image Missing.
\ No newline at end of file
export interface Reviews {
id: any;
rate: any;
caption: any;
description: any;
}
import { SyncAsync } from '@angular/compiler/src/util';
export interface User {
user_name: any;
......
......@@ -14,7 +14,7 @@ import { ReviewPage} from './review/review.page';
import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import { CallNumber } from '@ionic-native/call-number/ngx';
import { HttpClientModule } from '@angular/common/http';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { Toast } from '@ionic-native/toast/ngx';
......@@ -43,6 +43,7 @@ import { Toast } from '@ionic-native/toast/ngx';
StatusBar,
SplashScreen,
Geolocation,
CallNumber,
Toast,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
],
......
<ion-header>
<div class="app_header">
<div class="app_header" *ngIf="roadassistantDetails">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>Presto towing Service</h4></div>
<div class="nav_title floatLeft"><h4 *ngIf="roadassistantDetails.name">{{roadassistantDetails.name |}}</h4></div>
<button class="nav_btn nav_btn_text floatRight">
</button>
......@@ -83,7 +83,7 @@
<input type="radio" id="star1" name="rating" value="1" /><label class = "full" for="star1" title="Sucks big time - 1 star"></label>
<input type="radio" id="starhalf" name="rating" value="half" /><label class="half" for="starhalf" title="Sucks big time - 0.5 stars"></label>
</fieldset>
<span>4 Star | 34 Reviews</span>
<span *ngIf="ratingDetails">{{ratingDetails.rate}} | {{ratingDetails.reviewNumber}} Reviews</span>
</ion-col>
<ion-col col-4 class="p0 textRight">
<button class="add_review" (click)="istoggle()">+</button>
......
......@@ -3,7 +3,10 @@ import { Router, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { ReviewPage} from '../review/review.page';
import { AuthenticationService } from '../../Config/services/auth.service';
import { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
import { CallNumber } from '@ionic-native/call-number/ngx';
@Component({
selector: 'app-booking',
templateUrl: './booking.page.html',
......@@ -21,17 +24,32 @@ import { ReviewPage} from '../review/review.page';
]
})
export class BookingPage {
ratingDetails: any;
reviewcount: any;
rating: number;
id: any;
reviewErrormessage: boolean;
tab: any;
isShow = false;
roadassistantDetails = [];
reviewDetails = [];
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
private location: Location,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private storageservice: StorageService,
private callNumber: CallNumber
) {
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.id = JSON.parse(Data);
this.tab = 'about';
this.roadassistantDetails = null;
this.reviewDetails = null;
this.rating = 0;
this.reviewErrormessage = false;
this.roadassistantDetail(this.id);
}
......@@ -56,8 +74,42 @@ export class BookingPage {
this.isShow = !this.isShow;
}
roadassistantDetail(id) {
this.authenticationService.get_data('road_assistanceDetail?roadassistant_id=' + id).subscribe((data) => {
console.log(data);
if ( data && data.status === 'success') {
this.roadassistantDetails = data.data;
if ( data.data.review != null || '' ) {
this.reviewDetails = data.data.review;
this.reviewErrormessage = false;
this.reviewsFind();
} else {
this.reviewDetails = null;
this.reviewErrormessage = true;
}
} else {
this.validationService.presentToast('Something error happend');
}
});
}
callRoadAssistant(conctactNumber: any) {
this.callNumber.callNumber(conctactNumber, true)
.then(res => console.log('Launched dialer!', res))
.catch(err => console.log('Error launching dialer', err));
}
getImage(url) {
const baseImageURL = '';
return 'https' + baseImageURL;
}
reviewsFind() {
this.reviewcount = this.reviewDetails.length;
console.log('Review Length', this.reviewDetails);
for (let i = 0 ; i < this.reviewcount - 1 ; i++ ) {
this.reviewDetails[i + 1].rate = ((+this.reviewDetails[i].rate) + (+this.reviewDetails[i + 1].rate));
this.rating = (this.reviewDetails[i + 1 ].rate / this.reviewcount);
}
this.ratingDetails = { rate: this.rating, reviewNumber: this.reviewcount };
}
}
......@@ -2,7 +2,9 @@ import { Component, OnInit } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { AuthenticationService } from '../../Config/services/auth.service';
import { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-bookservice',
templateUrl: './bookservice.page.html',
......@@ -13,7 +15,10 @@ export class BookservicePage implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
private location: Location,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private storageservice: StorageService,
) { }
ngOnInit() {
......
......@@ -15,28 +15,28 @@
<form [formGroup]="signupForm">
<div class="row">
<p>Full Name</p>
<ion-input formControlName="user_name" [disabled]="disableForm()" type="text"></ion-input>
<ion-input formControlName="user_name" type="text"></ion-input>
</div>
<div class="row">
<p>Email</p>
<ion-input formControlName="user_email" [disabled]="disableForm()" type="text"></ion-input>
<ion-input formControlName="user_email" type="text"></ion-input>
</div>
<div class="row">
<p>Phone Number</p>
<ion-row class="p0">
<ion-col size="4">
<ion-select placeholder="" formControlName="user_phonecode" [disabled]="disableForm()">
<ion-select placeholder="" formControlName="user_phonecode" >
<ion-select-option value="">+33</ion-select-option>
</ion-select>
</ion-col>
<ion-col size="8">
<ion-input value="" formControlName="user_phonenumber" [disabled]="disableForm()" type="number"></ion-input>
<ion-input value="" formControlName="user_phonenumber" type="number"></ion-input>
</ion-col>
</ion-row>
</div>
<div class="row">
<p>Country</p>
<ion-input type="text" formControlName="user_country" [disabled]="disableForm()"></ion-input>
<ion-input type="text" formControlName="user_country" ></ion-input>
</div>
<!-- <div class="row">
<p>District</p>
......@@ -48,11 +48,11 @@
</div> -->
<div class="row">
<p>Area</p>
<ion-input type="text"formControlName="user_area"[disabled]="disableForm()" ></ion-input>
<ion-input type="text"formControlName="user_area" ></ion-input>
</div>
<div class="row">
<p>Address</p>
<ion-input type="text"formControlName="user_address" [disabled]="disableForm()" ></ion-input>
<ion-input type="text"formControlName="user_address" ></ion-input>
</div>
<div class="row">
<button class="signup_btn" (click)="formEdit()" *ngIf="editForm">EDIT PROFILE</button>
......
......@@ -46,6 +46,7 @@ export class GeneralPage implements OnInit {
ngOnInit() {
console.log(this.profileData);
this.getProfileData();
this.signupForm.disable();
}
......@@ -98,6 +99,7 @@ getStorgaeData() {
}
formEdit() {
this.editForm = false;
this.signupForm.enable();
}
updateProfileUser() {
console.log(this.signupForm.value);
......
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { trigger, transition, animate, style } from '@angular/animations';
import { Router,ActivatedRoute } from '@angular/router';
import { Router, ActivatedRoute } from '@angular/router';
import { AuthenticationService } from '../../Config/services/auth.service';
import {StorageService } from '../../Config/services/storage.service';
import { ValidationService } from '../../Config/services/validation.service';
@Component({
selector: 'app-myorders',
templateUrl: './myorders.page.html',
styleUrls: ['./myorders.page.scss'],
})
export class MyordersPage implements OnInit {
oderDeatils = [];
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private authenticationservice: AuthenticationService,
private storageservice: StorageService,
private validationservice: ValidationService
) {
this.oderDeatils = null;
this.getMyorders();
}
ngOnInit() {
}
goToPage(path,data=null){
this.router.navigateByUrl(path,{queryParams:data});
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
goBack() {
this.location.back();
}
getMyorders() {
this.authenticationservice.get_data('').subscribe((data) => {
if ( data.status === 'success') {
this.oderDeatils = data.data;
console.log(this.oderDeatils);
} else {
this.oderDeatils = null;
this.validationservice.presentToast(data.message);
}
});
}
}
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