fix(plan): 修改提交结果页按钮为返回上一页
- 按钮文本:从返回首页改为完成 - 按钮逻辑:使用 Taro.navigateBack() 返回上一页 - 移除 useGo hook 依赖 原因:结果页可能从多个入口进入,返回上一页更符合用户操作流程 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Showing
1 changed file
with
13 additions
and
9 deletions
| ... | @@ -39,15 +39,15 @@ | ... | @@ -39,15 +39,15 @@ |
| 39 | </div> | 39 | </div> |
| 40 | </div> | 40 | </div> |
| 41 | 41 | ||
| 42 | - <!-- 返回首页按钮 - 固定在底部 --> | 42 | + <!-- 完成按钮 - 固定在底部 --> |
| 43 | <div class="fixed bottom-0 left-0 right-0 bg-white px-[32rpx] py-[24rpx] pb-[calc(24rpx+env(safe-area-inset-bottom))]"> | 43 | <div class="fixed bottom-0 left-0 right-0 bg-white px-[32rpx] py-[24rpx] pb-[calc(24rpx+env(safe-area-inset-bottom))]"> |
| 44 | <nut-button | 44 | <nut-button |
| 45 | type="primary" | 45 | type="primary" |
| 46 | block | 46 | block |
| 47 | class="!h-[88rpx]" | 47 | class="!h-[88rpx]" |
| 48 | - @click="goHome" | 48 | + @click="handleComplete" |
| 49 | > | 49 | > |
| 50 | - 返回首页 | 50 | + 完成 |
| 51 | </nut-button> | 51 | </nut-button> |
| 52 | </div> | 52 | </div> |
| 53 | </div> | 53 | </div> |
| ... | @@ -56,10 +56,8 @@ | ... | @@ -56,10 +56,8 @@ |
| 56 | <script setup> | 56 | <script setup> |
| 57 | import { ref, computed } from 'vue' | 57 | import { ref, computed } from 'vue' |
| 58 | import { useLoad } from '@tarojs/taro' | 58 | import { useLoad } from '@tarojs/taro' |
| 59 | +import Taro from '@tarojs/taro' | ||
| 59 | import NavHeader from '@/components/NavHeader.vue' | 60 | import NavHeader from '@/components/NavHeader.vue' |
| 60 | -import { useGo } from '@/hooks/useGo' | ||
| 61 | - | ||
| 62 | -const go = useGo() | ||
| 63 | 61 | ||
| 64 | // 接收页面参数 | 62 | // 接收页面参数 |
| 65 | const success = ref(true) | 63 | const success = ref(true) |
| ... | @@ -91,9 +89,15 @@ useLoad((options) => { | ... | @@ -91,9 +89,15 @@ useLoad((options) => { |
| 91 | } | 89 | } |
| 92 | }) | 90 | }) |
| 93 | 91 | ||
| 94 | -// 返回首页 | 92 | +/** |
| 95 | -const goHome = () => { | 93 | + * 完成 - 返回上一页 |
| 96 | - go('/pages/index/index') | 94 | + * @description 因为入口可能来自多个页面(产品详情、计划书等), |
| 95 | + * 所以统一返回上一页而不是跳转到首页 | ||
| 96 | + */ | ||
| 97 | +const handleComplete = () => { | ||
| 98 | + Taro.navigateBack({ | ||
| 99 | + delta: 1 | ||
| 100 | + }) | ||
| 97 | } | 101 | } |
| 98 | </script> | 102 | </script> |
| 99 | 103 | ... | ... |
-
Please register or login to post a comment