From cd1fa6e5edadc74f4cc73f0a8893d42b23b9b876 Mon Sep 17 00:00:00 2001 From: yezian Date: Tue, 20 Aug 2024 16:41:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=92=8C=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=EF=BC=88=E5=8F=AA=E5=9C=A8app?= =?UTF-8?q?=E5=86=85=E7=94=9F=E6=95=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/vip/page.jsx | 56 +++++++++++++++---- .../[zid]/[product_id]/[moment_id]/page.jsx | 48 +++++++++++++++- 2 files changed, 91 insertions(+), 13 deletions(-) diff --git a/app/vip/page.jsx b/app/vip/page.jsx index 1a4cc67..c499f9f 100644 --- a/app/vip/page.jsx +++ b/app/vip/page.jsx @@ -9,26 +9,24 @@ import { useRouter, useSearchParams } from "next/navigation"; export default function Vip() { const router = useRouter(); const searchParams = useSearchParams(); - const alipayBlock = () => { - if (base?.b_mid === 161) { - createOrder("alipay_h5"); - return; - } - Toast.show({ - content: "支付渠道维护升级中,请24小时后再试", - }); - }; + + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); //检查用户是否是vip const [isVip, setIsVip] = useState(false); const [name, setName] = useState(""); const [isFetching, setIsFetching] = useState(true); + //判断当前环境是否在app内 + const [isInApp, setIsInApp] = useState(true); + const getBase = useCallback( (webviewBase) => { let searchParamsObj = null; let currentBaseCode = searchParams.get("base"); if (currentBaseCode) { + setIsInApp(false); let currentBase = JSON.parse(currentBaseCode); searchParamsObj = { ...currentBase }; } @@ -139,7 +137,7 @@ export default function Vip() { 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 )}` ); @@ -304,7 +302,7 @@ export default function Vip() {
-
+
createOrder("alipay_h5")} className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full" @@ -322,6 +320,42 @@ export default function Vip() {

+ {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" + > + + + +

+ 微信支付 +

+
+
+ ))}

确认购买即视为同意 diff --git a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx index a9bb355..1a2ac31 100644 --- a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx +++ b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx @@ -16,11 +16,19 @@ export default function Pay({ params }) { //超粉商品数据 const [superfanshipData, setSuperfanshipData] = useState(); const [isFetching, setIsFetching] = useState(true); + + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); + + //判断当前环境是否在app内 + const [isInApp, setIsInApp] = useState(true); + const getBase = useCallback( (webviewBase) => { let searchParamsObj = null; let currentBaseCode = searchParams.get("base"); if (currentBaseCode) { + setIsInApp(false); let currentBase = JSON.parse(currentBaseCode); searchParamsObj = { ...currentBase }; } @@ -158,7 +166,7 @@ export default function Pay({ params }) { 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 )}` ); @@ -327,7 +335,7 @@ export default function Pay({ params }) {

-
+
createOrder("alipay_h5")} className="flex flex-row cursor-pointer gap-1.5 h-11 items-center justify-center bg-primary rounded-full" @@ -345,6 +353,42 @@ export default function Pay({ params }) {

+ {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" + > + + + +

+ 微信支付 +

+
+
+ ))}

确认购买即视为同意