Commit 468e6757 by muhsin

conflict

parents f6b936e8 a9bd8295
...@@ -11655,8 +11655,7 @@ ...@@ -11655,8 +11655,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -11699,8 +11698,7 @@ ...@@ -11699,8 +11698,7 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
...@@ -11711,8 +11709,7 @@ ...@@ -11711,8 +11709,7 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -11829,8 +11826,7 @@ ...@@ -11829,8 +11826,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -11842,7 +11838,6 @@ ...@@ -11842,7 +11838,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -11872,7 +11867,6 @@ ...@@ -11872,7 +11867,6 @@
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -11891,7 +11885,6 @@ ...@@ -11891,7 +11885,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -11985,7 +11978,6 @@ ...@@ -11985,7 +11978,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -12071,8 +12063,7 @@ ...@@ -12071,8 +12063,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -12108,7 +12099,6 @@ ...@@ -12108,7 +12099,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -12128,7 +12118,6 @@ ...@@ -12128,7 +12118,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -12172,14 +12161,12 @@ ...@@ -12172,14 +12161,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
...@@ -12702,7 +12689,6 @@ ...@@ -12702,7 +12689,6 @@
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -12721,7 +12707,6 @@ ...@@ -12721,7 +12707,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -12901,8 +12886,7 @@ ...@@ -12901,8 +12886,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -13008,8 +12992,7 @@ ...@@ -13008,8 +12992,7 @@
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { AddressPage } from './address.page';
const routes: Routes = [
{
path: '',
component: AddressPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [AddressPage]
})
export class AddressPageModule {}
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png">
</button>
<div class="nav_title floatLeft">
<h4>Address</h4>
</div>
<div class="clear"></div>
</div>
<ion-content>
<div class="address-wrapper">
<ion-grid>
<ion-row>
<ion-col size="1">
<input type="radio" class="address-radio" name="address" checked>
</ion-col>
<ion-col size="9">
<h1>Shamjith KS</h1>
<h1>+00 0000 888 888</h1>
<p>Carnival Infopark, Infopark Kochi 682030, Kerala, India</p>
</ion-col>
<ion-col size="2"><button class="show-btn"><img src="../../assets/delete.png"></button></ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row>
<ion-col size="1">
<input type="radio" class="address-radio" name="address">
</ion-col>
<ion-col size="9">
<h1>Shamjith KS</h1>
<h1>+00 0000 888 888</h1>
<p>Carnival Infopark, Infopark Kochi 682030, Kerala, India</p>
</ion-col>
<ion-col size="2"><button><img src="../../assets/delete.png"></button></ion-col>
</ion-row>
</ion-grid>
<div class="address-btn-wrapper"><button class="show-btn">Add New Address</button></div>
</div>
</ion-content>
\ No newline at end of file
.address-wrapper {
padding: 15px;
.address-radio {
background-image: url("../../assets/radio.png");
-webkit-appearance: none;
background-repeat: no-repeat;
background-position: center;
background-size: 25px;
height: auto;
padding: 15px;
border-radius: 5px;
outline: none;
transition: all .6s ease-in-out;
}
.address-radio:checked {
background-image: url("../../assets/radio-checked.png");
}
.address-radio:checked+.show-btn {
opacity: 1;
}
h1 {
font-size: 18px;
margin-top: 6px;
padding-left: 10px;
}
p {
margin-top: 20px;
padding-left: 10px;
color: #B0AEC7;
}
button {
background: none;
outline: none;
}
img {
width: 35px;
}
}
.address-btn-wrapper {
padding: 15px;
position: absolute;
bottom: 50px;
left: 0;
right: 0;
button {
width: 100%;
background-color: #29285b;
color: #fff;
border-radius: 8px;
height: 45px;
font-size: 16px;
text-transform: uppercase;
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AddressPage } from './address.page';
describe('AddressPage', () => {
let component: AddressPage;
let fixture: ComponentFixture<AddressPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddressPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AddressPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-address',
templateUrl: './address.page.html',
styleUrls: ['./address.page.scss'],
})
export class AddressPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: '',
loadChildren: './landing/landing.module#LandingPageModule'
},
{ path: 'tabs', loadChildren: './tabs/tabs.module#TabsPageModule' },
{ path: 'login', loadChildren: './login/login.module#LoginPageModule' },
{ path: 'signup', loadChildren: './signup/signup.module#SignupPageModule' },
{
path: 'verification',
loadChildren: './verification/verification.module#VerificationPageModule'
},
{ path: 'forgot', loadChildren: './forgot/forgot.module#ForgotPageModule' },
{
path: 'changepass',
loadChildren: './changepass/changepass.module#ChangepassPageModule'
},
{
path: 'orderdelivered',
loadChildren:
'./orderdelivered/orderdelivered.module#OrderdeliveredPageModule'
},
{
path: 'orderplaced',
loadChildren: './orderplaced/orderplaced.module#OrderplacedPageModule'
},
{
path: 'ordercancelled',
loadChildren:
'./ordercancelled/ordercancelled.module#OrdercancelledPageModule'
},
{
path: 'myorder',
loadChildren: './myorder/myorder.module#MyorderPageModule'
},
{ path: 'cart', loadChildren: './cart/cart.module#CartPageModule' },
{
path: 'changedetails',
loadChildren: './changedetails/changedetails.module#ChangedetailsPageModule'
},
{
path: 'wishlist',
loadChildren: './wishlist/wishlist.module#WishlistPageModule'
},
{
path: 'addaddresss',
loadChildren: './addaddresss/addaddresss.module#AddaddresssPageModule'
},
{
path: 'profile',
loadChildren: './profile/profile.module#ProfilePageModule'
},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{
path: 'productlist',
loadChildren: './productlist/productlist.module#ProductlistPageModule'
},
{
path: 'productdetail',
loadChildren: './productdetail/productdetail.module#ProductdetailPageModule'
},
{
path: 'reviewlist',
loadChildren: './reviewlist/reviewlist.module#ReviewlistPageModule'
},
{
path: 'catagory',
loadChildren: './catagory/catagory.module#CatagoryPageModule'
},
{
path: 'trackorder',
loadChildren: './trackorder/trackorder.module#TrackorderPageModule'
},
{
path: 'storelist',
loadChildren: './storelist/storelist.module#StorelistPageModule'
},
{
path: 'catstorelist',
loadChildren: './catstorelist/catstorelist.module#CatStorelistPageModule'
},
{ path: 'nearby', loadChildren: './nearby/nearby.module#NearbyPageModule' },
{ path: 'review', loadChildren: './review/review.module#ReviewPageModule' },
{
path: 'delivery',
loadChildren: './delivery/delivery.module#DeliveryPageModule'
},
{
path: 'addcard',
loadChildren: './addcard/addcard.module#AddcardPageModule'
},
{
path: 'searchmodal',
loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule'
}, { path: 'noresult', loadChildren: './noresult/noresult.module#NoresultPageModule' },
{ path: 'feedback', loadChildren: './feedback/feedback.module#FeedbackPageModule' },
{ path: 'address', loadChildren: './address/address.module#AddressPageModule' }
const routes: Routes = [ ];
{ @NgModule({
path: '', imports: [
loadChildren: './landing/landing.module#LandingPageModule' RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
}, ],
{ path: 'tabs', loadChildren: './tabs/tabs.module#TabsPageModule' }, exports: [RouterModule]
{ path: 'login', loadChildren: './login/login.module#LoginPageModule' }, })
{ path: 'signup', loadChildren: './signup/signup.module#SignupPageModule' }, export class AppRoutingModule {}
{
path: 'verification',
loadChildren: './verification/verification.module#VerificationPageModule'
},
{ path: 'forgot', loadChildren: './forgot/forgot.module#ForgotPageModule' },
{
path: 'changepass',
loadChildren: './changepass/changepass.module#ChangepassPageModule'
},
{
path: 'orderdelivered',
loadChildren:
'./orderdelivered/orderdelivered.module#OrderdeliveredPageModule'
},
{
path: 'orderplaced',
loadChildren: './orderplaced/orderplaced.module#OrderplacedPageModule'
},
{
path: 'ordercancelled',
loadChildren:
'./ordercancelled/ordercancelled.module#OrdercancelledPageModule'
},
{
path: 'myorder',
loadChildren: './myorder/myorder.module#MyorderPageModule'
},
{ path: 'cart', loadChildren: './cart/cart.module#CartPageModule' },
{
path: 'changedetails',
loadChildren: './changedetails/changedetails.module#ChangedetailsPageModule'
},
{
path: 'wishlist',
loadChildren: './wishlist/wishlist.module#WishlistPageModule'
},
{
path: 'addaddresss',
loadChildren: './addaddresss/addaddresss.module#AddaddresssPageModule'
},
{
path: 'profile',
loadChildren: './profile/profile.module#ProfilePageModule'
},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{
path: 'productlist',
loadChildren: './productlist/productlist.module#ProductlistPageModule'
},
{
path: 'productdetail',
loadChildren: './productdetail/productdetail.module#ProductdetailPageModule'
},
{
path: 'reviewlist',
loadChildren: './reviewlist/reviewlist.module#ReviewlistPageModule'
},
{
path: 'catagory',
loadChildren: './catagory/catagory.module#CatagoryPageModule'
},
{
path: 'trackorder',
loadChildren: './trackorder/trackorder.module#TrackorderPageModule'
},
{
path: 'storelist',
loadChildren: './storelist/storelist.module#StorelistPageModule'
},
{
path: 'catstorelist',
loadChildren: './catstorelist/catstorelist.module#CatStorelistPageModule'
},
{ path: 'nearby', loadChildren: './nearby/nearby.module#NearbyPageModule' },
{ path: 'review', loadChildren: './review/review.module#ReviewPageModule' },
{
path: 'delivery',
loadChildren: './delivery/delivery.module#DeliveryPageModule'
},
{
path: 'addcard',
loadChildren: './addcard/addcard.module#AddcardPageModule'
},
{
path: 'searchmodal',
loadChildren: './searchmodal/searchmodal.module#SearchmodalPageModule'
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
} }
.side_menu_wrapper { .side_menu_wrapper {
<<<<<<< HEAD
background: rgba(41, 40, 91, 1); background: rgba(41, 40, 91, 1);
width: 100%; width: 100%;
height: 100vh; height: 100vh;
...@@ -43,6 +44,46 @@ ...@@ -43,6 +44,46 @@
color: #fff; color: #fff;
color: rgba(176, 174, 199, 1); color: rgba(176, 174, 199, 1);
} }
=======
background: rgba(41, 40, 91, 1);
width: 100%;
height: 100vh;
padding-left: 20px;
padding-top: 20px;
padding-right: 10px;
.top_banner {
.top_image {
width: 60px;
height: 60px;
float: left;
border-radius: 50%;
background-color: #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
border-radius: 50%;
}
}
.top_detail {
width: calc(100% - 60px);
float: left;
padding: 7px;
padding-left: 15px;
h4 {
margin: 0px;
padding: 0px;
color: #fff;
}
p {
margin: 0px;
padding: 0px;
color: #fff;
color: rgba(176, 174, 199, 1);
}
}
>>>>>>> a9bd8295df980b5b3661ca885b051970c7f081fc
} }
} }
.sidemenu_list { .sidemenu_list {
......
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { FeedbackPage } from './feedback.page';
const routes: Routes = [
{
path: '',
component: FeedbackPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [FeedbackPage]
})
export class FeedbackPageModule {}
<div class="nav_header">
<button class="nav_btn nav_back floatLeft" (click)="goBack()">
<img src="../assets/Group17_2.png">
</button>
<div class="nav_title floatLeft">
<h4>Complaints & Feedback</h4>
</div>
<div class="clear"></div>
</div>
<ion-content>
<div class="feedback_wrapper">
<div class="form_div">
<div class="row">
<p>From</p>
<input class="form-control" type="text" placeholder="[email protected]">
</div>
<div class="row">
<p>To</p>
<input class="form-control" type="text" placeholder="[email protected]">
</div>
<div class="row">
<p>Comments</p>
<textarea class="form-control" rows="8" placeholder="Type here.."></textarea>
</div>
<div class="row">
<button class="login_btn">SENT</button>
</div>
</div>
</div>
</ion-content>
\ No newline at end of file
.feedback_wrapper {
width: 80%;
margin: 0 auto;
padding-top: 30px;
.form_div {
.row {
margin-bottom: 20px;
.form-control {
border: 1px solid rgba(215, 213, 228, 1);
background: transparent;
color: #333;
width: 100%;
border-radius: 8px;
font-size: 16px;
padding: 11px 15px;
resize: none;
&::placeholder {
color: rgba(215, 213, 228, 1);
}
}
.login_btn {
width: 100%;
background-color: #29285b;
color: #fff;
border-radius: 8px;
height: 45px;
font-size: 16px;
margin-bottom: 50px;
}
P {
text-align: left;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bolder;
padding-bottom: 10px;
}
}
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FeedbackPage } from './feedback.page';
describe('FeedbackPage', () => {
let component: FeedbackPage;
let fixture: ComponentFixture<FeedbackPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FeedbackPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FeedbackPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-feedback',
templateUrl: './feedback.page.html',
styleUrls: ['./feedback.page.scss'],
})
export class FeedbackPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
...@@ -276,6 +276,7 @@ ...@@ -276,6 +276,7 @@
padding: 0px; padding: 0px;
font-weight: 800; font-weight: 800;
} }
<<<<<<< HEAD
ul { ul {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
...@@ -289,6 +290,25 @@ ...@@ -289,6 +290,25 @@
color: rgba(176, 174, 199, 1); color: rgba(176, 174, 199, 1);
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
=======
.add_address_wrapper {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
padding: 20px 20px 50px 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
background: #fff;
-webkit-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0px -2px 5px 0px rgba(0, 0, 0, 0.2);
h5 {
color: rgba(41, 40, 91, 1);
margin: 0px;
padding: 0px;
font-weight: 800;
>>>>>>> a9bd8295df980b5b3661ca885b051970c7f081fc
} }
.styled-checkbox { .styled-checkbox {
position: absolute; // take it out of document flow position: absolute; // take it out of document flow
......
import { Component, OnInit, ViewChild, } from '@angular/core'; import { Component, OnInit, ViewChild } from "@angular/core";
import { IonSlides } from '@ionic/angular'; import { IonSlides } from "@ionic/angular";
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from "@angular/router";
import { ServiceService } from './../../config/service.service'; import { ServiceService } from "./../../config/service.service";
import { SubjectService } from './../../config/subject.service'; import { SubjectService } from "./../../config/subject.service";
@Component({ @Component({
selector: 'app-landing', selector: "app-landing",
templateUrl: './landing.page.html', templateUrl: "./landing.page.html",
styleUrls: ['./landing.page.scss'], styleUrls: ["./landing.page.scss"]
}) })
export class LandingPage implements OnInit { export class LandingPage implements OnInit {
constructor( constructor(
...@@ -15,21 +15,21 @@ export class LandingPage implements OnInit { ...@@ -15,21 +15,21 @@ export class LandingPage implements OnInit {
private route: ActivatedRoute, private route: ActivatedRoute,
private service: ServiceService, private service: ServiceService,
public subjectService: SubjectService public subjectService: SubjectService
) { ) {
this.service.get('landing').then((data) => { this.service.get("landing").then(data => {
if (data === true) { if (data === true) {
const user = JSON.parse(localStorage.getItem('user')); const user = JSON.parse(localStorage.getItem("user"));
console.log(user); console.log(user);
if (user) { if (user) {
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.goToPage('home'); this.goToPage("home");
} else { } else {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.goToPage('login'); this.goToPage("login");
}
} }
}); }
} });
}
slideOpts = { slideOpts = {
initialSlide: 0, initialSlide: 0,
...@@ -37,7 +37,7 @@ export class LandingPage implements OnInit { ...@@ -37,7 +37,7 @@ export class LandingPage implements OnInit {
allowTouchMove: false allowTouchMove: false
}; };
@ViewChild(IonSlides, { static: false })slides: IonSlides; @ViewChild(IonSlides, { static: false }) slides: IonSlides;
currentIndex: any; currentIndex: any;
landingOptions = { landingOptions = {
...@@ -46,16 +46,14 @@ export class LandingPage implements OnInit { ...@@ -46,16 +46,14 @@ export class LandingPage implements OnInit {
allowTouchMove: false allowTouchMove: false
}; };
ngOnInit() { ngOnInit() {}
}
goToPage(path, data = null) { goToPage(path, data = null) {
this.service.set('landing', true); this.service.set("landing", true);
this.router.navigateByUrl(path, { queryParams: data }); this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
next() { next() {
this.slides.slideNext(); this.slides.slideNext();
} }
...@@ -68,8 +66,6 @@ export class LandingPage implements OnInit { ...@@ -68,8 +66,6 @@ export class LandingPage implements OnInit {
this.slides.getActiveIndex().then(index => { this.slides.getActiveIndex().then(index => {
this.currentIndex = index; this.currentIndex = index;
console.log(this.currentIndex); console.log(this.currentIndex);
}); });
} }
} }
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { NoresultPage } from './noresult.page';
const routes: Routes = [
{
path: '',
component: NoresultPage
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [NoresultPage]
})
export class NoresultPageModule {}
<div class="nav_header">
<ion-menu-toggle>
<button class="nav_btn nav_menu floatLeft">
</button>
</ion-menu-toggle>
<div class="nav_title floatLeft">
<h4>Shirts</h4>
</div>
<button class="nav_btn nav_search floatRight" *ngIf="!searchShow">
</button>
<div class="clear"></div>
</div>
<ion-content>
<div class="no-result-wrapper">
<img src="../../assets/basket.png">
<h1>No result found</h1>
<button>home</button>
</div>
</ion-content>
\ No newline at end of file
.no-result-wrapper {
text-align: center;
padding-top: 40%;
img {
width: 100px;
}
h1 {
font-size: 18px;
font-weight: bolder;
text-transform: uppercase;
color: #3B394D;
}
button {
background-color: #29285b;
border-radius: 8px;
height: 50px;
width: 48%;
color: #fff;
font-size: 18px;
font-weight: lighter;
text-transform: uppercase;
margin-top: 10px;
}
}
\ No newline at end of file
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NoresultPage } from './noresult.page';
describe('NoresultPage', () => {
let component: NoresultPage;
let fixture: ComponentFixture<NoresultPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NoresultPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(NoresultPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-noresult',
templateUrl: './noresult.page.html',
styleUrls: ['./noresult.page.scss'],
})
export class NoresultPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
<div class="nav_header"> <div class="nav_header">
<ion-menu-toggle> <ion-menu-toggle>
<button class="nav_btn nav_menu floatLeft"></button> <button class="nav_btn nav_menu floatLeft"></button>
</ion-menu-toggle> </ion-menu-toggle>
<div class="nav_title floatLeft"> <div class="nav_title floatLeft">
<img src="../../assets/Group [email protected]" /> <img src="../../assets/Group [email protected]" />
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<ion-content> <ion-content>
<div class="profile_wrapper" *ngIf="loggedUser"> <div class="profile_wrapper" *ngIf="loggedUser">
<div class="profile_banner"> <div class="profile_banner">
<!-- <div class="profile_circle"> <!-- <div class="profile_circle">
<div class="edit"></div> <div class="edit"></div>
</div> --> </div> -->
<div class="profile_circle"> <div class="profile_circle">
<img <img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" />
[src]="loggedUser.profilePhoto" <div class="edit"></div>
onerror="this.src='./../../assets/profile_banner.png'" <input type="file" accept="image/*" (change)="fileChange($event)" />
/> </div>
<div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" />
</div>
<h5>{{loggedUser.name}}</h5> <h5>{{loggedUser.name}}</h5>
<p (click)="authService.SignOut()">LOGOUT</p> <p (click)="istoggle()">LOGOUT</p>
</div>
<div class="account_wrapper">
<div class="account_header">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img
src="../../assets/edit.png" /></span>
<div class="clear"></div>
</div>
<div class="row">
<ion-row>
<ion-col class="textLeft p0">
<p>
Phone
<span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<span *ngIf="loggedUser.phoneVerified == false">Not Verified yet</span>
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.phone}}</h6>
</ion-col>
</ion-row>
</div>
<div class="row">
<ion-row>
<ion-col class="textLeft p0">
<p>
Email<span *ngIf="userData && userData.emailVerified == true">Verified</span>
<span *ngIf="loggedUser.emailVerified == false">Not Verified yet</span>
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6>
</ion-col>
</ion-row>
</div>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Wishlist</p>
</ion-col>
<ion-col class="textRight p0">
<h6>(3)</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Address</p>
</ion-col>
<ion-col class="textRight p0">
<h6>(1)</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>My Cards</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>My Order</p>
</ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Currency</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<span>AUD</span>
</h6>
</ion-col>
</ion-row>
</div>
</div> </div>
<div class="account_wrapper"> <div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="account_header"> <div class="logout_inner">
<h5 class="floatLeft">ACCOUNT INFORMATION</h5> <h4>Logout</h4>
<span <p>Are you sure to Logout ?</p>
class="floatRight" <div class="logout_footer">
(click)="goToPage('changedetails', user && user)"
><img src="../../assets/edit.png" <button class="btn-cancel floatLeft" (click)="istoggle();">Cancel</button>
/></span> <button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">Logout</button>
<div class="clear"></div>
</div>
<div class="row"> <div class="clear"></div>
<ion-row> </div>
<ion-col class="textLeft p0"> </div>
<p>
Phone
<span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<span *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.phone}}</h6>
</ion-col>
</ion-row>
</div>
<div class="row">
<ion-row>
<ion-col class="textLeft p0">
<p>
Email<span *ngIf="userData && userData.emailVerified == true"
>Verified</span
>
<span *ngIf="loggedUser.emailVerified == false"
>Not Verified yet</span
>
</p>
</ion-col>
<ion-col class="textRight p0">
<h6>{{loggedUser.emailId}}</h6>
</ion-col>
</ion-row>
</div>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Wishlist</p>
</ion-col>
<ion-col class="textRight p0">
<h6>(3)</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Address</p>
</ion-col>
<ion-col class="textRight p0">
<h6>(1)</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>My Cards</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>My Order</p>
</ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-col class="textLeft p0">
<p>Currency</p>
</ion-col>
<ion-col class="textRight p0">
<h6>
<span>AUD</span>
</h6>
</ion-col>
</ion-row>
</div> </div>
</div> </ion-content>
</ion-content> \ No newline at end of file
.profile_wrapper { .profile_wrapper {
.profile_banner { .profile_banner {
width: 100%; width: 100%;
background-image: url('../../assets/profile_banner.png'); background-image: url('../../assets/profile_banner.png');
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
text-align: center; text-align: center;
padding-top: 40px; padding-top: 40px;
.profile_circle { .profile_circle {
width: 100px; width: 100px;
height: 100px; height: 100px;
background-color: #fff; background-color: #fff;
border-radius: 50%; border-radius: 50%;
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
object-position: center; object-position: center;
border-radius: 50%; border-radius: 50%;
} }
input { input {
width: 80px; width: 80px;
height: 100%; height: 100%;
opacity: 0; opacity: 0;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
} }
.edit { .edit {
width: 30px; width: 30px;
height: 30px; height: 30px;
border-radius: 50%; border-radius: 50%;
object-fit: cover; object-fit: cover;
object-position: center; object-position: center;
background-color: #000; background-color: #000;
background-image: url('../../assets/edit_icon.png'); background-image: url('../../assets/edit_icon.png');
background-size: cover; background-size: cover;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0px; right: 0px;
} }
} }
h5 { h5 {
text-align: center; text-align: center;
color: #fff; color: #fff;
margin: 0px; margin: 0px;
padding-top: 15px; padding-top: 15px;
font-weight: 600; font-weight: 600;
padding-bottom: 5px; padding-bottom: 5px;
} }
p { p {
color: rgba(206, 153, 76, 1); color: rgba(206, 153, 76, 1);
text-align: center; text-align: center;
margin: 0px; margin: 0px;
padding-bottom: 20px; padding-bottom: 20px;
font-weight: 700; font-weight: 700;
} }
} }
.account_wrapper { .account_wrapper {
width: calc(100% - 40px); width: calc(100% - 40px);
margin: 0 auto; margin: 0 auto;
padding-top: 20px; padding-top: 20px;
padding-bottom: 100px; padding-bottom: 100px;
.account_header { .account_header {
padding-bottom: 15px; padding-bottom: 15px;
h5 { h5 {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(59, 57, 77, 1); color: rgba(59, 57, 77, 1);
font-weight: 900; font-weight: 900;
} }
span { span {
color: rgba(59, 57, 77, 1); color: rgba(59, 57, 77, 1);
img { img {
width: 20px; width: 20px;
} }
} }
} }
p { p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(176, 174, 199, 1); color: rgba(176, 174, 199, 1);
font-size: 18px; font-size: 18px;
span { span {
color: rgba(206, 153, 76, 1); color: rgba(206, 153, 76, 1);
margin-left: 10px; margin-left: 10px;
} }
} }
h6 { h6 {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: rgba(59, 57, 77, 1); color: rgba(59, 57, 77, 1);
font-size: 18px; font-size: 18px;
ion-icon { ion-icon {
color: rgba(176, 174, 199, 1); color: rgba(176, 174, 199, 1);
} }
} }
.row { .row {
padding-bottom: 20px; padding-bottom: 20px;
} }
hr { hr {
border-bottom: 1px solid rgba(176, 174, 199, 0.5); border-bottom: 1px solid rgba(176, 174, 199, 0.5);
height: 0px; height: 0px;
border-top: none; border-top: none;
margin-top: 15px; margin-top: 15px;
margin-bottom: 15px; margin-bottom: 15px;
} }
} }
} .logout-pop-wrapper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.logout_inner {
margin: 0 auto;
width: 280px;
padding: 10px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: #fff;
position: relative;
-webkit-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
top: 50%;
border-radius: 10px;
h4 {
text-align: center;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bold;
padding: 10px;
font-size: 18px;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-bottom: 20px;
}
p {
text-align: center;
}
.logout_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
text-transform: uppercase;
}
.btn-cancel {
border: 1px solid #29285B;
background-color: #29285B;
}
.btn-logout {
background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.16);
color: #000;
}
}
}
}
}
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from "@angular/core";
import { User } from '../../config/services/user'; import { User } from "../../config/services/user";
import { UserService } from '../../config/user.service'; import { UserService } from "../../config/user.service";
import { ServiceService } from '../../config/service.service'; import { ServiceService } from "../../config/service.service";
import { AuthService } from '../../config/auth.service'; import { AuthService } from "../../config/auth.service";
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from "@angular/router";
import { finalize, tap } from 'rxjs/operators'; import { finalize, tap } from "rxjs/operators";
import { import {
AngularFireStorage, AngularFireStorage,
AngularFireStorageReference, AngularFireStorageReference,
AngularFireUploadTask AngularFireUploadTask
} from '@angular/fire/storage'; } from "@angular/fire/storage";
import { import { trigger, transition, animate, style } from "@angular/animations";
AngularFirestore,
AngularFirestoreDocument,
AngularFirestoreCollection
} from '@angular/fire/firestore';
@Component({ @Component({
selector: 'app-profile', selector: "app-profile",
templateUrl: './profile.page.html', templateUrl: "./profile.page.html",
styleUrls: ['./profile.page.scss'] styleUrls: ["./profile.page.scss"],
animations: [
trigger("slideInOut", [
transition(":enter", [
style({ transform: "translateY(100%)" }),
animate("200ms ease-in", style({ transform: "translateY(0%)" }))
]),
transition(":leave", [
animate("200ms ease-out", style({ transform: "translateY(100%)" }))
])
])
]
}) })
export class ProfilePage implements OnInit { export class ProfilePage implements OnInit {
user: User; user: User;
userdata: any; userdata: any;
custId: string; custId: string;
isShow = false;
userData: any; userData: any;
loggedUser: any; loggedUser: any;
ref: AngularFireStorageReference; ref: AngularFireStorageReference;
...@@ -37,14 +45,14 @@ export class ProfilePage implements OnInit { ...@@ -37,14 +45,14 @@ export class ProfilePage implements OnInit {
private service: ServiceService, private service: ServiceService,
private authService: AuthService private authService: AuthService
) { ) {
this.service.get('user').then(data => { this.service.get("user").then(data => {
if (data) { if (data) {
this.userData = JSON.parse(data); this.userData = JSON.parse(data);
console.log(this.userData); console.log(this.userData);
} }
}); });
this.service.get('userData').then(data => { this.service.get("userData").then(data => {
if (data) { if (data) {
this.loggedUser = JSON.parse(data); this.loggedUser = JSON.parse(data);
} }
...@@ -61,10 +69,14 @@ export class ProfilePage implements OnInit { ...@@ -61,10 +69,14 @@ export class ProfilePage implements OnInit {
setTimeout(() => { setTimeout(() => {
this.user = this.useService.users; this.user = this.useService.users;
// console.log('[users]', this.user); // console.log('[users]', this.user);
this.service.set('params', this.user); this.service.set("params", this.user);
}, 500); }, 500);
} }
istoggle() {
this.isShow = !this.isShow;
}
async fileChange(event) { async fileChange(event) {
const fileList: FileList = event.target.files; const fileList: FileList = event.target.files;
if (fileList.length > 0) { if (fileList.length > 0) {
...@@ -80,8 +92,8 @@ export class ProfilePage implements OnInit { ...@@ -80,8 +92,8 @@ export class ProfilePage implements OnInit {
reader.readAsDataURL(event.target.files[0]); reader.readAsDataURL(event.target.files[0]);
const file = fileList[0]; const file = fileList[0];
const ext = file.name.split('.').pop(); const ext = file.name.split(".").pop();
if (ext === 'jpg' || ext === 'jpeg' || ext === 'png') { if (ext === "jpg" || ext === "jpeg" || ext === "png") {
const path = file.name; // + Date.now(); const path = file.name; // + Date.now();
const ref = this.storage.ref(path); const ref = this.storage.ref(path);
const task = this.storage const task = this.storage
......
<ion-header> <div class="nav_header">
<ion-toolbar> <button class="nav_btn nav_back floatLeft" (click)="goBack()">
<ion-title>wishlist</ion-title> <img src="../assets/Group17_2.png">
</ion-toolbar> </button>
</ion-header> <div class="nav_title floatLeft">
<h4>WISHLIST</h4>
</div>
<div class="clear"></div>
</div>
<ion-content> <ion-content>
</ion-content> <div class="wishlist-wrapper">
<ul>
<li>
<div class="wishlist_image">
<img src="../../assets/img-list.png">
</div>
<div class="wishlist_detail">
<p class="floatLeft">European Style V Neck</p>
<span class="floatRight"><img src="../../assets/heart.png"></span>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
<li>
<div class="wishlist_image">
<img src="../../assets/img-list.png">
</div>
<div class="wishlist_detail">
<p class="floatLeft">European Style V Neck</p>
<span class="floatRight"><img src="../../assets/heart.png"></span>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
</ul>
</div>
<div class="empty-wishlist-wrapper">
<img src="../../assets/wishlist.png">
<h1>There is no products added</h1>
<button>shop now</button>
</div>
<div class="footer-btns-wrapper">
<button class="btn-clear">Clear All</button>
<button class="btn-cart">add all to cart</button>
</div>
</ion-content>
\ No newline at end of file
.wishlist-wrapper {
padding: 20px 0 50px 0;
ul {
margin: 0px;
padding-left: 10px;
padding-right: 10px;
li {
list-style: none;
padding-bottom: 20px;
.wishlist_image {
width: 120px;
height: 125px;
float: left;
background-color: #a8a8a8;
border-radius: 8px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
}
.wishlist_detail {
width: calc(100% - 120px);
float: left;
padding-left: 20px;
padding-top: 18px;
img {
width: 16px;
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
h1 {
font-size: 18px;
color: #000;
font-weight: bolder;
margin-top: 20px;
}
}
}
}
}
.empty-wishlist-wrapper {
text-align: center;
padding-top: 25%;
img {
width: 100px;
}
h1 {
font-size: 18px;
font-weight: bolder;
text-transform: uppercase;
color: #3B394D;
}
button {
background-color: #29285b;
border-radius: 8px;
height: 50px;
width: 48%;
color: #fff;
font-size: 18px;
font-weight: lighter;
text-transform: uppercase;
margin-top: 10px;
}
}
.footer-btns-wrapper {
position: fixed;
bottom: 0;
left: 0;
right: 0;
button {
width: 50%;
padding: 12px 0;
text-transform: uppercase;
font-size: 18px;
}
.btn-clear {
border-top: 1px solid #d2d2d2;
border-top-left-radius: 15px;
background-color: #fff;
}
.btn-cart {
border-top: 1px solid #29285B;
border-top-right-radius: 15px;
background-color: #29285B;
color: #fff;
}
}
\ No newline at end of file
import { Injectable } from '@angular/core'; import { Injectable } from "@angular/core";
import { User, Signup, Address } from './services/user'; import { User, Signup, Address } from "./services/user";
import { auth } from 'firebase/app'; import { auth } from "firebase/app";
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from "@angular/router";
import { AngularFireAuth } from '@angular/fire/auth'; import { AngularFireAuth } from "@angular/fire/auth";
import { import {
AngularFirestore, AngularFirestore,
AngularFirestoreDocument, AngularFirestoreDocument,
AngularFirestoreCollection AngularFirestoreCollection
} from '@angular/fire/firestore'; } from "@angular/fire/firestore";
import { ServiceService } from './../config/service.service'; import { ServiceService } from "./../config/service.service";
import { SubjectService } from './../config/subject.service'; import { SubjectService } from "./../config/subject.service";
import { GooglePlus } from '@ionic-native/google-plus/ngx'; import { GooglePlus } from "@ionic-native/google-plus/ngx";
import { take } from 'rxjs/operators'; import { take } from "rxjs/operators";
import { from } from 'rxjs'; import { from } from "rxjs";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: "root"
}) })
export class AuthService { export class AuthService {
constructor( constructor(
...@@ -32,24 +32,24 @@ export class AuthService { ...@@ -32,24 +32,24 @@ export class AuthService {
this.subjectService.sendLoginData(false); this.subjectService.sendLoginData(false);
this.userData = user; this.userData = user;
console.log(this.userData); console.log(this.userData);
this.service.set('user', JSON.stringify(this.userData)); this.service.set("user", JSON.stringify(this.userData));
this.SetUserData(user); this.SetUserData(user);
if (this.type === 1) { if (this.type === 1) {
this.router.navigateByUrl('home'); this.router.navigateByUrl("home");
} else { } else {
this.router.navigateByUrl('verification'); this.router.navigateByUrl("verification");
} }
} else { } else {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.service.set('user', null); this.service.set("user", null);
JSON.parse(localStorage.getItem('user')); JSON.parse(localStorage.getItem("user"));
this.router.navigateByUrl('login'); this.router.navigateByUrl("login");
} }
}); });
} }
get isLoggedIn(): boolean { get isLoggedIn(): boolean {
const user = JSON.parse(localStorage.getItem('user')); const user = JSON.parse(localStorage.getItem("user"));
return user !== null && user.emailVerified !== false ? true : false; return user !== null && user.emailVerified !== false ? true : false;
} }
userData: any; userData: any;
...@@ -62,7 +62,7 @@ export class AuthService { ...@@ -62,7 +62,7 @@ export class AuthService {
return this.afAuth.auth return this.afAuth.auth
.signInWithEmailAndPassword(email, password) .signInWithEmailAndPassword(email, password)
.then(result => { .then(result => {
console.log('success'); console.log("success");
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
this.SetUserData(result.user); this.SetUserData(result.user);
}) })
...@@ -76,8 +76,8 @@ export class AuthService { ...@@ -76,8 +76,8 @@ export class AuthService {
// tslint:disable-next-line:radix // tslint:disable-next-line:radix
// const otpnew = parseInt(otp); // const otpnew = parseInt(otp);
const custRef: AngularFirestoreCollection<any> = this.afs.collection( const custRef: AngularFirestoreCollection<any> = this.afs.collection(
'customers', "customers",
ref => ref.where('otp', '==', otp).where('uid', '==', this.userData.uid) ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid)
); );
custRef custRef
.valueChanges() .valueChanges()
...@@ -85,20 +85,20 @@ export class AuthService { ...@@ -85,20 +85,20 @@ export class AuthService {
.subscribe((value: User[]) => { .subscribe((value: User[]) => {
if (value.length > 0) { if (value.length > 0) {
this.afs this.afs
.collection('customers') .collection("customers")
.doc(this.userData.uid) .doc(this.userData.uid)
.update({ otp: '', phoneVerified: true }); .update({ otp: "", phoneVerified: true });
this.service.set('type', 1); this.service.set("type", 1);
this.router.navigateByUrl('nearby'); this.router.navigateByUrl("nearby");
} else { } else {
window.alert('Please input valid OTP'); window.alert("Please input valid OTP");
} }
}); });
} }
profilePic(pic) { profilePic(pic) {
this.afs this.afs
.collection('customers') .collection("customers")
.doc(this.userData.uid) .doc(this.userData.uid)
.update({ profilePhoto: pic }); .update({ profilePhoto: pic });
} }
...@@ -109,7 +109,7 @@ export class AuthService { ...@@ -109,7 +109,7 @@ export class AuthService {
this.afAuth.auth this.afAuth.auth
.signInWithPopup(new auth.GoogleAuthProvider()) .signInWithPopup(new auth.GoogleAuthProvider())
.then(result => { .then(result => {
console.log('success'); console.log("success");
console.log(result.additionalUserInfo.isNewUser); console.log(result.additionalUserInfo.isNewUser);
if ( if (
result.additionalUserInfo && result.additionalUserInfo &&
...@@ -125,7 +125,7 @@ export class AuthService { ...@@ -125,7 +125,7 @@ export class AuthService {
this.afAuth.auth this.afAuth.auth
.signInWithPopup(new auth.FacebookAuthProvider()) .signInWithPopup(new auth.FacebookAuthProvider())
.then(result => { .then(result => {
console.log('success'); console.log("success");
console.log(result); console.log(result);
}); });
} }
...@@ -149,8 +149,12 @@ export class AuthService { ...@@ -149,8 +149,12 @@ export class AuthService {
loginType: value.loginType loginType: value.loginType
}; };
this.loggedUser = userData; this.loggedUser = userData;
<<<<<<< HEAD
this.service.set('userData', JSON.stringify(this.loggedUser)); this.service.set('userData', JSON.stringify(this.loggedUser));
this.subjectService.sendUserData(JSON.stringify(this.loggedUser)); this.subjectService.sendUserData(JSON.stringify(this.loggedUser));
=======
this.service.set("userData", JSON.stringify(this.loggedUser));
>>>>>>> a9bd8295df980b5b3661ca885b051970c7f081fc
console.log(this.loggedUser); console.log(this.loggedUser);
}); });
} }
...@@ -158,8 +162,8 @@ export class AuthService { ...@@ -158,8 +162,8 @@ export class AuthService {
public async SignOut() { public async SignOut() {
return this.afAuth.auth.signOut().then(() => { return this.afAuth.auth.signOut().then(() => {
this.subjectService.sendLoginData(true); this.subjectService.sendLoginData(true);
this.service.remove('user'); this.service.remove("user");
console.log('logout'); console.log("logout");
}); });
} }
...@@ -167,9 +171,9 @@ export class AuthService { ...@@ -167,9 +171,9 @@ export class AuthService {
this.type = 2; this.type = 2;
console.log(userData.user); console.log(userData.user);
const currencyData = { const currencyData = {
currId: '123', currId: "123",
currName: 'Australian dollar', currName: "Australian dollar",
symbol: 'A$' symbol: "A$"
}; };
const otp = Math.floor(1000 + Math.random() * 9000); const otp = Math.floor(1000 + Math.random() * 9000);
userData = userData.user; userData = userData.user;
...@@ -189,11 +193,11 @@ export class AuthService { ...@@ -189,11 +193,11 @@ export class AuthService {
this.userPostData = postData; this.userPostData = postData;
console.log(postData); console.log(postData);
this.afs this.afs
.collection('customers') .collection("customers")
.doc(userData.uid) .doc(userData.uid)
.set(postData) .set(postData)
.then(() => { .then(() => {
console.log('successs'); console.log("successs");
}); });
} }
...@@ -207,15 +211,15 @@ export class AuthService { ...@@ -207,15 +211,15 @@ export class AuthService {
console.log(result.user); console.log(result.user);
this.afAuth.auth.currentUser.sendEmailVerification(); this.afAuth.auth.currentUser.sendEmailVerification();
const currencyData = { const currencyData = {
currId: '123', currId: "123",
currName: 'Australian dollar', currName: "Australian dollar",
symbol: 'A$' symbol: "A$"
}; };
const custData = result.user; const custData = result.user;
const postData: User = { const postData: User = {
uid: custData.uid, uid: custData.uid,
status: true, status: true,
profilePhoto: '', profilePhoto: "",
phoneVerified: false, phoneVerified: false,
phone: userData.phone, phone: userData.phone,
name: userData.name, name: userData.name,
...@@ -228,11 +232,11 @@ export class AuthService { ...@@ -228,11 +232,11 @@ export class AuthService {
this.userPostData = postData; this.userPostData = postData;
console.log(postData); console.log(postData);
this.afs this.afs
.collection('customers') .collection("customers")
.doc(custData.uid) .doc(custData.uid)
.set(postData) .set(postData)
.then(() => { .then(() => {
console.log('successs'); console.log("successs");
}); });
}) })
.catch(error => { .catch(error => {
...@@ -245,7 +249,7 @@ export class AuthService { ...@@ -245,7 +249,7 @@ export class AuthService {
console.log(this.userData.uid); console.log(this.userData.uid);
this.afs this.afs
.collection('address') .collection("address")
.add({ .add({
uid: this.userData.uid uid: this.userData.uid
}) })
...@@ -269,13 +273,13 @@ export class AuthService { ...@@ -269,13 +273,13 @@ export class AuthService {
const neworderId = docRef.id; const neworderId = docRef.id;
console.log(addrData); console.log(addrData);
this.afs this.afs
.collection('address') .collection("address")
.doc(neworderId) .doc(neworderId)
.set(addrData) .set(addrData)
.then(() => { .then(() => {
console.log('Address add Successfully'); console.log("Address add Successfully");
this.service.set('user', JSON.stringify(this.userData)); this.service.set("user", JSON.stringify(this.userData));
this.router.navigateByUrl('home'); this.router.navigateByUrl("home");
document.body.scrollTop = document.documentElement.scrollTop = 0; 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