描述:一个页面,有一块是密码登录框,有一块是机器码框。
打开页面时,只显示密码登录框,密码输对了,隐藏密码登录框,显示机器码框。那么问题来了,
我输入的密码,会在机器码框出现,如图:
请问这是什么原因呢?
这个页的代码复制出来,如下:
<template>
<view class="container">
<view class="login_pwd" v-if="is_show">
<view class="item" >
<input type="password" class="input-ui u-border" placeholder="用户密码"
@input="bindPassword" />
</view>
<view class="botton-ui" @click="login">登录</view>
</view>
<view class="code-box" v-else>
<input type="text" class="input-ui u-border" placeholder="机器码" @input="bindMachineCode" value="" />
<input type="text" class="input-ui u-border" placeholder="激活码" @input="bindActCode" />
<view class="botton-ui" @click="getcode">获取</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
psd:"",
machineCode:"",
is_show:true
}
},
onLoad() {
// console.log(md5.hex_md5("1"))
},
methods: {
login(){
console.log(this.psd)
var pwd="111111";
if(pwd==this.psd){
this.is_show=false;
}else{
uni.showToast({
title:"密码错误!",
icon:"error"
})
}
},
getcode(){
console.log(this.machineCode)
},
bindPassword: function (e) {
this.psd= e.detail.value
},
bindMachineCode:function(e){
this.machineCode=e.detail.value
}
}
}
</script>
<style>
.container{
padding: 30upx 30upx;
}
.item{
position: relative;
margin-bottom: 20upx;
background-color: #dadbde;
}
.input-ui{
border: 1upx solid #dadbde;
padding: 12upx 18upx;
border-radius: 8upx;
font-size: 30upx;
color: rgb(48, 49, 51);
}
.showPwd{
position: absolute;
top: 0;
right: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
width: 76upx;
height: 76upx;
}
.botton-ui{
width: 100%;
padding: 22upx 0;
background: #3c9cff;
color: #fff;
text-align: center;
border-radius: 8upx;
font-size: 30upx;
}
image{
width: 36upx;
height: 36upx;
}
.code-box{margin-top: 10px;;}
</style>