wxml
<view wx:if ="{{wallets_password_flag}}" class ="wallets-password" >
<view class ="input-content-wrap" >
<view class ="top" >
<view catchtap ="close_wallets_password" class ="close" > ×view >
<view class ="txt" > 请输入支付密码view >
<view catchtap ="modify_password" class ="forget" > 忘记密码view >
view >
<view class ="actual_fee" >
<span > ¥span >
<text > {{actual_fee/100}}text >
view >
<view catchtap ="set_Focus" class ="input-password-wrap" >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=1}}" > i >
view >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=2}}" > i >
view >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=3}}" > i >
view >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=4}}" > i >
view >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=5}}" > i >
view >
<view class ="password_dot" >
<i wx:if ="{{wallets_password.length>=6}}" > i >
view >
view >
view >
<input bindinput ="set_wallets_password" class ="input-content" password type ="number" focus ="{{isFocus}}" maxlength ="6" />
view >
wxss
page .wallets-password {
position : absolute;
left : 0 ;
top : 0 ;
width : 100% ;
height : 100% ;
background : rgba (0, 0, 0, 0.6);
}
page .wallets-password .input-content-wrap {
position : absolute;
top : 200 rpx;
left : 50% ;
display : flex;
flex-direction : column;
width : 600 rpx;
margin-left : -300 rpx;
background : #fff ;
border-radius : 20 rpx;
}
page .wallets-password .input-content-wrap .top {
display : flex;
align-items : center;
height : 90 rpx;
border-bottom : 2 rpx solid #ddd ;
justify-content : space-around;
}
page .wallets-password .input-content-wrap .top .close {
font-size : 44 rpx;
color : #999 ;
font-weight : 100 ;
}
page .wallets-password .input-content-wrap .top .forget {
color : #00a2ff ;
font-size : 22 rpx;
}
page .wallets-password .input-content-wrap .actual_fee {
display : flex;
align-items : center;
justify-content : center;
color : #000 ;
height : 100 rpx;
margin : 0 23 rpx;
border-bottom : 2 rpx solid #ddd ;
}
page .wallets-password .input-content-wrap .actual_fee span {
font-size : 24 rpx;
}
page .wallets-password .input-content-wrap .actual_fee text {
font-size : 36 rpx;
}
page .wallets-password .input-content-wrap .input-password-wrap {
display : flex;
align-items : center;
justify-content : center;
height : 150 rpx;
}
page .wallets-password .input-content-wrap .input-password-wrap .password_dot {
display : flex;
align-items : center;
justify-content : center;
text-align : center;
color : #000 ;
box-sizing : border-box;
width : 90 rpx;
height : 90 rpx;
border : 2 rpx solid #ddd ;
border-left : none 0 ;
}
page .wallets-password .input-content-wrap .input-password-wrap .password_dot :nth-child(1) {
border-left : 2 rpx solid #ddd ;
}
page .wallets-password .input-content-wrap .input-password-wrap .password_dot i {
background : #000 ;
border-radius : 50% ;
width : 20 rpx;
height : 20 rpx;
}
page .wallets-password .input-content {
position : absolute;
opacity : 0 ;
left : -100% ;
top : 600 rpx;
background : #f56 ;
z-index : -999 ;
}
page .wallets-password .input-content .active {
z-index : -99 ;
}
wxjs
data: {
payment_mode : 1 ,
isFocus: false ,
balance:100 ,
actual_fee:20 ,
wallets_password_flag:false
},
set_wallets_password(e) {
this .setData({
wallets_password : e.detail.value
});
if (this .data.wallets_password.length == 6 ) {
wallet_pay(this )
}
},
set_Focus() {
console .log('isFocus' , this .data.isFocus)
邀请
原作者: 模板之家
来自: 网络收集