diff --git a/app/vip/page.jsx b/app/vip/page.jsx index 5acaf5d..1a4cc67 100644 --- a/app/vip/page.jsx +++ b/app/vip/page.jsx @@ -23,19 +23,22 @@ export default function Vip() { const [isVip, setIsVip] = useState(false); const [name, setName] = useState(""); const [isFetching, setIsFetching] = useState(true); - - const getBase = useCallback((webviewBase)=>{ - let searchParamsObj=null; - let currentBaseCode = searchParams.get("base") - if(currentBaseCode){ - let currentBase = JSON.parse(currentBaseCode); - searchParamsObj={...currentBase}; - } - return searchParamsObj || webviewBase; - },[searchParams]); + + const getBase = useCallback( + (webviewBase) => { + let searchParamsObj = null; + let currentBaseCode = searchParams.get("base"); + if (currentBaseCode) { + let currentBase = JSON.parse(currentBaseCode); + searchParamsObj = { ...currentBase }; + } + return searchParamsObj || webviewBase; + }, + [searchParams] + ); const getUserData = async () => { const webviewBase = webviewBaseRequest(); - let base = getBase(webviewBase) + let base = getBase(webviewBase); try { const signature = generateSignature({ ...base, @@ -73,9 +76,9 @@ export default function Vip() { setTimeout(() => { getUserData(); }, 500); - // const intervalId = setInterval(() => { - // getUserData(); - // }, 2000); + const intervalId = setInterval(() => { + getUserData(); + }, 2000); return () => clearInterval(intervalId); }, []); @@ -94,7 +97,7 @@ export default function Vip() { product_id: "membership", pay_type: type, redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "", - from: searchParams.get("base")?"web":"app", + from: searchParams.get("base") ? "web" : "app", }; //如果是微信jsapi支付直接跳转到中间页 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 d5e0776..a9bb355 100644 --- a/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx +++ b/app/zone/pay/[zid]/[product_id]/[moment_id]/page.jsx @@ -20,7 +20,6 @@ export default function Pay({ params }) { (webviewBase) => { let searchParamsObj = null; let currentBaseCode = searchParams.get("base"); - // console.log("currentBaseCode", currentBaseCode); if (currentBaseCode) { let currentBase = JSON.parse(currentBaseCode); searchParamsObj = { ...currentBase }; @@ -40,7 +39,6 @@ export default function Pay({ params }) { product_id: params.product_id, ...base, }; - // console.log("body1", body); const signature = generateSignature(body); const response = await fetch( `/api/zone/get_cashier?signature=${signature}`, @@ -76,7 +74,6 @@ export default function Pay({ params }) { product_id: "h5_zone_superfanship", ...base, }; - // console.log("body2", body); const signature = generateSignature(body); const response = await fetch( `/api/zone/get_cashier?signature=${signature}`, @@ -102,11 +99,11 @@ export default function Pay({ params }) { getData(); getSuperfanshipData(); }, 500); - // const intervalId = setInterval(() => { - // getData(); - // getSuperfanshipData(); - // }, 2000); - // return () => clearInterval(intervalId); + const intervalId = setInterval(() => { + getData(); + getSuperfanshipData(); + }, 2000); + return () => clearInterval(intervalId); }, []); //是否勾选购买超粉switch组件 @@ -128,7 +125,6 @@ export default function Pay({ params }) { redirect_url: type === "yeepay_wxpay_h5" ? window.location.href : "", from: searchParams.get("base") ? "web" : "app", }; - // console.log("body", body); setIsLoading(true); const signature = generateSignature(body); @@ -211,7 +207,11 @@ export default function Pay({ params }) { {isLoading && ( )} -
+

¥{" "} {checked @@ -278,7 +278,7 @@ export default function Pay({ params }) {

)} {checked ? ( -
+

购买须知:

1、开通超粉后可在有效期内免费查看当前空间内的所有动态内容; @@ -293,7 +293,7 @@ export default function Pay({ params }) {

) : params.product_id === "h5_zone_moment" ? ( -
+

购买须知:

1、当前购买内容为本空间内特定单条动态的查阅权限,如需要查阅空间内全部动态请开通超粉; @@ -306,7 +306,7 @@ export default function Pay({ params }) {

) : ( -
+

购买须知:

1、本空间由空间主人自行创建,加入空间前请确认相关风险,避免上当受骗;