hookehuyr

refactor(CheckoutPage): 调整支付弹窗高度和返回按钮逻辑

将支付弹窗的高度调整为100%,移除不必要的圆角样式。修改支付成功后的返回按钮逻辑,从返回首页改为返回上一页,并更新按钮文本为“完成”。简化代码,移除冗余的导航逻辑。
......@@ -251,14 +251,12 @@
<van-popup
v-model:show="showPayment"
position="bottom"
round
:style="{ height: '50%' }"
:style="{ height: '100%' }"
>
<div class="bg-gradient-to-r from-green-500/10 to-blue-500/10 h-full">
<WechatPayment
v-if="showPayment && orderId"
:order-id="orderId"
cancelBtnText="关闭"
@success="handlePaymentSuccess"
@failed="handlePaymentFailed"
@processing="handlePaymentProcessing"
......@@ -266,10 +264,10 @@
>
<template #success-action>
<button
@click="handleBackToHome"
@click="handleBack"
class="w-full bg-gradient-to-r from-green-500 to-green-600 text-white py-3 rounded-xl font-medium"
>
返回首页
完成
</button>
</template>
<template #failed-action>
......@@ -375,8 +373,6 @@ const handleSubmit = async (e) => {
const handlePaymentSuccess = () => {
orderComplete.value = true
clearCart();
// 返回上一页
router.go(-1)
}
// 处理支付失败
......@@ -390,8 +386,8 @@ const handlePaymentProcessing = () => {
console.log('支付处理中...')
}
// Handle navigation back to home after order completion
const handleBackToHome = () => {
router.push('/')
// 返回详情页
const handleBack = () => {
router.go(-1)
}
</script>
......