修复问题
This commit is contained in:
parent
ae2d164b84
commit
a090c7063f
|
@ -11,8 +11,7 @@ export default function BillDetail({ params }) {
|
||||||
const [data, setData] = useState([]);
|
const [data, setData] = useState([]);
|
||||||
const [isFetching, setIsFetching] = useState(true);
|
const [isFetching, setIsFetching] = useState(true);
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const webviewBase = webviewBaseRequest()
|
const getBase = useCallback((webviewBase)=>{
|
||||||
const base = useMemo(()=>{
|
|
||||||
let searchParamsObj=null;
|
let searchParamsObj=null;
|
||||||
if(searchParams.get("b_mid")){
|
if(searchParams.get("b_mid")){
|
||||||
searchParamsObj={};
|
searchParamsObj={};
|
||||||
|
@ -27,7 +26,7 @@ export default function BillDetail({ params }) {
|
||||||
searchParamsObj.b_ts=searchParams.get("b_ts");
|
searchParamsObj.b_ts=searchParams.get("b_ts");
|
||||||
}
|
}
|
||||||
return searchParamsObj || webviewBase;
|
return searchParamsObj || webviewBase;
|
||||||
},[searchParams,webviewBase]);
|
},[searchParams]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
let type;
|
let type;
|
||||||
|
@ -48,6 +47,8 @@ export default function BillDetail({ params }) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
const base = getBase(webviewBase);
|
||||||
const signature = generateSignature({
|
const signature = generateSignature({
|
||||||
type: type,
|
type: type,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
|
@ -115,7 +116,10 @@ export default function BillDetail({ params }) {
|
||||||
return (
|
return (
|
||||||
<section className="flex flex-1 flex-col">
|
<section className="flex flex-1 flex-col">
|
||||||
{params.type == "income" && (
|
{params.type == "income" && (
|
||||||
<Link className="flex flex-col mt-4 btn bg-[#FF61B030] items-center text-base font-medium" href={"income/income_querry"}>
|
<Link
|
||||||
|
className="flex flex-col mt-4 btn bg-[#FF61B030] items-center text-base font-medium"
|
||||||
|
href={"income/income_querry"}
|
||||||
|
>
|
||||||
<p className="text-primary">查看近一周收益情况</p>
|
<p className="text-primary">查看近一周收益情况</p>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -44,8 +44,7 @@ export default function Pay() {
|
||||||
|
|
||||||
//获取当前充值档位
|
//获取当前充值档位
|
||||||
const [isFetching, setIsFetching] = useState(true);
|
const [isFetching, setIsFetching] = useState(true);
|
||||||
const webviewBase = webviewBaseRequest()
|
const getBase = useCallback((webviewBase)=>{
|
||||||
const base = useMemo(()=>{
|
|
||||||
let searchParamsObj=null;
|
let searchParamsObj=null;
|
||||||
if(searchParams.get("b_mid")){
|
if(searchParams.get("b_mid")){
|
||||||
searchParamsObj={};
|
searchParamsObj={};
|
||||||
|
@ -60,10 +59,11 @@ export default function Pay() {
|
||||||
searchParamsObj.b_ts=searchParams.get("b_ts");
|
searchParamsObj.b_ts=searchParams.get("b_ts");
|
||||||
}
|
}
|
||||||
return searchParamsObj || webviewBase;
|
return searchParamsObj || webviewBase;
|
||||||
},[searchParams,webviewBase]);
|
},[searchParams]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
const base = getBase(webviewBase);
|
||||||
const body = { ...base };
|
const body = { ...base };
|
||||||
const signature = generateSignature(body);
|
const signature = generateSignature(body);
|
||||||
try {
|
try {
|
||||||
|
@ -108,7 +108,8 @@ export default function Pay() {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
const base = getBase(webviewBase);
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
...base,
|
...base,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect, useMemo } from "react";
|
import React, { useState, useEffect, useMemo, useCallback } from "react";
|
||||||
import { generateSignature } from "@/utils/crypto";
|
import { generateSignature } from "@/utils/crypto";
|
||||||
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
@ -23,8 +23,8 @@ export default function Vip() {
|
||||||
const [isVip, setIsVip] = useState(false);
|
const [isVip, setIsVip] = useState(false);
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [isFetching, setIsFetching] = useState(true);
|
const [isFetching, setIsFetching] = useState(true);
|
||||||
const webviewBase = webviewBaseRequest()
|
|
||||||
const base = useMemo(()=>{
|
const getBase = useCallback((webviewBase)=>{
|
||||||
let searchParamsObj=null;
|
let searchParamsObj=null;
|
||||||
if(searchParams.get("b_mid")){
|
if(searchParams.get("b_mid")){
|
||||||
searchParamsObj={};
|
searchParamsObj={};
|
||||||
|
@ -39,8 +39,10 @@ export default function Vip() {
|
||||||
searchParamsObj.b_ts=searchParams.get("b_ts");
|
searchParamsObj.b_ts=searchParams.get("b_ts");
|
||||||
}
|
}
|
||||||
return searchParamsObj || webviewBase;
|
return searchParamsObj || webviewBase;
|
||||||
},[searchParams,webviewBase]);
|
},[searchParams]);
|
||||||
const getUserData = async () => {
|
const getUserData = async () => {
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
let base = getBase(webviewBase)
|
||||||
try {
|
try {
|
||||||
const signature = generateSignature({
|
const signature = generateSignature({
|
||||||
...base,
|
...base,
|
||||||
|
@ -78,15 +80,17 @@ export default function Vip() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getUserData();
|
getUserData();
|
||||||
}, 500);
|
}, 500);
|
||||||
const intervalId = setInterval(() => {
|
// const intervalId = setInterval(() => {
|
||||||
getUserData();
|
// getUserData();
|
||||||
}, 2000);
|
// }, 2000);
|
||||||
return () => clearInterval(intervalId);
|
return () => clearInterval(intervalId);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
//创建充值订单
|
//创建充值订单
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const createOrder = async (type = "alipay_h5") => {
|
const createOrder = async (type = "alipay_h5") => {
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
let base = getBase(webviewBase)
|
||||||
const body = {
|
const body = {
|
||||||
...base,
|
...base,
|
||||||
product_id: "membership",
|
product_id: "membership",
|
||||||
|
|
|
@ -6,7 +6,7 @@ import Link from "next/link";
|
||||||
import { Toast, Switch } from "antd-mobile";
|
import { Toast, Switch } from "antd-mobile";
|
||||||
import { generateSignature } from "@/utils/crypto";
|
import { generateSignature } from "@/utils/crypto";
|
||||||
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
import webviewBaseRequest from "@/utils/webviewBaseRequest";
|
||||||
import { useRouter,useSearchParams } from "next/navigation";
|
import { useRouter, useSearchParams } from "next/navigation";
|
||||||
|
|
||||||
export default function Pay({ params }) {
|
export default function Pay({ params }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -16,8 +16,7 @@ export default function Pay({ params }) {
|
||||||
//超粉商品数据
|
//超粉商品数据
|
||||||
const [superfanshipData, setSuperfanshipData] = useState();
|
const [superfanshipData, setSuperfanshipData] = useState();
|
||||||
const [isFetching, setIsFetching] = useState(true);
|
const [isFetching, setIsFetching] = useState(true);
|
||||||
const webviewBase = webviewBaseRequest()
|
const getBase = useCallback((webviewBase)=>{
|
||||||
const base = useMemo(()=>{
|
|
||||||
let searchParamsObj=null;
|
let searchParamsObj=null;
|
||||||
if(searchParams.get("b_mid")){
|
if(searchParams.get("b_mid")){
|
||||||
searchParamsObj={};
|
searchParamsObj={};
|
||||||
|
@ -32,10 +31,12 @@ export default function Pay({ params }) {
|
||||||
searchParamsObj.b_ts=searchParams.get("b_ts");
|
searchParamsObj.b_ts=searchParams.get("b_ts");
|
||||||
}
|
}
|
||||||
return searchParamsObj || webviewBase;
|
return searchParamsObj || webviewBase;
|
||||||
},[searchParams,webviewBase]);
|
},[searchParams]);
|
||||||
//获取当前选购的商品数据
|
//获取当前选购的商品数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
try {
|
try {
|
||||||
|
const webviewBase = webviewBaseRequest();
|
||||||
|
const base = getBase(webviewBase);
|
||||||
const body = {
|
const body = {
|
||||||
zid: parseInt(params.zid),
|
zid: parseInt(params.zid),
|
||||||
moment_id: parseInt(params.moment_id),
|
moment_id: parseInt(params.moment_id),
|
||||||
|
@ -70,7 +71,8 @@ export default function Pay({ params }) {
|
||||||
//获取超粉商品数据
|
//获取超粉商品数据
|
||||||
const getSuperfanshipData = async () => {
|
const getSuperfanshipData = async () => {
|
||||||
try {
|
try {
|
||||||
const base = webviewBaseRequest();
|
const webviewBase = webviewBaseRequest();
|
||||||
|
const base = getBase(webviewBase);
|
||||||
const body = {
|
const body = {
|
||||||
zid: parseInt(params.zid),
|
zid: parseInt(params.zid),
|
||||||
product_id: "h5_zone_superfanship",
|
product_id: "h5_zone_superfanship",
|
||||||
|
|
Loading…
Reference in New Issue