This commit is contained in:
2025-10-01 11:13:26 +08:00
parent 9cb2ef0b6f
commit 6d416618f7
9 changed files with 116 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ import { clear_login_state } from "@/services/loginService";
import { convert_db_gender_to_display } from "@/utils/genderUtils";
import { EditModal } from "@/components";
import img from "@/config/images";
import CommonDialog from '@/components/CommonDialog'
const EditProfilePage: React.FC = () => {
// 用户信息状态
@@ -49,6 +50,7 @@ const EditProfilePage: React.FC = () => {
// 加载状态
const [loading, setLoading] = useState(true);
const [showLogoutDialog, setShowLogoutDialog] = useState(false);
// 编辑弹窗状态
const [edit_modal_visible, setEditModalVisible] = useState(false);
@@ -304,6 +306,11 @@ const EditProfilePage: React.FC = () => {
});
};
// 注销账户
const handle_close_account = () => {
setShowLogoutDialog(true);
}
const onGetPhoneNumber = async (e) => {
if (!e.detail || !e.detail.code) {
Taro.showToast({
@@ -580,7 +587,7 @@ const EditProfilePage: React.FC = () => {
{/* 注销账号 */}
<View className="logout_section">
<View className="logout_button" onClick={handle_logout}>
<View className="logout_button" onClick={handle_close_account}>
<Text className="logout_text"></Text>
</View>
</View>
@@ -687,6 +694,16 @@ const EditProfilePage: React.FC = () => {
onChange={handle_occupation_change}
/>
)}
{/* 取消关注确认弹窗 */}
<CommonDialog
visible={showLogoutDialog}
cancelText="确定注销"
confirmText="再想想"
onCancel={() => {UserService.logout()}}
onConfirm={() => setShowLogoutDialog(false)}
contentTitle="确定要注销账号吗?"
contentDesc="你的账号将会彻底删除,该操作不可恢复。"
/>
</View>
);
};