微信小程序常六位付款密码组件与模板写法

本文介绍了如何在微信小程序中创建一个六位密码输入组件,包括HTML、CSS和JS代码实现。同时提供了模板写法的示例,适用于1.6.3以上版本的小程序,对于低版本则需考虑兼容性问题。
摘要由CSDN通过智能技术生成

先看看效果


Html代码

<view class="payPass_box1" wx:if="{
  {allinputF1}}">
	<view class="qiueBtn" bindtap="hideBox">关闭</view>
	<view class="payPass_box_t">请输入您的支付密码</view>
	<view class="payPass_box_m">
		<view class="payPass_box_m_in" bindtap="focusInput">
			<view class="payPass_box_m_in_in" wx:for="{
  {6}}" wx:key="{
  {index}}">
				<input data-index="{
  {index}}" bindinput="allInputBtn" type="number" confirm-hold="true" value="{
  {inputArr[index]}}" disabled="true" maxlength="1" password="{
  {true}}"/>
			</view>
		</view>
		<view class="indexTopInput">
			<input value="{
  {inputStr}}" focus="{
  {allinputF1}}" maxlength="6" type="number" bindinput="passInput"/>
		</view>
	</view>
</view>

Css代码

.payPass_box1{
	font-size: 26rpx;
	color: #333;
	width: 640rpx;
	text-align: center;
	margin-top: 40rpx;
	height:400rpx;
	position: fixed;
	left: 50%;
	top: 30%;
	transform: translate(-50%,-50%);
	border: 2rpx #d1d1d1 solid;
	background: #f
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值