added profile page
Showing
This diff is collapsed.
Click to expand it.
| <ion-app> | ||
| <ion-split-pane> | ||
| <ion-menu> | ||
| <ion-content> | ||
| <div class="side_menu_wrapper"> | ||
| <ion-menu-toggle> | ||
| <div class="top_banner"> | ||
| <div class="top_image"> | ||
| <ion-split-pane> | ||
| <ion-menu> | ||
| <ion-content> | ||
| <div class="side_menu_wrapper"> | ||
| <ion-menu-toggle> | ||
| <div class="top_banner"> | ||
| <div class="top_image"></div> | ||
| <div class="top_detail"> | ||
| <h4>John Doe</h4> | ||
| <p>[email protected]</p> | ||
| </div> | ||
| <div class="clear"></div> | ||
| </div> | ||
| </ion-menu-toggle> | ||
| <div class="sidemenu_list"> | ||
| <ul> | ||
| <ion-menu-toggle> | ||
| <li (click)="vieworder('home')">Shop</li> | ||
| </ion-menu-toggle> | ||
| <li>About us</li> | ||
| <ion-menu-toggle> | ||
| <li (click)="vieworder('myorder')">View Order</li> | ||
| </ion-menu-toggle> | ||
| </div> | ||
| <div class="top_detail" > | ||
| <h4>John Doe</h4> | ||
| <p>[email protected]</p> | ||
| </div> | ||
| <div class="clear"></div> | ||
| </div> | ||
| </ion-menu-toggle> | ||
| <div class="sidemenu_list"> | ||
| <ul> | ||
| <ion-menu-toggle> | ||
| <li (click)="vieworder('home')">Shop</li> | ||
| </ion-menu-toggle> | ||
| <li>About us</li> | ||
| <ion-menu-toggle> | ||
| <li (click)="vieworder('myorder')">View Order</li> | ||
| </ion-menu-toggle> | ||
| <div class="sub_menu"> | ||
| <ul *ngIf="categoryService.activecategories"> | ||
| <ion-menu-toggle> | ||
| <li *ngFor="let category of categoryService.activecategories" (click)="goToPage('catstorelist', category)">{{category.catName}}</li> | ||
| </ion-menu-toggle> | ||
| <!-- <li>Women's Fashion</li> | ||
| <div class="sub_menu"> | ||
| <ul *ngIf="categoryService.activecategories"> | ||
| <ion-menu-toggle> | ||
| <li | ||
| *ngFor="let category of categoryService.activecategories" | ||
| (click)="goToPage('catstorelist', category)" | ||
| > | ||
| {{ category.catName }} | ||
| </li> | ||
| </ion-menu-toggle> | ||
| <!-- <li>Women's Fashion</li> | ||
| <li>Features</li> | ||
| <li>Bags</li> | ||
| <li>Shoes</li> | ||
| <li>Electronics</li> --> | ||
| </ul> | ||
| </div> | ||
| <li>Complaints & Feedback</li> | ||
| <li> | ||
| <span class="floatLeft" (click)="authService.SignOut()">Logout</span> | ||
| <span class="floatRight version">Version 0.1.0.2</span> | ||
| <div class="clear"></div> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </ion-content> | ||
| </ion-menu> | ||
| <ion-router-outlet main></ion-router-outlet> | ||
| </ion-split-pane> | ||
| </ul> | ||
| </div> | ||
| <li>Complaints & Feedback</li> | ||
| <li> | ||
| <span class="floatLeft" (click)="authService.SignOut()" | ||
| >Logout</span | ||
| > | ||
| <span class="floatRight version">Version 0.1.0.2</span> | ||
| <div class="clear"></div> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </ion-content> | ||
| </ion-menu> | ||
| <ion-router-outlet main></ion-router-outlet> | ||
| </ion-split-pane> | ||
| </ion-app> | ||
| <div class="common_tab" [hidden]="getState()"> | ||
| <ul> | ||
| <li (click)="goToPage('home')"> | ||
| <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> | ||
| </li> | ||
| <li (click)="goToPage('catagory')"> | ||
| <div class="icon_sec m3_icon" [class.m3_icon_act]="sec_active3" (click)="setActive3()"></div> | ||
| </li> | ||
| <!-- <li (click)="goToPage('cart')"> | ||
| <ul> | ||
| <li (click)="goToPage('home')"> | ||
| <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> | ||
| </li> | ||
| <li (click)="goToPage('catagory')"> | ||
| <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> | ||
| </li> | ||
| <li (click)="goToPage('profile')"> | ||
| <div class="icon_sec m6_icon" [class.m6_icon_act]="sec_active6" (click)="setActive6()"></div> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| \ No newline at end of file | ||
| <li (click)="goToPage('myorder')"> | ||
| <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()" | ||
| ></div> | ||
| </li> | ||
| </ul> | ||
| </div> |
| <div class="nav_header"> | ||
| <button class="nav_btn nav_back floatLeft" (click)="goBack()"> | ||
| <img src="../assets/Group17_2.png"> | ||
| <button class="nav_btn nav_back floatLeft" (click)="goBack()"> | ||
| <img src="../assets/Group17_2.png" /> | ||
| </button> | ||
| <div class="nav_title floatLeft"> | ||
| <h4>CHANGE DETAILS</h4> | ||
| </div> | ||
| <div class="clear"></div> | ||
| <div class="nav_title floatLeft"> | ||
| <h4>CHANGE DETAILS</h4> | ||
| </div> | ||
| <div class="clear"></div> | ||
| </div> | ||
| <ion-content> | ||
| <div class="login_wrapper"> | ||
| <div class="form_div"> | ||
| <div class="row"> | ||
| <h6>Personal Details</h6> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="text" placeholder="John Doe"> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="mail" placeholder="[email protected]"> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="number" placeholder="+00 9851 5871 6985"> | ||
| </div> | ||
| <div class="row"> | ||
| <h6>Change Password</h6> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="Current Password"> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="New Password"> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="Confirm Password"> | ||
| </div> | ||
| <div class="row"> | ||
| <button class="login_btn">UPDATE</button> | ||
| </div> | ||
| <div class="login_wrapper"> | ||
| <form class="form_div" #updateForm="ngForm" novalidate> | ||
| <div class="row"> | ||
| <h6>Personal Details</h6> | ||
| </div> | ||
| <div class="row"> | ||
| <input | ||
| name="name" | ||
| required | ||
| class="" | ||
| type="text" | ||
| [(ngModel)]="updateData.name" | ||
| placeholder="John Doe" | ||
| #name="ngModel" | ||
| /> | ||
| <div | ||
| class="md-errors-spacer" | ||
| [hidden]="name.valid || submitted == false" | ||
| class="ion-padding-start" | ||
| > | ||
| Name is required | ||
| </div> | ||
| </div> | ||
| </ion-content> | ||
| \ No newline at end of file | ||
| </div> | ||
| <div class="row"> | ||
| <input | ||
| required | ||
| class="" | ||
| name="emailId" | ||
| type="mail" | ||
| [(ngModel)]="updateData.emailId" | ||
| placeholder="[email protected]" | ||
| pattern="[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}" | ||
| #emailId="ngModel" | ||
| /> | ||
| <div | ||
| class="md-errors-spacer" | ||
| [hidden]="emailId.valid || submitted == false" | ||
| > | ||
| <div *ngIf="emailId.errors && emailId.errors.required"> | ||
| Email is required | ||
| </div> | ||
| <div *ngIf="emailId.errors && emailId.errors.pattern"> | ||
| Email is invalid | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="row"> | ||
| <input | ||
| required | ||
| class="" | ||
| name="phone" | ||
| type="number" | ||
| pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}" | ||
| maxlength="10" | ||
| [(ngModel)]="updateData.phone" | ||
| placeholder="+00 9851 5871 6985" | ||
| #phone="ngModel" | ||
| /> | ||
| <div | ||
| class="md-errors-spacer" | ||
| [hidden]="phone.valid || submitted == false" | ||
| > | ||
| <div *ngIf="phone.errors && phone.errors.required"> | ||
| Phone number is required | ||
| </div> | ||
| <div *ngIf="phone.errors && phone.errors.pattern"> | ||
| Phone is invalid | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="row"> | ||
| <h6>Change Password</h6> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="Current Password" /> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="New Password" /> | ||
| </div> | ||
| <div class="row"> | ||
| <input class="" type="password" placeholder="Confirm Password" /> | ||
| </div> | ||
| <div class="row"> | ||
| <button class="login_btn" (click)="onFormSubmit(updateForm)"> | ||
| UPDATE | ||
| </button> | ||
| </div> | ||
| </form> | ||
| </div> | ||
| </ion-content> |
This diff is collapsed.
Click to expand it.
| <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"> | ||
| <div class="profile_banner"> | ||
| <div class="profile_circle"> | ||
| <div class="edit"></div> | ||
| </div> | ||
| <h5>JOHN DOE</h5> | ||
| <p>LOGOUT</p> | ||
| </div> | ||
| <div class="account_wrapper"> | ||
| <div class="account_header"> | ||
| <h5 class="floatLeft">ACCOUNT INFORMATION</h5> | ||
| <span class="floatRight"><img src="../../assets/edit.png"></span> | ||
| <div class="clear"></div> | ||
| </div> | ||
| <div class="row"> | ||
| <ion-row> | ||
| <ion-col class="textLeft p0"> | ||
| <p>Name<span>Verfied</span></p> | ||
| </ion-col> | ||
| <ion-col class="textRight p0"> | ||
| <h6>John Doe</h6> | ||
| </ion-col> | ||
| </ion-row> | ||
| </div> | ||
| <div class="row"> | ||
| <ion-row> | ||
| <ion-col class="textLeft p0"> | ||
| <p>Email<span>Not Verfied yet</span></p> | ||
| </ion-col> | ||
| <ion-col class="textRight p0"> | ||
| <h6>[email protected]</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"> | ||
| <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 class="profile_wrapper"> | ||
| <div class="profile_banner"> | ||
| <div class="profile_circle"> | ||
| <div class="edit"></div> | ||
| </div> | ||
| <h5>{{user && user.name}}</h5> | ||
| <p>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> | ||
| Name<span | ||
| >{{user && phoneVerified? "Verified": "Not Verified yet"}}</span | ||
| > | ||
| </p> | ||
| </ion-col> | ||
| <ion-col class="textRight p0"> | ||
| <h6>{{user && user.name}}</h6> | ||
| </ion-col> | ||
| </ion-row> | ||
| </div> | ||
| <div class="row"> | ||
| <ion-row> | ||
| <ion-col class="textLeft p0"> | ||
| <p> | ||
| Email<span | ||
| >{{user && emailVerified? "Verified": "Not Verified yet"}}</span | ||
| > | ||
| </p> | ||
| </ion-col> | ||
| <ion-col class="textRight p0"> | ||
| <h6>{{user && user.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"> | ||
| <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> | ||
| </ion-content> | ||
| \ No newline at end of file | ||
| </div> | ||
| </ion-content> |
This diff is collapsed.
Click to expand it.
| 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'; | ||
| 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"; | ||
| @Injectable({ | ||
| providedIn: 'root' | ||
| providedIn: "root" | ||
| }) | ||
| export class CartsService { | ||
| size: string; | ||
| ... | ... | @@ -27,13 +31,13 @@ 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; | ||
| console.log(this.custId); | ||
| // console.log(this.custId); | ||
| } | ||
| }); | ||
| } | ||
| ... | ... | @@ -42,30 +46,30 @@ 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() | ||
| .pipe(take(1)) | ||
| .subscribe(value => { | ||
| console.log(value); | ||
| // console.log(value); | ||
| if (value.length === 0) { | ||
| product.image = | ||
| product.image === undefined | ||
| ? '../assets/[email protected]' | ||
| ? "../assets/[email protected]" | ||
| : product.image; | ||
| const cart: Cart = { | ||
| color: this.color, | ||
| ... | ... | @@ -80,36 +84,36 @@ export class CartsService { |
| qty: 1, | ||
| size: this.size | ||
| }; | ||
| console.log(cart); | ||
| // 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(() => { | ||
| console.log('Booking Successfully'); | ||
| // console.log('Booking Successfully'); | ||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
| }); | ||
| }) | ||
| .catch(error => { | ||
| console.error('Error adding document: ', error); | ||
| console.error("Error adding document: ", error); | ||
| }); | ||
| } else { | ||
| console.log(value); | ||
| // console.log(value); | ||
| // alert('Item already added in the cart'); | ||
| const cartId = value[0].cartId; | ||
| // tslint:disable-next-line:radix | ||
| const qty = parseInt(value[0].qty) + 1; | ||
| this.afs | ||
| .collection('carts') | ||
| .collection("carts") | ||
| .doc(cartId) | ||
| .update({ qty: `${qty}` }) | ||
| .then(() => { | ||
| console.log('Booking Successfully'); | ||
| // console.log('Booking Successfully'); | ||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
| }); | ||
| } | ||
| ... | ... | @@ -118,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 = []; | ||
| ... | ... | @@ -139,7 +143,7 @@ export class CartsService { |
| qty: item.qty, | ||
| size: item.size | ||
| }; | ||
| console.log(item.price, item.qty); | ||
| // console.log(item.price, item.qty); | ||
| if (item.price) { | ||
| this.cartTotal += item.price * item.qty; | ||
| } | ||
| ... | ... | @@ -175,9 +179,9 @@ export class CartsService { |
| ? this.carts[index].qty - 1 | ||
| : this.carts[index].qty; | ||
| this.carts[index].qty = qty; | ||
| console.log(this.carts[index].qty); | ||
| // console.log(this.carts[index].qty); | ||
| this.afs | ||
| .collection('carts') | ||
| .collection("carts") | ||
| .doc(this.carts[index].cartId) | ||
| .update({ | ||
| qty: this.carts[index].qty | ||
| ... | ... | @@ -189,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 | ||
| ... | ... | @@ -198,21 +202,19 @@ export class CartsService { |
| removeItem(index) { | ||
| this.afs | ||
| .collection('carts') | ||
| .collection("carts") | ||
| .doc(this.carts[index].cartId) | ||
| .delete(); | ||
| } | ||
| checkPromo(promoCode: string) { | ||
| console.log(promoCode); | ||
| // console.log(promoCode); | ||
| const state = true; | ||
| const promoRef: AngularFirestoreCollection<any> = this.afs.collection('promocode', ref => ref.where('promoCode', '==', promoCode) | ||
| .where('status', '==', state)); | ||
| const promoRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
| "promocode", | ||
| ref => | ||
| ref.where("promoCode", "==", promoCode).where("status", "==", state) | ||
| ); | ||
| return promoRef.valueChanges(); | ||
| } | ||
| } |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
src/config/services/slides.ts
0 → 100644
src/config/update.service.ts
0 → 100644
src/config/user.service.ts
0 → 100644
Please
register
or
sign in
to comment