代码提交
This commit is contained in:
@ -31,6 +31,14 @@ const buttonText = computed(() => {
|
||||
});
|
||||
|
||||
const startCountdown = () => {
|
||||
if(!props.mobile){
|
||||
uni.showToast({
|
||||
title: '用户名不能为空',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (!countingDown.value) {
|
||||
countingDown.value = true;
|
||||
handleSendSmsCode()
|
||||
@ -42,7 +50,6 @@ const handleSendSmsCode = () => {
|
||||
uni.showLoading({
|
||||
title: '发送验证码中'
|
||||
});
|
||||
console.log("gxs --> % handleSendSmsCode % props.mobile:\n", props.mobile)
|
||||
sendSmsCode({
|
||||
"mobile": props.mobile,
|
||||
"scene": props.scene
|
||||
@ -55,7 +62,6 @@ const handleSendSmsCode = () => {
|
||||
});
|
||||
timer.value = setInterval(() => {
|
||||
countdownSeconds.value--;
|
||||
console.log("gxs --> % timer % countdownSeconds.value:\n", countdownSeconds.value)
|
||||
if (countdownSeconds.value <= 0) {
|
||||
clearInterval(timer.value);
|
||||
countdownSeconds.value = 60; // 倒计时结束后重置为初始值
|
||||
@ -64,7 +70,6 @@ const handleSendSmsCode = () => {
|
||||
}, 1000);
|
||||
}).catch(error => {
|
||||
countingDown.value = false;
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -73,7 +78,7 @@ onUnmounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
<style lang="scss">
|
||||
.goods {
|
||||
position: relative;
|
||||
padding: 30rpx 0;
|
||||
|
Reference in New Issue
Block a user