Commit 86664af8 by Adarsh K

Merge branch 'muhsin' into 'master'

Muhsin See merge request !54
parents d0836db7 4995603e
.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;
.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;
border-radius: 5px;
outline: none;
transition: all .6s ease-in-out;
}
.address-radio:checked {
background-image: url("../../assets/radio-checked.png");
}
.address-radio:checked+.show-btn {
opacity: 1;
}
h1 {
font-size: 18px;
margin-top: 6px;
padding-left: 10px;
}
p {
margin-top: 20px;
padding-left: 10px;
color: #B0AEC7;
}
button {
background: none;
outline: none;
}
img {
width: 35px;
}
border-radius: 5px;
outline: none;
transition: all 0.6s ease-in-out;
}
.address-radio:checked {
background-image: url('../../assets/radio-checked.png');
}
.address-radio:checked + .show-btn {
opacity: 1;
}
h1 {
font-size: 18px;
margin-top: 6px;
padding-left: 10px;
}
p {
margin-top: 20px;
padding-left: 10px;
color: #b0aec7;
}
button {
background: none;
outline: none;
}
img {
width: 35px;
}
}
.address-btn-wrapper {
padding: 15px;
position: absolute;
bottom: 50px;
left: 0;
right: 0;
button {
width: 100%;
background-color: #29285b;
color: #fff;
border-radius: 8px;
height: 45px;
font-size: 16px;
text-transform: uppercase;
}
}
\ No newline at end of file
padding: 15px;
padding-top: 0;
padding-bottom: 10px;
background-color: #fff;
position: fixed;
bottom: 0px;
left: 0;
right: 0;
button {
width: 100%;
background-color: #29285b;
color: #fff;
border-radius: 8px;
height: 45px;
font-size: 16px;
text-transform: uppercase;
}
}
......@@ -139,34 +139,59 @@
<p>COD</p>
</label>
</div>
<!-- <div class="payment_method">
<input type="radio" name="payments" id="paypal" name="radio-group" checked (click)="getwaypaypal()">
<label for="test1">
<p>PayPal</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=1">
<input class="card_no borderNone widthFull" placeholder="PayPal ID">
</div>
<div class="payment_method">
<input type="radio" name="payments" id="afterpay" name="radio-group" (click)="getwayafterpay()">
<label for="test2">
<p>AfterPay</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=2">
<input class="card_no" placeholder="**** **** **** 1458">
<input class="cv_number" placeholder="CVV">
</div>
<div class="payment_method">
<input type="radio" name="payments" id="payk" name="radio-group" (click)="getwaypayk()">
<label for="test3">
<p>PayK</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=3">
<input class="card_no borderNone widthFull" placeholder="PafyK ID">
</div> -->
<div class="payment_method">
<input
type="radio"
name="payments"
id="paypal"
name="radio-group"
checked
(click)="getwaypaypal()"
/>
<label for="test1">
<p>PayPal</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=1">
<input
class="card_no borderNone widthFull"
placeholder="PayPal ID"
/>
</div>
<div class="payment_method">
<input
type="radio"
name="payments"
id="afterpay"
name="radio-group"
(click)="getwayafterpay()"
/>
<label for="test2">
<p>AfterPay</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=2">
<input class="card_no" placeholder="**** **** **** 1458" />
<input class="cv_number" placeholder="CVV" />
</div>
<div class="payment_method">
<input
type="radio"
name="payments"
id="payk"
name="radio-group"
(click)="getwaypayk()"
/>
<label for="test3">
<p>PayK</p>
</label>
</div>
<div class="card_div" [hidden]="gateway !=3">
<input
class="card_no borderNone widthFull"
placeholder="PafyK ID"
/>
</div>
<!-- <div class="delivery_time">
<ul>
<li>
......@@ -262,7 +287,7 @@
[hidden]="currentIndex != 0"
>
<div class="continue" (click)="goToPage('productlist')">
CONTINUE SHOPING
CONTINUE SHOPPING
</div>
<div class="checkout" (click)="next(1)">CHECKOUT</div>
</div>
......
.home_wrapper {
width: 100%;
.home_banner {
width: 100%;
.home_banner {
height: 300px;
padding-top: 80px;
position: relative;
background-color: #fff;
.home_banner_title {
padding: 10px;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
img {
width: 100px;
}
p {
margin: 0px;
text-align: right;
background-image: url('../../assets/Path 55_2.png');
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
padding-left: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
ion-slides {
width: 100%;
height: 100%;
ion-slide {
width: 100%;
height: 300px;
padding-top: 80px;
height: 100%;
position: relative;
background-color: #fff;
.home_banner_title {
padding: 10px;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
img {
width: 100px;
}
p {
margin: 0px;
text-align: right;
background-image: url("../../assets/Path 55_2.png");
background-position: left;
background-repeat: no-repeat;
background-size: 12px;
padding-left: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
}
ion-slides {
width: 100%;
height: 100%;
ion-slide {
width: 100%;
height: 100%;
position: relative;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
.banner_slide {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
-webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
-moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
padding-top: 160px;
padding-left: 20px;
padding-right: 20px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 5px;
font-size: 14px;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
}
}
}
.banner_slide {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
-webkit-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
-moz-box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
box-shadow: inset 0px -128px 63px -45px rgba(0, 0, 0, 0.75);
padding-top: 160px;
padding-left: 20px;
padding-right: 20px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 5px;
font-size: 14px;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
}
}
}
}
.home_sub_header {
padding: 10px;
padding-top: 20px;
padding-bottom: 20px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
}
.home_sub_header {
padding: 10px;
padding-top: 20px;
padding-bottom: 20px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
}
.featured_slider {
padding-left: 10px;
padding-right: 10px;
.feature_product {
width: 100%;
height: 130px;
position: relative;
background-color: #a8a8a8;
border: 2px solid #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.feature_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.75);
padding: 15px;
padding-top: 60px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 2px;
font-size: 14px;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
}
}
}
.featured_slider {
padding-left: 10px;
padding-right: 10px;
.feature_product {
}
.nearby_shop_list {
ul {
margin: 0px;
padding-left: 10px;
padding-right: 10px;
li {
list-style: none;
padding-bottom: 10px;
.nearby_image {
width: 120px;
height: 125px;
float: left;
background-color: #a8a8a8;
border-radius: 8px;
img {
width: 100%;
height: 130px;
position: relative;
background-color: #a8a8a8;
border: 2px solid #fff;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.feature_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background-color: rgba(0, 0, 0, 0.75);
padding: 15px;
padding-top: 60px;
h5 {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-weight: bold;
letter-spacing: 2px;
padding-bottom: 2px;
font-size: 14px;
}
p {
color: #fff;
margin: 0px;
padding: 0px;
text-align: left;
font-size: 20px;
font-weight: lighter;
}
}
height: 100%;
object-fit: cover;
object-position: center;
}
}
}
.nearby_shop_list {
ul {
.nearby_detail {
width: calc(100% - 120px);
float: left;
padding-left: 20px;
padding-top: 40px;
h5 {
margin: 0px;
padding-left: 10px;
padding-right: 10px;
li {
list-style: none;
padding-bottom: 10px;
.nearby_image {
width: 120px;
height: 125px;
float: left;
background-color: #a8a8a8;
border-radius: 8px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
}
.nearby_detail {
width: calc(100% - 120px);
float: left;
padding-left: 20px;
padding-top: 40px;
h5 {
margin: 0px;
padding: 0px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
padding-bottom: 2px;
img {
width: 16px;
}
}
p {
margin: 0px;
padding: 0px;
color: rgba(176, 174, 199);
}
}
padding: 0px;
color: rgba(59, 57, 77, 1);
font-weight: 900;
padding-bottom: 2px;
img {
width: 16px;
}
}
}
.featured_catagory_list {
padding: 10px;
ul {
}
p {
margin: 0px;
padding: 0px;
li {
list-style: none;
position: relative;
height: 120px;
width: 100%;
border-radius: 8px;
margin-bottom: 10px;
&:nth-child(odd) {
text-align: left;
}
&:nth-child(even) {
text-align: right;
}
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.featured_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
border-radius: 8px;
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
padding: 45px;
padding-left: 20px;
padding-right: 20px;
h4 {
margin: 0px;
font-size: 26px;
font-weight: 900;
}
}
}
color: rgba(176, 174, 199);
}
}
}
}
}
.sort_wrappper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.sort_inner {
margin: 0 auto;
width: 90%;
padding: 10px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: #fff;
}
.featured_catagory_list {
padding: 10px;
padding-bottom: 14%;
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
position: relative;
-webkit-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
top: 25%;
border-radius: 0px;
h4 {
text-align: center;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bold;
padding: 10px;
font-size: 18px;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-bottom: 20px;
margin-bottom: 30px;
height: 120px;
width: 100%;
border-radius: 8px;
margin-bottom: 10px;
&:nth-child(odd) {
text-align: left;
}
.search_box {
width: calc(100% - 100px);
height: 45px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
&:nth-child(even) {
text-align: right;
}
.search_btn {
width: 100px;
height: 45px;
background-color: rgba(41, 40, 91, 1);
border: none;
color: #fff;
font-size: 16px;
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
ul {
.featured_overlay {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
border-radius: 8px;
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
padding: 45px;
padding-left: 20px;
padding-right: 20px;
h4 {
margin: 0px;
padding: 0px;
li {
list-style: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-top: 10px;
padding-bottom: 10px;
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
&+label {
position: relative;
cursor: pointer;
padding: 0;
width: 100%;
}
// Box.
&+label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 5px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
&:checked+label:before {
background: #29285b;
}
// Disabled state label.
&:disabled+label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled+label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked+label:after {
content: '';
position: absolute;
left: 6px;
top: 10px;
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;
transform: rotate(45deg);
}
}
}
font-size: 26px;
font-weight: 900;
}
}
.sort_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
}
.submit {
background-color: rgba(41, 40, 91, 1);
}
.cancel {
background-color: rgba(215, 213, 228, 1);
}
}
}
}
}
.sort_wrappper {
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
background: rgba(0, 0, 0, 0.6);
z-index: 99;
.sort_inner {
margin: 0 auto;
width: 90%;
padding: 10px;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 15px;
background-color: #fff;
position: relative;
-webkit-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.3);
top: 25%;
border-radius: 0px;
h4 {
text-align: center;
color: rgba(59, 57, 77, 1);
margin: 0px;
font-weight: bold;
padding: 10px;
font-size: 18px;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-bottom: 20px;
margin-bottom: 30px;
}
.search_box {
width: calc(100% - 100px);
height: 45px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}
.search_btn {
width: 100px;
height: 45px;
background-color: rgba(41, 40, 91, 1);
border: none;
color: #fff;
font-size: 16px;
}
ul {
margin: 0px;
padding: 0px;
li {
list-style: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.16);
padding-top: 10px;
padding-bottom: 10px;
.styled-checkbox {
position: absolute; // take it out of document flow
opacity: 0; // hide it
& + label {
position: relative;
cursor: pointer;
padding: 0;
width: 100%;
}
// Box.
& + label:before {
content: '';
margin-right: 10px;
display: inline-block;
vertical-align: text-top;
width: 20px;
height: 20px;
border-radius: 5px;
background: white;
border: 1px solid rgba(215, 213, 228, 1);
}
&:checked + label:before {
background: #29285b;
}
// Disabled state label.
&:disabled + label {
color: #b8b8b8;
cursor: auto;
}
// Disabled box.
&:disabled + label:before {
box-shadow: none;
background: #ddd;
}
// Checkmark. Could be replaced with an image
&:checked + label:after {
content: '';
position: absolute;
left: 6px;
top: 10px;
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;
transform: rotate(45deg);
}
}
}
}
.sort_footer {
padding-top: 10px;
button {
border-radius: 8px;
height: 40px;
width: 48%;
color: #fff;
font-size: 15px;
font-weight: lighter;
}
.submit {
background-color: rgba(41, 40, 91, 1);
}
.cancel {
background-color: rgba(215, 213, 228, 1);
}
}
}
\ No newline at end of file
}
}
......@@ -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
......@@ -72,9 +72,22 @@
<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"
minlength="6"
#currentPassword="ngModel"
[(ngModel)]="updatePassword.currentPassword"
name="currentPassword"
placeholder="Current Password"
/>
<div
*ngIf="currentPassword.errors && currentPassword.errors.minlength"
>
Password must be at least 6 characters
</div>
</div>
<div class="row">
<input
class=""
......@@ -83,6 +96,7 @@
type="password"
placeholder="New Password"
minlength="6"
[required]="currentPassword ? true: false"
#password="ngModel"
/>
<div *ngIf="password.errors && password.errors.minlength">
......@@ -96,10 +110,11 @@
[(ngModel)]="updatePassword.confirmPassword"
name="confirmPassword"
type="password"
[required]="currentPassword ? true: false"
placeholder="Confirm Password"
/>
<div *ngIf="">
Password should match
<div *ngIf="confirmPassword.errors">
{{confPasswordErr}}
</div>
</div>
</div>
......@@ -112,3 +127,10 @@
</form>
</div>
</ion-content>
<div class="loader" *ngIf="register.loader">
<div class="lds-ripple">
<div></div>
<div></div>
</div>
</div>
......@@ -17,6 +17,7 @@ export class ChangedetailsPage implements OnInit {
name: '',
phone: ''
};
confPasswordErr: string;
updatePassword: UpdatePassword = {
password: '',
......@@ -32,10 +33,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,18 +63,28 @@ export class ChangedetailsPage implements OnInit {
console.log(form.value);
if (form.valid) {
// Change Password
if (
form.value.password &&
form.value.password != form.value.confirmPassword
) {
// this.register.updatePassword(form.value.password);
if (form.value.currentPassword && form.value.password) {
if (
form.value.password &&
form.value.password === form.value.confirmPassword
) {
// this.register.updateData(form.value, this.userData.uid);
this.register.updatePassword(
form.value.currentPassword,
form.value.password
);
console.log('Password Changed and profile updated'), form.value;
} else {
console.log('Password should match');
this.confPasswordErr = 'Password should match';
}
} else {
alert('Password should match');
// this.register.updateData(form.value, this.userData);
console.log('profile updated', form.value);
}
// 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);
} else {
console.log(form);
}
}
}
......@@ -108,7 +108,7 @@
img {
width: 100%;
height: 100%;
object-fit: cover;
object-fit: contain;
object-position: center;
}
}
......
......@@ -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,10 +57,14 @@ export class ProfilePage implements OnInit {
}
});
this.service.get('userData').then(data => {
if (data) {
this.loggedUser = JSON.parse(data);
}
// Listens to url
route.params.subscribe(val => {
// 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 {
}
ngOnInit() {
console.log('profile page');
const This = this;
setTimeout(() => {
this.user = this.useService.users;
......
......@@ -9,42 +9,42 @@
</div>
<ion-content>
<!-- <div class="wishlist-wrapper">
<ul>
<li>
<div class="wishlist_image">
<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>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
<li>
<div class="wishlist_image">
<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>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
</ul>
</div> -->
<div class="wishlist-wrapper">
<ul>
<li>
<div class="wishlist_image">
<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>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
<li>
<div class="wishlist_image">
<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>
<div class="clear"></div>
<p>Green, Small</p>
<h1>AU$88.00</h1>
</div>
<div class="clear"></div>
</li>
</ul>
</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;
}
......@@ -21,6 +21,7 @@ export class UpdateService {
type: number;
userPostData: any;
updateStatus: number;
loader: boolean;
constructor(
public afs: AngularFirestore,
......@@ -47,25 +48,88 @@ export class UpdateService {
// });
}
updateData(userData: UpdateUserDetails, uid: string) {
// Update User Data
updateData(userData: UpdateUserDetails, oldData: User) {
this.loader = true;
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.router.navigateByUrl('profile');
this.service
.set('userData', JSON.stringify(updateOldData))
.then(res => {
console.log('success', updateOldData, res);
this.service
.showToast('Profile updated!', 'top', 'my-toast', 1000)
.then(res => {
this.router.navigateByUrl('profile');
this.loader = false;
});
})
.catch(err => console.log(err));
})
.catch(error => {
console.log(error);
});
}
// Change user password
updatePassword(currentPassword: string, newPasswd: string) {
this.loader = true;
let currentUser = this.afAuth.auth.currentUser; // Gets current user
// Credential is required for re-authentication
const credential = auth.EmailAuthProvider.credential(
currentUser.email,
currentPassword
);
// Re-authenticate user
currentUser
.reauthenticateWithCredential(credential)
.then(() => {
currentUser
.updatePassword(newPasswd) // Update password
.then(success => {
console.log('password changed');
this.loader = false;
this.service
.showToast('Password Changed!', 'top', 'my-toast', 1000) //success toast
.then(res => {
this.router.navigateByUrl('profile');
this.loader = false;
});
})
.catch(error => {
console.log('something fishy');
this.service
.showToast('Something went wrong', 'top', 'my-toast', 1000) //failure toast
.then(res => {
this.loader = false;
});
});
})
.catch(error => {
console.log(error);
this.service
.showToast(error.message, 'top', 'my-error', 3000) //failure toast
.then(res => {
this.loader = false;
});
});
}
}
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