diff --git a/screeens/EditSpacePost/index.jsx b/screeens/EditSpacePost/index.jsx index db41a5a..d8ee933 100644 --- a/screeens/EditSpacePost/index.jsx +++ b/screeens/EditSpacePost/index.jsx @@ -103,8 +103,8 @@ export default function EditSpacePost({ navigation, route }) { : text ); setPrice((price ? price / 100 : 0).toString()); - setTextVisibleRange(text_visible_range.toString()); - setImageVisibleRange(media_visible_range.toString()); + setTextVisibleRange(text_visible_range?.toString()); + setImageVisibleRange(media_visible_range?.toString()); setBlurCover(is_blurring_cover === 1); setIsFreeForIronfan(is_ironfan_visible === 1); setPaidText(paid_text ? paid_text.substring(1) : ""); diff --git a/screeens/My/index.jsx b/screeens/My/index.jsx index fbbeb9e..35b1cf5 100644 --- a/screeens/My/index.jsx +++ b/screeens/My/index.jsx @@ -635,9 +635,6 @@ export default function My({ navigation }) { remainCompleteInformation(() => navigation.navigate("Refund", { screen: "RefundList", - params: { - b_mid: data.mid, - }, }) ) } diff --git a/screeens/Refund/RefundDetail/index.jsx b/screeens/Refund/RefundDetail/index.jsx index 54ff6fe..3c4e88d 100644 --- a/screeens/Refund/RefundDetail/index.jsx +++ b/screeens/Refund/RefundDetail/index.jsx @@ -34,6 +34,7 @@ export default function RefundDetail({ navigation, route }) { ...base, audit_id: route.params.id, }); + try { const refundResponse = await fetch( `${apiUrl}/api/zone/refund_info?signature=${signature}`, @@ -48,7 +49,9 @@ export default function RefundDetail({ navigation, route }) { }), } ); + const refundData = await refundResponse.json(); + if (refundData.ret === -1) { Toast.show({ type: "error", diff --git a/screeens/Refund/RefundList/PendingReview/index.jsx b/screeens/Refund/RefundList/PendingReview/index.jsx index cbe9fe3..8dce497 100644 --- a/screeens/Refund/RefundList/PendingReview/index.jsx +++ b/screeens/Refund/RefundList/PendingReview/index.jsx @@ -23,12 +23,12 @@ export default function PendingReview({ zid, navigation }) { const [more, setMore] = useState(1); const [data, setData] = useState({ list: [], total: 0 }); const getData = async () => { - if (zid === undefined || !more) return; + if (!more) return; const apiUrl = process.env.EXPO_PUBLIC_API_URL; try { const base = await baseRequest(); const body = { - b_mid: parseInt(zid), + b_mid: parseInt(base.b_mid), audit_type: 1, offset: offset, limit: 20, diff --git a/screeens/Refund/RefundList/Reviewed/index.jsx b/screeens/Refund/RefundList/Reviewed/index.jsx index 17f0c36..dab9bf0 100644 --- a/screeens/Refund/RefundList/Reviewed/index.jsx +++ b/screeens/Refund/RefundList/Reviewed/index.jsx @@ -15,7 +15,7 @@ import baseRequest from "../../../../utils/baseRequest"; import { generateSignature } from "../../../../utils/crypto"; import formatTimestamp from "../../../../utils/formatTimestamp"; -export default function Reviewed({ navigation, zid }) { +export default function Reviewed({ navigation }) { const blurhash = "LcKUTa%gOYWBYRt6xuoJo~s8V@fk"; const tailwind = useTailwind(); @@ -23,12 +23,12 @@ export default function Reviewed({ navigation, zid }) { const [more, setMore] = useState(1); const [data, setData] = useState({ list: [], total: 0 }); const getData = async () => { - if (zid === undefined || !more) return; + if (!more) return; const apiUrl = process.env.EXPO_PUBLIC_API_URL; try { const base = await baseRequest(); const body = { - b_mid: parseInt(zid), + b_mid: parseInt(base.b_mid), audit_type: 2, offset: offset, limit: 20, diff --git a/screeens/Refund/RefundList/index.jsx b/screeens/Refund/RefundList/index.jsx index ac21259..323c6d0 100644 --- a/screeens/Refund/RefundList/index.jsx +++ b/screeens/Refund/RefundList/index.jsx @@ -11,7 +11,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context"; import { TabView, SceneMap, TabBar } from "react-native-tab-view"; import PendingReview from "./PendingReview"; import Reviewed from "./Reviewed"; - export default function RefundList({ navigation, route }) { const tailwind = useTailwind(); const insets = useSafeAreaInsets(); @@ -25,10 +24,8 @@ export default function RefundList({ navigation, route }) { const renderScene = useCallback( SceneMap({ - doing: () => ( - - ), - done: () => , + doing: () => , + done: () => , }), [route] ); diff --git a/utils/tools.js b/utils/tools.js index e51e260..3bfedf4 100644 --- a/utils/tools.js +++ b/utils/tools.js @@ -58,15 +58,15 @@ export function goToPage({ url, action }) { if (action !== "inward") return url; let linkArr = url.split("?"); const params = linkArr[1]?.split("&"); - if (!params) return linkArr[0]; - if (linkArr[0].includes("/")) { - const path = linkArr[0].replace(/^\/+|\/+$/g, ""); - const pathNames = path.split("/").filter((it) => it != ""); - return [pathNames[0], { screen: pathNames[1] }]; - } const query = params .map((it) => ({ [it.split("=")[0]]: it.split("=")[1] })) .reduce((acc, cur) => ({ ...acc, ...cur }), {}); + if (linkArr[0].includes("/")) { + const path = linkArr[0].replace(/^\/+|\/+$/g, ""); + const pathNames = path.split("/").filter((it) => it != ""); + return [pathNames[0], { screen: pathNames[1], params: query }]; + } + return [linkArr[0], query]; }