|
|
@@ -154,7 +154,12 @@
|
|
|
<!-- 按钮 -->
|
|
|
<div class="custom-bottom-fixed-btns">
|
|
|
<!-- <div class="bottom-btn secondary-btn" @click="handlePage">跳过</div> -->
|
|
|
- <div class="bottom-btn primary-btn" @click="handlePage">确认信息</div>
|
|
|
+ <div
|
|
|
+ class="bottom-btn primary-btn"
|
|
|
+ @click.stop="handlePage"
|
|
|
+ @touchstart.stop
|
|
|
+ @touchend.stop
|
|
|
+ >确认信息</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -630,47 +635,54 @@ const disabledDate = (time) => {
|
|
|
return time.getTime() < minDate.getTime() || time.getTime() >= tomorrow.getTime();
|
|
|
}
|
|
|
const handlePage = async () => {
|
|
|
- // 先进行校验
|
|
|
- if (!validateForm()) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const typeNames = JSON.parse(route.query.typeNames);
|
|
|
- phenologyList.value = typeNames.map(item => ({
|
|
|
- typeName: item,
|
|
|
- phenologyId: firstPhenology.value.phenologyId,
|
|
|
- startDateLabel: firstPhenology.value.startDateLabel,
|
|
|
- phenologyName: firstPhenology.value.phenologyName,
|
|
|
- phenologyStartDate: '2026-01-01',
|
|
|
- }));
|
|
|
- // 如果有选择的专家,添加 preferredExpertCode
|
|
|
- if (basicForm.value.expertCode) {
|
|
|
- const selectedExpert = basicFarmFormData.value.expertOptions.find(item => item.code === basicForm.value.expertCode);
|
|
|
- if (selectedExpert) {
|
|
|
- basicForm.value.expertInfo = selectedExpert;
|
|
|
+ try {
|
|
|
+ // 先进行校验
|
|
|
+ if (!validateForm()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 安全解析 typeNames
|
|
|
+ let typeNames = [];
|
|
|
+ try {
|
|
|
+ if (route.query.typeNames) {
|
|
|
+ typeNames = JSON.parse(route.query.typeNames);
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('缺少必要参数,请重新进入页面');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('解析 typeNames 失败:', e);
|
|
|
+ ElMessage.warning('参数格式错误,请重新进入页面');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查 firstPhenology 是否已初始化
|
|
|
+ if (!firstPhenology.value || !firstPhenology.value.phenologyId) {
|
|
|
+ ElMessage.warning('物候期数据未加载完成,请稍候再试');
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+ phenologyList.value = typeNames.map(item => ({
|
|
|
+ typeName: item,
|
|
|
+ phenologyId: firstPhenology.value.phenologyId,
|
|
|
+ startDateLabel: firstPhenology.value.startDateLabel,
|
|
|
+ phenologyName: firstPhenology.value.phenologyName,
|
|
|
+ phenologyStartDate: '2026-01-01',
|
|
|
+ }));
|
|
|
+
|
|
|
+ // 如果有选择的专家,添加 preferredExpertCode
|
|
|
+ if (basicForm.value.expertCode) {
|
|
|
+ const selectedExpert = basicFarmFormData.value.expertOptions?.find(item => item.code === basicForm.value.expertCode);
|
|
|
+ if (selectedExpert) {
|
|
|
+ basicForm.value.expertInfo = selectedExpert;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ showPeriodPopup.value = true;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('handlePage 执行失败:', error);
|
|
|
+ ElMessage.error('操作失败,请重试');
|
|
|
}
|
|
|
- showPeriodPopup.value = true;
|
|
|
- // // 获取所有需要传递的参数,包括 from 参数
|
|
|
- // const queryParams = {
|
|
|
- // containerId: route.query.containerId,
|
|
|
- // };
|
|
|
-
|
|
|
- // // 如果存在 from 参数,继续传递
|
|
|
- // if (route.query.from) {
|
|
|
- // queryParams.from = route.query.from;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 传递所有农场相关的参数,以便在 agricultural_plan 页面创建农场
|
|
|
- // const farmParams = ['wkt', 'speciesId', 'containerId', 'agriculturalCreate', 'geom', 'address', 'mu', 'name', 'fzr', 'tel', 'defaultFarm', 'typeId', 'speciesName', 'userType'];
|
|
|
- // farmParams.forEach(key => {
|
|
|
- // if (route.query[key] !== undefined) {
|
|
|
- // queryParams[key] = route.query[key];
|
|
|
- // }
|
|
|
- // });
|
|
|
- // router.push({
|
|
|
- // path: '/agricultural_plan',
|
|
|
- // query: queryParams
|
|
|
- // });
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -1280,6 +1292,32 @@ const handlePeriodConfirm = async () => {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 优化按钮点击体验,解决移动端点击无响应问题
|
|
|
+.custom-bottom-fixed-btns {
|
|
|
+ z-index: 99 !important; // 提高 z-index,确保不被其他元素遮挡
|
|
|
+ pointer-events: auto; // 确保可以接收点击事件
|
|
|
+
|
|
|
+ .bottom-btn {
|
|
|
+ cursor: pointer;
|
|
|
+ user-select: none; // 防止文本选择
|
|
|
+ touch-action: manipulation; // 优化移动端触摸响应
|
|
|
+ -webkit-tap-highlight-color: transparent; // 移除移动端点击高亮
|
|
|
+ position: relative; // 确保点击区域正确
|
|
|
+ z-index: 1;
|
|
|
+
|
|
|
+ // 添加点击反馈效果
|
|
|
+ &:active {
|
|
|
+ opacity: 0.8;
|
|
|
+ transform: scale(0.98);
|
|
|
+ }
|
|
|
+
|
|
|
+ &.primary-btn {
|
|
|
+ // 确保按钮可点击
|
|
|
+ pointer-events: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|