Merge branch 'adarsh' into 'master'
Adarsh
See merge request !47
Showing
<div class="nav_header"> | ||
<ion-menu-toggle> | ||
<button class="nav_btn nav_menu floatLeft"></button> | ||
</ion-menu-toggle> | ||
<div class="nav_title floatLeft"> | ||
<img src="../../assets/Group [email protected]" /> | ||
</div> | ||
<div class="clear"></div> | ||
<ion-menu-toggle> | ||
<button class="nav_btn nav_menu floatLeft"></button> | ||
</ion-menu-toggle> | ||
<div class="nav_title floatLeft"> | ||
<img src="../../assets/Group [email protected]" /> | ||
</div> | ||
<div class="clear"></div> | ||
</div> | ||
<ion-content> | ||
<div class="profile_wrapper" *ngIf="loggedUser"> | ||
<div class="profile_banner"> | ||
<!-- <div class="profile_circle"> | ||
<div class="profile_wrapper" *ngIf="loggedUser"> | ||
<div class="profile_banner"> | ||
<!-- <div class="profile_circle"> | ||
<div class="edit"></div> | ||
</div> --> | ||
<div class="profile_circle"> | ||
<img [src]="loggedUser.profilePhoto" onerror="this.src='./../../assets/profile_banner.png'" /> | ||
<div class="edit"></div> | ||
<input type="file" accept="image/*" (change)="fileChange($event)" /> | ||
</div> | ||
<div class="profile_circle"> | ||
<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)="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> | ||
<h5>{{loggedUser.name}}</h5> | ||
<p (click)="istoggle()">LOGOUT</p> | ||
</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="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" (click)="goToPage('wishlist')"> | ||
<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" (click)="goToPage('address')"> | ||
<h6 *ngIf="addressService.addList"> | ||
({{addressService.addressList.length}}) | ||
</h6> | ||
</ion-col> | ||
</ion-row> | ||
<hr /> | ||
<!-- <ion-row> | ||
<ion-col class="textLeft p0"> | ||
<p>My Cards</p> | ||
</ion-col> | ||
<ion-col class="textRight p0" (click)="goToPage('addcard')"> | ||
<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 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 class="clear"></div> | ||
</div> | ||
</div> | ||
</ion-content> | ||
\ No newline at end of file | ||
</div> | ||
</ion-content> |
... | ... | @@ -282,10 +282,3 @@ export class AuthService { |
return false; | ||
} | ||
} | ||
/*displayName: "Adarsh Techware" | ||
email: "[email protected]" | ||
emailVerified: true | ||
: "https://lh4.googleusercontent.com/-h0rs2pE-Azw/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rcjNtapRhKoG09NKifQsv_lQPC_2A/photo.jpg" | ||
: "vT498Fz6X0Z6l5l5iNn5hxfwz692" | ||
providerData: [Gl]*/ |
import { Injectable } from "@angular/core"; | ||
import { Injectable } from '@angular/core'; | ||
import { | ||
AngularFirestore, | ||
AngularFirestoreDocument, | ||
AngularFirestoreCollection | ||
} from "@angular/fire/firestore"; | ||
import { Router, ActivatedRoute } from "@angular/router"; | ||
import { Products } from "./services/product"; | ||
import { Cart, CartItem } from "./services/cart"; | ||
import { ServiceService } from "./service.service"; | ||
import * as firebase from "firebase"; | ||
import { take } from "rxjs/operators"; | ||
import { User } from "./services/user"; | ||
import { from } from "rxjs"; | ||
} from '@angular/fire/firestore'; | ||
import { Router, ActivatedRoute } from '@angular/router'; | ||
import { Products } from './services/product'; | ||
import { Cart, CartItem } from './services/cart'; | ||
import { ServiceService } from './service.service'; | ||
import * as firebase from 'firebase'; | ||
import { take } from 'rxjs/operators'; | ||
import { User } from './services/user'; | ||
import { from } from 'rxjs'; | ||
@Injectable({ | ||
providedIn: "root" | ||
providedIn: 'root' | ||
}) | ||
export class CartsService { | ||
size: string; | ||
... | ... | @@ -31,9 +31,9 @@ export class CartsService { |
public router: Router, | ||
public service: ServiceService | ||
) { | ||
this.custId = ""; | ||
this.custId = ''; | ||
this.carts = []; | ||
const users = this.service.get("user").then(data => { | ||
const users = this.service.get('user').then(data => { | ||
if (data) { | ||
data = JSON.parse(data); | ||
this.custId = data.uid; | ||
... | ... | @@ -46,20 +46,20 @@ export class CartsService { |
this.prodId = product.prodId; | ||
const prodRef = firebase | ||
.firestore() | ||
.collection("products") | ||
.collection('products') | ||
.doc(this.prodId); | ||
this.size = this.size === undefined ? product.size[0] : this.size; | ||
this.color = this.color === undefined ? product.color[0] : this.color; | ||
const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
"carts", | ||
'carts', | ||
ref => | ||
ref | ||
.where("size", "==", this.size) | ||
.where("color", "==", this.color) | ||
.where("custId", "==", this.custId) | ||
.where("product", "==", prodRef) | ||
.where('size', '==', this.size) | ||
.where('color', '==', this.color) | ||
.where('custId', '==', this.custId) | ||
.where('product', '==', prodRef) | ||
); | ||
cartRef | ||
.valueChanges() | ||
... | ... | @@ -69,7 +69,7 @@ export class CartsService { |
if (value.length === 0) { | ||
product.image = | ||
product.image === undefined | ||
? "../assets/[email protected]" | ||
? '../assets/[email protected]' | ||
: product.image; | ||
const cart: Cart = { | ||
color: this.color, | ||
... | ... | @@ -86,12 +86,12 @@ export class CartsService { |
}; | ||
// console.log(cart); | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.add(cart) | ||
.then(docRef => { | ||
const neworderId = docRef.id; | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.doc(neworderId) | ||
.update({ cartId: docRef.id }) | ||
.then(() => { | ||
... | ... | @@ -100,7 +100,7 @@ export class CartsService { |
}); | ||
}) | ||
.catch(error => { | ||
console.error("Error adding document: ", error); | ||
console.error('Error adding document: ', error); | ||
}); | ||
} else { | ||
// console.log(value); | ||
... | ... | @@ -109,7 +109,7 @@ export class CartsService { |
// tslint:disable-next-line:radix | ||
const qty = parseInt(value[0].qty) + 1; | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.doc(cartId) | ||
.update({ qty: `${qty}` }) | ||
.then(() => { | ||
... | ... | @@ -122,8 +122,8 @@ export class CartsService { |
public async cartList() { | ||
const cartRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
"carts", | ||
ref => ref.where("custId", "==", this.custId) | ||
'carts', | ||
ref => ref.where('custId', '==', this.custId) | ||
); | ||
cartRef.valueChanges().subscribe(value => { | ||
this.carts = []; | ||
... | ... | @@ -181,7 +181,7 @@ export class CartsService { |
this.carts[index].qty = qty; | ||
// console.log(this.carts[index].qty); | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.doc(this.carts[index].cartId) | ||
.update({ | ||
qty: this.carts[index].qty | ||
... | ... | @@ -193,7 +193,7 @@ export class CartsService { |
this.cartTotal = 0; | ||
this.carts[index].qty = qty; | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.doc(this.carts[index].cartId) | ||
.update({ | ||
qty: this.carts[index].qty | ||
... | ... | @@ -202,7 +202,7 @@ export class CartsService { |
removeItem(index) { | ||
this.afs | ||
.collection("carts") | ||
.collection('carts') | ||
.doc(this.carts[index].cartId) | ||
.delete(); | ||
} | ||
... | ... | @@ -211,9 +211,9 @@ export class CartsService { |
// console.log(promoCode); | ||
const state = true; | ||
const promoRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
"promocode", | ||
'promocode', | ||
ref => | ||
ref.where("promoCode", "==", promoCode).where("status", "==", state) | ||
ref.where('promoCode', '==', promoCode).where('status', '==', state) | ||
); | ||
return promoRef.valueChanges(); | ||
} | ||
... | ... |
Please
register
or
sign in
to comment