137 lines
3.7 KiB
JavaScript
137 lines
3.7 KiB
JavaScript
"use client";
|
|
|
|
import React from "react";
|
|
import { List } from "antd-mobile";
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
import { faAngleLeft, faAngleRight } from "@fortawesome/free-solid-svg-icons";
|
|
import { useRouter } from "next/navigation";
|
|
import { handleLogout } from "@/api/public";
|
|
import { connect } from "react-redux";
|
|
import { handleLogin } from "@/store/actions";
|
|
function Setting({ handleLogin }) {
|
|
const router = useRouter();
|
|
return (
|
|
<div>
|
|
<div className="p-4 fixed top-0 z-10 w-full">
|
|
<div className="w-9 h-9 flex items-center justify-center bg-[#FFFFFF1A] rounded-full absolute">
|
|
<FontAwesomeIcon
|
|
icon={faAngleLeft}
|
|
style={{ maxWidth: "12px" }}
|
|
size="xl"
|
|
onClick={() => {
|
|
router.back();
|
|
}}
|
|
/>
|
|
</div>
|
|
<p className="text-base text-center leading-9">设置</p>
|
|
</div>
|
|
{/* 内容 */}
|
|
<div className="pt-16 ">
|
|
<List mode="card">
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
handleLogout().then(() => {
|
|
handleLogin({ isSignin: false, userToken: null });
|
|
});
|
|
router.push("/login");
|
|
}}
|
|
>
|
|
退出账号
|
|
</List.Item>
|
|
{/* <List.Item arrow onClick={() => {
|
|
router.push("/my/setting/switchAccount");
|
|
}}>切换账号</List.Item> */}
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
router.push("/my/setting/editPassword");
|
|
}}
|
|
>
|
|
修改密码
|
|
</List.Item>
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
router.push("/my/setting/bannedList");
|
|
}}
|
|
>
|
|
黑名单
|
|
</List.Item>
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
router.push("/my/setting/feedback");
|
|
}}
|
|
>
|
|
意见反馈
|
|
</List.Item>
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
router.push("/my/setting/deleteAccount");
|
|
}}
|
|
>
|
|
账号注销
|
|
</List.Item>
|
|
<List.Item
|
|
arrow={
|
|
<FontAwesomeIcon
|
|
icon={faAngleRight}
|
|
style={{ maxWidth: "12px" }}
|
|
size="sm"
|
|
className="h-4"
|
|
/>
|
|
}
|
|
onClick={() => {
|
|
router.push("/my/setting/aboutUs");
|
|
}}
|
|
>
|
|
关于我们
|
|
</List.Item>
|
|
</List>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const mapDispatchToProps = {
|
|
handleLogin,
|
|
};
|
|
export default connect(null, mapDispatchToProps)(Setting);
|