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>
);
};

View File

@@ -257,11 +257,19 @@ const FollowPage: React.FC = () => {
>
<Text className="tab_text">{tab.label}</Text>
{tab.key === 'recommend' && (
<View className="recommend_icon">
<View className="recommend_icon" onClick={(e) => {
e.stopPropagation();
Taro.showModal({
title: '推荐说明',
content: '我们会向你推荐一些可能感兴趣的球友,帮你更快遇见同样热爱运动的人。推荐基于公开信息与社区互动,仅用于球友推荐,不涉及个人隐私。',
showCancel: false,
confirmText: '确认',
confirmColor: '#000',
})
}}>
{/* 推荐图标 SVG */}
<View className="icon_container">
<View className="star_icon" />
</View>
</View>
)}

View File

@@ -5,11 +5,6 @@
font-style: Regular;
color: #3C3C4399;
font-size: 12px;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
.withdrawal-container {
@@ -110,10 +105,13 @@
}
.withdraw_popup {
min-height: unset;
.popup_content {
display: flex;
flex-direction: column;
align-items: center;
user-select: none;
pointer-events: none;
.popup_text {
font-family: DingTalk JinBuTi;

View File

@@ -1,10 +1,11 @@
import React, { useState, useEffect } from "react";
import React, { useState, useEffect, useRef } from "react";
import { View, Text, Input, Button } from "@tarojs/components";
import Taro, { useDidShow } from "@tarojs/taro";
import httpService from "@/services/httpService";
import "./index.scss";
import { CommonPopup } from "@/components";
import { useKeyboardHeight } from '@/store/keyboardStore'
interface WalletInfo {
balance: string;
@@ -15,6 +16,23 @@ interface WalletInfo {
}
const Withdrawal: React.FC = () => {
const inputRef = useRef(null);
// 使用全局键盘状态
const { keyboardHeight, isKeyboardVisible, addListener, initializeKeyboardListener } = useKeyboardHeight()
// 使用全局键盘状态监听
useEffect(() => {
// 初始化全局键盘监听器
initializeKeyboardListener()
// 添加本地监听器
const removeListener = addListener((height, visible) => {
console.log('AiImportPopup 收到键盘变化:', height, visible)
})
return () => {
removeListener()
}
}, [initializeKeyboardListener, addListener])
const [showTips, setShowTips] = useState(false);
const [tipsText, setTipsText] = useState<string>("");
const [inputValue, setInputValue] = useState<string>("0.00");
@@ -33,7 +51,11 @@ const Withdrawal: React.FC = () => {
load_wallet_data();
getWithdrawErrorCodes();
});
useEffect(() => {
if (show_withdraw_popup && inputRef.current) {
inputRef.current.focus();
}
}, [show_withdraw_popup]);
useEffect(() => {
if (show_withdraw_popup) {
setIsFocus(true);
@@ -51,7 +73,7 @@ const Withdrawal: React.FC = () => {
setShowTips(true);
setTipsText("单笔提现金额不能超过 200元");
} else {
setShowTips(false);
setShowTips(false);
}
};
@@ -191,7 +213,6 @@ const Withdrawal: React.FC = () => {
content: message,
showCancel: false,
confirmText: "确认",
confirmColor: "#fff",
});
return;
} else {
@@ -214,6 +235,10 @@ const Withdrawal: React.FC = () => {
}, 100);
}
}
const handlePopupClick = (e) => {
e.stopPropagation();
inputRef.current!.focus();
};
return (
<View className="withdrawal-page" >
<View className="withdrawal-container">
@@ -270,8 +295,9 @@ const Withdrawal: React.FC = () => {
title="提现"
className="withdraw_popup"
hideFooter={true}
style={{ bottom: isKeyboardVisible ? `${keyboardHeight}px` : undefined }}
>
<View className="popup_content">
<View className="popup_content" onClick={handlePopupClick}>
<View className="popup_text">{`¥${inputValue}`}</View>
<View className="password_container">
{
@@ -282,7 +308,7 @@ const Withdrawal: React.FC = () => {
))
}
</View>
<Input focus={isFocus} type="number" style={{ width: "0", height: "0", opacity: "0" }} value={password.filter(item => item !== "").join("")} maxlength={6} onInput={handlePasswordInput} />
<Input ref={inputRef} focus={isFocus} type="number" adjustPosition={false} style={{ width: "0", height: "0", opacity: "0" }} value={password.filter(item => item !== "").join("")} maxlength={6} onInput={handlePasswordInput} />
</View>
</CommonPopup>
</View >