"use client"; import React, { useState, useCallback, useEffect } from "react"; import { Divider, Toast, Button, Radio } from "antd-mobile"; import { useParams, useRouter } from "next/navigation"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import requireAPI from "@/utils/requireAPI"; import LoadingMask from "@/components/LoadingMask"; export default function RefundDetail() { const [data, setData] = useState(null); const [isLoading, setIsLoading] = useState(false); const [selectedIndex, setIndex] = useState(2); const [checkAble, setCheckAble] = useState(true); const { id } = useParams(); const router = useRouter(); useEffect(() => { const getData = async () => { setIsLoading(true); try { const body = { audit_id: id, }; const refundData = await requireAPI("POST", "/api/zone/refund_info", { body, }); if (refundData.ret === -1) { Toast.show({ icon: "fail", content: refundData.msg, position: "top", }); return; } setData(refundData.data); setIndex(refundData.data.refunds_status); setCheckAble(refundData.data.refunds_status === 1); } catch (error) { console.error(error); } finally { setIsLoading(false); } }; getData(); }, []); const handleSubmit = async () => { setIsLoading(true); try { const body = { audit_id: id, refunds_status: selectedIndex, }; const refundData = await requireAPI("POST", "/api/zone/refund_audit", { body, }); if (refundData.ret === -1) { Toast.show({ icon: "fail", content: refundData.msg, position: "top", }); return; } setCheckAble(false); } catch (error) { console.error(error); } finally { setIsSubmitting(false); } }; return (
退款审核
同意退款
同意退回用户的[空间成员]费用,同时自动禁止用户再次购买此商品。拒绝退款
拒绝退回用户的[空间成员]费用。