优化小程序验证码倒计时样式
This commit is contained in:
@@ -27,8 +27,9 @@
|
||||
<text class="field-label">验证码</text>
|
||||
<view class="code-row">
|
||||
<input class="code-input" value="{{form.code}}" data-field="code" bindinput="onInput" type="number" placeholder="请输入验证码" />
|
||||
<button class="code-btn" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendLoginCode">
|
||||
{{countdown > 0 ? countdown + 's' : '获取验证码'}}
|
||||
<button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendLoginCode">
|
||||
<text wx:if="{{countdown > 0}}">重新获取 {{countdown}}s</text>
|
||||
<text wx:else>获取验证码</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -84,7 +84,13 @@
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
text-align: right;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.code-btn.counting {
|
||||
color: #aaa39a;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.agreement-row,
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
<view class="field">
|
||||
<text class="field-label">验证码</text>
|
||||
<input value="{{form.code}}" data-field="code" bindinput="onInput" placeholder="请输入验证码" />
|
||||
<button class="code-btn" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendCode">
|
||||
{{countdown > 0 ? countdown + 's' : '获取验证码'}}
|
||||
<button class="code-btn {{countdown > 0 ? 'counting' : ''}}" loading="{{codeLoading}}" disabled="{{codeLoading || countdown > 0}}" bindtap="sendCode">
|
||||
<text wx:if="{{countdown > 0}}">重新获取 {{countdown}}s</text>
|
||||
<text wx:else>获取验证码</text>
|
||||
</button>
|
||||
</view>
|
||||
<view class="field">
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
.code-btn {
|
||||
width: 148rpx;
|
||||
min-width: 148rpx;
|
||||
max-width: 148rpx;
|
||||
width: 180rpx;
|
||||
min-width: 180rpx;
|
||||
max-width: 180rpx;
|
||||
height: 56rpx;
|
||||
padding: 0;
|
||||
color: #6f8f83;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
text-align: right;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.code-btn.counting {
|
||||
color: #aaa39a;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user