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:
commit
7b25f4554b
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue