|
@@ -181,49 +181,35 @@ export default {
|
|
|
this.$msg('请输入重量')
|
|
this.$msg('请输入重量')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_name) {
|
|
if (!this.expressForm.user_name) {
|
|
|
this.$msg('收货人姓名不能为空')
|
|
this.$msg('收货人姓名不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_phone) {
|
|
if (!this.expressForm.user_phone) {
|
|
|
this.$msg('收货人手机号不能为空')
|
|
this.$msg('收货人手机号不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_address) {
|
|
if (!this.expressForm.user_address) {
|
|
|
this.$msg('收货地址不能为空')
|
|
this.$msg('收货地址不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
this.isQuerying = true
|
|
this.isQuerying = true
|
|
|
- try {
|
|
|
|
|
- const data = {
|
|
|
|
|
- orderId: this.orderId,
|
|
|
|
|
- price: this.expressForm.price,
|
|
|
|
|
- weight: Number(this.expressForm.weight),
|
|
|
|
|
- packageNum: this.expressForm.packageNum,
|
|
|
|
|
- user_name: this.expressForm.user_name,
|
|
|
|
|
- user_phone: this.expressForm.user_phone,
|
|
|
|
|
- user_address: this.expressForm.user_address,
|
|
|
|
|
- user_lng: this.expressForm.user_lng,
|
|
|
|
|
- user_lat: this.expressForm.user_lat
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const res = await getStoreFee(data)
|
|
|
|
|
- if (res.code === 1) {
|
|
|
|
|
- const deliveryFee = res.data.est_fee || '0'
|
|
|
|
|
- this.deliveryFee = deliveryFee/100.0
|
|
|
|
|
- this.$msg('运费查询成功')
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$msg(res.msg || '查询运费失败')
|
|
|
|
|
- }
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- this.$msg('查询运费失败,请重试')
|
|
|
|
|
- console.error('查询运费错误:', error)
|
|
|
|
|
- } finally {
|
|
|
|
|
- this.isQuerying = false
|
|
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ orderId: this.orderId,
|
|
|
|
|
+ price: this.expressForm.price,
|
|
|
|
|
+ weight: Number(this.expressForm.weight),
|
|
|
|
|
+ packageNum: this.expressForm.packageNum,
|
|
|
|
|
+ user_name: this.expressForm.user_name,
|
|
|
|
|
+ user_phone: this.expressForm.user_phone,
|
|
|
|
|
+ user_address: this.expressForm.user_address,
|
|
|
|
|
+ user_lng: this.expressForm.user_lng,
|
|
|
|
|
+ user_lat: this.expressForm.user_lat
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getStoreFee(data)
|
|
|
|
|
+ if (res.code === 1) {
|
|
|
|
|
+ const deliveryFee = res.data.est_fee || '0'
|
|
|
|
|
+ this.deliveryFee = deliveryFee/100.0
|
|
|
|
|
+ this.$msg('运费查询成功')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -236,30 +222,24 @@ export default {
|
|
|
this.$msg('请输入重量')
|
|
this.$msg('请输入重量')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_name) {
|
|
if (!this.expressForm.user_name) {
|
|
|
this.$msg('收货人姓名不能为空')
|
|
this.$msg('收货人姓名不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_phone) {
|
|
if (!this.expressForm.user_phone) {
|
|
|
this.$msg('收货人手机号不能为空')
|
|
this.$msg('收货人手机号不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.expressForm.user_address) {
|
|
if (!this.expressForm.user_address) {
|
|
|
this.$msg('收货地址不能为空')
|
|
this.$msg('收货地址不能为空')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (!this.deliveryFee) {
|
|
if (!this.deliveryFee) {
|
|
|
this.$msg('请先查询运费')
|
|
this.$msg('请先查询运费')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
this.$util.confirmModal({content: '确认呼叫跑腿?'}, async () => {
|
|
this.$util.confirmModal({content: '确认呼叫跑腿?'}, async () => {
|
|
|
this.isSubmitting = true
|
|
this.isSubmitting = true
|
|
|
- try {
|
|
|
|
|
const data = {
|
|
const data = {
|
|
|
orderId: this.orderId,
|
|
orderId: this.orderId,
|
|
|
weight: Number(this.expressForm.weight),
|
|
weight: Number(this.expressForm.weight),
|
|
@@ -273,7 +253,6 @@ export default {
|
|
|
note: this.expressForm.note,
|
|
note: this.expressForm.note,
|
|
|
isNew: this.isNew
|
|
isNew: this.isNew
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
const res = await createExpressOrder(data)
|
|
const res = await createExpressOrder(data)
|
|
|
if (res.code === 1) {
|
|
if (res.code === 1) {
|
|
|
this.$msg('提交成功')
|
|
this.$msg('提交成功')
|
|
@@ -281,15 +260,7 @@ export default {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
|
}, 1500)
|
|
}, 1500)
|
|
|
- } else {
|
|
|
|
|
- this.$msg(res.msg || '创建配送订单失败')
|
|
|
|
|
}
|
|
}
|
|
|
- } catch (error) {
|
|
|
|
|
- this.$msg('创建配送订单失败,请重试')
|
|
|
|
|
- console.error('创建配送订单错误:', error)
|
|
|
|
|
- } finally {
|
|
|
|
|
- this.isSubmitting = false
|
|
|
|
|
- }
|
|
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|