From 06a17c236d4cb9b8da75fce43af938cb7ea510bf Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期一, 15 十二月 2025 09:50:12 +0800
Subject: [PATCH] feat: 优化企业微信判断,优化gps分断处理
---
app/pagesTask/edit-welfare.vue | 66 +++++++++++++++++++++-----------
1 files changed, 43 insertions(+), 23 deletions(-)
diff --git a/app/pagesTask/edit-welfare.vue b/app/pagesTask/edit-welfare.vue
index 22d9ea6..ec5c362 100644
--- a/app/pagesTask/edit-welfare.vue
+++ b/app/pagesTask/edit-welfare.vue
@@ -171,6 +171,13 @@
selectedVehicleId: null,
selectedOrganization: '',
mapSelectorType: '',
+ // 鎵╁睍 addressCoordinates 鏀寔澶氱閿悕
+ addressCoordinates: {
+ start: null,
+ end: null,
+ startAddress: null,
+ endAddress: null
+ },
taskForm: {
serviceTime: '',
passenger: {
@@ -237,16 +244,22 @@
// 璁剧疆鍦板潃鍧愭爣锛堜娇鐢╩ixin涓殑鏂规硶锛�
if (this.taskDetail.departureLongitude && this.taskDetail.departureLatitude) {
- this.setStartLocation({
+ const startLocation = {
lng: this.taskDetail.departureLongitude,
lat: this.taskDetail.departureLatitude
- })
+ }
+ this.setStartLocation(startLocation)
+ // 鍚屾椂淇濆瓨鍒� startAddress 閿�
+ this.addressCoordinates.startAddress = startLocation
}
if (this.taskDetail.destinationLongitude && this.taskDetail.destinationLatitude) {
- this.setEndLocation({
+ const endLocation = {
lng: this.taskDetail.destinationLongitude,
lat: this.taskDetail.destinationLatitude
- })
+ }
+ this.setEndLocation(endLocation)
+ // 鍚屾椂淇濆瓨鍒� endAddress 閿�
+ this.addressCoordinates.endAddress = endLocation
}
}).catch(error => {
console.error('鍔犺浇浠诲姟璇︽儏澶辫触:', error)
@@ -288,10 +301,14 @@
if (this.mapSelectorType === 'startAddress') {
this.taskForm.startAddress = formattedAddress
- this.setLocationByAddress('start', address)
+ const location = this.setLocationByAddress('start', address)
+ // 鍚屾椂淇濆瓨鍒� startAddress 閿�
+ this.addressCoordinates.startAddress = location
} else if (this.mapSelectorType === 'endAddress') {
this.taskForm.endAddress = formattedAddress
- this.setLocationByAddress('end', address)
+ const location = this.setLocationByAddress('end', address)
+ // 鍚屾椂淇濆瓨鍒� endAddress 閿�
+ this.addressCoordinates.endAddress = location
}
// 鐩戝惉mixin涓殑璺濈璁$畻瀹屾垚浜嬩欢
@@ -345,29 +362,32 @@
},
buildSubmitData() {
+ // 鏋勫缓鎻愪氦鏁版嵁 - 浣跨敤涓� TaskCreateVO 涓�鑷寸殑缁撴瀯
const submitData = {
taskId: this.taskId,
taskType: 'WELFARE',
vehicleIds: this.selectedVehicleId ? [this.selectedVehicleId] : [],
plannedStartTime: this.taskForm.serviceTime,
- welfareInfo: {
- passengerContact: this.taskForm.passenger.contact,
- passengerPhone: this.taskForm.passenger.phone,
- pickupAddress: this.taskForm.startAddress,
- destinationAddress: this.taskForm.endAddress,
- serviceDistance: this.taskForm.distance ? parseFloat(this.taskForm.distance) : null,
- servicePrice: this.taskForm.price ? parseFloat(this.taskForm.price) : null
+
+ // 鍑哄彂鍦板湴鍧�鍜屽潗鏍�
+ departureAddress: this.taskForm.startAddress,
+ departureLongitude: this.addressCoordinates.startAddress ? this.addressCoordinates.startAddress.lng : null,
+ departureLatitude: this.addressCoordinates.startAddress ? this.addressCoordinates.startAddress.lat : null,
+
+ // 鐩爣鍦板湴鍧�鍜屽潗鏍�
+ destinationAddress: this.taskForm.endAddress,
+ destinationLongitude: this.addressCoordinates.endAddress ? this.addressCoordinates.endAddress.lng : null,
+ destinationLatitude: this.addressCoordinates.endAddress ? this.addressCoordinates.endAddress.lat : null,
+
+ // 璺濈鍜屼环鏍硷紙涓讳换鍔″瓧娈碉級
+ distance: this.taskForm.distance ? parseFloat(this.taskForm.distance) : null,
+ price: this.taskForm.price ? parseFloat(this.taskForm.price) : null,
+
+ // 涔樺淇℃伅锛堝祵濂楀璞★級
+ passenger: {
+ contact: this.taskForm.passenger.contact,
+ phone: this.taskForm.passenger.phone
}
- }
-
- if (this.addressCoordinates.startAddress) {
- submitData.departureLongitude = this.addressCoordinates.startAddress.lng
- submitData.departureLatitude = this.addressCoordinates.startAddress.lat
- }
-
- if (this.addressCoordinates.endAddress) {
- submitData.destinationLongitude = this.addressCoordinates.endAddress.lng
- submitData.destinationLatitude = this.addressCoordinates.endAddress.lat
}
return submitData
--
Gitblit v1.9.1