Commit a9bd8295 by Adarsh K

Merge branch 'arjunlatest' into 'master'

Arjunlatest See merge request !45
parents b35f2269 aa11ddb9
......@@ -11655,8 +11655,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
......@@ -11699,8 +11698,7 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
......@@ -11711,8 +11709,7 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -11829,8 +11826,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
......@@ -11842,7 +11838,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -11872,7 +11867,6 @@
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -11891,7 +11885,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -11985,7 +11978,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -12071,8 +12063,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -12108,7 +12099,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -12128,7 +12118,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -12172,14 +12161,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
......@@ -12702,7 +12689,6 @@
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
......@@ -12721,7 +12707,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -12901,8 +12886,7 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -13008,8 +12992,7 @@
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": 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() {
}
}
......@@ -95,7 +95,10 @@ const routes: Routes = [
{
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' }
];
@NgModule({
imports: [
......
......@@ -3,12 +3,14 @@
<ion-menu>
<ion-content>
<div class="side_menu_wrapper">
<ion-menu-toggle *ngIf="userData">
<ion-menu-toggle>
<div class="top_banner">
<div class="top_image"></div>
<div class="top_image">
<img src="../assets/asset_avatar.png">
</div>
<div class="top_detail">
<h4>{{userData.name}}</h4>
<p>{{userData.emailId}}</p>
<h4>John Doe</h4>
<p>[email protected]</p>
</div>
<div class="clear"></div>
</div>
......@@ -26,10 +28,7 @@
<div class="sub_menu">
<ul *ngIf="categoryService.activecategories">
<ion-menu-toggle>
<li
*ngFor="let category of categoryService.activecategories"
(click)="goToPage('catstorelist', category)"
>
<li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)">
{{ category.catName }}
</li>
</ion-menu-toggle>
......@@ -42,9 +41,7 @@
</div>
<li>Complaints & Feedback</li>
<li>
<span class="floatLeft" (click)="authService.SignOut()"
>Logout</span
>
<span class="floatLeft" (click)="authService.SignOut()">Logout</span>
<span class="floatRight version">Version 0.1.0.2</span>
<div class="clear"></div>
</li>
......@@ -60,42 +57,22 @@
<div class="common_tab" [hidden]="fetchCase() === true">
<ul>
<li (click)="goToPage('home')">
<div
class="icon_sec m1_icon"
[class.m1_icon_act]="sec_active1"
(click)="setActive1()"
></div>
<div class="icon_sec m1_icon" [class.m1_icon_act]="sec_active1" (click)="setActive1()"></div>
</li>
<li (click)="goToPage('catagory')">
<div
class="icon_sec m2_icon"
[class.m2_icon_act]="sec_active2"
(click)="setActive2()"
></div>
<div class="icon_sec m2_icon" [class.m2_icon_act]="sec_active2" (click)="setActive2()"></div>
</li>
<li (click)="searchModal()">
<div
class="icon_sec m3_icon"
[class.m3_icon_act]="sec_active3"
(click)="setActive3()"
></div>
<div class="icon_sec m3_icon" [class.m3_icon_act]="sec_active3" (click)="setActive3()"></div>
</li>
<!-- <li (click)="goToPage('cart')">
<div class="icon_sec m4_icon" [class.m4_icon_act]="sec_active4" (click)="setActive4()"></div>
</li> -->
<li (click)="goToPage('myorder')">
<div
class="icon_sec m5_icon"
[class.m5_icon_act]="sec_active5"
(click)="setActive5()"
></div>
<div class="icon_sec m5_icon" [class.m5_icon_act]="sec_active5" (click)="setActive5()"></div>
</li>
<li (click)="goToPage('profile')">
<div
class="icon_sec m6_icon"
[class.m6_icon_act]="sec_active6"
(click)="setActive6()"
menuClose></div>
<div class="icon_sec m6_icon" [class.m6_icon_act]="sec_active6" (click)="setActive6()" menuClose></div>
</li>
</ul>
</div>
\ No newline at end of file
......@@ -17,8 +17,8 @@
width: 60px;
height: 60px;
float: left;
background-color: #fff;
border-radius: 50%;
background-color: #fff;
img {
width: 100%;
height: 100%;
......
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() {
}
}
......@@ -263,7 +263,7 @@
bottom: 0px;
left: 0px;
right: 0px;
padding: 20px;
padding: 20px 20px 50px 20px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
background: #fff;
......
import { Component, OnInit, ViewChild, } from '@angular/core';
import { IonSlides } from '@ionic/angular';
import { Router, ActivatedRoute } from '@angular/router';
import { ServiceService } from './../../config/service.service';
import { SubjectService } from './../../config/subject.service';
import { Component, OnInit, ViewChild } from "@angular/core";
import { IonSlides } from "@ionic/angular";
import { Router, ActivatedRoute } from "@angular/router";
import { ServiceService } from "./../../config/service.service";
import { SubjectService } from "./../../config/subject.service";
@Component({
selector: 'app-landing',
templateUrl: './landing.page.html',
styleUrls: ['./landing.page.scss'],
selector: "app-landing",
templateUrl: "./landing.page.html",
styleUrls: ["./landing.page.scss"]
})
export class LandingPage implements OnInit {
constructor(
......@@ -16,16 +16,16 @@ export class LandingPage implements OnInit {
private service: ServiceService,
public subjectService: SubjectService
) {
this.service.get('landing').then((data) => {
this.service.get("landing").then(data => {
if (data === true) {
const user = JSON.parse(localStorage.getItem('user'));
const user = JSON.parse(localStorage.getItem("user"));
console.log(user);
if (user) {
this.subjectService.sendLoginData(false);
this.goToPage('home');
this.goToPage("home");
} else {
this.subjectService.sendLoginData(true);
this.goToPage('login');
this.goToPage("login");
}
}
});
......@@ -37,7 +37,7 @@ export class LandingPage implements OnInit {
allowTouchMove: false
};
@ViewChild(IonSlides, { static: false })slides: IonSlides;
@ViewChild(IonSlides, { static: false }) slides: IonSlides;
currentIndex: any;
landingOptions = {
......@@ -46,16 +46,14 @@ export class LandingPage implements OnInit {
allowTouchMove: false
};
ngOnInit() {
}
ngOnInit() {}
goToPage(path, data = null) {
this.service.set('landing', true);
this.service.set("landing", true);
this.router.navigateByUrl(path, { queryParams: data });
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
next() {
this.slides.slideNext();
}
......@@ -68,8 +66,6 @@ export class LandingPage implements OnInit {
this.slides.getActiveIndex().then(index => {
this.currentIndex = index;
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() {
}
}
......@@ -15,25 +15,19 @@
</div> -->
<div class="profile_circle">
<img
[src]="loggedUser.profilePhoto"
onerror="this.src='./../../assets/profile_banner.png'"
/>
<img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" />
<div class="edit"></div>
<input type="file" accept="image/*" (change)="fileChange($event)" />
</div>
<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>
<span class="floatRight" (click)="goToPage('changedetails', user && user)"><img
src="../../assets/edit.png" /></span>
<div class="clear"></div>
</div>
<div class="row">
......@@ -42,9 +36,7 @@
<p>
Phone
<span *ngIf="loggedUser.phoneVerified == true">Verified</span>
<span *ngIf="loggedUser.phoneVerified == false"
>Not Verified yet</span
>
<span *ngIf="loggedUser.phoneVerified == false">Not Verified yet</span>
</p>
</ion-col>
<ion-col class="textRight p0">
......@@ -56,12 +48,8 @@
<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
>
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">
......@@ -122,4 +110,18 @@
</ion-row>
</div>
</div>
<div class="logout-pop-wrapper" *ngIf="isShow" [@slideInOut]>
<div class="logout_inner">
<h4>Logout</h4>
<p>Are you sure to Logout ?</p>
<div class="logout_footer">
<button class="btn-cancel floatLeft" (click)="istoggle();">Cancel</button>
<button class="btn-logout floatRight" (click)="authService.SignOut(); istoggle()">Logout</button>
<div class="clear"></div>
</div>
</div>
</div>
</ion-content>
\ No newline at end of file
.profile_wrapper {
.profile_wrapper {
.profile_banner {
width: 100%;
background-image: url('../../assets/profile_banner.png');
......@@ -113,4 +113,64 @@
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 { User } from '../../config/services/user';
import { UserService } from '../../config/user.service';
import { ServiceService } from '../../config/service.service';
import { AuthService } from '../../config/auth.service';
import { Router, ActivatedRoute } from '@angular/router';
import { finalize, tap } from 'rxjs/operators';
import { Component, OnInit } from "@angular/core";
import { User } from "../../config/services/user";
import { UserService } from "../../config/user.service";
import { ServiceService } from "../../config/service.service";
import { AuthService } from "../../config/auth.service";
import { Router, ActivatedRoute } from "@angular/router";
import { finalize, tap } from "rxjs/operators";
import {
AngularFireStorage,
AngularFireStorageReference,
AngularFireUploadTask
} from '@angular/fire/storage';
import {
AngularFirestore,
AngularFirestoreDocument,
AngularFirestoreCollection
} from '@angular/fire/firestore';
} from "@angular/fire/storage";
import { trigger, transition, animate, style } from "@angular/animations";
@Component({
selector: 'app-profile',
templateUrl: './profile.page.html',
styleUrls: ['./profile.page.scss']
selector: "app-profile",
templateUrl: "./profile.page.html",
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 {
user: User;
userdata: any;
custId: string;
isShow = false;
userData: any;
loggedUser: any;
ref: AngularFireStorageReference;
......@@ -37,14 +45,14 @@ export class ProfilePage implements OnInit {
private service: ServiceService,
private authService: AuthService
) {
this.service.get('user').then(data => {
this.service.get("user").then(data => {
if (data) {
this.userData = JSON.parse(data);
console.log(this.userData);
}
});
this.service.get('userData').then(data => {
this.service.get("userData").then(data => {
if (data) {
this.loggedUser = JSON.parse(data);
}
......@@ -61,10 +69,14 @@ export class ProfilePage implements OnInit {
setTimeout(() => {
this.user = this.useService.users;
// console.log('[users]', this.user);
this.service.set('params', this.user);
this.service.set("params", this.user);
}, 500);
}
istoggle() {
this.isShow = !this.isShow;
}
async fileChange(event) {
const fileList: FileList = event.target.files;
if (fileList.length > 0) {
......@@ -80,8 +92,8 @@ export class ProfilePage implements OnInit {
reader.readAsDataURL(event.target.files[0]);
const file = fileList[0];
const ext = file.name.split('.').pop();
if (ext === 'jpg' || ext === 'jpeg' || ext === 'png') {
const ext = file.name.split(".").pop();
if (ext === "jpg" || ext === "jpeg" || ext === "png") {
const path = file.name; // + Date.now();
const ref = this.storage.ref(path);
const task = this.storage
......
<ion-header>
<ion-toolbar>
<ion-title>wishlist</ion-title>
</ion-toolbar>
</ion-header>
<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>WISHLIST</h4>
</div>
<div class="clear"></div>
</div>
<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 { User, Signup, Address } from './services/user';
import { auth } from 'firebase/app';
import { Router, ActivatedRoute } from '@angular/router';
import { AngularFireAuth } from '@angular/fire/auth';
import { Injectable } from "@angular/core";
import { User, Signup, Address } from "./services/user";
import { auth } from "firebase/app";
import { Router, ActivatedRoute } from "@angular/router";
import { AngularFireAuth } from "@angular/fire/auth";
import {
AngularFirestore,
AngularFirestoreDocument,
AngularFirestoreCollection
} from '@angular/fire/firestore';
import { ServiceService } from './../config/service.service';
import { SubjectService } from './../config/subject.service';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
import { take } from 'rxjs/operators';
import { from } from 'rxjs';
} from "@angular/fire/firestore";
import { ServiceService } from "./../config/service.service";
import { SubjectService } from "./../config/subject.service";
import { GooglePlus } from "@ionic-native/google-plus/ngx";
import { take } from "rxjs/operators";
import { from } from "rxjs";
@Injectable({
providedIn: 'root'
providedIn: "root"
})
export class AuthService {
constructor(
......@@ -32,24 +32,24 @@ export class AuthService {
this.subjectService.sendLoginData(false);
this.userData = user;
console.log(this.userData);
this.service.set('user', JSON.stringify(this.userData));
this.service.set("user", JSON.stringify(this.userData));
this.SetUserData(user);
if (this.type === 1) {
this.router.navigateByUrl('home');
this.router.navigateByUrl("home");
} else {
this.router.navigateByUrl('verification');
this.router.navigateByUrl("verification");
}
} else {
this.subjectService.sendLoginData(true);
this.service.set('user', null);
JSON.parse(localStorage.getItem('user'));
this.router.navigateByUrl('login');
this.service.set("user", null);
JSON.parse(localStorage.getItem("user"));
this.router.navigateByUrl("login");
}
});
}
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;
}
userData: any;
......@@ -62,7 +62,7 @@ export class AuthService {
return this.afAuth.auth
.signInWithEmailAndPassword(email, password)
.then(result => {
console.log('success');
console.log("success");
document.body.scrollTop = document.documentElement.scrollTop = 0;
this.SetUserData(result.user);
})
......@@ -76,8 +76,8 @@ export class AuthService {
// tslint:disable-next-line:radix
// const otpnew = parseInt(otp);
const custRef: AngularFirestoreCollection<any> = this.afs.collection(
'customers',
ref => ref.where('otp', '==', otp).where('uid', '==', this.userData.uid)
"customers",
ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid)
);
custRef
.valueChanges()
......@@ -85,20 +85,20 @@ export class AuthService {
.subscribe((value: User[]) => {
if (value.length > 0) {
this.afs
.collection('customers')
.collection("customers")
.doc(this.userData.uid)
.update({ otp: '', phoneVerified: true });
this.service.set('type', 1);
this.router.navigateByUrl('nearby');
.update({ otp: "", phoneVerified: true });
this.service.set("type", 1);
this.router.navigateByUrl("nearby");
} else {
window.alert('Please input valid OTP');
window.alert("Please input valid OTP");
}
});
}
profilePic(pic) {
this.afs
.collection('customers')
.collection("customers")
.doc(this.userData.uid)
.update({ profilePhoto: pic });
}
......@@ -109,7 +109,7 @@ export class AuthService {
this.afAuth.auth
.signInWithPopup(new auth.GoogleAuthProvider())
.then(result => {
console.log('success');
console.log("success");
console.log(result.additionalUserInfo.isNewUser);
if (
result.additionalUserInfo &&
......@@ -125,7 +125,7 @@ export class AuthService {
this.afAuth.auth
.signInWithPopup(new auth.FacebookAuthProvider())
.then(result => {
console.log('success');
console.log("success");
console.log(result);
});
}
......@@ -149,7 +149,7 @@ export class AuthService {
loginType: value.loginType
};
this.loggedUser = userData;
this.service.set('userData', JSON.stringify(this.loggedUser));
this.service.set("userData", JSON.stringify(this.loggedUser));
console.log(this.loggedUser);
});
}
......@@ -157,8 +157,8 @@ export class AuthService {
public async SignOut() {
return this.afAuth.auth.signOut().then(() => {
this.subjectService.sendLoginData(true);
this.service.remove('user');
console.log('logout');
this.service.remove("user");
console.log("logout");
});
}
......@@ -166,9 +166,9 @@ export class AuthService {
this.type = 2;
console.log(userData.user);
const currencyData = {
currId: '123',
currName: 'Australian dollar',
symbol: 'A$'
currId: "123",
currName: "Australian dollar",
symbol: "A$"
};
const otp = Math.floor(1000 + Math.random() * 9000);
userData = userData.user;
......@@ -188,11 +188,11 @@ export class AuthService {
this.userPostData = postData;
console.log(postData);
this.afs
.collection('customers')
.collection("customers")
.doc(userData.uid)
.set(postData)
.then(() => {
console.log('successs');
console.log("successs");
});
}
......@@ -206,15 +206,15 @@ export class AuthService {
console.log(result.user);
this.afAuth.auth.currentUser.sendEmailVerification();
const currencyData = {
currId: '123',
currName: 'Australian dollar',
symbol: 'A$'
currId: "123",
currName: "Australian dollar",
symbol: "A$"
};
const custData = result.user;
const postData: User = {
uid: custData.uid,
status: true,
profilePhoto: '',
profilePhoto: "",
phoneVerified: false,
phone: userData.phone,
name: userData.name,
......@@ -227,11 +227,11 @@ export class AuthService {
this.userPostData = postData;
console.log(postData);
this.afs
.collection('customers')
.collection("customers")
.doc(custData.uid)
.set(postData)
.then(() => {
console.log('successs');
console.log("successs");
});
})
.catch(error => {
......@@ -244,7 +244,7 @@ export class AuthService {
console.log(this.userData.uid);
this.afs
.collection('address')
.collection("address")
.add({
uid: this.userData.uid
})
......@@ -268,13 +268,13 @@ export class AuthService {
const neworderId = docRef.id;
console.log(addrData);
this.afs
.collection('address')
.collection("address")
.doc(neworderId)
.set(addrData)
.then(() => {
console.log('Address add Successfully');
this.service.set('user', JSON.stringify(this.userData));
this.router.navigateByUrl('home');
console.log("Address add Successfully");
this.service.set("user", JSON.stringify(this.userData));
this.router.navigateByUrl("home");
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