fix(结账页面): 在支付成功后返回上一页
在支付成功后,除了清空购物车,还增加了返回上一页的逻辑,以提升用户体验。同时更新了路由守卫文件中的注释标签。
Showing
2 changed files
with
5 additions
and
3 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-03-20 20:36:36 | 2 | * @Date: 2025-03-20 20:36:36 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-03-27 16:49:19 | 4 | + * @LastEditTime: 2025-05-23 14:21:22 |
| 5 | * @FilePath: /mlaj/src/router/guards.js | 5 | * @FilePath: /mlaj/src/router/guards.js |
| 6 | * @Description: 路由守卫逻辑 | 6 | * @Description: 路由守卫逻辑 |
| 7 | */ | 7 | */ |
| ... | @@ -24,7 +24,7 @@ export const authRequiredRoutes = [ | ... | @@ -24,7 +24,7 @@ export const authRequiredRoutes = [ |
| 24 | }, | 24 | }, |
| 25 | ] | 25 | ] |
| 26 | 26 | ||
| 27 | -// 微信授权检查 | 27 | +// TAG: 微信授权检查 |
| 28 | export const checkWxAuth = async () => { | 28 | export const checkWxAuth = async () => { |
| 29 | if (!import.meta.env.DEV && wxInfo().isWeiXin) { | 29 | if (!import.meta.env.DEV && wxInfo().isWeiXin) { |
| 30 | try { | 30 | try { | ... | ... |
| ... | @@ -374,7 +374,9 @@ const handleSubmit = async (e) => { | ... | @@ -374,7 +374,9 @@ const handleSubmit = async (e) => { |
| 374 | // 处理支付成功 | 374 | // 处理支付成功 |
| 375 | const handlePaymentSuccess = () => { | 375 | const handlePaymentSuccess = () => { |
| 376 | orderComplete.value = true | 376 | orderComplete.value = true |
| 377 | - clearCart() | 377 | + clearCart(); |
| 378 | + // 返回上一页 | ||
| 379 | + router.go(-1) | ||
| 378 | } | 380 | } |
| 379 | 381 | ||
| 380 | // 处理支付失败 | 382 | // 处理支付失败 | ... | ... |
-
Please register or login to post a comment