Commit 0e2f3581 authored by liwei's avatar liwei

liwei

...@@ -133,36 +133,37 @@ export default { ...@@ -133,36 +133,37 @@ export default {
// msg: "该用户没有物流信息" // msg: "该用户没有物流信息"
// }; // };
if (res) { if (res) {
if (res.deliver_detail && res.deliver_detail.length > 0) { if (res.deliver_detail.toString().slice(8, -1) == "Object") {
this.deliverDetail = res.deliver_detail[0]; this.deliverDetail = res.deliver_detail;
if ( } else if (res.deliver_detail.toString().slice(8, -1) == "Array") {
!this.deliverDetail.receive_name || if (res.deliver_detail.length > 0) {
this.deliverDetail.receive_name.length === 0 || this.deliverDetail = res.deliver_detail[0];
!this.deliverDetail.receive_mobile ||
this.deliverDetail.receive_mobile.length === 0 ||
!this.deliverDetail.address ||
this.deliverDetail.address.length === 0
) {
this.isShowCurrent = false;
} else {
this.isShowCurrent = true;
} }
} }
if (res.no_deliver_detail && res.no_deliver_detail.length > 0) { if (res.no_deliver_detail) {
this.noDeliverDetail = res.no_deliver_detail[0]; if (res.no_deliver_detail.toString().slice(8, -1) == "Object") {
if ( this.noDeliverDetail = res.no_deliver_detail;
!this.noDeliverDetail.receive_name || } else if (
this.noDeliverDetail.receive_name.length === 0 || res.no_deliver_detail.toString().slice(8, -1) == "Array"
!this.noDeliverDetail.receive_mobile ||
this.noDeliverDetail.receive_mobile.length === 0 ||
!this.noDeliverDetail.address ||
this.noDeliverDetail.address.length === 0
) { ) {
this.isShowNext = false; if (res.no_deliver_detail.length > 0) {
} else { this.noDeliverDetail = res.no_deliver_detail[0];
this.isShowNext = true; }
} }
} }
if (
!this.noDeliverDetail.receive_name ||
this.noDeliverDetail.receive_name.length === 0 ||
!this.noDeliverDetail.receive_mobile ||
this.noDeliverDetail.receive_mobile.length === 0 ||
!this.noDeliverDetail.address ||
this.noDeliverDetail.address.length === 0
) {
this.isShowNext = false;
} else {
this.isShowNext = true;
}
} }
}) })
.catch(error => { .catch(error => {
......
...@@ -112,29 +112,30 @@ export default { ...@@ -112,29 +112,30 @@ export default {
getNewestAddressListAPi() getNewestAddressListAPi()
.then(res => { .then(res => {
if (res) { if (res) {
if (res.deliver_detail && res.deliver_detail.length > 0) { if (res.deliver_detail) {
this.deliverDetail = res.deliver_detail[0]; if (res.deliver_detail.toString().slice(8, -1) == "Object") {
this.deliverDetail = res.deliver_detail;
} else if (
res.deliver_detail.toString().slice(8, -1) == "Array"
) {
if (res.deliver_detail.length > 0) {
this.deliverDetail = res.deliver_detail[0];
}
}
} }
if (res.no_deliver_detail && res.no_deliver_detail.length > 0) { if (res.no_deliver_detail) {
this.noDeliverDetail = res.no_deliver_detail[0]; if (res.no_deliver_detail.toString().slice(8, -1) == "Object") {
this.noDeliverDetail = res.no_deliver_detail;
} else if (
res.no_deliver_detail.toString().slice(8, -1) == "Array"
) {
if (res.no_deliver_detail.length > 0) {
this.noDeliverDetail = res.no_deliver_detail[0];
}
}
} }
if (!this.deliverDetail && !this.noDeliverDetail) { if (!this.deliverDetail && !this.noDeliverDetail) {
this.isShowAddress = false; this.isShowAddress = false;
} else if (
!this.deliverDetail &&
this.noDeliverDetail.length == 0
) {
this.isShowAddress = false;
} else if (
this.deliverDetail.length == 0 &&
!this.noDeliverDetail
) {
this.isShowAddress = false;
} else if (
this.deliverDetail.length == 0 &&
this.noDeliverDetail.length == 0
) {
this.isShowAddress = false;
} else { } else {
this.isShowAddress = true; this.isShowAddress = true;
} }
......
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