fix: 微信小程序余额充值不跳转问题

This commit is contained in:
黄少君
2024-02-26 16:49:35 +08:00
parent f8fac0a5bc
commit e7600b4df1
136 changed files with 166 additions and 2 deletions

View File

@ -35,6 +35,7 @@ onLoad(() => {
})
onShow(() => {
mainStore.getUserInfo()
refreshPage()
})
</script>

View File

@ -15,11 +15,12 @@ import { onLoad } from "@dcloudio/uni-app";
import { useRouter } from "@/hooks/useRouter";
import { createRechargeOrder, getRechargeConfig } from "@/api/account/balance";
import { doPayment, PayType } from "@/utils/paymentUtils";
import { h5InWeChat } from "@/utils";
// ========================= hooks ==========================
const {toast, loading, hideLoading} = useInterface();
const {scrollTop} = useScroll();
const {getParams} = useRouter();
const {getParams, push} = useRouter();
// =========================== 充值方式 =========================
@ -115,6 +116,15 @@ async function confirm() {
type: PayType["0"],
payInfo: {orderId}
})
// #ifndef H5
push({url: '/views/account/balance/index'})
// #endif
// 处理微信内h5
// #ifdef H5
if (h5InWeChat()) {
push({url: '/views/account/balance/index'})
}
// #endif
} catch (e) {
console.error(e)
throw new Error(e)