"use client"; import React, { useState, useEffect, useRef } from "react"; import { Button, Dialog, Toast } from "antd-mobile"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import { useRouter } from "next/navigation"; import { formatDeadline } from "@/utils/tools"; import requireAPI from "@/utils/requireAPI"; export default function DeleteAccount() { const [deadline, setDeadline] = useState(); const router = useRouter(); const showMobal = useRef(); useEffect(() => { checkAccountStatus(); }, []); //查询用户是否在注销中 const checkAccountStatus = async () => { try { const _data = await requireAPI( "POST", "/api/account_cancellation/list_by_mid" ); if (_data.ret === -1) { Toast.show({ icon: "fail", content: _data.msg, position: "top", }); return; } if (_data.data.status === 0) setDeadline(_data.data.due_time); } catch (error) { // console.error(error); } }; //提交注销申请 const handleDeleteAccount = async () => { try { const _data = await requireAPI("POST", "/api/account/cancel"); // console.log("requireAPI",_data) if (_data.ret === -1) { Toast.show({ icon: "fail", content: _data.msg, position: "top", }); return; } checkAccountStatus(); showMobal.current?.close(); } catch (error) { // console.error(error); } }; //取消注销 const undoDeleteAccount = async () => { try { const _data = await requireAPI("POST", "/api/account/abort_cancellation"); if (_data.ret === -1) { Toast.show({ icon: "fail", content: _data.msg, position: "top", }); return; } setDeadline(); } catch (error) { // console.error(error); } }; const handleShowDialog = () => { showMobal.current = Dialog.show({ title: "您确认要注销此账号吗?", content: "注销后无法恢复,请仔细阅读《注销必看须知》后确认。", bodyStyle: { maxHeight: "none", width: "80vw", position: "fixed", top: "200px", left: "10vw", "--text-color": "#fff", color: "#fff", }, // cancelText:"确认", // confirmText:"取消", style: { "--text-color": "#fff", }, closeOnAction: true, actions: [ [ { key: "submit", text: "确认", style: { color: "#ffffff80" }, onClick: handleDeleteAccount, }, { key: "close", text: "取消", bold: true, style: { color: "#fff" }, onClick: () => { showMobal.current?.close(); }, }, ], ], }); // if (result) { // Toast.show({ content: "点击了确认", position: "bottom" }); // } }; return (
{ router.back(); }} />

帐号注销

{/* 内容 */}

注销必看须知:

1、账号个人信息

账号注销后,您将永远失去该账户的所有内容,且无法恢复。包括但不限于:个人资料信息、访问记录、关注列表、私信聊天记录等。

2、账号资产与权益

账号注销后,您将失去所有账号使用期间获得的资产与权益,且无法恢复。包括但不限于您的金币、钻石、会员特权以及其他已付费的订单商品等。

3、注销时间

您发起注销账户申请后,我们将在7个自然日后完全清除您的账号信息,在此期间您可以随时在本页面撤销该申请。

4、其他

平台入驻创作者请联系运营进行注销。

{deadline && (

您的账号将于{formatDeadline(deadline)} 注销,如需取消注销,请点击下方“取消注销”

)}
); }