From bd01b17c2447fbd25c18d50f9e03a46def6dbb84 Mon Sep 17 00:00:00 2001 From: sszdot Date: Tue, 17 Dec 2024 15:07:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F=E6=88=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=90=8E=20=E9=83=BD=E8=B7=B3=E8=BD=AC=E5=88=B0=20=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=20=E3=80=90?= =?UTF-8?q?=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- pages/shop/pay.vue | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/pages/shop/pay.vue b/pages/shop/pay.vue index ae0f6af..53643d8 100644 --- a/pages/shop/pay.vue +++ b/pages/shop/pay.vue @@ -129,6 +129,12 @@ title: '支付失败', icon: 'error' }) + // 延迟跳转到首页 + setTimeout(() => { + uni.reLaunch({ + url: '/pages/main/order', + }) + }, 1500) // 1.5秒后跳转 console.error(res.data.msg) } }) @@ -142,23 +148,33 @@ signType: payMsg.signType, paySign: payMsg.paySign, success: (res) => { - if (res.status === 1) { - uni.showToast({ - title: '支付成功', - icon: 'success' + uni.showToast({ + title: '支付成功', + icon: 'success' + }) + + // 延迟跳转到首页 + setTimeout(() => { + uni.reLaunch({ + url: '/pages/main/order', }) - } + }, 1500) // 1.5秒后跳转 }, fail: (err) => { + console.error('支付失败:', err) uni.showToast({ title: '支付失败', icon: 'error' }) - console.error(err) + // 延迟跳转到首页 + setTimeout(() => { + uni.reLaunch({ + url: '/pages/main/order', + }) + }, 1500) // 1.5秒后跳转 } }) - }, - + } }, destroyed() {