diff --git a/app/pay/page.jsx b/app/pay/page.jsx index 56da298..c155542 100644 --- a/app/pay/page.jsx +++ b/app/pay/page.jsx @@ -9,16 +9,11 @@ import Link from "next/link"; export default function Pay() { const router = useRouter(); + + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); + const searchParams = useSearchParams(); - const alipayBlock = () => { - if (base?.b_mid === 161) { - createOrder("alipay_h5"); - return; - } - Toast.show({ - content: "支付渠道维护升级中,请24小时后再试", - }); - }; //商品列表 const [productList, setProductList] = useState([]); @@ -29,6 +24,9 @@ export default function Pay() { //选择任意金额充值 const [customCoin, setCustomCoin] = useState({ selected: false, num: 1000 }); + //判断当前环境是否在app内 + const [isInApp, setIsInApp] = useState(true); + //任意金额充值的金币数量 const handleChangeCustomCoin = (e) => { let newValue = parseInt(e.target.value, 10); @@ -49,6 +47,7 @@ export default function Pay() { let searchParamsObj = null; let currentBaseCode = searchParams.get("base"); if (currentBaseCode) { + setIsInApp(false); let currentBase = JSON.parse(currentBaseCode); searchParamsObj = { ...currentBase }; } @@ -155,7 +154,7 @@ export default function Pay() { break; case "wxpay_h5": router.push( - `https://shop.tiefen.fun/pay/wxpay_h5/${encodeURIComponent( + `https://app.tiefen.fun/wxpay_h5/${encodeURIComponent( data.data.wxpay_h5_param_str )}` ); @@ -296,7 +295,7 @@ export default function Pay() {
-
+
createOrder("alipay_h5")} className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full" @@ -314,6 +313,42 @@ export default function Pay() {

+ {isInApp && + (isPaymentHided ? ( +
+
setIsPaymentHided(false)} + className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-[#2E2E2E] rounded-full" + > + + + +

+ 其他支付 +

+
+
+ ) : ( +
+
createOrder("wxpay_h5")} + className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full" + > + + + +

+ 微信支付 +

+
+
+ ))}

确认购买即视为同意