调整体重记录bug显示重复数据bug,变更钱包设置密码,验证密码键盘key

This commit is contained in:
唐明明
2022-01-17 14:31:05 +08:00
parent 7cedee35fe
commit 61d389bef4
8 changed files with 221 additions and 42 deletions

View File

@@ -4,14 +4,42 @@
<view class="password">
<view class="prompt">请设置6位数字密码建议不要使用连续的数字</view>
<view class="group">
<view class="inputs">
<input type="digit" password v-model="password" maxlength="6" placeholder="请设置密码" />
<view class="inputs" @click="onShowKet('password')">
<block v-if="password.length > 0">
<text v-for="item in password.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'password'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="password.length === 0" class="placeholder">请设置密码</text>
</block>
</view>
<view class="inputs">
<input type="digit" password v-model="verify" maxlength="6" placeholder="请确认密码" />
<view class="inputs" :class="{'hide': verify === ''}" @click="onShowKet('verify')">
<block v-if="verify.length > 0">
<text v-for="item in verify.length" :key="item"></text>
</block>
<block v-if="keyShow && valKye === 'verify'">
<text class="flicker-animation">|</text>
</block>
<block v-else>
<text v-if="verify.length === 0" class="placeholder">请确认密码</text>
</block>
</view>
</view>
</view>
<!-- key键盘 -->
<u-keyboard
mode="number"
random
dotDisabled
:overlay="false"
:show="keyShow"
:showCancel="false"
@change="keyValChange"
@backspace="keyValBackspace"
@confirm="keyShow = false"
></u-keyboard>
<!-- 按钮 -->
<view class="buttons">
<button type="default" form-type="submit" @click="createWallet">确认激活</button>
@@ -25,10 +53,26 @@ export default {
data() {
return {
password: '',
verify : ''
verify : '',
valKye : '',
keyShow : false
};
},
methods: {
// 唤起key
onShowKet(key){
this.valKye = key
this.keyShow = true
},
// 键盘输入
keyValChange(e){
if(this[this.valKye].length >= 6) return
this[this.valKye] += e
},
// 键盘删除
keyValBackspace(e){
if(this[this.valKye].length) this[this.valKye] = this[this.valKye].substr(0, this[this.valKye].length - 1)
},
// 激活钱包
createWallet() {
if (this.password === '' || this.verify === '') {
@@ -63,6 +107,16 @@ export default {
};
</script>
<style>
.flicker-animation{
animation: flicker .8s infinite;
}
@keyframes flicker{
0%{opacity: 0;}
100{opacity: 1;}
}
</style>
<style lang="scss" scoped>
// 副标题
.sub-title {
@@ -89,15 +143,17 @@ export default {
margin-top: $margin;
border-radius: $radius-m;
background-color: $window-color;
&:last-child {
border-bottom: none;
}
input {
height: 70rpx;
line-height: 70rpx;
font-size: $title-size-lg;
height: 70rpx;
line-height: 70rpx;
font-size: $title-size-lg;
text-align: center;
text{
padding: 0 10rpx;
text-align: center;
}
.placeholder{
color: $text-gray;
}
}
}
}