99国产在线视频有精品视频_国产精品久久久久久亚洲影视 _国产三级日本三级韩国三级在线看_精精国产XXXX视频在线my_乱VODAFONEWIFI熟妇_超碰cao国产精品一区二区_91久久精品青青草原伊人_欧美,一区,日韩,精品

注冊驗證碼

627次瀏覽 更新日期:2025-05-11 12:40:47 分類:程序交流 評論:3

大家好,我在注冊會員時,所有輸入框都輸入正確,唯獨驗證碼輸入錯誤,在驗證碼輸入錯誤的同時,驗證碼沒有自動更新,請兄弟們指點一下,如下圖。

                                   



 1746938282188808.png


script如下

$(document).on("click", ' #send-btn', function () {

        const email = $('#email').val();

        const sendBtn = $(this);

        sendBtn.prop('disabled', true);

        if(!email){

            layer.tips('請填寫注冊郵箱!', '#email', {

                tips: [3, 'red'],time: 6000

            });

            return false;

        }

        if(!isEmail(email)){

            layer.tips('郵箱格式錯誤,請重新填寫!', '#email', {

                tips: [3, 'red'],time: 6000

            });

            return false;

        }

        $.ajax({

            type: 'POST',

            url: "{U('api/index/send_email_code')}",

            data: {

                email: email

            },

            success: function (response) {

                // 發送郵件成功后,啟動倒計時

                let seconds = 60;

                // 啟動倒計時

                const countdownInterval = setInterval(() => {

                    seconds--;

                    if (seconds <= 0) {

                        clearInterval(countdownInterval);

                        sendBtn.html('發送郵件驗證碼');

                        sendBtn.prop('disabled', false);

                    } else {

                        sendBtn.html('已發送, ' + seconds + '秒');

                    }

                }, 1000);

            },

            error: function (data) {

                layer.msg(data.responseJSON.msg, {icon: 2, offset: '16px', anim: 'slideDown', time: 5000});

                sendBtn.prop('disabled', false);

            }

        });

    });

    function tijiao(obj, url){

    $.ajax({

    type: 'POST',

    url: url, 

    data: $(obj).serialize(),

    dataType: "json", 

    success: function (msg) {

    if(msg.status == 1){

    layer.msg(msg.message, {icon:1,time: 2000}, function(){

    window.location.href = msg.url;

    });

    }else{

    layer.msg(msg.message, {icon:2,time: 2500});

    }

    }

    })

return false;

}


我來說兩句
  • oolaile
    oolaile 4月前
    弄好了,謝謝大佬
    1
    回復
  • $('#code+img').attr('src',$('#code+img').attr('src') + '?' + Math.random());根據你代碼結構來改節點就行
    1
    回復
  •    function tijiao(obj, url){
    
        	$.ajax({
    
        		type: 'POST',
    
        		url: url, 
    
        		data: $(obj).serialize(),
    
        		dataType: "json", 
    
        		success: function (msg) {
    
        			if(msg.status == 1){
    
        				layer.msg(msg.message, {icon:1,time: 2000}, function(){
    
        					window.location.href = msg.url;
    
        				});
    
        			}else{
                                    $('#code+img').attr('src',$('#code+img').attr('src') + '?' + Math.random());
        				layer.msg(msg.message, {icon:2,time: 2500});
    
        			}
    
        		}
    
        	})
    
    	return false;
    
    }
    1
    回復
作者信息
發布見解
發內容 回頂部