Sfoglia il codice sorgente

经纬度保留4为,修复重复请求问题

yuanmingze 2 settimane fa
parent
commit
ede8a7d28e

+ 1 - 2
src/pages-auth/settlement-channel-sign/index.vue

@@ -486,7 +486,6 @@ const signRedirect = async (subjectLocation: string): Promise<boolean> => {
       title: '签约成功',
       icon: 'success',
     })
-    await userStore.getUserInfoByCode()
     return true
   } catch (error) {
     console.error('signRedirect error:', error)
@@ -495,13 +494,13 @@ const signRedirect = async (subjectLocation: string): Promise<boolean> => {
 }
 
 onLoad(async (query) => {
-  await userStore.getUserInfoByCode()
   const subjectLocation = query?.subjectLocationByUrl?.trim() || ''
 
   if (subjectLocation) {
     await signRedirect(subjectLocation)
   }
 
+  await userStore.getUserInfoByCode()
   await getSubjectLocationDict()
 })
 </script>

+ 6 - 1
src/pages-task/task-detail/components/sign-task-detail/SignRecordCard.vue

@@ -12,7 +12,8 @@
     <view v-if="item.record.address" class="sign-record-card__location">
       <view class="sign-record-card__address">{{ item.record.address }}</view>
       <view v-if="item.hasCoordinates" class="sign-record-card__coordinate">
-        任务定位:{{ item.record.longitude }}, {{ item.record.latitude }}
+        任务定位:{{ formatCoordinate(item.record.longitude) }},
+        {{ formatCoordinate(item.record.latitude) }}
       </view>
     </view>
 
@@ -24,6 +25,10 @@
 import SignVisitDetails from './SignVisitDetails.vue'
 import type { SignRecordDisplay } from './types'
 
+function formatCoordinate(value: string | null) {
+  return Number(value).toFixed(4)
+}
+
 defineProps<{
   item: SignRecordDisplay
 }>()