当前位置:网站首页>Wechat applet payment password input
Wechat applet payment password input
2022-06-27 11:50:00 【Draw a flourishing fireworks with a black pencil】
wxml Code
<view catchtap='showInputLayer' class="btn_pay"> Pay now </view>
<!-- Password input box -->
<view wx:if='{
{showPayPwdInput}}'>
<view class='bg_layer'></view>
<view class='input_main'>
<view class='input_title'>
<view class='input_back' catchtap='hidePayLayer'><text></text></view>
<text> Enter payment password </text>
</view>
<view class='input_tip'><text> You need to verify your identity to use your membership card balance to pay , Payment can only be made after verification .</text></view>
<view class='input_row' catchtap='getFocus'>
<view class='pwd_item' wx:for='{
{6}}' wx:key='item' wx:for-index='i'>
<text wx:if='{
{pwdVal.length>i}}'></text>
</view>
</view>
<view class='forget_pwd' catchtap='hidePayLayer'> Forget the password </view>
<input class='input_control' password type='number' focus='{
{payFocus}}' bindinput='inputPwd' maxlength='6'/>
</view>
</view>js Code
Page({
data: {
showPayPwdInput: false, // Whether the password input layer is displayed
pwdVal: '', // The password entered
payFocus: true, // Text box focus
},
onLoad: function () {
},
/**
* Display the payment password input layer
*/
showInputLayer: function(){
this.setData({ showPayPwdInput: true, payFocus: true });
},
/**
* Hide the payment password input layer
*/
hidePayLayer: function(){
let val = this.data.pwdVal;
this.setData({ showPayPwdInput: false, payFocus: false, pwdVal: '' });
},
/**
* Get focus
*/
getFocus: function(){
this.setData({ payFocus: true });
},
/**
* Enter password to listen
*/
inputPwd: function(e){
let that = this;
this.setData({ pwdVal: e.detail.value });
let pwd = e.detail.value;
if (e.detail.value.length >= 6){
if(pwd == '123456'){
this.hidePayLayer();
wx.showToast({
title: ' success ',
icon: 'success',
duration: 2000
})
}else{
this.hidePayLayer();
wx.showToast({
title: ' Failure ',
icon: 'error',
duration: 2000
})
}
}
}
})wxss Code
.bg_layer {
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 9998;
}
.input_main {
position: fixed;
left: 0;
bottom: 500rpx;
width: 100%;
height: 394rpx;
background-color: #fff;
z-index: 9999;
}
.input_title {
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
font-size: 32rpx;
border-bottom: 1rpx solid #e2e2e2;
}
.input_back {
position: absolute;
left: 0;
top: 0;
width: 80rpx;
height: 90rpx;
display: flex;
justify-content: center;
align-items: center;
}
.input_back text {
width: 20rpx;
height: 20rpx;
background-color: white;
border: 1rpx solid #aaa;
border-width: 5rpx 0 0 5rpx;
transform: rotate(-45deg);
}
.input_tip {
margin: 30rpx;
font-size: 24rpx;
color: #888;
}
/* Password mask emulation */
.input_row {
width: 690rpx;
margin: 0 auto;
height: 98rpx;
position: relative;
display: flex;
align-items: center;
border: 1rpx solid #e2e2e2;
border-radius: 20rpx;
}
.input_row .pwd_item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
border-right: 1rpx solid #e2e2e2;
position: relative;
}
.pwd_item:nth-last-of-type(1) {
border-right: 0;
}
.pwd_item text {
width: 30rpx;
height: 30rpx;
border-radius: 30rpx;
background-color: #555;
}
.forget_pwd {
float: right;
margin: 30rpx;
width: 100rpx;
text-align: right;
font-size: 24rpx;
color: #ff7800;
}
/* Text input box position : Set to the left to hide */
.input_control {
position: relative;
left: -300rpx;
bottom: 0;
width: 100rpx;
height: 100rpx;
}边栏推荐
猜你喜欢

【TcaplusDB知识库】TcaplusDB运维单据介绍

"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?

【TcaplusDB知识库】Tmonitor系统升级介绍

Redis 分布式锁15问,看看你都掌握了哪些?
![21: Chapter 3: develop pass service: 4: further improve [send SMS, interface]; (in [send SMS, interface], call Alibaba cloud SMS service and redis service; a design idea: basecontroller;)](/img/a7/ce0dc8e53569703aa02843f1fc1cf4.png)
21: Chapter 3: develop pass service: 4: further improve [send SMS, interface]; (in [send SMS, interface], call Alibaba cloud SMS service and redis service; a design idea: basecontroller;)

Microsoft cloud technology overview

Nvme2.0 protocol - new features

Redis distributed lock 15 ask, what have you mastered?

Usage of rxjs mergemap

Glide caching mechanism
随机推荐
i.mx6ull(单片机) c语言环境搭建
星际争霸的虫王IA退役2年搞AI,自叹不如了
R语言使用epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用by参数指定分组参数可视化不同分组的点图分布、使用dot.col参数指定分组数据点的颜色
杰理之添加定时器中断【篇】
最大路径和问题(摘樱桃问题)
旭日3SDB,安装原版ros
The DBSCAN function of FPC package in R language performs density clustering analysis on data, and the plot function visualizes the clustering graph
Open source model library of flying propeller industry: accelerating the development and application of enterprise AI tasks
Unity Shader学习(一)认识unity shader基本结构
【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
杰理之睡眠以后定时唤醒系统继续跑不复位【篇】
R语言glm函数构建二分类logistic回归模型(family参数为binomial)、使用AIC函数比较两个模型的AIC值的差异(简单模型和复杂模型)
Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
杰理之DAC输出方式设置【篇】
Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company
Code for structural design of proe/creo household appliances - electric frying pan
The R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, specifies the grouping parameters with the b
15+城市道路要素分割应用,用这一个分割模型就够了!
Safe landing practice of software supply chain under salesforce containerized ISV scenario