下载记录、钱包账单添加加载更多;监听键盘高度优化样式
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user