This commit is contained in:
Ling53666
2025-05-15 21:01:14 +08:00
parent 9b8553930b
commit 7c371623eb
35 changed files with 620 additions and 401 deletions

View File

@ -146,6 +146,39 @@ getcode(){
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);
}
},
back(){
wx.navigateTo({
url: '/pages/logain/logain',
})
}
})

View File

@ -10,14 +10,14 @@
<view class="flex-col justify-start items-start text-wrapper_1"><input class="text_1 font_2 text_4" bindinput="phone" placeholder="请输入手机号" /></view>
<view class="flex-row justify-between section mt-20">
<input class="font_2 text_5" bindinput="yanzhengma" placeholder="请输入验证码" />
<text class="font_2 text_6" bind:tap="getcode">获取验证码</text>
<text class="font_2 text_6"style="color: {{isCountingDown ? '#ccc' : '#ff8d1a'}};" bind:tap="{{isCountingDown ? '' : 'getcode'}}"> {{ isCountingDown ? countdown + '秒后重试' : '获取验证码' }}</text>
</view>
<view class="flex-col justify-start items-start text-wrapper_2 mt-20"><input class="text_1 font_2" bindinput="password" password type="text" placeholder="请输入密码" /></view>
<view class="flex-col justify-start items-start text-wrapper_4 mt-20">
<input class="text_1 font_2 text_7" bindinput="passwordagain" password type="text" placeholder="请再次输入密码" />
</view>
</view>
<text class="self-end text_8 mt-16">登陆账号</text>
<text class="self-end text_8 mt-16" bind:tap="back">登陆账号</text>
</view>
</view>
<view class="flex-col justify-start items-center self-stretch text-wrapper_3" bind:tap="subimt">