1***@qq.com
1***@qq.com
  • 发布:2025-08-07 10:27
  • 更新:2025-08-07 10:34
  • 阅读:93

【报Bug】ios 端input框开会切换,需要二次点击才能聚焦的,安卓是好的

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 24H2

HBuilderX类型: 正式

HBuilderX版本号: 4.66

第三方开发者工具版本号: 1.06.2409140

基础库版本号: 3.3.5

项目创建方式: HBuilderX

示例代码:
<template> <view class="page-container"> <common-head :isReturn='true' :title="pageTitle"> </common-head> <view class="content"> <view class="operation-card"> <view class="card-title"> 设置密码 </view> <view class="card-item"> <view class="left"> <text>新密码</text> </view> <view class="center"> <input type="text" maxlength="16" :password="NPWD" class="s-input" placeholder="请输入新密码" v-model="passwordVo.new_password" /> </view> <view class="right"> <uni-icons class="right-icon" color="#999999" :size="24" type="NPWD?'eye-slash':'eye'" @click="changePassword('NPWD')" /> </view>
</view>
<view class="card-item">
<view class="left">
<text>确认密码</text>
</view>
<view class="center">
<input type="text" maxlength="16" :password="CPWD" class="s-input"
placeholder="请输入确认密码" v-model="passwordVo.confirm_password"
/>
</view>
<view class="right">
<uni-icons class="right-icon" color="#999999" :size="24" type="CPWD?'eye-slash':'eye'" @click="changePassword('CPWD')" /> </view>
</view>
</view>
</view>
<view class="submit-box">
<view @click="confirm" class="submit-btn" :class="{'active':canLogin}">提交
</view>
</view>
</view>
</template>

<script>
import service from '@/service';
import {
regexPassword
} from '@/utils/formRegex.js';
export default {
components: {},
computed: {
// 登录按钮是否高亮
canLogin() {
if (this.passwordVo.new_password && this.passwordVo.confirm_password) {
return true;
} else {
return false;
}
}
},
data() {
return {
pageTitle: '修改密码',
passwordVo: {
new_password: '',
confirm_password: '',
},
NPWD: true,
CPWD: true,
};
},
methods: {
// 密码框切换
changePassword(val) {
this[val] = !this[val];
},
newpasswordInput({
detail: {
value
}
}) {
// if (regexPassword(value)) {
// console.log('密码验证成功');
// } else {
// uni.showToast({
// icon: 'none',
// title: '密码至少8个字符,且包含大小写英文字母及数字',
// });
// }
},
confirm() {
if (this.passwordVo.new_password === '') {
uni.showToast({
icon: 'none',
title: '新密码不能为空',
});
return;
}
if (this.passwordVo.confirm_password === '') {
uni.showToast({
icon: 'none',
title: '确认密码不能为空',
});
return;
}
if (this.passwordVo.new_password != this.passwordVo.confirm_password) {
uni.showToast({
icon: 'none',
title: '两次输入的密码不一致',
});
return;
} else if (!regexPassword(this.passwordVo.new_password)) {
uni.showToast({
icon: 'none',
title: '密码至少8个字符,且包含大小写英文字母及数字',
});
return;
} else if (!regexPassword(this.passwordVo.confirm_password)) {

                uni.showToast({  
                    icon: 'none',  
                    title: '密码至少8个字符,且包含大小写英文字母及数字',  
                });  
                return;  
            } else {  
                this.senNet();  

            }  
        },  
        senNet() {  
            let obj = {  
                password: this.passwordVo.new_password  
            };  
            this.$http.setPassword(obj).then((res) => {  
                if (res.code === '000000') {  
                    uni.showToast({  
                        icon: 'none',  
                        title: '密码设置成功',  
                        mask: true,  
                        duration: 2000  
                    });  
                    setTimeout(() => {  
                        uni.reLaunch({  
                            url: '/pages/my/index'  
                        })  
                    }, 2000);  
                }  
            }).finally(() => {  
                uni.hideLoading({  
                    noConflict: true  
                });  
            });  
        },  
    },  
};  

</script>

<style lang="scss" scoped>
.page-container {
background: #F7F7F7;
}

.content {  
    .operation-card {  
        background: #fff;  
        margin: 20rpx 20rpx 0;  
        border-radius: 16rpx;  
        overflow: hidden;  

        .card-title {  
            font-weight: 500;  
            font-size: 32rpx;  
            color: #000000;  
            line-height: 28rpx;  
            margin: 40rpx 30rpx 34rpx;  
        }  

        .card-item {  
            height: 112rpx;  
            display: flex;  
            align-items: center;  
            border-bottom: 2rpx solid #F7F7F7;  
            margin: 0 32rpx;  
            padding: 32rpx 0;  
            box-sizing: border-box;  
            border-radius: 16rpx;  
            overflow: hidden;  

            .left {  
                width: 160rpx;  
            }  

            .center {  
                flex: 1;  
                display: flex;  
                align-items: center;  

                .s-input {  
                    flex: 1;  
                    height: 112rpx;  
                }  
            }  

            .right {  
                width: 48rpx;  
                padding: 20rpx;  
                margin-left: 20rpx;  

                .right-icon {  
                    height: 100%;  
                    display: flex;  
                    align-items: center;  
                    // padding: 0 10rpx;  
                }  
            }  
        }  

        .card-item:last-child {  
            border-bottom: none;  
        }  
    }  
}  

.submit-box {  
    position: fixed;  
    bottom: 0;  
    left: 0;  
    width: 100%;  
    background: #fff;  
    padding: 28rpx 32rpx 68rpx;  
    border-radius: 32rpx 32rpx 0px 0px;  
    overflow: hidden;  
    box-sizing: border-box;  

    .submit-btn {  
        width: 100%;  
        height: 100rpx;  
        background: #C4D6FF;  
        border-radius: 16rpx;  
        font-weight: 600;  
        overflow: hidden;  
        font-size: 36rpx;  
        color: #ffffff;  
        display: flex;  
        justify-content: center;  
        align-items: center;  
    }  

    .submit-btn.active {  
        background: #3974FE;  
    }  
}  

</style>

操作步骤:

ios端来回切换两个input框

预期结果:

ios端不需要二次点击

实际结果:

ios端需要二次点击

bug描述:

ios端修改切换input框键盘键盘收起,并且需要二次点击,小米的安卓端是好的,支付宝的ios也是好的,就是微信小程序的ios端有问题

2025-08-07 10:27 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你好,可以测试一下原生的微信小程序输入框有在ios微信小程序上有此问题吗?

  • 1***@qq.com (作者)

    日了,原生也有

    2025-08-07 16:05

  • 1***@qq.com (作者)

    tm,把锅甩给腾讯,老板今天就要

    2025-08-07 16:06

  • DCloud_UNI_yuhe

    回复 1***@qq.com: 这样得去微信社区反馈一下了

    2025-08-12 15:51

要回复问题请先登录注册