当前位置:网站首页>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;
}边栏推荐
- Oracle-分组统计查询
- 【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
- pull request
- R语言dplyr包arrange函数排序dataframe数据、通过多个数据列排序dataframe数据、指定第一个字段降序排序,第二字段不指定(默认升序排序)
- Codeforces Round #786 (Div. 3) ABCDE
- 【值得收藏】Centos7 安装mysql完整操作命令
- Jerry's seamless looping [chapter]
- [tcapulusdb knowledge base] Introduction to tcapulusdb table data caching
- Native JS implements page scroll bar loading data and page drop-down loading content
- How to adjust an integer that is entered in Excel but always displays decimals?
猜你喜欢

Excel中输入整数却总是显示小数,如何调整?

Heap heap sort TOPK

【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
![[worthy of collection] centos7 installation MySQL complete operation command](/img/23/7c4b69e1abc3a3ceba9b79cebe1c9b.png)
[worthy of collection] centos7 installation MySQL complete operation command

Native JS implements page scroll bar loading data and page drop-down loading content

C/s architecture
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area](/img/b7/2358e8cf1cdaeaba77e52d04cc74d4.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area

等等, 怎么使用 SetMemoryLimit?

【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
![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;)
随机推荐
MQTT协议栈原理及交互流程图
VPT Model Video Explanation
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
力扣(LeetCode)177. 第N高的薪水(2022.06.26)
Deep learning in finance in cross sectional sectional predictions for random forests
Wait, how do I use setmemorylimit?
The R language uses the follow up The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The labels parameter adds label information t
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
R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
【TcaplusDB知识库】TcaplusDB常规单据介绍
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company
等等, 怎么使用 SetMemoryLimit?
Jerry's constant feeding of dogs will cause frequent switch interruptions leading to timer [chapter]
R language uses the poisgof function of epidisplay package to test the goodness of fit of Poisson regression and whether there is overdispersion
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
matlab习题 —— 创建 50 行 50 列全零矩阵、全 1 矩阵、单位矩阵、对角矩阵,输出矩阵第135号元素。
ECMAScript 6(es6)
Leetcode 522 longest special sequence ii[enumeration double pointer] leetcode path of heroding
Oracle-多表查询