支付后跳转问题

msb_beta
ch 3 years ago
parent 9b92348b3d
commit ec4d401f49

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-29 14:26:10 * @Date: 2022-04-29 14:26:10
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-05 11:26:35 * @LastEditTime: 2022-05-05 19:16:29
* @Description: file content * @Description: file content
*/ */
@ -35,7 +35,7 @@ export const Wxpay = async ({orderId,openId})=>{
}, res => { }, res => {
if(res.err_msg !== 'get_brand_wcpay_request:cancel'){ if(res.err_msg !== 'get_brand_wcpay_request:cancel'){
uni.navigateTo({ 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); uni.$u.toast(error.message);
return false; 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}`; window.location.href = `${result.dataInfo.payUrl}&redirect_url=${redirect_url}`;
} }
} }

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-28 15:01:41 * @Date: 2022-04-28 15:01:41
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-05 11:34:39 * @LastEditTime: 2022-05-05 19:18:30
* @Description: file content * @Description: file content
--> -->
@ -29,7 +29,7 @@
<view class="title">支付失败</view> <view class="title">支付失败</view>
<view class="desc">请重新试试</view> <view class="desc">请重新试试</view>
<view class="btns"> <view class="btns">
<UiButton class="btn" @click="$Router.back()"></UiButton> <UiButton class="btn" @click="back"> </UiButton>
</view> </view>
</template> </template>
</template> </template>
@ -66,6 +66,14 @@ export default {
} }
this.orderInfo = result; this.orderInfo = result;
uni.setNavigationBarTitle({title:result.isSuccess ? '支付成功' : '支付失败'}); uni.setNavigationBarTitle({title:result.isSuccess ? '支付成功' : '支付失败'});
},
back(){
const payType = this.$Route.query.payType;
if(payType === 'wxh5'){
this.$Router.back(2);
}else{
this.$Router.back();
}
} }
} }

Loading…
Cancel
Save