|
|
@@ -128,11 +128,15 @@ export default {
|
|
|
orderId: null,
|
|
|
senderInfo: {
|
|
|
name: '门店',
|
|
|
- address: ''
|
|
|
+ address: '',
|
|
|
+ long: '',
|
|
|
+ lat: '',
|
|
|
},
|
|
|
receiverInfo: {
|
|
|
name: '客户',
|
|
|
- address: ''
|
|
|
+ address: '',
|
|
|
+ long: '',
|
|
|
+ lat: '',
|
|
|
},
|
|
|
deliveryList: [],
|
|
|
weight: 1,
|
|
|
@@ -171,12 +175,6 @@ export default {
|
|
|
return 0;
|
|
|
}
|
|
|
return parseInt(item.price);
|
|
|
- },
|
|
|
- isClientAddressInvalid() {
|
|
|
- return this.$util.isEmpty(this.receiverInfo.long) || this.$util.isEmpty(this.receiverInfo.lat) || this.$util.isEmpty(this.receiverInfo.address)
|
|
|
- },
|
|
|
- isSenderAddressInvalid() {
|
|
|
- return this.$util.isEmpty(this.senderInfo.long) || this.$util.isEmpty(this.senderInfo.lat) || this.$util.isEmpty(this.senderInfo.address)
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -195,8 +193,9 @@ export default {
|
|
|
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.loadOrderData();
|
|
|
- this.handleLoadDelivery();
|
|
|
+ this.loadOrderData().then(() => {
|
|
|
+ this.handleLoadDelivery();
|
|
|
+ });
|
|
|
},
|
|
|
created() {
|
|
|
if (this.deliveryList.length > 0 && !this.selectedDelivery) {
|
|
|
@@ -271,10 +270,10 @@ export default {
|
|
|
* 获取订单详情
|
|
|
*/
|
|
|
loadOrderData() {
|
|
|
- address({ orderId: this.orderId }).then(res => {
|
|
|
+ return address({ orderId: this.orderId }).then(res => {
|
|
|
if (res && res.code === 1) {
|
|
|
- this.senderInfo.address = res.data.send_address;
|
|
|
- this.receiverInfo.address = res.data.receive_address;
|
|
|
+ this.senderInfo = res.data.sender;
|
|
|
+ this.receiverInfo = res.data.receiver;
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
console.log('获取发货与收货地址失败:', err);
|
|
|
@@ -282,13 +281,14 @@ export default {
|
|
|
},
|
|
|
loadDeliveryList() {
|
|
|
//客户地址不完善
|
|
|
- if (this.isClientAddressInvalid) {
|
|
|
- //this.$msg('客户地址不完善,无法获取运力');
|
|
|
+ if(this.$util.isEmpty(this.receiverInfo.long) || this.$util.isEmpty(this.receiverInfo.lat) || this.$util.isEmpty(this.receiverInfo.address)) {
|
|
|
+ this.$msg('客户地址不完善,无法获取运力');
|
|
|
return;
|
|
|
}
|
|
|
- //门店
|
|
|
- if (this.isSenderAddressInvalid) {
|
|
|
- //this.$msg('门店地址不完善,无法获取运力');
|
|
|
+
|
|
|
+ //门店地址不完善
|
|
|
+ if(this.$util.isEmpty(this.senderInfo.long) || this.$util.isEmpty(this.senderInfo.lat) || this.$util.isEmpty(this.senderInfo.address)) {
|
|
|
+ this.$msg('门店地址不完善,无法获取运力');
|
|
|
return;
|
|
|
}
|
|
|
|