uniapp自定义密码输入键盘-数字键盘效果demoUI方法二(整理)
2023-09-14 09:04:05 时间
效果图:
<template>
<view class="paymentCodeBox">
<!-- 自定义键盘 -->
<view class="password-set-page">
<view class="setPage">
<view class="hint margin-bottom30 height110 width100Percent font-size32 color222 font-bold">
输入支付密码
<view class="width50 height50 imgClose" @click="closeClick()">
<image src="../static/goods/close.png" mode="" class="width50 height50"></image>
</view>
</view>
<view class="code margin-bottom30">
<view class="numFont">
<view v-for="(item, index) in 6" :key="index">{{ password[index] && '●' || '' }}</view>
</view>
</view>
<view class="slipBox dis_f margin-left30 margin-right30 margin-bottom80">
<view class="font-size24 colorccc">忘记支付密码或没有设置支付密码?</view>
<view class="dis_f goto">
<text class="margin-right10 font-size24" style="color: #F21177;">去修改支付密码</text>
<view class="imgBox">
<image src="../static/goods/tz2.png" mode="" class="img"></image>
</view>
</view>
</view>
<view class="keyboard">
<button v-for="(item, index) in 9" :key="index" @click="key(index + 1)">
<text>{{ index + 1 }}</text>
</button>
<button class="hide"></button>
<button @click="key(0)">
<text>0</text>
</button>
<button @click="del()">
<!-- <image src="../static/enter/btn_xuanzhong.png" mode="aspectFill"></image> -->
<image src="../static/goods/del1.png" mode="aspectFill"></image>
</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
// pageNum: 1,
password: '',
}
},
// 页面加载
onLoad(e) {
uni.hideTabBar(); //不让底部显示tab选项
},
// 页面显示
onShow() {
},
// 方法
methods: {
//关闭键盘
closeClick(){
this.password = '';
this.KeypadShow = 0;
},
// 键盘
key(key) {
if (this.password.length < 6) {
this.password += key
if (this.password.length === 6) {
// 密码验证操作
console.log(this.password,'37')
// this.$.open('/trait/details');
}
}
},
del() {
if (this.password.length > 0) {
this.password = this.password.substring(0, this.password.length - 1)
}
},
//获取列表数据
getListData() {
this.$.ajax("POST", "/xxxxx/xxxxx", {
page: this.pageNum,
}, (res) => {
if (res) {
if (this.pageNum == 1) {
this.list = res.data
} else {
this.list = this.list.concat(res.data)
if (res.data.length === 0) {
this.pageNum--
}
}
}
uni.stopPullDownRefresh()
});
}
},
// 计算属性
computed: {
},
// 侦听器
watch: {
},
// 页面隐藏
onHide() {
},
// 页面卸载
onUnload() {
},
// 触发下拉刷新
onPullDownRefresh() {
// this.pageNum = 1
// this.getListData()
},
// 页面上拉触底事件的处理函数
onReachBottom() {
// this.pageNum++
// this.getListData()
},
}
</script>
<style lang="scss" scoped>
.paymentCodeBox {
width: 100%;
height: 100vh;
background: #fff;
.password-set-page {
position: fixed;
bottom: 0;
width: 100%;
height: 100vh;
overflow: hidden;
background-color: rgba(0, 0, 0, .5);
z-index: 999999;
.setPage{
position: fixed;
bottom: 0;
background: #fff;
border-radius: 20rpx 20rpx 0px 0px;
.hint{
line-height: 110rpx;
position: relative;
text-align: center;
border-bottom: 1rpx solid #ECECEC;
.imgClose{
position: absolute;
right: 20rpx;
top: 26rpx;
}
}
}
.slipBox{
display: flex;
justify-content: space-between;
.goto{
align-items: center;
.imgBox{
width: 9rpx;
height: 16rpx;
.img{
width: 9rpx;
height: 16rpx;
}
}
}
}
.code {
view {
// border: 1rpx solid #D9D9D9;
border-radius: 8rpx;
overflow: hidden;
display: flex;
width: 690rpx;
margin: 0 auto;
view {
display: flex;
align-items: center;
justify-content: center;
// width: 100rpx;
height: 100rpx;
// background: #FAFAFA;
font-size: 60rpx;
border: 1rpx solid #D9D9D9;
&:not(:last-child) {
border-right: 1rpx solid #D9D9D9;
}
}
}
}
.keyboard {
width: 100%;
background: #EEEEEE;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
button {
display: flex;
align-items: center;
justify-content: center;
width: calc(100vw / 3 - 1rpx);
background: #FFFFFF;
border-radius: 0;
margin-top: 1rpx;
font-size: 50rpx;
height: 120rpx;
&.button-hover:not(.hide) {
background: #EEEEEE;
}
image {
width: 52rpx;
height: 38rpx;
}
}
}
}
}
</style>
相关文章
- oracle修改用户名密码语句_oracle修改数据库用户名
- 暴力激活成功教程密码 – C++ 递归方法实现
- CentOS | 密码尝试次数过多
- 实现SSH无密码自动登录
- linux系统安装的mysql数据库root帐户密码忘记的两种处理方法
- 密码的安全管理,OA登录锁定策略及特权账号管理方案| FB甲方群话题讨论
- 谷歌账号修改密码教程和谷歌密保使用方法2023ChatGPT注册修改密码
- 《安富莱嵌入式周报》第309期:开源脑机接口套件,三相多电平逆变器,开源电位仪,单片机并行计算,蓝牙市场分析报告,AI密码破解,nRF54H2发布,Z-Wave
- Oracle用户密码设为不过期的两种方法
- Ubuntu 18.04 安装MySQL时未提示输入密码的问题及解决方法
- Oracle用户密码含特殊字符时登陆失败问题
- 为什么在密码问题上char[]优先于String详解编程语言
- MySQL重置Root用户密码指南(mysql重置root密码)
- Oracle账户密码到期须知(oracle密码到期)
- MySQL安全精英:设置登录密码(mysql设置登陆密码)
- Linux修改密码的简单方法(linux怎么修改密码)
- 阿里云上查看MySQL密码的方法(阿里云查看mysql密码)
- Linux账户安全:重要性和实现方法(linux账户密码)
- Wifi密码破解实战
- 本地SQL Server账户密码查看方法(查看本地sqlserver密码)
- 轻松解决问题:mysql密码修改指南(mysql 密码修改)
- 和密码MSSQL注入泄漏用户名及密码(mssql注入爆用户名)
- 上的安装方法在macOS上安装MySQL的步骤下载安装文件双击安装启动MySQL配置root密码测试连接完成
- MySQL登录时无法输入密码解决方法(mysql不能输入密码)
- 为Redis设置远程连接密码(redis远程链接密码)
- Oracle 11 重置密码的简单方法(oracle11重置密码)
- 允许phpmyadmin空密码登录的配置方法
- 修改mysql密码与忘记mysql密码的处理方法
- jquery实现密码框的显示与隐藏示例代码