From 4f2925f1974844b66225ac70ae35065b8262b315 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 04 十二月 2025 13:26:11 +0800
Subject: [PATCH] feat:增加微信token缓存

---
 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