Commit 5c138740 by muhsin

fixed styling, changedetails page, 'shoping' spelling

parent dba0e182
.address-wrapper {
padding: 15px;
padding-bottom: 11%;
.address-radio {
background-image: url("../../assets/radio.png");
background-image: url('../../assets/radio.png');
-webkit-appearance: none;
background-repeat: no-repeat;
background-position: center;
......@@ -10,12 +11,12 @@
padding: 15px;
border-radius: 5px;
outline: none;
transition: all .6s ease-in-out;
transition: all 0.6s ease-in-out;
}
.address-radio:checked {
background-image: url("../../assets/radio-checked.png");
background-image: url('../../assets/radio-checked.png');
}
.address-radio:checked+.show-btn {
.address-radio:checked + .show-btn {
opacity: 1;
}
h1 {
......@@ -26,7 +27,7 @@
p {
margin-top: 20px;
padding-left: 10px;
color: #B0AEC7;
color: #b0aec7;
}
button {
background: none;
......@@ -39,8 +40,11 @@
.address-btn-wrapper {
padding: 15px;
position: absolute;
bottom: 50px;
padding-top: 0;
padding-bottom: 10px;
background-color: #fff;
position: fixed;
bottom: 0px;
left: 0;
right: 0;
button {
......
......@@ -114,7 +114,7 @@ export class AppComponent {
const currentUrl = this.router.url.split('/');
const index = restrictedUrl.findIndex(x => x === currentUrl[1]);
// console.log(currentUrl[1], index, this.state);
console.log(this.tabData);
// console.log(this.tabData);
if (index > -1 || this.tabData === false) {
return true;
} else {
......
......@@ -262,7 +262,7 @@
[hidden]="currentIndex != 0"
>
<div class="continue" (click)="goToPage('productlist')">
CONTINUE SHOPING
CONTINUE SHOPPING
</div>
<div class="checkout" (click)="next(1)">CHECKOUT</div>
</div>
......
......@@ -18,7 +18,7 @@
p {
margin: 0px;
text-align: right;
background-image: url("../../assets/Path 55_2.png");
background-image: url('../../assets/Path 55_2.png');
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
......@@ -173,6 +173,7 @@
}
.featured_catagory_list {
padding: 10px;
padding-bottom: 14%;
ul {
margin: 0px;
padding: 0px;
......@@ -278,14 +279,14 @@
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
&+label {
& + label {
position: relative;
cursor: pointer;
padding: 0;
width: 100%;
}
// Box.
&+label:before {
& + label:before {
content: '';
margin-right: 10px;
display: inline-block;
......@@ -296,21 +297,21 @@
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
&:checked+label:before {
&:checked + label:before {
background: #29285b;
}
// Disabled state label.
&:disabled+label {
&:disabled + label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled+label:before {
&:disabled + label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked+label:after {
&:checked + label:after {
content: '';
position: absolute;
left: 6px;
......@@ -318,7 +319,8 @@
background: white;
width: 2px;
height: 2px;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white,
4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
transform: rotate(45deg);
}
}
......
......@@ -21,7 +21,7 @@
class=""
type="text"
[(ngModel)]="userData && userData.name"
[(placeholder)]="userData && userData.name"
placeholder="Change your Name"
#name="ngModel"
/>
<div
......@@ -39,7 +39,7 @@
class=""
name="emailId"
type="mail"
[(placeholder)]="userData && userData.emailId"
placeholder="email cannot be changed"
/>
</div>
......@@ -53,7 +53,7 @@
pattern="(\(+61\)|\+61|\(0[1-9]\)|0[1-9])?( ?-?[0-9]){6,9}"
maxlength="10"
[(ngModel)]="userData && userData.phone"
[(placeholder)]="userData && userData.phone"
placeholder="Change your Phone Number"
#phone="ngModel"
/>
<div
......
......@@ -32,10 +32,18 @@ export class ChangedetailsPage implements OnInit {
private service: ServiceService
) {
// Gets userdata
this.service.get('params').then(val => {
this.userData = val;
console.log(val);
this.service.get('userData').then(val => {
console.log(JSON.parse(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() {}
......@@ -54,17 +62,18 @@ export class ChangedetailsPage implements OnInit {
console.log(form.value);
if (form.valid) {
// Change Password
if (
form.value.password &&
form.value.password != form.value.confirmPassword
) {
if (form.value.password) {
if (form.value.password === form.value.confirmPassword) {
// this.register.updateData(form.value, this.userData.uid);
// this.register.updatePassword(form.value.password);
console.log('Password Changed and profile updated');
} else {
alert('Password should match');
console.log('Password should match');
}
} else {
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);
}
}
......
......@@ -71,20 +71,20 @@
</ion-row>
</div>
<hr />
<ion-row>
<ion-row (click)="goToPage('wishlist')">
<ion-col class="textLeft p0">
<p>Wishlist</p>
</ion-col>
<ion-col class="textRight p0" (click)="goToPage('wishlist')">
<ion-col class="textRight p0">
<h6>(0)</h6>
</ion-col>
</ion-row>
<hr />
<ion-row>
<ion-row (click)="goToPage('address')">
<ion-col class="textLeft p0">
<p>Address</p>
</ion-col>
<ion-col class="textRight p0" (click)="goToPage('address')">
<ion-col class="textRight p0">
<h6 *ngIf="addressService.addList">
({{addressService.addressList.length}})
</h6>
......@@ -102,11 +102,11 @@
</ion-col>
</ion-row>
<hr /> -->
<ion-row>
<ion-row (click)="goToPage('myorder')">
<ion-col class="textLeft p0">
<p>My Order</p>
</ion-col>
<ion-col class="textRight p0" (click)="goToPage('myorder')">
<ion-col class="textRight p0">
<h6>
<ion-icon name="arrow-forward"></ion-icon>
</h6>
......
......@@ -41,6 +41,7 @@ export class ProfilePage implements OnInit {
downloadURL;
constructor(
private route: ActivatedRoute,
private router: Router,
private storage: AngularFireStorage,
private useService: UserService,
......@@ -56,11 +57,15 @@ export class ProfilePage implements OnInit {
}
});
// Listens to url
route.params.subscribe(val => {
// Get user Data
this.service.get('userData').then(data => {
if (data) {
this.loggedUser = JSON.parse(data);
}
});
});
}
goToPage(path, data = null) {
......@@ -69,6 +74,7 @@ export class ProfilePage implements OnInit {
}
ngOnInit() {
console.log('profile page');
const This = this;
setTimeout(() => {
this.user = this.useService.users;
......
......@@ -9,15 +9,15 @@
</div>
<ion-content>
<!-- <div class="wishlist-wrapper">
<div class="wishlist-wrapper">
<ul>
<li>
<div class="wishlist_image">
<img src="../../assets/img-list.png">
<img src="../../assets/img-list.png" />
</div>
<div class="wishlist_detail">
<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>
<p>Green, Small</p>
<h1>AU$88.00</h1>
......@@ -26,11 +26,11 @@
</li>
<li>
<div class="wishlist_image">
<img src="../../assets/img-list.png">
<img src="../../assets/img-list.png" />
</div>
<div class="wishlist_detail">
<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>
<p>Green, Small</p>
<h1>AU$88.00</h1>
......@@ -38,13 +38,13 @@
<div class="clear"></div>
</li>
</ul>
</div> -->
</div>
<!--
<div class="empty-wishlist-wrapper">
<img src="../../assets/wishlist.png" />
<h1>There is no products added</h1>
<button (click)="goToPage('home')">shop now</button>
</div>
</div> -->
<div class="footer-btns-wrapper">
<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,23 +47,33 @@ export class UpdateService {
// });
}
updateData(userData: UpdateUserDetails, uid: string) {
updateData(userData: UpdateUserDetails, oldData: User) {
this.type = 2;
const postData: UpdateUserDetails = {
phone: userData.phone,
name: userData.name
};
const updateOldData = {
...oldData,
phone: userData.phone,
name: userData.name
};
this.userPostData = postData;
this.afs
.collection('customers')
.doc(uid)
.doc(oldData.uid)
.update(postData)
.then(() => {
console.log('success');
this.service
.set('userData', JSON.stringify(updateOldData))
.then(res => {
console.log('success', updateOldData, res);
this.router.navigateByUrl('profile');
})
.catch(err => console.log(err));
})
.catch(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