Commit 5c138740 by muhsin

fixed styling, changedetails page, 'shoping' spelling

parent dba0e182
.address-wrapper { .address-wrapper {
padding: 15px;
padding-bottom: 11%;
.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; padding: 15px;
.address-radio { border-radius: 5px;
background-image: url("../../assets/radio.png"); outline: none;
-webkit-appearance: none; transition: all 0.6s ease-in-out;
background-repeat: no-repeat; }
background-position: center; .address-radio:checked {
background-size: 25px; background-image: url('../../assets/radio-checked.png');
height: auto; }
padding: 15px; .address-radio:checked + .show-btn {
border-radius: 5px; opacity: 1;
outline: none; }
transition: all .6s ease-in-out; h1 {
} font-size: 18px;
.address-radio:checked { margin-top: 6px;
background-image: url("../../assets/radio-checked.png"); padding-left: 10px;
} }
.address-radio:checked+.show-btn { p {
opacity: 1; margin-top: 20px;
} padding-left: 10px;
h1 { color: #b0aec7;
font-size: 18px; }
margin-top: 6px; button {
padding-left: 10px; background: none;
} outline: none;
p { }
margin-top: 20px; img {
padding-left: 10px; width: 35px;
color: #B0AEC7; }
}
button {
background: none;
outline: none;
}
img {
width: 35px;
}
} }
.address-btn-wrapper { .address-btn-wrapper {
padding: 15px; padding: 15px;
position: absolute; padding-top: 0;
bottom: 50px; padding-bottom: 10px;
left: 0; background-color: #fff;
right: 0; position: fixed;
button { bottom: 0px;
width: 100%; left: 0;
background-color: #29285b; right: 0;
color: #fff; button {
border-radius: 8px; width: 100%;
height: 45px; background-color: #29285b;
font-size: 16px; color: #fff;
text-transform: uppercase; border-radius: 8px;
} height: 45px;
} font-size: 16px;
\ No newline at end of file text-transform: uppercase;
}
}
...@@ -114,7 +114,7 @@ export class AppComponent { ...@@ -114,7 +114,7 @@ export class AppComponent {
const currentUrl = this.router.url.split('/'); const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]); const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state); // console.log(currentUrl[1], index, this.state);
console.log(this.tabData); // console.log(this.tabData);
if (index > -1 || this.tabData === false) { if (index > -1 || this.tabData === false) {
return true; return true;
} else { } else {
......
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
[hidden]="currentIndex != 0" [hidden]="currentIndex != 0"
> >
<div class="continue" (click)="goToPage('productlist')"> <div class="continue" (click)="goToPage('productlist')">
CONTINUE SHOPING CONTINUE SHOPPING
</div> </div>
<div class="checkout" (click)="next(1)">CHECKOUT</div> <div class="checkout" (click)="next(1)">CHECKOUT</div>
</div> </div>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
class="" class=""
type="text" type="text"
[(ngModel)]="userData && userData.name" [(ngModel)]="userData && userData.name"
[(placeholder)]="userData && userData.name" placeholder="Change your Name"
#name="ngModel" #name="ngModel"
/> />
<div <div
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
class="" class=""
name="emailId" name="emailId"
type="mail" type="mail"
[(placeholder)]="userData && userData.emailId" placeholder="email cannot be changed"
/> />
</div> </div>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}" pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}"
maxlength="10" maxlength="10"
[(ngModel)]="userData && userData.phone" [(ngModel)]="userData && userData.phone"
[(placeholder)]="userData && userData.phone" placeholder="Change your Phone Number"
#phone="ngModel" #phone="ngModel"
/> />
<div <div
......
...@@ -32,10 +32,18 @@ export class ChangedetailsPage implements OnInit { ...@@ -32,10 +32,18 @@ export class ChangedetailsPage implements OnInit {
private service: ServiceService private service: ServiceService
) { ) {
// Gets userdata // Gets userdata
this.service.get('params').then(val => { this.service.get('userData').then(val => {
this.userData = val; console.log(JSON.parse(val));
console.log(val); this.userData = JSON.parse(val);
console.log(this.userData);
}); });
// this.service.get('user').then(data => {
// if (data) {
// this.userData = JSON.parse(data);
// console.log(this.userData);
// }
// });
} }
ngOnInit() {} ngOnInit() {}
...@@ -54,17 +62,18 @@ export class ChangedetailsPage implements OnInit { ...@@ -54,17 +62,18 @@ export class ChangedetailsPage implements OnInit {
console.log(form.value); console.log(form.value);
if (form.valid) { if (form.valid) {
// Change Password // Change Password
if ( if (form.value.password) {
form.value.password && if (form.value.password === form.value.confirmPassword) {
form.value.password != form.value.confirmPassword // this.register.updateData(form.value, this.userData.uid);
) { // this.register.updatePassword(form.value.password);
// this.register.updatePassword(form.value.password); console.log('Password Changed and profile updated');
} else {
console.log('Password should match');
}
} else { } else {
alert('Password should match'); this.register.updateData(form.value, this.userData);
console.log('profile updated');
} }
// Calls update user data fn
// this.register.updateData(form.value, this.userData.uid);
console.log('valid form values', form.value); console.log('valid form values', form.value);
} }
} }
......
...@@ -71,20 +71,20 @@ ...@@ -71,20 +71,20 @@
</ion-row> </ion-row>
</div> </div>
<hr /> <hr />
<ion-row> <ion-row (click)="goToPage('wishlist')">
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Wishlist</p> <p>Wishlist</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('wishlist')"> <ion-col class="textRight p0">
<h6>(0)</h6> <h6>(0)</h6>
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> <hr />
<ion-row> <ion-row (click)="goToPage('address')">
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>Address</p> <p>Address</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('address')"> <ion-col class="textRight p0">
<h6 *ngIf="addressService.addList"> <h6 *ngIf="addressService.addList">
({{addressService.addressList.length}}) ({{addressService.addressList.length}})
</h6> </h6>
...@@ -102,11 +102,11 @@ ...@@ -102,11 +102,11 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<hr /> --> <hr /> -->
<ion-row> <ion-row (click)="goToPage('myorder')">
<ion-col class="textLeft p0"> <ion-col class="textLeft p0">
<p>My Order</p> <p>My Order</p>
</ion-col> </ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')"> <ion-col class="textRight p0">
<h6> <h6>
<ion-icon name="arrow-forward"></ion-icon> <ion-icon name="arrow-forward"></ion-icon>
</h6> </h6>
......
...@@ -41,6 +41,7 @@ export class ProfilePage implements OnInit { ...@@ -41,6 +41,7 @@ export class ProfilePage implements OnInit {
downloadURL; downloadURL;
constructor( constructor(
private route: ActivatedRoute,
private router: Router, private router: Router,
private storage: AngularFireStorage, private storage: AngularFireStorage,
private useService: UserService, private useService: UserService,
...@@ -56,10 +57,14 @@ export class ProfilePage implements OnInit { ...@@ -56,10 +57,14 @@ export class ProfilePage implements OnInit {
} }
}); });
this.service.get('userData').then(data => { // Listens to url
if (data) { route.params.subscribe(val => {
this.loggedUser = JSON.parse(data); // Get user Data
} this.service.get('userData').then(data => {
if (data) {
this.loggedUser = JSON.parse(data);
}
});
}); });
} }
...@@ -69,6 +74,7 @@ export class ProfilePage implements OnInit { ...@@ -69,6 +74,7 @@ export class ProfilePage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log('profile page');
const This = this; const This = this;
setTimeout(() => { setTimeout(() => {
this.user = this.useService.users; this.user = this.useService.users;
......
...@@ -9,42 +9,42 @@ ...@@ -9,42 +9,42 @@
</div> </div>
<ion-content> <ion-content>
<!-- <div class="wishlist-wrapper"> <div class="wishlist-wrapper">
<ul> <ul>
<li> <li>
<div class="wishlist_image"> <div class="wishlist_image">
<img src="../../assets/img-list.png"> <img src="../../assets/img-list.png" />
</div> </div>
<div class="wishlist_detail"> <div class="wishlist_detail">
<p class="floatLeft">European Style V Neck</p> <p class="floatLeft">European Style V Neck</p>
<span class="floatRight"><img src="../../assets/heart.png"></span> <span class="floatRight"><img src="../../assets/heart.png"/></span>
<div class="clear"></div> <div class="clear"></div>
<p>Green, Small</p> <p>Green, Small</p>
<h1>AU$88.00</h1> <h1>AU$88.00</h1>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
<li> <li>
<div class="wishlist_image"> <div class="wishlist_image">
<img src="../../assets/img-list.png"> <img src="../../assets/img-list.png" />
</div> </div>
<div class="wishlist_detail"> <div class="wishlist_detail">
<p class="floatLeft">European Style V Neck</p> <p class="floatLeft">European Style V Neck</p>
<span class="floatRight"><img src="../../assets/heart.png"></span> <span class="floatRight"><img src="../../assets/heart.png"/></span>
<div class="clear"></div> <div class="clear"></div>
<p>Green, Small</p> <p>Green, Small</p>
<h1>AU$88.00</h1> <h1>AU$88.00</h1>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</li> </li>
</ul> </ul>
</div> --> </div>
<!--
<div class="empty-wishlist-wrapper"> <div class="empty-wishlist-wrapper">
<img src="../../assets/wishlist.png" /> <img src="../../assets/wishlist.png" />
<h1>There is no products added</h1> <h1>There is no products added</h1>
<button (click)="goToPage('home')">shop now</button> <button (click)="goToPage('home')">shop now</button>
</div> </div> -->
<div class="footer-btns-wrapper"> <div class="footer-btns-wrapper">
<button class="btn-clear">Clear All</button> <button class="btn-clear">Clear All</button>
......
export interface Wishlist {
amount: string;
bookDate: any;
pickupLocation: any;
deliveryLocation: any;
deliveryAddress: any;
status: number;
orderStatus: number;
riderName: string;
orderId: string;
time: string;
product: any;
orderCode: string;
}
...@@ -47,22 +47,32 @@ export class UpdateService { ...@@ -47,22 +47,32 @@ export class UpdateService {
// }); // });
} }
updateData(userData: UpdateUserDetails, uid: string) { updateData(userData: UpdateUserDetails, oldData: User) {
this.type = 2; this.type = 2;
const postData: UpdateUserDetails = { const postData: UpdateUserDetails = {
phone: userData.phone, phone: userData.phone,
name: userData.name name: userData.name
}; };
const updateOldData = {
...oldData,
phone: userData.phone,
name: userData.name
};
this.userPostData = postData; this.userPostData = postData;
this.afs this.afs
.collection('customers') .collection('customers')
.doc(uid) .doc(oldData.uid)
.update(postData) .update(postData)
.then(() => { .then(() => {
console.log('success'); this.service
this.router.navigateByUrl('profile'); .set('userData', JSON.stringify(updateOldData))
.then(res => {
console.log('success', updateOldData, res);
this.router.navigateByUrl('profile');
})
.catch(err => console.log(err));
}) })
.catch(error => { .catch(error => {
console.log(error); console.log(error);
......
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