|
|
@@ -76,6 +76,7 @@
|
|
|
|
|
|
<view
|
|
|
v-if="taskFieldConfigList.length"
|
|
|
+ v-show="!keyboardVisible"
|
|
|
class="visit-add-page__footer"
|
|
|
:style="footerStyle"
|
|
|
>
|
|
|
@@ -198,7 +199,7 @@ const { setFieldFormValue, clearFieldValue } = useTaskFormFields({
|
|
|
})
|
|
|
|
|
|
const { showNotice, noticeText, selectLevel, initializeTaskFormPage } = useTaskFormPageFeatures()
|
|
|
-const { contentStyle, footerStyle, initSafeArea } = useTaskFormSafeArea()
|
|
|
+const { contentStyle, footerStyle, keyboardVisible, initSafeArea } = useTaskFormSafeArea()
|
|
|
const { currentLocation, locationStatus, rangeRadius, refreshCurrentLocation } = useVisitLocation()
|
|
|
|
|
|
const userId = computed(() => String(userStore.currentUserInfo?.userId ?? '').trim())
|
|
|
@@ -298,14 +299,18 @@ const syncTaskTypeField = () => {
|
|
|
setFieldText(taskTypeField.value, taskTypeId.value)
|
|
|
}
|
|
|
|
|
|
-const syncSelectedPoint = (point: SelectedPoint) => {
|
|
|
+const syncSelectedPointLocation = (point: SelectedPoint) => {
|
|
|
setFieldText(coordinateField.value, `${point.longitude},${point.latitude}`)
|
|
|
setFieldText(addressField.value, point.address)
|
|
|
setFieldText(districtField.value, point.district)
|
|
|
- setFieldText(targetNameField.value, point.name)
|
|
|
syncTaskTypeField()
|
|
|
}
|
|
|
|
|
|
+const initializeSelectedPointFields = (point: SelectedPoint) => {
|
|
|
+ syncSelectedPointLocation(point)
|
|
|
+ setFieldText(targetNameField.value, point.name)
|
|
|
+}
|
|
|
+
|
|
|
const loadVisitForm = async () => {
|
|
|
if (!taskTypeId.value) return
|
|
|
|
|
|
@@ -404,7 +409,7 @@ const handlePointTap = async (event: MapPoiTapEvent) => {
|
|
|
}
|
|
|
|
|
|
selectedPoint.value = point
|
|
|
- syncSelectedPoint(point)
|
|
|
+ initializeSelectedPointFields(point)
|
|
|
} catch (error) {
|
|
|
console.error('[task-visit-add] 地点解析失败', error)
|
|
|
showToast('获取地点信息失败')
|
|
|
@@ -479,7 +484,7 @@ const handleVisitSubmit = async () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- syncSelectedPoint(selectedPoint.value)
|
|
|
+ syncSelectedPointLocation(selectedPoint.value)
|
|
|
setFieldText(checkInField.value, checkInTime.value)
|
|
|
|
|
|
await handleSubmit()
|