下载记录、钱包账单添加加载更多;监听键盘高度优化样式

This commit is contained in:
2025-10-01 08:10:01 +08:00
parent a06487ecdc
commit 1b05bd1da7
10 changed files with 140 additions and 63 deletions

View File

@@ -4,6 +4,7 @@ import { View, Text, Input, Button } from "@tarojs/components";
import "./index.scss";
import httpService from "@/services/httpService";
import { useKeyboardHeight } from '@/store/keyboardStore'
interface FormFields {
old_password?: string;
@@ -13,6 +14,22 @@ interface FormFields {
}
const SetTransactionPassword: React.FC = () => {
// 使用全局键盘状态
const { keyboardHeight, isKeyboardVisible, addListener, initializeKeyboardListener } = useKeyboardHeight()
// 使用全局键盘状态监听
useEffect(() => {
// 初始化全局键盘监听器
initializeKeyboardListener()
// 添加本地监听器
const removeListener = addListener((height, visible) => {
console.log('AiImportPopup 收到键盘变化:', height, visible)
})
return () => {
removeListener()
}
}, [initializeKeyboardListener, addListener])
const [handleType, setHandleType] = useState("set");
const router = useRouter();
const { type, phone, sms_code } = router.params;
@@ -129,7 +146,7 @@ const SetTransactionPassword: React.FC = () => {
</View>
)}
<Text className="tips">* 6</Text>
<Button className="btn bottom-btn" onClick={handleConfirm}>
<Button className="btn bottom-btn" onClick={handleConfirm} style={{ bottom: isKeyboardVisible ? `${keyboardHeight + 20}px` : undefined }}>
</Button>
</View>