search-service
Showing
dist/out-tsc/e2e/src/app.e2e-spec.js
0 → 100644
dist/out-tsc/e2e/src/app.e2e-spec.js.map
0 → 100644
dist/out-tsc/e2e/src/app.po.js
0 → 100644
dist/out-tsc/e2e/src/app.po.js.map
0 → 100644
dist/out-tsc/src/app/addcard/addcard.page.js
0 → 100644
dist/out-tsc/src/app/address/address.page.js
0 → 100644
dist/out-tsc/src/app/app-routing.module.js
0 → 100644
dist/out-tsc/src/app/app.component.js
0 → 100644
dist/out-tsc/src/app/app.component.js.map
0 → 100644
dist/out-tsc/src/app/app.component.spec.js
0 → 100644
dist/out-tsc/src/app/app.module.js
0 → 100644
dist/out-tsc/src/app/app.module.js.map
0 → 100644
dist/out-tsc/src/app/cart/cart.module.js
0 → 100644
dist/out-tsc/src/app/cart/cart.module.js.map
0 → 100644
dist/out-tsc/src/app/cart/cart.page.js
0 → 100644
dist/out-tsc/src/app/cart/cart.page.js.map
0 → 100644
dist/out-tsc/src/app/cart/cart.page.spec.js
0 → 100644
dist/out-tsc/src/app/failed/failed.module.js
0 → 100644
dist/out-tsc/src/app/failed/failed.page.js
0 → 100644
| import * as tslib_1 from "tslib"; | |||
| import { Component } from '@angular/core'; | |||
| import { Location } from '@angular/common'; | |||
| import { SubjectService } from '../../config/subject.service'; | |||
| import { FeedbackService } from '../../config/feedback.service'; | |||
| import { ServiceService } from '../../config/service.service'; | |||
| let FeedbackPage = class FeedbackPage { | |||
| constructor(location, subjectService, feedService, service) { | |||
| this.location = location; | |||
| this.subjectService = subjectService; | |||
| this.feedService = feedService; | |||
| this.service = service; | |||
| this.submitted = false; | |||
| this.feedbackData = { | |||
| feedbackId: '', | |||
| from: '', | |||
| to: '[email protected]', | |||
| message: '' | |||
| }; | |||
| // Gets userdata | |||
| this.subjectService.getUserData().subscribe(userData => { | |||
| if (userData) { | |||
| this.userData = JSON.parse(userData); | |||
| console.log(userData); | |||
| } | |||
| else { | |||
| console.log(userData); | |||
| } | |||
| }); | |||
| } | |||
| onFeedbackSubmit(form) { | |||
| this.submitted = true; | |||
| console.log(form.value); | |||
| if (form.valid && form.value.message !== '') { | |||
| this.feedService.feedbackCreate(form.value); | |||
| } | |||
| else { | |||
| this.submitted = false; | |||
| this.service.showToast('Invalid request!', 'top', 'my-error', 1000); | |||
| } | |||
| } | |||
| ngOnInit() { } | |||
| goBack() { | |||
| this.location.back(); | |||
| } | |||
| }; | |||
| FeedbackPage = tslib_1.__decorate([ | |||
| Component({ | |||
| selector: 'app-feedback', | |||
| templateUrl: './feedback.page.html', | |||
| styleUrls: ['./feedback.page.scss'] | |||
| }), | |||
| tslib_1.__metadata("design:paramtypes", [Location, | |||
| SubjectService, | |||
| FeedbackService, | |||
| ServiceService]) | |||
| ], FeedbackPage); | |||
| export { FeedbackPage }; | |||
| //# sourceMappingURL=feedback.page.js.map | |||
| \ No newline at end of file |
dist/out-tsc/src/app/forgot/forgot.module.js
0 → 100644
dist/out-tsc/src/app/forgot/forgot.page.js
0 → 100644
dist/out-tsc/src/app/home/home.module.js
0 → 100644
dist/out-tsc/src/app/home/home.module.js.map
0 → 100644
dist/out-tsc/src/app/home/home.page.js
0 → 100644
dist/out-tsc/src/app/home/home.page.js.map
0 → 100644
dist/out-tsc/src/app/home/home.page.spec.js
0 → 100644
dist/out-tsc/src/app/landing/landing.page.js
0 → 100644
dist/out-tsc/src/app/login/login.module.js
0 → 100644
dist/out-tsc/src/app/login/login.page.js
0 → 100644
dist/out-tsc/src/app/login/login.page.js.map
0 → 100644
dist/out-tsc/src/app/myorder/myorder.page.js
0 → 100644
dist/out-tsc/src/app/nearby/nearby.module.js
0 → 100644
dist/out-tsc/src/app/nearby/nearby.page.js
0 → 100644
dist/out-tsc/src/app/profile/profile.page.js
0 → 100644
dist/out-tsc/src/app/review/review.module.js
0 → 100644
dist/out-tsc/src/app/review/review.page.js
0 → 100644
dist/out-tsc/src/app/signup/signup.module.js
0 → 100644
dist/out-tsc/src/app/signup/signup.page.js
0 → 100644
dist/out-tsc/src/app/sortby/sortby.module.js
0 → 100644
dist/out-tsc/src/app/sortby/sortby.page.js
0 → 100644
dist/out-tsc/src/app/success/success.page.js
0 → 100644
dist/out-tsc/src/app/tab1/tab1.module.js
0 → 100644
dist/out-tsc/src/app/tab1/tab1.module.js.map
0 → 100644
dist/out-tsc/src/app/tab1/tab1.page.js
0 → 100644
dist/out-tsc/src/app/tab1/tab1.page.js.map
0 → 100644
dist/out-tsc/src/app/tab1/tab1.page.spec.js
0 → 100644
dist/out-tsc/src/app/tab2/tab2.module.js
0 → 100644
dist/out-tsc/src/app/tab2/tab2.module.js.map
0 → 100644
dist/out-tsc/src/app/tab2/tab2.page.js
0 → 100644
dist/out-tsc/src/app/tab2/tab2.page.js.map
0 → 100644
dist/out-tsc/src/app/tab2/tab2.page.spec.js
0 → 100644
dist/out-tsc/src/app/tab3/tab3.module.js
0 → 100644
dist/out-tsc/src/app/tab3/tab3.module.js.map
0 → 100644
dist/out-tsc/src/app/tab3/tab3.page.js
0 → 100644
dist/out-tsc/src/app/tab3/tab3.page.js.map
0 → 100644
dist/out-tsc/src/app/tab3/tab3.page.spec.js
0 → 100644
dist/out-tsc/src/app/tabs/tabs.module.js
0 → 100644
dist/out-tsc/src/app/tabs/tabs.module.js.map
0 → 100644
dist/out-tsc/src/app/tabs/tabs.page.js
0 → 100644
dist/out-tsc/src/app/tabs/tabs.page.js.map
0 → 100644
dist/out-tsc/src/app/tabs/tabs.page.spec.js
0 → 100644
dist/out-tsc/src/config/address.service.js
0 → 100644
dist/out-tsc/src/config/auth.service.js
0 → 100644
dist/out-tsc/src/config/auth.service.js.map
0 → 100644
dist/out-tsc/src/config/cart.service.js
0 → 100644
| import * as tslib_1 from "tslib"; | |||
| import { Injectable } from '@angular/core'; | |||
| import { AngularFirestore } from '@angular/fire/firestore'; | |||
| import { Router } from '@angular/router'; | |||
| import { ServiceService } from './service.service'; | |||
| import * as firebase from 'firebase'; | |||
| import { take } from 'rxjs/operators'; | |||
| let CartsService = class CartsService { | |||
| constructor(afs, router, service) { | |||
| this.afs = afs; | |||
| this.router = router; | |||
| this.service = service; | |||
| this.carts = []; | |||
| this.custId = ''; | |||
| this.carts = []; | |||
| const users = this.service.get('user').then(data => { | |||
| if (data) { | |||
| data = JSON.parse(data); | |||
| this.custId = data.uid; | |||
| // console.log(this.custId); | |||
| } | |||
| }); | |||
| } | |||
| buyNow(product) { | |||
| return tslib_1.__awaiter(this, void 0, void 0, function* () { | |||
| this.prodId = product.prodId; | |||
| const prodRef = firebase | |||
| .firestore() | |||
| .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 = this.afs.collection('carts', ref => ref | |||
| .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); | |||
| if (value.length === 0) { | |||
| product.image = | |||
| product.image === undefined | |||
| ? '../assets/[email protected]' | |||
| : product.image; | |||
| const cart = { | |||
| color: this.color, | |||
| custId: this.custId, | |||
| shopperId: product.shopperId, | |||
| product: firebase.firestore().doc(`products/${this.prodId}`), | |||
| image: product.image, | |||
| prodId: product.prodId, | |||
| price: product.price, | |||
| prodName: product.prodName, | |||
| shopper: product.shopper, | |||
| qty: 1, | |||
| size: this.size | |||
| }; | |||
| // console.log(cart); | |||
| this.afs | |||
| .collection('carts') | |||
| .add(cart) | |||
| .then(docRef => { | |||
| const neworderId = docRef.id; | |||
| this.afs | |||
| .collection('carts') | |||
| .doc(neworderId) | |||
| .update({ cartId: docRef.id }) | |||
| .then(() => { | |||
| // console.log('Booking Successfully'); | |||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | |||
| }); | |||
| }) | |||
| .catch(error => { | |||
| console.error('Error adding document: ', error); | |||
| }); | |||
| } | |||
| else { | |||
| // 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') | |||
| .doc(cartId) | |||
| .update({ qty: `${qty}` }) | |||
| .then(() => { | |||
| // console.log('Booking Successfully'); | |||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | |||
| }); | |||
| } | |||
| }); | |||
| }); | |||
| } | |||
| cartList() { | |||
| return tslib_1.__awaiter(this, void 0, void 0, function* () { | |||
| console.log('called'); | |||
| const cartRef = this.afs.collection('carts', ref => ref.where('custId', '==', this.custId)); | |||
| cartRef.valueChanges().subscribe(value => { | |||
| this.carts = []; | |||
| const res = value; | |||
| this.cartTotal = 0; | |||
| if (res.length > 0) { | |||
| res.forEach(item => { | |||
| const cartItem = { | |||
| cartId: item.cartId, | |||
| color: item.color, | |||
| shopperId: item.shopperId, | |||
| shopper: item.shopper, | |||
| prodId: item.prodId, | |||
| price: item.price, | |||
| prodName: item.prodName, | |||
| image: item.image, | |||
| qty: item.qty, | |||
| size: item.size | |||
| }; | |||
| // console.log(item.price, item.qty); | |||
| if (item.price) { | |||
| this.cartTotal += item.price * item.qty; | |||
| } | |||
| /*const prodItem = item.product.get().then((property) => { | |||
| const response = property.data(); | |||
| cartItem.prodName = response.prodName; | |||
| cartItem.price = response.price; | |||
| cartItem.image = response.image; | |||
| cartItem.prodId = response.prodId; | |||
| cartItem.shopperId = response.shopper; | |||
| this.cartTotal += response.price; | |||
| });*/ | |||
| this.carts.push(cartItem); | |||
| }); | |||
| } | |||
| else { | |||
| // alert('No Products Found'); | |||
| } | |||
| }); | |||
| }); | |||
| } | |||
| choose_size(size) { | |||
| this.size = size; | |||
| } | |||
| choose_color(color) { | |||
| this.color = color; | |||
| } | |||
| removeCount(index) { | |||
| // tslint:disable-next-line:radix | |||
| const qty = this.carts[index].qty > 1 | |||
| ? this.carts[index].qty - 1 | |||
| : this.carts[index].qty; | |||
| this.carts[index].qty = qty; | |||
| // console.log(this.carts[index].qty); | |||
| this.afs | |||
| .collection('carts') | |||
| .doc(this.carts[index].cartId) | |||
| .update({ | |||
| qty: this.carts[index].qty | |||
| }); | |||
| } | |||
| addCount(index) { | |||
| const qty = Number(this.carts[index].qty) + 1; // Converts string to Number | |||
| this.cartTotal = 0; | |||
| this.carts[index].qty = qty; | |||
| this.afs | |||
| .collection('carts') | |||
| .doc(this.carts[index].cartId) | |||
| .update({ | |||
| qty: this.carts[index].qty | |||
| }); | |||
| } | |||
| removeItem(index) { | |||
| this.afs | |||
| .collection('carts') | |||
| .doc(this.carts[index].cartId) | |||
| .delete(); | |||
| } | |||
| checkPromo(promoCode) { | |||
| // console.log(promoCode); | |||
| const state = true; | |||
| const promoRef = this.afs.collection('promocode', ref => ref.where('promoCode', '==', promoCode).where('status', '==', state)); | |||
| return promoRef.valueChanges(); | |||
| } | |||
| }; | |||
| CartsService = tslib_1.__decorate([ | |||
| Injectable({ | |||
| providedIn: 'root' | |||
| }), | |||
| tslib_1.__metadata("design:paramtypes", [AngularFirestore, | |||
| Router, | |||
| ServiceService]) | |||
| ], CartsService); | |||
| export { CartsService }; | |||
| //# sourceMappingURL=cart.service.js.map | |||
| \ No newline at end of file |
dist/out-tsc/src/config/cart.service.js.map
0 → 100644
dist/out-tsc/src/config/category.service.js
0 → 100644
dist/out-tsc/src/config/center.service.js
0 → 100644
dist/out-tsc/src/config/feedback.service.js
0 → 100644
dist/out-tsc/src/config/myorder.service.js
0 → 100644
dist/out-tsc/src/config/order.service.js
0 → 100644
dist/out-tsc/src/config/order.service.js.map
0 → 100644
dist/out-tsc/src/config/products.service.js
0 → 100644
dist/out-tsc/src/config/search.service.js
0 → 100644
dist/out-tsc/src/config/service.service.js
0 → 100644
dist/out-tsc/src/config/services/address.js
0 → 100644
dist/out-tsc/src/config/services/cart.js
0 → 100644
dist/out-tsc/src/config/services/cart.js.map
0 → 100644
dist/out-tsc/src/config/services/category.js
0 → 100644
dist/out-tsc/src/config/services/center.js
0 → 100644
dist/out-tsc/src/config/services/feedback.js
0 → 100644
dist/out-tsc/src/config/services/myorder.js
0 → 100644
dist/out-tsc/src/config/services/order.js
0 → 100644
dist/out-tsc/src/config/services/product.js
0 → 100644
dist/out-tsc/src/config/services/search.js
0 → 100644
dist/out-tsc/src/config/services/shopper.js
0 → 100644
dist/out-tsc/src/config/services/slides.js
0 → 100644
dist/out-tsc/src/config/services/user.js
0 → 100644
dist/out-tsc/src/config/services/user.js.map
0 → 100644
dist/out-tsc/src/config/services/wishlist.js
0 → 100644
dist/out-tsc/src/config/shopper.service.js
0 → 100644
dist/out-tsc/src/config/subject.service.js
0 → 100644
dist/out-tsc/src/config/update.service.js
0 → 100644
dist/out-tsc/src/config/user.service.js
0 → 100644
dist/out-tsc/src/config/user.service.js.map
0 → 100644
dist/out-tsc/src/config/wish.service.js
0 → 100644
dist/out-tsc/src/config/wish.service.js.map
0 → 100644
dist/out-tsc/src/environments/environment.js
0 → 100644
dist/out-tsc/src/main.js
0 → 100644
dist/out-tsc/src/main.js.map
0 → 100644
dist/out-tsc/src/polyfills.js
0 → 100644
dist/out-tsc/src/polyfills.js.map
0 → 100644
dist/out-tsc/src/test.js
0 → 100644
dist/out-tsc/src/test.js.map
0 → 100644
dist/out-tsc/src/zone-flags.js
0 → 100644
dist/out-tsc/src/zone-flags.js.map
0 → 100644
Please
register
or
sign in
to comment