fix:修复wifi弹窗不同输入法导致的结构错层
This commit is contained in:
@@ -312,6 +312,16 @@ const handleKeyboardHeightChange = (res) => {
|
|||||||
keyboardHeight.value = res?.height || 0;
|
keyboardHeight.value = res?.height || 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 切换密码显示状态前先收起键盘,避免安全键盘和普通输入法切换时复用旧高度产生黑条。
|
||||||
|
const togglePasswordVisibility = () => {
|
||||||
|
uni.hideKeyboard({
|
||||||
|
complete() {
|
||||||
|
keyboardHeight.value = 0;
|
||||||
|
showPassword.value = !showPassword.value;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 页面挂载后启动 WiFi 扫描流程。
|
// 页面挂载后启动 WiFi 扫描流程。
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (typeof uni.onKeyboardHeightChange === "function") {
|
if (typeof uni.onKeyboardHeightChange === "function") {
|
||||||
@@ -498,6 +508,7 @@ onUnmounted(() => {
|
|||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
:password="!showPassword"
|
:password="!showPassword"
|
||||||
|
:adjust-position="false"
|
||||||
v-model="connectInput.password"
|
v-model="connectInput.password"
|
||||||
placeholder="输入网络密码"
|
placeholder="输入网络密码"
|
||||||
placeholder-class="input-placeholder"
|
placeholder-class="input-placeholder"
|
||||||
@@ -505,7 +516,7 @@ onUnmounted(() => {
|
|||||||
@confirm="joinNetwork"
|
@confirm="joinNetwork"
|
||||||
/>
|
/>
|
||||||
<!-- 密码显示/隐藏切换按钮 -->
|
<!-- 密码显示/隐藏切换按钮 -->
|
||||||
<view class="pwd-eye-btn" @click="showPassword = !showPassword">
|
<view class="pwd-eye-btn" @click="togglePasswordVisibility">
|
||||||
<image
|
<image
|
||||||
:src="showPassword ? '../static/sicon/eye-on.png' : '../static/sicon/eye-off.png'"
|
:src="showPassword ? '../static/sicon/eye-on.png' : '../static/sicon/eye-off.png'"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
@@ -560,6 +571,7 @@ onUnmounted(() => {
|
|||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
:password="!showPassword"
|
:password="!showPassword"
|
||||||
|
:adjust-position="false"
|
||||||
v-model="connectInput.password"
|
v-model="connectInput.password"
|
||||||
placeholder="输入网络密码"
|
placeholder="输入网络密码"
|
||||||
placeholder-class="input-placeholder"
|
placeholder-class="input-placeholder"
|
||||||
@@ -567,7 +579,7 @@ onUnmounted(() => {
|
|||||||
@confirm="joinNetwork"
|
@confirm="joinNetwork"
|
||||||
/>
|
/>
|
||||||
<!-- 密码显示/隐藏切换按钮 -->
|
<!-- 密码显示/隐藏切换按钮 -->
|
||||||
<view class="pwd-eye-btn" @click="showPassword = !showPassword">
|
<view class="pwd-eye-btn" @click="togglePasswordVisibility">
|
||||||
<image
|
<image
|
||||||
:src="showPassword ? '../static/sicon/eye-on.png' : '../static/sicon/eye-off.png'"
|
:src="showPassword ? '../static/sicon/eye-on.png' : '../static/sicon/eye-off.png'"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
|
|||||||
Reference in New Issue
Block a user