From 5de2a0d848d5d7dab6dced017512e5fee66b2a5a Mon Sep 17 00:00:00 2001 From: yezian Date: Thu, 18 Jul 2024 16:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E5=8F=A0=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pay/page.jsx | 61 +++++++++++-------- app/vip/page.jsx | 61 +++++++++++-------- .../[zid]/[product_id]/[moment_id]/page.jsx | 52 +++++++++++----- 3 files changed, 109 insertions(+), 65 deletions(-) diff --git a/app/pay/page.jsx b/app/pay/page.jsx index b0bed35..83722c3 100644 --- a/app/pay/page.jsx +++ b/app/pay/page.jsx @@ -10,16 +10,8 @@ import Link from "next/link"; export default function Pay() { const router = useRouter(); - const alipayBlock = () => { - const base = webviewBaseRequest(); - if (base?.b_mid === 161) { - createOrder("alipay_h5"); - return; - } - Toast.show({ - content: "支付渠道维护升级中,请24小时后再试", - }); - }; + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); //商品列表 const [productList, setProductList] = useState([]); @@ -301,22 +293,41 @@ export default function Pay() {

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

- 微信支付 -

+ {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/vip/page.jsx b/app/vip/page.jsx index a59d269..133647a 100644 --- a/app/vip/page.jsx +++ b/app/vip/page.jsx @@ -10,16 +10,8 @@ import { useRouter } from "next/navigation"; export default function Vip() { const router = useRouter(); - const alipayBlock = () => { - const base = webviewBaseRequest(); - if (base?.b_mid === 161) { - createOrder("alipay_h5"); - return; - } - Toast.show({ - content: "支付渠道维护升级中,请24小时后再试", - }); - }; + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); //检查用户是否是vip const [isVip, setIsVip] = useState(false); @@ -310,22 +302,41 @@ export default function Vip() {

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

- 微信支付 -

+ {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 d10e06d..a17ad72 100644 --- a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx +++ b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx @@ -11,6 +11,9 @@ import { useRouter } from "next/navigation"; export default function Pay({ params }) { const router = useRouter(); + //是否显示被隐藏的支付方式 + const [isPaymentHided, setIsPaymentHided] = useState(true); + //当前选购的商品数据 const [data, setData] = useState({}); //超粉商品数据 @@ -328,22 +331,41 @@ export default function Pay({ params }) {

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

- 微信支付 -

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

+ 微信支付 +

+
+
+ )}

确认购买即视为同意