xiugai
This commit is contained in:
@ -5,7 +5,8 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
countdown: 60, // 设置倒计时时长(秒)
|
||||
timer: null, // 存储计时器
|
||||
},
|
||||
|
||||
name(e){
|
||||
@ -76,6 +77,34 @@ Page({
|
||||
console.error('请求失败', err);
|
||||
}
|
||||
});
|
||||
this.startCountdown();
|
||||
},
|
||||
startCountdown() {
|
||||
this.setData({
|
||||
isCountingDown: true,
|
||||
countdown: 60
|
||||
});
|
||||
|
||||
this.data.timer = setInterval(() => {
|
||||
let count = this.data.countdown;
|
||||
if (count <= 1) {
|
||||
clearInterval(this.data.timer);
|
||||
this.setData({
|
||||
isCountingDown: false,
|
||||
countdown: 60
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
countdown: count - 1
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
onUnload() {
|
||||
// 页面卸载时清除定时器
|
||||
if (this.data.timer) {
|
||||
clearInterval(this.data.timer);
|
||||
}
|
||||
},
|
||||
// 注册
|
||||
submit(){
|
||||
@ -161,6 +190,7 @@ Page({
|
||||
icon: 'error',
|
||||
duration: 2000
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
|
@ -13,11 +13,11 @@
|
||||
<text class="font_2 text_7" bind:tap="getcode">获取验证码</text>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-start view_2"><input class="text_3 font_3 text_8" bindinput="code" placeholder="请输入邀请码" /></view>
|
||||
<view class="flex-col justify-start items-start view_3"><input class="text_3 font_3 text_9" bindinput="password" placeholder="请设置密码" /></view>
|
||||
<view class="flex-col justify-start items-start view_3"><input class="text_3 font_3 text_9" bindinput="password" password type="text" placeholder="请设置密码" /></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row items-center self-start group_2">
|
||||
<radio class="radio" color="#ff8d1a" bind:tap="onAgreeChange"></radio>
|
||||
<checkbox class="radio" color="#ff8d1a" bind:tap="onAgreeChange" />
|
||||
<text class="shrink-0 font_4 text_10">我已阅读并同意</text>
|
||||
<text class="flex-1 font_4 text_11">青橙用户服务协议、隐私政策</text>
|
||||
</view>
|
||||
|
@ -112,9 +112,12 @@
|
||||
line-height: 26.92rpx;
|
||||
}
|
||||
.text_10 {
|
||||
margin-left: 35.56rpx;
|
||||
margin-left: 15.56rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.radio{
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.text_11 {
|
||||
color: #d43030;
|
||||
margin-left: 10rpx;
|
||||
@ -148,4 +151,4 @@
|
||||
.imagesize{
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user