design fix
Showing
| ... | ... | @@ -5,7 +5,9 @@ |
| <div class="side_menu_wrapper"> | ||
| <ion-menu-toggle> | ||
| <div class="top_banner"> | ||
| <div class="top_image"></div> | ||
| <div class="top_image"> | ||
| <img src="../assets/avatar.png"> | ||
| </div> | ||
| <div class="top_detail"> | ||
| <h4>John Doe</h4> | ||
| <p>[email protected]</p> | ||
| ... | ... | @@ -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()" | ||
| ></div> | ||
| <div class="icon_sec m6_icon" [class.m6_icon_act]="sec_active6" (click)="setActive6()"></div> | ||
| </li> | ||
| </ul> | ||
| </div> | ||
| \ No newline at end of file |
src/app/noresult/noresult.module.ts
0 → 100644
src/app/noresult/noresult.page.html
0 → 100644
src/app/noresult/noresult.page.scss
0 → 100644
src/app/noresult/noresult.page.spec.ts
0 → 100644
src/app/noresult/noresult.page.ts
0 → 100644
src/assets/avatar.png
0 → 100644
26.5 KB
src/assets/basket.png
0 → 100644
9.86 KB
| 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'; | ||
| 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"; | ||
| @Injectable({ | ||
| providedIn: 'root' | ||
| providedIn: "root" | ||
| }) | ||
| export class AuthService { | ||
| userData: any; | ||
| ... | ... | @@ -32,27 +36,30 @@ 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)); | ||
| 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"); | ||
| } | ||
| }); | ||
| } | ||
| public async SignIn(email: string, password: string) { | ||
| return this.afAuth.auth.signInWithEmailAndPassword(email, password).then((result) => { | ||
| console.log('success'); | ||
| return this.afAuth.auth | ||
| .signInWithEmailAndPassword(email, password) | ||
| .then(result => { | ||
| console.log("success"); | ||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
| this.SetUserData(result.user); | ||
| }).catch((error) => { | ||
| }) | ||
| .catch(error => { | ||
| window.alert(error.message); | ||
| }); | ||
| } | ||
| ... | ... | @@ -61,27 +68,34 @@ export class AuthService { |
| console.log(this.userData.uid, otp); | ||
| // 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) | ||
| const custRef: AngularFirestoreCollection<any> = this.afs.collection( | ||
| "customers", | ||
| ref => ref.where("otp", "==", otp).where("uid", "==", this.userData.uid) | ||
| ); | ||
| custRef.valueChanges().pipe(take(1)).subscribe((value: User[]) => { | ||
| custRef | ||
| .valueChanges() | ||
| .pipe(take(1)) | ||
| .subscribe((value: User[]) => { | ||
| if (value.length > 0) { | ||
| this.afs.collection('customers').doc(this.userData.uid).update({otp: ''}); | ||
| this.service.set('type', 1); | ||
| this.router.navigateByUrl('nearby'); | ||
| this.afs | ||
| .collection("customers") | ||
| .doc(this.userData.uid) | ||
| .update({ otp: "" }); | ||
| this.service.set("type", 1); | ||
| this.router.navigateByUrl("nearby"); | ||
| } else { | ||
| window.alert('Please input valid OTP'); | ||
| window.alert("Please input valid OTP"); | ||
| } | ||
| }); | ||
| } | ||
| public async google(type: number) { | ||
| this.type = type; | ||
| // this.googlePlus.login({}).then(res => console.log(res)).catch(err => console.error(err)); | ||
| this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider()).then((result) => { | ||
| console.log('success'); | ||
| this.afAuth.auth | ||
| .signInWithPopup(new auth.GoogleAuthProvider()) | ||
| .then(result => { | ||
| console.log("success"); | ||
| console.log(result); | ||
| this.socialSignUp(result); | ||
| }); | ||
| ... | ... | @@ -89,21 +103,24 @@ export class AuthService { |
| public async facebook(type: number) { | ||
| this.type = type; | ||
| this.afAuth.auth.signInWithPopup(new auth.FacebookAuthProvider()).then((result) => { | ||
| console.log('success'); | ||
| this.afAuth.auth | ||
| .signInWithPopup(new auth.FacebookAuthProvider()) | ||
| .then(result => { | ||
| console.log("success"); | ||
| console.log(result); | ||
| }); | ||
| } | ||
| get isLoggedIn(): boolean { | ||
| const user = JSON.parse(localStorage.getItem('user')); | ||
| return(user !== null && user.emailVerified !== false) ? true : false; | ||
| const user = JSON.parse(localStorage.getItem("user")); | ||
| return user !== null && user.emailVerified !== false ? true : false; | ||
| } | ||
| SetUserData(user: any) { | ||
| const userRef: AngularFirestoreDocument<any> = this.afs.doc(`customers/${user.uid}`); | ||
| userRef.valueChanges().subscribe((value) => { | ||
| const userRef: AngularFirestoreDocument<any> = this.afs.doc( | ||
| `customers/${user.uid}` | ||
| ); | ||
| userRef.valueChanges().subscribe(value => { | ||
| const userData: User = { | ||
| uid: value.uid, | ||
| emailId: value.emailId, | ||
| ... | ... | @@ -124,8 +141,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"); | ||
| }); | ||
| } | ||
| ... | ... | @@ -133,9 +150,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; | ||
| ... | ... | @@ -154,8 +171,12 @@ export class AuthService { |
| }; | ||
| this.userPostData = postData; | ||
| console.log(postData); | ||
| this.afs.collection('customers').doc(userData.uid).set(postData).then(() => { | ||
| console.log('successs'); | ||
| this.afs | ||
| .collection("customers") | ||
| .doc(userData.uid) | ||
| .set(postData) | ||
| .then(() => { | ||
| console.log("successs"); | ||
| }); | ||
| } | ||
| ... | ... | @@ -163,19 +184,21 @@ export class AuthService { |
| this.type = 2; | ||
| console.log(userData); | ||
| const otp = Math.floor(1000 + Math.random() * 9000); | ||
| this.afAuth.auth.createUserWithEmailAndPassword(userData.emailId, userData.password).then((result) => { | ||
| this.afAuth.auth | ||
| .createUserWithEmailAndPassword(userData.emailId, userData.password) | ||
| .then(result => { | ||
| 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, | ||
| ... | ... | @@ -187,10 +210,15 @@ export class AuthService { |
| }; | ||
| this.userPostData = postData; | ||
| console.log(postData); | ||
| this.afs.collection('customers').doc(custData.uid).set(postData).then(() => { | ||
| console.log('successs'); | ||
| this.afs | ||
| .collection("customers") | ||
| .doc(custData.uid) | ||
| .set(postData) | ||
| .then(() => { | ||
| console.log("successs"); | ||
| }); | ||
| }).catch((error) => { | ||
| }) | ||
| .catch(error => { | ||
| window.alert(error.message); | ||
| }); | ||
| } | ||
| ... | ... | @@ -199,9 +227,12 @@ export class AuthService { |
| console.log(addressData); | ||
| console.log(this.userData.uid); | ||
| this.afs.collection('address').add({ | ||
| this.afs | ||
| .collection("address") | ||
| .add({ | ||
| uid: this.userData.uid | ||
| }).then((docRef) => { | ||
| }) | ||
| .then(docRef => { | ||
| console.log(docRef); | ||
| const addrData = { | ||
| uid: this.userData.uid, | ||
| ... | ... | @@ -220,10 +251,14 @@ export class AuthService { |
| }; | ||
| const neworderId = docRef.id; | ||
| console.log(addrData); | ||
| this.afs.collection('address').doc(neworderId).set(addrData).then(() => { | ||
| console.log('Address add Successfully'); | ||
| this.service.set('user', JSON.stringify(this.userData)); | ||
| this.router.navigateByUrl('home'); | ||
| this.afs | ||
| .collection("address") | ||
| .doc(neworderId) | ||
| .set(addrData) | ||
| .then(() => { | ||
| console.log("Address add Successfully"); | ||
| this.service.set("user", JSON.stringify(this.userData)); | ||
| this.router.navigateByUrl("home"); | ||
| document.body.scrollTop = document.documentElement.scrollTop = 0; | ||
| }); | ||
| }); | ||
| ... | ... | @@ -231,14 +266,9 @@ export class AuthService { |
| } | ||
| } | ||
| /*displayName: "Adarsh Techware" | ||
| email: "[email protected]" | ||
| emailVerified: true | ||
| : "https://lh4.googleusercontent.com/-h0rs2pE-Azw/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rcjNtapRhKoG09NKifQsv_lQPC_2A/photo.jpg" | ||
| : "vT498Fz6X0Z6l5l5iNn5hxfwz692" | ||
| providerData: [Gl]*/ | ||