Merge pull request '增加微信h5支付逻辑' (#114) from main into space_domain

Reviewed-on: https://git.wishpal.cn/wishpal_ironfan/tiefen_space_web/pulls/114
This commit is contained in:
yezian 2025-03-17 19:52:00 +08:00
commit 7b25f4554b
2 changed files with 40 additions and 8 deletions

View File

@ -120,7 +120,7 @@ export default function Pay() {
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
custom_coins: customCoin.selected ? customCoin.num : 0,
pay_type: type,
redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "",
redirect_url: type === "wxpay_h5" ? "https://yibowanhe.top/success" : "",
from: searchParams.get("base") ? "web" : "app",
};
@ -163,9 +163,17 @@ export default function Pay() {
break;
case "wxpay_h5":
if (base.b_ch === "h5") {
window.parent.location.href = `https://yibowanhe.top?url=${encodeURIComponent(
// 使postMessage
const redirectUrl = `https://yibowanhe.top?url=${encodeURIComponent(
data.data.wxpay_h5_param_str
)}`;
window.parent.postMessage(
{
type: "navigation",
url: redirectUrl,
},
"*"
); //
} else {
router.push(
`https://yibowanhe.top?url=${encodeURIComponent(
@ -207,7 +215,7 @@ export default function Pay() {
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
custom_coins: customCoin.selected ? customCoin.num : 0,
pay_type: type,
redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "",
redirect_url: type === "wxpay_h5" ? "https://yibowanhe.top/success" : "",
from: searchParams.get("base") ? "web" : "app",
ver: "aliv2",
};
@ -251,9 +259,17 @@ export default function Pay() {
break;
case "wxpay_h5":
if (base.b_ch === "h5") {
window.parent.location.href = `https://yibowanhe.top?url=${encodeURIComponent(
// 使postMessage
const redirectUrl = `https://yibowanhe.top?url=${encodeURIComponent(
data.data.wxpay_h5_param_str
)}`;
window.parent.postMessage(
{
type: "navigation",
url: redirectUrl,
},
"*"
); //
} else {
router.push(
`https://yibowanhe.top?url=${encodeURIComponent(

View File

@ -90,7 +90,7 @@ export default function Vip() {
...base,
product_id: "membership",
pay_type: type,
redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "",
redirect_url: type === "wxpay_h5" ? "https://yibowanhe.top/success" : "",
from: searchParams.get("base") ? "web" : "app",
};
@ -133,9 +133,17 @@ export default function Vip() {
break;
case "wxpay_h5":
if (base.b_ch === "h5") {
window.parent.location.href = `https://yibowanhe.top?url=${encodeURIComponent(
// 使postMessage
const redirectUrl = `https://yibowanhe.top?url=${encodeURIComponent(
data.data.wxpay_h5_param_str
)}`;
window.parent.postMessage(
{
type: "navigation",
url: redirectUrl,
},
"*"
); //
} else {
router.push(
`https://yibowanhe.top?url=${encodeURIComponent(
@ -163,7 +171,7 @@ export default function Vip() {
...base,
product_id: "membership",
pay_type: type,
redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "",
redirect_url: type === "wxpay_h5" ? "https://yibowanhe.top/success" : "",
from: searchParams.get("base") ? "web" : "app",
ver: "aliv2",
};
@ -207,9 +215,17 @@ export default function Vip() {
break;
case "wxpay_h5":
if (base.b_ch === "h5") {
window.parent.location.href = `https://yibowanhe.top?url=${encodeURIComponent(
// 使postMessage
const redirectUrl = `https://yibowanhe.top?url=${encodeURIComponent(
data.data.wxpay_h5_param_str
)}`;
window.parent.postMessage(
{
type: "navigation",
url: redirectUrl,
},
"*"
); //
} else {
router.push(
`https://yibowanhe.top?url=${encodeURIComponent(