This commit is contained in:
Le Deng
2017-03-11 16:55:19 -05:00
parent 190058907a
commit d486eae6e9
2 changed files with 23 additions and 3 deletions

View File

@@ -172,7 +172,16 @@ export class OrderComponent implements OnInit {
res=>{
console.log(res.json());
this.userShippingList=res.json();
this.emptyShippingList = false;
if(this.userShippingList.length) {
this.emptyShippingList = false;
for (let userShipping of this.userShippingList) {
if(userShipping.userShippingDefault) {
this.setShippingAddress(userShipping);
return;
}
}
}
},
error=>{
console.log(error.text());
@@ -184,6 +193,17 @@ export class OrderComponent implements OnInit {
console.log(res.json());
this.userPaymentList=res.json();
this.emptyPaymentList = false;
if(this.userPaymentList.length) {
this.emptyPaymentList = false;
for (let userPayment of this.userPaymentList) {
if(userPayment.defaultPayment) {
this.setPaymentMethod(userPayment);
return;
}
}
}
},
error=>{
console.log(error.text());