Commit b31f8dff by kevin

10-10-2019

parent acb0636b
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.
6.Remove user_id from user_otp & user_otp_resend.
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
No preview for this file type
......@@ -28,24 +28,24 @@
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
<icon density="ldpi" src="resources\android\icon\drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources\android\icon\drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources\android\icon\drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources\android\icon\drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources\android\icon\drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources\android\icon\drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources\android\splash\drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources\android\splash\drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources\android\splash\drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources\android\splash\drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources\android\splash\drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources\android\splash\drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources\android\splash\drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources\android\splash\drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources\android\splash\drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources\android\splash\drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources\android\splash\drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources\android\splash\drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
......@@ -102,5 +102,4 @@
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<engine name="android" spec="7.1.4" />
</widget>
......@@ -21,6 +21,7 @@
"@angular/platform-browser": "^7.2.2",
"@angular/platform-browser-dynamic": "^7.2.2",
"@angular/router": "^7.2.2",
"@ionic-native/call-number": "^5.15.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/geolocation": "^5.15.0",
"@ionic-native/splash-screen": "^5.0.0",
......@@ -29,7 +30,8 @@
"@ionic/angular": "^4.1.0",
"@types/jquery": "^3.3.31",
"angular-calendar": "^0.27.14",
"cordova-android": "7.1.4",
"call-number": "^1.0.1",
"cordova-android": "^8.1.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geolocation": "^4.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
......@@ -85,10 +87,11 @@
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-geolocation": {},
"cordova-plugin-x-toast": {}
"cordova-plugin-x-toast": {},
"mx.ferreyra.callnumber": {}
},
"platforms": [
"android"
]
}
}
}
\ No newline at end of file
import { SyncAsync } from '@angular/compiler/src/util';
export interface User {
user_name: any;
user_email: any;
......@@ -9,4 +11,6 @@ export interface User {
user_lat: any;
user_lng: any;
user_type: any;
device_id: any;
user_id: any;
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { FormsModule , ReactiveFormsModule} from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
......@@ -19,6 +19,7 @@ const routes: Routes = [
CommonModule,
FormsModule,
IonicModule,
ReactiveFormsModule,
RouterModule.forChild(routes)
],
declarations: [AddaddressPage]
......
......@@ -3,66 +3,58 @@
<div class="app_header">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>ADD ADDRESS</h4></div>
<div class="nav_title floatLeft"><h4>ADD NEW ADDRESS</h4></div>
<button class="nav_btn nav_btn_text floatRight">
</button>
<div class="clear"></div>
</div>
</ion-header>
<ion-content>
<div class="signup_wrapper">
<div class="signup_form">
<form [formGroup]="deliveryaddressForm">
<div class="row">
<p>Name</p>
<ion-input value="John Doe" type="text"></ion-input>
<p>Full Name</p>
<ion-input type="text" formControlName="name" ></ion-input>
</div>
<div class="row">
<p>Phone Number</p>
<ion-row class="p0">
<ion-col size="4">
<ion-select placeholder="">
<ion-select-option value="">+91</ion-select-option>
</ion-select>
<!-- <ion-select >
<ion-select-option value="" formControlName="">+33</ion-select-option>
</ion-select> -->
</ion-col>
<ion-col size="8">
<ion-input value="" type="number"></ion-input>
<ion-input value="" type="number" formControlName="phone_no"></ion-input>
</ion-col>
</ion-row>
</div>
<div class="row">
<p>Country</p>
<ion-select placeholder="">
<ion-select-option value="">Country Name</ion-select-option>
</ion-select>
</div>
<div class="row">
<p>District</p>
<ion-select placeholder="">
<ion-select-option value="">District Name</ion-select-option>
</ion-select>
<ion-input type="text" formControlName="country"></ion-input>
</div>
<div class="row">
<p>City</p>
<ion-select placeholder="">
<ion-select-option value="">City Name</ion-select-option>
</ion-select>
<ion-input type="text" formControlName="city"></ion-input>
</div>
<div class="row">
<p>Area</p>
<ion-select placeholder="">
<ion-select-option value="">Area name</ion-select-option>
</ion-select>
<ion-input type="text" formControlName="area"></ion-input>
</div>
<div class="row">
<p>House name/Building</p>
<ion-select placeholder="">
<ion-select-option value="">Choose address</ion-select-option>
</ion-select>
<p>Address</p>
<ion-input type="text" formControlName="house_no"></ion-input>
</div>
<div class="row">
<h6><strong>Your Product will deliver to this address.</strong></h6>
</div>
<div class="row">
<button class="signup_btn">Save</button>
<button class="signup_btn" (click)="addnewAddress()">PROCEED</button>
</div>
</form>
</div>
</div>
</ion-content>
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 { FormBuilder, Validators } from '@angular/forms';
import { StorageService } from '../../Config/services/storage.service';
import { ValidationService } from '../../Config/services/validation.service';
import { AuthenticationService } from '../../Config/services/auth.service';
@Component({
selector: 'app-addaddress',
templateUrl: './addaddress.page.html',
styleUrls: ['./addaddress.page.scss'],
})
export class AddaddressPage implements OnInit {
userData: any;
userLocation: any;
deliveryaddressForm = this.fb.group({
name: ['', Validators.required],
phone_no: ['', Validators.required],
country: ['', Validators.required],
area: ['', Validators.required],
house_no: ['', Validators.required],
city: ['', Validators.required],
district: ['Ernakulam'],
user_id: ['', Validators.required]
});
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private fb: FormBuilder,
private storageService: StorageService,
private authenticationservice: AuthenticationService,
private validationservice: ValidationService
) {
this.getStorgaeData();
}
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();
}
addnewAddress() {
this.deliveryaddressForm.patchValue({
user_id : this.userData.id
});
if ( this.deliveryaddressForm.valid) {
console.log(this.deliveryaddressForm.value);
this.authenticationservice.post_data('add_newadress' , this.deliveryaddressForm.value).subscribe((data) => {
console.log(data);
if ( data.status === 'success') {
this.validationservice.presentToast(data.message);
} else {
this.validationservice.presentToast(data.message);
}
});
} else {
this.validationservice.presentToast('Please fill all fields');
}
}
getStorgaeData() {
this.userData = JSON.parse(this.storageService.getLocalStorageItem('userData'));
console.log(this.userData);
this.userLocation = JSON.parse(this.storageService.getLocalStorageItem('location'));
}
}
......@@ -64,25 +64,27 @@ const routes: Routes = [
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'myservices', loadChildren: './myservices/myservices.module#MyservicesPageModule' },
{ path: 'profilephoto', loadChildren: './profilephoto/profilephoto.module#ProfilephotoPageModule' },
{ path: 'carlist', loadChildren: './carlist/carlist.module#CarlistPageModule' },
{ path: 'carlist/:id', loadChildren: './carlist/carlist.module#CarlistPageModule' },
{ path: 'servicedetails', loadChildren: './servicedetails/servicedetails.module#ServicedetailsPageModule' },
{ path: 'myorders', loadChildren: './myorders/myorders.module#MyordersPageModule' },
{ path: 'general', loadChildren: './general/general.module#GeneralPageModule' },
{ path: 'settings', loadChildren: './settings/settings.module#SettingsPageModule' },
{ path: 'selectservices/:id', loadChildren: './selectservices/selectservices.module#SelectservicesPageModule' },
{ path: 'date/:id', loadChildren: './date/date.module#DatePageModule' },
{ path: 'summary', loadChildren: './summary/summary.module#SummaryPageModule' },
{ path: 'summary/:id', loadChildren: './summary/summary.module#SummaryPageModule' },
{ path: 'waiting1', loadChildren: './waiting1/waiting1.module#Waiting1PageModule' },
{ path: 'available', loadChildren: './available/available.module#AvailablePageModule' },
{ path: 'bookservice', loadChildren: './bookservice/bookservice.module#BookservicePageModule' },
{ path: 'cancel', loadChildren: './cancel/cancel.module#CancelPageModule' },
{ path: 'purchaseparts', loadChildren: './purchaseparts/purchaseparts.module#PurchasepartsPageModule' },
{ path: 'productbooking', loadChildren: './productbooking/productbooking.module#ProductbookingPageModule' },
{ path: 'productbooking/:id', loadChildren: './productbooking/productbooking.module#ProductbookingPageModule' },
{ path: 'addaddress', loadChildren: './addaddress/addaddress.module#AddaddressPageModule' },
{ path: 'deliveryaddress', loadChildren: './deliveryaddress/deliveryaddress.module#DeliveryaddressPageModule' },
{ path: 'partproduct', loadChildren: './partproduct/partproduct.module#PartproductPageModule' },
{ path: 'orderdetails', loadChildren: './orderdetails/orderdetails.module#OrderdetailsPageModule' },
{ path: 'listingservice', loadChildren: './listingservice/listingservice.module#ListingservicePageModule' }
{ path: 'listingservice', loadChildren: './listingservice/listingservice.module#ListingservicePageModule' },
{ path: 'changepassword', loadChildren: './changepassword/changepassword.module#ChangepasswordPageModule' }
];
......
import { Component } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
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';
......@@ -20,23 +20,23 @@ import { ReviewPage} from '../review/review.page';
])
]
})
export class BookingPage{
export class BookingPage {
tab:any;
tab: any;
isShow = false;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) {
) {
this.tab = "about";
this.tab = 'about';
}
goToPage(path,data=null){
this.router.navigateByUrl(path,{queryParams:data});
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data , replaceUrl: true});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......@@ -49,10 +49,10 @@ export class BookingPage{
this.tab = type;
}
istoggle(){
istoggle() {
this.isShow = !this.isShow;
}
......
......@@ -16,7 +16,7 @@
<ul>
<li>
<div class="auto_pic"></div>
<div class="auto_detail">
<div class="auto_detail" (click)="bookService()">
<h4><strong>Rolls Royce</strong> Ghost</h4>
<div class="auto_detail_inner">
<p>Mileage: 08 - 12</p>
......@@ -25,39 +25,6 @@
</div>
<div class="clear"></div>
</li>
<li>
<div class="auto_pic"></div>
<div class="auto_detail">
<h4><strong>Rolls Royce</strong> Ghost</h4>
<div class="auto_detail_inner">
<p>Mileage: 08 - 12</p>
<p>Model: 2019</p>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="auto_pic"></div>
<div class="auto_detail">
<h4><strong>Rolls Royce</strong> Ghost</h4>
<div class="auto_detail_inner">
<p>Mileage: 08 - 12</p>
<p>Model: 2019</p>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="auto_pic"></div>
<div class="auto_detail">
<h4><strong>Rolls Royce</strong> Ghost</h4>
<div class="auto_detail_inner">
<p>Mileage: 08 - 12</p>
<p>Model: 2019</p>
</div>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
</ion-content>
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 { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-carlist',
templateUrl: './carlist.page.html',
styleUrls: ['./carlist.page.scss'],
})
export class CarlistPage implements OnInit {
getData: any;
userData: any;
addressList: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private storageservice: StorageService,
) {
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.getData = JSON.parse(Data);
console.log(this.getData);
}
ngOnInit() {
this.getStorgaeData();
this.getSavedAddress();
this.addressList = null;
}
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();
}
bookService() {
if ( this.getData.type === 1) {
// tslint:disable-next-line: max-line-length
const passData = {date: this.getData.booking_date, message: this.getData.message, id: [this.getData.subservice_id], car_id: '1', sub_name: this.getData.sub_name, main_name: this.getData.main_name };
console.log(JSON.stringify(passData));
this.goToPage('/summary/' + encodeURIComponent(JSON.stringify(passData)));
}
if (this.getData.type === 2) {
this.goToPage('deliveryaddress');
}
}
getSavedAddress() {
this.authenticationService.get_data('get_deliveryadress?user_id=' + this.userData.id).subscribe((data) => {
console.log(data);
if (data.status === 'success') {
this.addressList = data.data;
} else {
this.addressList = null;
}
});
}
getStorgaeData() {
this.userData = JSON.parse(this.storageservice.getLocalStorageItem('userData'));
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { ChangepasswordPage } from './changepassword.page';
const routes: Routes = [
{
path: '',
component: ChangepasswordPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ReactiveFormsModule,
RouterModule.forChild(routes)
],
declarations: [ChangepasswordPage]
})
export class ChangepasswordPageModule {}
<ion-content>
<div class="forgot_wrapper">
<div class="app_header">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>Password</h4></div>
<div class="clear"></div>
</div>
<div class="forgot_form">
<form [formGroup]="passwordForm">
<div class="row">
<p>Password</p>
<ion-input formControlName="password" type="password"></ion-input>
</div>
<div style="text-align: center" *ngIf="passwordForm.controls.password.invalid && (passwordForm.get('password').dirty || passwordForm.get('password').touched)">
Minimum 6 characters required
</div>
<div class="row">
<p>Confirm Password</p>
<ion-input formControlName="newpassword" type="password"></ion-input>
</div>
<div style="text-align: center" *ngIf="passwordForm.controls.newpassword.invalid && (passwordForm.get('newpassword').dirty || passwordForm.get('newpassword').touched)">
Minimum 6 characters required
</div>
<br>
<div class="row textCenter">
<button class="signup_btn" (click)="changePsw()">CHANAGE PASSWORD</button>
</div>
</form>
</div>
</div>
</ion-content>
.forgot_wrapper{
background-image: url("../../assets/img/asset_forgot_bg.png");
background-position: center top -30px;
background-size: 100%;
.forgot_form{
padding: 15px;
padding-top: 40px;
.row{
margin-bottom:15px;
p{
color: #4e4961;
padding: 10px;
margin: 0px;
padding-left: 20px;
font-weight: 500;
a{
color: #39267f;
}
}
h5{
color: #4e4961;
text-align: center;
font-size: 16px;
}
h2{
text-align: center;
color: #282438;
font-size: 32px;
padding-bottom: 15%;
}
h6{
color: #4e4961;
padding-left: 20px;
font-weight: 400;
font-size: 14px;
}
ion-input{
background: #dcdae9;
border-radius:35px;
color:#39267f;
height: 45px;
font-weight: 600;
text-align: center;
}
ion-select {
background: #dcdae9;
border-radius: 20px;
color:#39267f;
height: 40px;
font-weight: 600;
padding-left: 15px !important;
padding-right: 20px;
}
.signup_btn{
height: 40px;
width: 100%;
color: #fff;
background-color: #39267f;
border-radius: 20px;
font-weight: 500;
font-size: 16px;
}
}
.otp_input_box{
width: 80%;
margin: 0 auto;
}
}
}
h3{
color: #39267f;
text-align:center;
font-size: 15px;
font-weight: 500;
}
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangepasswordPage } from './changepassword.page';
describe('ChangepasswordPage', () => {
let component: ChangepasswordPage;
let fixture: ComponentFixture<ChangepasswordPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChangepasswordPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChangepasswordPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { FormBuilder, Validators } from '@angular/forms';
import { AuthenticationService } from '../../Config/services/auth.service';
import { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-changepassword',
templateUrl: './changepassword.page.html',
styleUrls: ['./changepassword.page.scss'],
})
export class ChangepasswordPage implements OnInit {
userData: any;
passwordForm = this.fb.group({
user_id: ['', Validators.required],
password: ['', Validators.compose([Validators.required, Validators.minLength(6)])],
newpassword: ['', Validators.compose([Validators.required, Validators.minLength(6)])]
});
constructor(
private router: Router,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private route: ActivatedRoute,
private location: Location,
private fb: FormBuilder,
private storageservice: StorageService
) { }
ngOnInit() {
}
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
goBack() {
this.location.back();
}
getStorageData() {
this.userData = JSON.parse(this.storageservice.getLocalStorageItem('userData'));
}
changePsw() {
this.passwordForm.patchValue({
user_id : this.userData.profile_id
});
if (this.passwordForm.valid) {
if (this.passwordForm.value.password === this.passwordForm.value.newpassword) {
} else {
this.validationService.presentToast('Password Mismatch!');
this.passwordForm.reset();
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
} else {
this.validationService.presentToast('Please enter all fields');
this.passwordForm.reset();
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}
}
......@@ -14,21 +14,21 @@
<ion-item>
<ion-label>Pick Date</ion-label>
<ion-datetime displayFormat="DD MM YY" [(ngModel)]="myDate" placeholder="Select Date" [min]="today"></ion-datetime>
<ion-datetime displayFormat="DD MM YY" [(ngModel)]="myDate" placeholder="Select Date" ></ion-datetime>
</ion-item>
<h4>Instruction</h4>
<textarea rows="6" placeholder="Type here..." [(ngModel)]="message" ></textarea>
<textarea rows="6" placeholder="Type here..." [(ngModel)]="Message" ></textarea>
</div>
<div class="select_footer">
<div class="select_footer" *ngIf="getData">
<ion-row>
<ion-col size="9">
<h6>2 Services</h6>
<h6>Rolls Royce Ghost</h6>
<h6>June 26th 2019<strong> 13:20 PM to 14:20 PM</strong> </h6>
<h6>Category : {{getData.main_name}}</h6>
<h6>Service : {{getData.sub_name}}</h6>
<!-- <h6>{{myDate}}</h6> -->
</ion-col>
<ion-col size="3">
<button class="next_btn floatRight" (click)="movetoSelectCar()">Next</button>
<button class="next_btn floatRight" (click)="movetoSelectCar()">NEXT</button>
<div class="clear"></div>
</ion-col>
</ion-row>
......
......@@ -11,7 +11,9 @@ import { FormBuilder, Validators } from '@angular/forms';
})
export class DatePage implements OnInit {
myDate = new Date();
message: any;
Message: any;
getData: any;
today = new Date();
constructor(
private router: Router,
private route: ActivatedRoute,
......@@ -22,6 +24,9 @@ export class DatePage implements OnInit {
}
ngOnInit() {
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.getData = JSON.parse(Data);
console.log(this.getData);
}
goToPage(path, data= null) {
......@@ -33,6 +38,9 @@ export class DatePage implements OnInit {
this.location.back();
}
movetoSelectCar() {
// const passData = {}
}
console.log(this.myDate);
// tslint:disable-next-line: max-line-length
const passData = {subservice_id: this.getData.sub_id, booking_date: this.myDate , message: this.Message, sub_name: this.getData.sub_name,main_name:this.getData.main_name ,type:1}
this.goToPage('/carlist/' + encodeURIComponent(JSON.stringify(passData)));
}
}
......@@ -4,7 +4,7 @@
</button>
<div class="nav_title floatLeft"><h4>DELIVERY ADDRESS</h4></div>
<button class="nav_btn nav_btn_text floatRight">
<div class="add_car">
<div class="add_car" (click)="goToPage('addaddress')">
+
</div>
</button>
......
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 { StorageService } from '../../Config/services/storage.service';
import { ValidationService } from '../../Config/services/validation.service';
import { AuthenticationService } from '../../Config/services/auth.service';
@Component({
selector: 'app-deliveryaddress',
......@@ -10,23 +12,45 @@ import { Router,ActivatedRoute } from '@angular/router';
styleUrls: ['./deliveryaddress.page.scss'],
})
export class DeliveryaddressPage implements OnInit {
userData: any;
saveAddress: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private storageService: StorageService,
private authenticationservice: AuthenticationService,
private validationservice: ValidationService
) {
this.saveAddress = null;
}
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();
}
getStorgaeData() {
this.userData = JSON.parse(this.storageService.getLocalStorageItem('userData'));
console.log(this.userData);
}
getuserSavedAddress() {
this.authenticationservice.get_data('get_deliveryadress?user_id=' + this.userData.profile_id).subscribe((data) => {
console.log(data);
if (data.status === 'success') {
this.saveAddress = data.data;
} else {
this.saveAddress = '';
this.validationservice.presentToast(data.message);
}
});
}
}
......@@ -11,7 +11,7 @@
<div class="forgot_form">
<div class="row">
<form [formGroup]="forgotPswForm">
<p>Type your Phone Number</p>
<p>Enter Registered Number</p>
<ion-row class="p0">
<ion-col size="4">
<ion-select placeholder="Phone Code" formControlName="user_countrycode" >
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { FormsModule , ReactiveFormsModule} from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
......@@ -18,6 +18,7 @@ const routes: Routes = [
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
IonicModule,
RouterModule.forChild(routes)
],
......
......@@ -3,7 +3,7 @@
<div class="app_header">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>GENERAL DETAILS</h4></div>
<div class="nav_title floatLeft"><h4>MY PROFILE</h4></div>
<button class="nav_btn nav_btn_text floatRight">
</button>
<div class="clear"></div>
......@@ -12,60 +12,53 @@
<ion-content>
<div class="signup_wrapper">
<div class="signup_form">
<form [formGroup]="signupForm">
<div class="row">
<p>Your Full Name</p>
<ion-input value="John Doe" type="text"></ion-input>
<p>Full Name</p>
<ion-input formControlName="user_name" [disabled]="disableForm()" type="text"></ion-input>
</div>
<div class="row">
<p>Email Address</p>
<ion-input value="[email protected]" type="text"></ion-input>
<p>Email</p>
<ion-input formControlName="user_email" [disabled]="disableForm()" type="text"></ion-input>
</div>
<div class="row">
<p>Phone Number</p>
<ion-row class="p0">
<ion-col size="4">
<ion-select placeholder="">
<ion-select-option value="">+91</ion-select-option>
<ion-select placeholder="" formControlName="user_phonecode" [disabled]="disableForm()">
<ion-select-option value="">+33</ion-select-option>
</ion-select>
</ion-col>
<ion-col size="8">
<ion-input value="" type="number"></ion-input>
<ion-input value="" formControlName="user_phonenumber" [disabled]="disableForm()" type="number"></ion-input>
</ion-col>
</ion-row>
</div>
<div class="row">
<p>Country</p>
<ion-select placeholder="">
<ion-select-option value="">Country Name</ion-select-option>
</ion-select>
<ion-input type="text" formControlName="user_country" [disabled]="disableForm()"></ion-input>
</div>
<div class="row">
<!-- <div class="row">
<p>District</p>
<ion-select placeholder="">
<ion-select-option value="">District Name</ion-select-option>
</ion-select>
<ion-input type="text"></ion-input>
</div>
<div class="row">
<p>City</p>
<ion-select placeholder="">
<ion-select-option value="">City Name</ion-select-option>
</ion-select>
</div>
<ion-input type="text"></ion-input>
</div> -->
<div class="row">
<p>Area</p>
<ion-select placeholder="">
<ion-select-option value="">Area name</ion-select-option>
</ion-select>
<ion-input type="text"formControlName="user_area"[disabled]="disableForm()" ></ion-input>
</div>
<div class="row">
<p>House name/Building</p>
<ion-select placeholder="">
<ion-select-option value="">Choose address</ion-select-option>
</ion-select>
<p>Address</p>
<ion-input type="text"formControlName="user_address" [disabled]="disableForm()" ></ion-input>
</div>
<div class="row">
<button class="signup_btn">Save</button>
<button class="signup_btn" (click)="formEdit()" *ngIf="editForm">EDIT PROFILE</button>
<button class="signup_btn" (click)="updateProfileUser()" *ngIf="!editForm">UPDATE PROFILE</button>
</div>
</form>
</div>
</div>
......
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 { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
import { User } from '../../Config/model/user';
import { FormBuilder, Validators } from '@angular/forms';
@Component({
selector: 'app-general',
templateUrl: './general.page.html',
styleUrls: ['./general.page.scss'],
})
export class GeneralPage implements OnInit {
userData: any;
profileData: any;
editForm: boolean;
userLocation: any;
signupForm = this.fb.group({
user_name: ['', Validators.required],
user_email: ['', Validators.required],
user_phonecode: ['', Validators.required],
user_phonenumber: ['', Validators.required],
user_country: ['', Validators.required],
user_area: ['', Validators.required],
user_address: ['', Validators.required],
device_id: ['', Validators.required],
user_lat: ['', Validators.required],
user_lng: ['', Validators.required],
user_id: ['', Validators.required]
});
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private storageservice: StorageService,
private fb: FormBuilder
) {
this.getStorgaeData();
this.editForm = true;
}
ngOnInit() {
console.log(this.profileData);
this.getProfileData();
}
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();
}
getProfileData() {
this.authenticationService.get_data('get_userProfile?user_id=' + this.userData.profile_id).subscribe((data) => {
console.log(data);
if ( data.status === 'success') {
this.profileData = data.data;
console.log(this.profileData);
this.insertFormvalue();
} else {
this.validationService.presentToast('Sorry, failed to fetch user Data');
}
});
}
disableForm() {
return this.editForm;
}
insertFormvalue() {
const Userdata: User = {
user_name : this.profileData[0].name,
user_email : this.profileData[0].email_id,
user_address : this.profileData[0].address,
user_area: this.profileData[0].area,
user_phonecode : this.profileData[0].code,
user_phonenumber : this.profileData[0].phone_no,
user_lat : this.userLocation.lat,
user_lng : this.userLocation.lng,
user_country : 'France',
user_type : '1',
device_id : '1234567',
user_id : this.userData.profile_id
};
this.signupForm.patchValue(Userdata);
console.log('ModelValue', Userdata);
}
getStorgaeData() {
this.userData = JSON.parse(this.storageservice.getLocalStorageItem('userData'));
console.log(this.userData);
this.userLocation = JSON.parse(this.storageservice.getLocalStorageItem('location'));
}
formEdit() {
this.editForm = false;
}
updateProfileUser() {
console.log(this.signupForm.value);
this.authenticationService.post_data('update_profile' , this.signupForm.value).subscribe((data) => {
console.log(data);
if (data.status === 'status') {
this.validationService.presentToast(data.message);
this.storageservice.setLocalStorageItem('userData', JSON.stringify(this.signupForm.value));
this.goToPage('profile');
} else {
this.validationService.presentToast(data.message);
}
});
}
}
......@@ -41,9 +41,9 @@
<button class="more_btn" (click)="goToPage('purchaseparts')">More</button>
<div class="clear"></div>
</div>
<div class="product_section" *ngIf="peopleMostpurchasedList">
<div class="product_section" *ngIf="peopleMostpurchasedList" >
<ion-row>
<ion-col col-4 *ngFor="let product of peopleMostpurchasedList; let i = index">
<ion-col col-4 *ngFor="let product of peopleMostpurchasedList; let i = index" (click)="purchaseProduct(product.id)">
<div class="product_div">
<div class="rating">{{product.count}}</div>
<div class="product_img">
......@@ -123,7 +123,7 @@
</div>
<div class="product_section" *ngIf="productsForUserList">
<ion-row>
<ion-col col-4 *ngFor="let product of productsForUserList; let i = index">
<ion-col col-4 *ngFor="let product of productsForUserList; let i = index" (click)="purchaseProduct(product.id)">
<div class="product_div">
<div class="rating">{{product.count}}</div>
<div class="product_img">
......@@ -166,11 +166,11 @@
</ion-row>
</div> -->
<div class="header_submenu">
<h4>Services</h4>
<h4>Avilable Services</h4>
<div class="clear"></div>
</div>
<div class="home_main_stack_menu" *ngIf="mainServicesList">
<ion-row *ngFor="let service of mainServicesList; let i = index ">
<ion-row *ngFor="let service of mainServicesList; let i = index " (click)="bookService(service)">
<ion-col class="textCenter">
<img [src] ="getImage(service.image)">
<p>{{service.service_name}}</p>
......
......@@ -99,4 +99,13 @@ getProductsforYouList() {
getImage(imageurl) {
return imageurl;
}
bookService(service) {
console.log(service);
const PassData = {service_name: service.service_name, service_id: service.id};
this.goToPage('/selectservices/' + encodeURIComponent(JSON.stringify(PassData)));
}
purchaseProduct(id) {
console.log(id);
this.goToPage('/productbooking/' + encodeURIComponent(JSON.stringify(id)));
}
}
......@@ -36,7 +36,7 @@
<h6>{{serviceDetails}}</h6>
</ion-col>
<ion-col>
<button class="next_btn floatRight" (click)="getsubserviceList()">Next</button>
<button class="next_btn floatRight" (click)="getsubserviceList()">NEXT</button>
<div class="clear"></div>
</ion-col>
</ion-row>
......
......@@ -4,6 +4,7 @@ import { Location } from '@angular/common';
import { AuthenticationService } from '../../Config/services/auth.service';
import { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-listingservice',
templateUrl: './listingservice.page.html',
......@@ -55,7 +56,7 @@ getImage(imageurl) {
}
getsubserviceList() {
const PassData = {service_name: this.serviceDetails, service_id: this.id};
this.goToPage('/selectservices/' + JSON.stringify(PassData));
this.goToPage('/selectservices/' + encodeURIComponent(JSON.stringify(PassData)));
}
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data});
......
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 { StorageService } from '../../Config/services/storage.service';
import { ValidationService } from '../../Config/services/validation.service';
import { AuthenticationService } from '../../Config/services/auth.service';
@Component({
selector: 'app-myservices',
templateUrl: './myservices.page.html',
styleUrls: ['./myservices.page.scss'],
})
export class MyservicesPage implements OnInit {
userData: any;
serviceList: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private storageService: StorageService,
private authenticationservice: AuthenticationService,
private validationservice: ValidationService
) {
this.serviceList = null;
}
ngOnInit() {
this.getStorageData();
this.getServiceList();
}
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;
}
......@@ -29,6 +39,18 @@ export class MyservicesPage implements OnInit {
this.location.back();
}
getStorageData() {
this.userData = JSON.parse(this.storageService.getLocalStorageItem('userData'));
}
getServiceList() {
this.authenticationservice.get_data('get_userbookedServiceDetails').subscribe((data) => {
console.log(data);
if (data.status === 'success') {
this.serviceList = data.data;
} else {
this.validationservice.presentToast('No services found');
}
});
}
}
......@@ -2,7 +2,7 @@
<div class="app_header">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>Product booking</h4></div>
<div class="nav_title floatLeft"><h4>Product Booking</h4></div>
<button class="nav_btn nav_btn_text floatRight">
</button>
......@@ -12,7 +12,7 @@
<ion-content>
<div class="product_booking_wrapper">
<div class="product_slider">
<ion-slides pager="false" [options]="slidesOpts" (ionSlideDidChange)="slideChanged()">
<ion-slides pager="false" [options]="slidesOpts" >
<ion-slide>
<img src="../../assets/img/asset_slider1.png">
</ion-slide>
......@@ -30,13 +30,13 @@
</div>
<div class="product_detail">
<div class="product_top"></div>
<div class="product_inner">
<div class="product_inner" *ngIf="productDetail">
<div class="product_header">
<div class="product_name">
<h4>Mega 3 Inch Band P200</h4>
<h4>{{productDetail.unique_name}}</h4>
<hr>
</div>
<div class="product_btn">
<div class="product_btn" (click)="purchaseProduct()">
Purchase
</div>
<div class="clear"></div>
......
......@@ -44,7 +44,7 @@
z-index: 9;
.product_top{
width: 100%;
height:50px;
height:0px;
background: url("../../assets/img/asset_top_bg.png");
}
.product_inner{
......@@ -55,9 +55,10 @@
width:calc(100% - 120px);
float: left;
h4{
margin:0px;
padding:0px;
padding-bottom: 5px;
padding-bottom: 25px;
}
hr{
border:2px solid #fbd339;
......@@ -68,7 +69,7 @@
}
}
.product_btn{
width:120px;
width:325px;
float: left;
text-align: center;
background-color: #39267f;
......
......@@ -3,7 +3,10 @@ import { Component, OnInit, ViewChild, } from '@angular/core';
import { IonSlides } from '@ionic/angular';
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 { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-productbooking',
......@@ -11,20 +14,32 @@ import { Router,ActivatedRoute } from '@angular/router';
styleUrls: ['./productbooking.page.scss'],
})
export class ProductbookingPage implements OnInit {
@ViewChild(IonSlides) slides: IonSlides;
currentIndex: any;
id: any;
productDetail: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private validationService: ValidationService,
private authenticationservice: AuthenticationService,
private storageservice: StorageService
) {
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.id = JSON.parse(Data);
}
@ViewChild(IonSlides) slides: IonSlides;
currentIndex: any;
slidesOpts = {
slidesPerView: 1
};
ngOnInit() {
this.getProductDetails();
}
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;
}
......@@ -32,10 +47,6 @@ export class ProductbookingPage implements OnInit {
this.location.back();
}
slidesOpts = {
slidesPerView: 1
}
next() {
this.slides.slideNext();
}
......@@ -43,5 +54,16 @@ export class ProductbookingPage implements OnInit {
prev() {
this.slides.slidePrev();
}
getProductDetails() {
this.authenticationservice.get_data('product_detail?product_id=' + this.id).subscribe((data) => {
console.log(data);
if (data.status === 'success') {
this.productDetail = data.data;
}
});
}
purchaseProduct() {
const PassData = {type: 2};
this.goToPage('/carlist/' + encodeURIComponent(JSON.stringify(PassData)));
}
}
......@@ -60,7 +60,17 @@
</div>
<div class="clear"></div>
</li>
<li (click)="goToPage('login')">
<li (click)="goToPage('changepassword')">
<div class="li_image">
<img src="../../assets/img/asset_m5.png">
</div>
<div class="li_detail borderNone">
<h5>Change Password</h5>
<p></p>
</div>
<div class="clear"></div>
</li>
<li (click)="logout()">
<div class="li_image">
<img src="../../assets/img/asset_m5.png">
</div>
......@@ -70,6 +80,7 @@
</div>
<div class="clear"></div>
</li>
</ul>
</div>
</div>
......
import { Component, OnInit } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
import { Router, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { AuthenticationService } from '../../Config/services/auth.service';
import {StorageService } from '../../Config/services/storage.service';
import { ValidationService } from '../../Config/services/validation.service';
@Component({
selector: 'app-profile',
templateUrl: './profile.page.html',
......@@ -12,14 +14,17 @@ export class ProfilePage implements OnInit {
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
private location: Location,
private authenticationservice: AuthenticationService,
private storageservice: StorageService,
private validationservice: ValidationService
) { }
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;
}
......@@ -27,5 +32,9 @@ export class ProfilePage implements OnInit {
goBack() {
this.location.back();
}
logout() {
this.storageservice.removeLocalStorageItem('userData');
this.goToPage('login');
}
}
......@@ -2,13 +2,13 @@
<div class="app_header relative">
<button class="nav_btn back_btn floatLeft" (click)="goBack()">
</button>
<div class="nav_title floatLeft"><h4>Purchase Parts</h4></div>
<div class="nav_title floatLeft"><h4>Purchase Product</h4></div>
<button class="nav_btn nav_btn_text floatRight">
</button>
<div class="clear"></div>
<div class="seach_bar_outer">
<div class="search_bar">
<input class="" placeholder="Search Parts...">
<input class="" [(ngModel)]="searchProduct" placeholder="Search Parts..." (keyup)="searchAProduct()">
</div>
</div>
</div>
......@@ -16,129 +16,38 @@
<ion-content>
<div class="purchase_wrapper">
<div class="header_submenu">
<h4>People most purchased</h4>
<button class="more_btn">More</button>
<h4>People most purchased</h4>
<div class="clear"></div>
</div>
<div class="product_section">
<ion-slides pager="false" [options]="slideOpts">
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<ion-slides pager="false" [options]="slideOpts" >
<ion-slide *ngFor= "let prodcuts of peopleMostpurchasedList" (click)="purchaseProduct(prodcuts.id)">
<div class="product_outter" >
<div class="product_div" >
<div class="rating">{{prodcuts.count}}</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item1.png">
</div>
</div>
<h4>PM 237</h4>
<h4>{{prodcuts.unique_name}}</h4>
<hr>
</div>
</ion-slide>
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item2.png">
</div>
</div>
<h4>Mega 3inch Band</h4>
<hr>
</div>
</ion-slide>
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item3.png">
</div>
</div>
<h4>PM 237</h4>
<hr>
</div>
</ion-slide>
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item1.png">
</div>
</div>
<h4>PM 237</h4>
<hr>
</div>
</ion-slide>
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item2.png">
</div>
</div>
<h4>Mega 3inch Band</h4>
<hr>
</div>
</ion-slide>
<ion-slide>
<div class="product_outter">
<div class="product_div">
<div class="rating">3.1</div>
<div class="product_img">
<img src="../../assets/img/asset_dummy_item3.png">
</div>
</div>
<h4>PM 237</h4>
<hr>
</div>
</ion-slide>
</ion-slides>
</ion-slides>
</div>
<div class="header_submenu">
<h4>People most purchased</h4>
<button class="more_btn">More</button>
<div class="clear"></div>
</div>
<div class="product_list_bay">
<div class="product_list_bay" *ngIf="productsList">
<ul>
<li (click)="goToPage('productbooking')">
<div class="badge premium_badge">Premium</div>
<li *ngFor="let products of productsList" (click)="purchaseProduct(products.id)">
<img src="../../assets/img/asset_dummy_item1.png">
<h4>PM 237</h4>
<p>Lorem ipsum</p>
<div class="rating">3.1</div>
<hr>
</li>
<li (click)="goToPage('productbooking')">
<div class="badge bestseller_badge">Best Seller</div>
<img src="../../assets/img/asset_dummy_item2.png">
<h4>PM 237</h4>
<p>Lorem ipsum</p>
<div class="rating">3.0</div>
<hr>
</li>
<li (click)="goToPage('productbooking')">
<div class="badge on_offer">On Offer</div>
<img src="../../assets/img/asset_dummy_item3.png">
<h4>PM 237</h4>
<p>Lorem ipsum</p>
<div class="rating">3.7</div>
<hr>
</li>
<li (click)="goToPage('productbooking')">
<img src="../../assets/img/asset_dummy_item1.png">
<h4>PM 237</h4>
<p>Lorem ipsum</p>
<div class="rating">2.8</div>
<hr>
</li>
<li (click)="goToPage('productbooking')">
<img src="../../assets/img/asset_dummy_item2.png">
<h4>PM 237</h4>
<p>Lorem ipsum</p>
<div class="rating">3.5</div>
<h4>{{products.unique_name}}</h4>
<!-- <p>Lorem ipsum</p> -->
<div class="rating">{{products.rating}}</div>
<hr>
</li>
</ul>
......
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 { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-purchaseparts',
......@@ -9,29 +12,81 @@ import { Router,ActivatedRoute } from '@angular/router';
styleUrls: ['./purchaseparts.page.scss'],
})
export class PurchasepartsPage implements OnInit {
peopleMostpurchasedList = [];
searchProduct: any;
productsList = [];
slideOpts = {
initialSlide: 1,
speed: 400,
slidesPerView:3
slidesPerView: 3
};
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private validationService: ValidationService,
private authenticationservice: AuthenticationService,
private storageservice: StorageService
) {
this.getAllproductsList();
this.getpeopleMostpurchasedList();
this.searchProduct = '';
}
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();
}
getpeopleMostpurchasedList() {
// this.validationService.presentLoader();
this.authenticationservice.get_data('get_mostpurchased').subscribe((data) => {
console.log(data);
// this.validationService.dismissLoader();
if ( data.status === 'success') {
this.peopleMostpurchasedList = data.data;
}
});
}
getAllproductsList() {
// this.validationService.presentLoader();
this.authenticationservice.get_data('all_productList').subscribe((data) => {
// this.validationService.dismissLoader();
if (data.status === 'success') {
this.productsList = data.data;
} else {
this.validationService.presentToast(data.message);
}
});
}
purchaseProduct(id) {
console.log(id);
this.goToPage('/productbooking/' + encodeURIComponent(JSON.stringify(id)));
}
searchAProduct() {
console.log(this.searchProduct);
if (this.searchProduct.length > 3) {
// this.validationService.presentLoader();
const passData = {product_keyword: this.searchProduct };
this.authenticationservice.post_data('search_product', passData ).subscribe((data) => {
console.log(data);
// this.validationService.dismissLoader();
if (data.status === 'success') {
this.productsList = data.data;
} else {
this.validationService.presentToast('Sorry, no matching product find');
this.productsList = null;
this.getAllproductsList();
}
});
} else if (this.searchProduct.length === 0) {
this.getAllproductsList();
}
}
}
......@@ -32,7 +32,7 @@
<h6>{{serviceDetails}}</h6>
</ion-col>
<ion-col>
<button class="next_btn floatRight" (click)="movetoDate()">Next</button>
<button class="next_btn floatRight" (click)="movetoDate()">NEXT</button>
<div class="clear"></div>
</ion-col>
</ion-row>
......
......@@ -29,8 +29,8 @@ export class SelectservicesPage implements OnInit {
}
ngOnInit() {
this.getData = JSON.parse(this.route.snapshot.paramMap.get('id'));
console.log(this.getData);
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.getData = JSON.parse(Data);
this.getSubserviceList();
}
......@@ -64,7 +64,7 @@ export class SelectservicesPage implements OnInit {
console.log(this.serviceDetails);
}
movetoDate() {
const passData = {sub_id: this.serviceDetails.id , sub_name: this.selectedService.sub_services, main_name: this.getData.service_name};
this.goToPage('/date/' + JSON.stringify(passData));
const passData = {sub_id: this.selectedService.id , sub_name: this.selectedService.sub_services, main_name: this.getData.service_name};
this.goToPage('/date/' + encodeURIComponent(JSON.stringify(passData)));
}
}
......@@ -32,7 +32,7 @@ export class StartPage implements OnInit {
}
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data});
this.router.navigateByUrl(path, {queryParams: data, replaceUrl: true});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
......
......@@ -11,21 +11,26 @@
<ion-content>
<div class="summary_wrapper">
<div class="content_detail">
<h4>Service Details</h4>
<div class="content_inner">
<h4>Category</h4>
<div class="content_inner" *ngIf="getData">
<ul>
<li>
<img src="../../assets/img/asset_menu6.png">
<span>Clutch & Transmissions</span>
<div class="clear"></div>
</li>
<li>
<img src="../../assets/img/asset_menu10.png">
<span>Exterior and Interior</span>
<span>{{getData.main_name}}</span>
<div class="clear"></div>
</li>
</ul>
</div>
<h4>Service Details</h4>
<div class="content_inner" *ngIf="getData">
<ul>
<li>
<img src="../../assets/img/asset_menu6.png">
<span>{{getData.sub_name}}</span>
<div class="clear"></div>
</li>
</ul>
</div>
<h4>Car Details</h4>
<div class="content_inner">
<ul>
......@@ -56,20 +61,14 @@
</ul>
</div>
<h4>Date & Time</h4>
<div class="content_inner">
<div class="content_inner" *ngIf="getData">
<ul>
<li>
<ion-row>
<ion-col><p>Date :</p></ion-col>
<ion-col>June 25 th 2019</ion-col>
<ion-col>{{getData.date}}</ion-col>
</ion-row>
</li>
<li>
<ion-row>
<ion-col><p>Time:</p></ion-col>
<ion-col>10:30 pm to 11:00pm</ion-col>
</ion-row>
</li>
</ul>
</div>
<h4>Your Message</h4>
......@@ -77,13 +76,7 @@
<ul>
<li>
<ion-row>
<ion-col>Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum</ion-col>
<ion-col>{{getData.message}}</ion-col>
</ion-row>
</li>
</ul>
......@@ -93,7 +86,7 @@
<div class="select_footer">
<ion-row>
<ion-col class="textCenter">
<button class="request_btn" (click)="goToPage('date')">Send Request<img src="../../assets/img/asset_send_request.png"></button>
<button class="request_btn" (click)="ConfirmbookService()">Send Request<img src="../../assets/img/asset_send_request.png"></button>
<div class="clear"></div>
</ion-col>
</ion-row>
......
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 { ValidationService} from '../../Config/services/validation.service';
import {StorageService } from '../../Config/services/storage.service';
@Component({
selector: 'app-summary',
templateUrl: './summary.page.html',
styleUrls: ['./summary.page.scss'],
})
export class SummaryPage implements OnInit {
getData: any;
userData: any;
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location
) { }
private location: Location,
private validationService: ValidationService,
private authenticationService: AuthenticationService,
private storageservice: StorageService
) {
const Data = decodeURIComponent((this.route.snapshot.paramMap.get('id')));
this.getData = JSON.parse(Data);
console.log(this.getData);
}
ngOnInit() {
this.getDatafromStorage();
}
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();
}
getDatafromStorage() {
this.userData = JSON.parse(this.storageservice.getLocalStorageItem('userData')) ;
}
ConfirmbookService() {
this.validationService.presentLoader();
// tslint:disable-next-line: max-line-length
const passData = {user_id: this.userData.id , subservice_id: this.getData.id, booking_date: this.getData.date, car_id: this.getData.car_id, message: this.getData.message};
this.authenticationService.post_data('user_requestService' , passData).subscribe((data) => {
console.log(data);
this.validationService.dismissLoader();
if ( data.status === 'success') {
this.goToPage('waiting1');
} else {
this.validationService.presentToast('Failed to send request,try again after sometime!');
}
});
}
}
......@@ -6,7 +6,7 @@
<h4>Relax</h4>
<h3>We got your request</h3>
<p>We will update you within 10 to 20 minutes.</p>
<button class="back_btn1">Home</button><br>
<button class="back_btn1" (click)="goToPage('home')">Home</button><br>
<button class="home">Service History</button>
</div>
</ion-content>
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';
@Component({
selector: 'app-waiting1',
templateUrl: './waiting1.page.html',
......@@ -7,9 +9,16 @@ import { Component, OnInit } from '@angular/core';
})
export class Waiting1Page implements OnInit {
constructor() { }
constructor(
private router: Router,
private route: ActivatedRoute,
private location: Location,
) { }
ngOnInit() {
}
goToPage(path, data= null) {
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}
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