From ec4d401f49fd9956b04bb873b40e6559c456c493 Mon Sep 17 00:00:00 2001 From: ch Date: Thu, 5 May 2022 19:31:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=90=8E=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/utils/wxpay.js | 6 +++--- pages/order/payResult.vue | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/common/utils/wxpay.js b/common/utils/wxpay.js index da6c650..3f8f5e1 100644 --- a/common/utils/wxpay.js +++ b/common/utils/wxpay.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-04-29 14:26:10 * @LastEditors: ch - * @LastEditTime: 2022-05-05 11:26:35 + * @LastEditTime: 2022-05-05 19:16:29 * @Description: file content */ @@ -35,7 +35,7 @@ export const Wxpay = async ({orderId,openId})=>{ }, res => { if(res.err_msg !== 'get_brand_wcpay_request:cancel'){ uni.navigateTo({ - url : `/payResult?orderId=${orderId}` + url : `/payResult?orderId=${orderId}&payType=wxjsapi` }); } }) @@ -46,7 +46,7 @@ export const Wxpay = async ({orderId,openId})=>{ uni.$u.toast(error.message); return false; } - const redirect_url = decodeURIComponent(`https://you-app.mashibing.com/payResult?orderId=${orderId}`); + const redirect_url = decodeURIComponent(`https://you-app.mashibing.com/payResult?orderId=${orderId}&payType=wxh5`); window.location.href = `${result.dataInfo.payUrl}&redirect_url=${redirect_url}`; } } \ No newline at end of file diff --git a/pages/order/payResult.vue b/pages/order/payResult.vue index 6f04b49..1d2b73e 100644 --- a/pages/order/payResult.vue +++ b/pages/order/payResult.vue @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-04-28 15:01:41 * @LastEditors: ch - * @LastEditTime: 2022-05-05 11:34:39 + * @LastEditTime: 2022-05-05 19:18:30 * @Description: file content --> @@ -29,7 +29,7 @@ 支付失败 请重新试试 - 返回商品详情 + 返 回 @@ -66,6 +66,14 @@ export default { } this.orderInfo = result; uni.setNavigationBarTitle({title:result.isSuccess ? '支付成功' : '支付失败'}); + }, + back(){ + const payType = this.$Route.query.payType; + if(payType === 'wxh5'){ + this.$Router.back(2); + }else{ + this.$Router.back(); + } } }