From a4b14a35a2209a30e53472e6333b13aa4a55b0eb Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 30 十二月 2025 22:14:25 +0800
Subject: [PATCH] feat:增加创建任务

---
 app/pagesTask/components/HospitalSelector.vue |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/app/pagesTask/components/HospitalSelector.vue b/app/pagesTask/components/HospitalSelector.vue
index cd4fd01..3b2dd62 100644
--- a/app/pagesTask/components/HospitalSelector.vue
+++ b/app/pagesTask/components/HospitalSelector.vue
@@ -45,7 +45,7 @@
             @click="selectAddressSuggestion(item)"
           >
             <view class="suggestion-name">{{ item.name }}</view>
-            <view class="suggestion-address">{{ item.district }}{{ item.address }}</view>
+            <view class="suggestion-address">{{ (item.district || '') + (item.address || '') }}</view>
           </view>
         </view>
       </view>
@@ -58,7 +58,7 @@
 
 <script>
 import { searchHospitals } from "@/api/hospital"
-import { baiduPlaceSuggestion } from "@/api/map"
+import { searchTianDiTuAddress } from "@/api/map"
 
 export default {
   name: 'HospitalSelector',
@@ -185,8 +185,9 @@
         this.searchResults = response.data || []
         this.showResults = true
       }).catch(error => {
-        console.error('鎼滅储鍖婚櫌澶辫触:', error)
+        // console.error('鎼滅储鍖婚櫌澶辫触:', error)
         this.searchResults = []
+        // this.showResults = false
       })
     },
     
@@ -215,9 +216,9 @@
         this.searchResults = this.defaultHospitals
         this.showResults = true
         this.hasLoadedDefault = true
-        console.log('鍔犺浇榛樿鍖婚櫌鍒楄〃锛屾暟閲�:', this.defaultHospitals.length)
+        // console.log('鍔犺浇榛樿鍖婚櫌鍒楄〃锛屾暟閲�:', this.defaultHospitals.length)
       }).catch(error => {
-        console.error('鍔犺浇榛樿鍖婚櫌鍒楄〃澶辫触:', error)
+        // console.error('鍔犺浇榛樿鍖婚櫌鍒楄〃澶辫触:', error)
         this.defaultHospitals = []
       })
     },
@@ -294,7 +295,7 @@
         
     // 鎼滅储鍦板潃寤鸿
     searchAddress(query) {
-      baiduPlaceSuggestion(query, this.region).then(response => {
+      searchTianDiTuAddress(query, this.region).then(response => {
         if (response.code === 200 && response.data) {
           this.addressSuggestions = response.data
           this.showAddressSuggestions = true
@@ -303,7 +304,7 @@
           this.showAddressSuggestions = false
         }
       }).catch(error => {
-        console.error('鎼滅储鍦板潃澶辫触:', error)
+        // console.error('鎼滅储鍦板潃澶辫触:', error)
         this.addressSuggestions = []
         this.showAddressSuggestions = false
       })
@@ -318,7 +319,7 @@
         
     // 閫夋嫨鍦板潃寤鸿
     selectAddressSuggestion(item) {
-      const fullAddress = item.district + item.address
+      const fullAddress = (item.district || '') + (item.address || '')
       this.$emit('input', {
         ...this.value,
         address: fullAddress

--
Gitblit v1.9.1