From 1c5d3f0d3e7bcb7d6009ce33e2557428a59d8094 Mon Sep 17 00:00:00 2001 From: yezian Date: Mon, 19 Aug 2024 17:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8app=E5=86=85=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pay/page.jsx | 57 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 11 deletions(-) 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" + > + + + +

+ 微信支付 +

+
+
+ ))}

确认购买即视为同意 -- 2.41.0