fix(路由): 修复戒子和义工页面跳转逻辑,优先使用category_link
当item存在category_link时,使用location.href跳转,否则保持原有router.push逻辑
Showing
1 changed file
with
8 additions
and
0 deletions
| ... | @@ -308,11 +308,19 @@ const viewMore = (type, item) => { | ... | @@ -308,11 +308,19 @@ const viewMore = (type, item) => { |
| 308 | break | 308 | break |
| 309 | case '戒子': | 309 | case '戒子': |
| 310 | // 跳转到戒子页面的逻辑 | 310 | // 跳转到戒子页面的逻辑 |
| 311 | + if (item?.category_link) { | ||
| 312 | + location.href = location.origin + location.pathname + '#/' + item?.category_link; | ||
| 313 | + } else { | ||
| 311 | router.push(`/students?i=${item.id}`) | 314 | router.push(`/students?i=${item.id}`) |
| 315 | + } | ||
| 312 | break | 316 | break |
| 313 | case '义工': | 317 | case '义工': |
| 314 | // 跳转到义工页面的逻辑 | 318 | // 跳转到义工页面的逻辑 |
| 319 | + if (item?.category_link) { | ||
| 320 | + location.href = location.origin + location.pathname + '#/' + item?.category_link; | ||
| 321 | + } else { | ||
| 315 | router.push(`/volunteers?i=${item.id}`) | 322 | router.push(`/volunteers?i=${item.id}`) |
| 323 | + } | ||
| 316 | break | 324 | break |
| 317 | } | 325 | } |
| 318 | } | 326 | } | ... | ... |
-
Please register or login to post a comment