增加微信h5支付逻辑
This commit is contained in:
parent
38d69b98c1
commit
a2e99c58b2
|
@ -120,7 +120,7 @@ export default function Pay() {
|
||||||
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
|
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
|
||||||
custom_coins: customCoin.selected ? customCoin.num : 0,
|
custom_coins: customCoin.selected ? customCoin.num : 0,
|
||||||
pay_type: type,
|
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",
|
from: searchParams.get("base") ? "web" : "app",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -163,9 +163,17 @@ export default function Pay() {
|
||||||
break;
|
break;
|
||||||
case "wxpay_h5":
|
case "wxpay_h5":
|
||||||
if (base.b_ch === "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
|
data.data.wxpay_h5_param_str
|
||||||
)}`;
|
)}`;
|
||||||
|
window.parent.postMessage(
|
||||||
|
{
|
||||||
|
type: "navigation",
|
||||||
|
url: redirectUrl,
|
||||||
|
},
|
||||||
|
"*"
|
||||||
|
); // 生产环境中应替换为父页面的确切域名
|
||||||
} else {
|
} else {
|
||||||
router.push(
|
router.push(
|
||||||
`https://yibowanhe.top?url=${encodeURIComponent(
|
`https://yibowanhe.top?url=${encodeURIComponent(
|
||||||
|
@ -207,7 +215,7 @@ export default function Pay() {
|
||||||
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
|
product_id: customCoin.selected ? "h5_custom_coin" : selectedPrice.id,
|
||||||
custom_coins: customCoin.selected ? customCoin.num : 0,
|
custom_coins: customCoin.selected ? customCoin.num : 0,
|
||||||
pay_type: type,
|
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",
|
from: searchParams.get("base") ? "web" : "app",
|
||||||
ver: "aliv2",
|
ver: "aliv2",
|
||||||
};
|
};
|
||||||
|
@ -251,9 +259,17 @@ export default function Pay() {
|
||||||
break;
|
break;
|
||||||
case "wxpay_h5":
|
case "wxpay_h5":
|
||||||
if (base.b_ch === "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
|
data.data.wxpay_h5_param_str
|
||||||
)}`;
|
)}`;
|
||||||
|
window.parent.postMessage(
|
||||||
|
{
|
||||||
|
type: "navigation",
|
||||||
|
url: redirectUrl,
|
||||||
|
},
|
||||||
|
"*"
|
||||||
|
); // 生产环境中应替换为父页面的确切域名
|
||||||
} else {
|
} else {
|
||||||
router.push(
|
router.push(
|
||||||
`https://yibowanhe.top?url=${encodeURIComponent(
|
`https://yibowanhe.top?url=${encodeURIComponent(
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default function Vip() {
|
||||||
...base,
|
...base,
|
||||||
product_id: "membership",
|
product_id: "membership",
|
||||||
pay_type: type,
|
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",
|
from: searchParams.get("base") ? "web" : "app",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,9 +133,17 @@ export default function Vip() {
|
||||||
break;
|
break;
|
||||||
case "wxpay_h5":
|
case "wxpay_h5":
|
||||||
if (base.b_ch === "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
|
data.data.wxpay_h5_param_str
|
||||||
)}`;
|
)}`;
|
||||||
|
window.parent.postMessage(
|
||||||
|
{
|
||||||
|
type: "navigation",
|
||||||
|
url: redirectUrl,
|
||||||
|
},
|
||||||
|
"*"
|
||||||
|
); // 生产环境中应替换为父页面的确切域名
|
||||||
} else {
|
} else {
|
||||||
router.push(
|
router.push(
|
||||||
`https://yibowanhe.top?url=${encodeURIComponent(
|
`https://yibowanhe.top?url=${encodeURIComponent(
|
||||||
|
@ -163,7 +171,7 @@ export default function Vip() {
|
||||||
...base,
|
...base,
|
||||||
product_id: "membership",
|
product_id: "membership",
|
||||||
pay_type: type,
|
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",
|
from: searchParams.get("base") ? "web" : "app",
|
||||||
ver: "aliv2",
|
ver: "aliv2",
|
||||||
};
|
};
|
||||||
|
@ -207,9 +215,17 @@ export default function Vip() {
|
||||||
break;
|
break;
|
||||||
case "wxpay_h5":
|
case "wxpay_h5":
|
||||||
if (base.b_ch === "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
|
data.data.wxpay_h5_param_str
|
||||||
)}`;
|
)}`;
|
||||||
|
window.parent.postMessage(
|
||||||
|
{
|
||||||
|
type: "navigation",
|
||||||
|
url: redirectUrl,
|
||||||
|
},
|
||||||
|
"*"
|
||||||
|
); // 生产环境中应替换为父页面的确切域名
|
||||||
} else {
|
} else {
|
||||||
router.push(
|
router.push(
|
||||||
`https://yibowanhe.top?url=${encodeURIComponent(
|
`https://yibowanhe.top?url=${encodeURIComponent(
|
||||||
|
|
Loading…
Reference in New Issue