Subversion Repositories SmartDukaan

Rev

Rev 35971 | Rev 36842 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35971 Rev 35977
Line 363... Line 363...
363
                });
363
                });
364
        }
364
        }
365
    }
365
    }
366
});
366
});
367
 
367
 
368
$(document).on('click', "#LOI_otp", function () {
-
 
369
    let loiId = $(this).val();
368
var otpCountdownTimer = null;
370
    if (confirm("Are you sure to send OTP ?")) {
-
 
371
        doPostAjaxRequestHandler(`${context}/loiAcceptanceOtp?loiId=` + loiId,
-
 
372
            function (response) {
-
 
373
                alert(response);
-
 
374
                doGetAjaxRequestHandler(context + "/generateLoi?loiId=" + loiId,
-
 
375
                    function (response) {
-
 
376
                        $('#' + 'main-content').html(response);
-
 
377
                    });
-
 
378
            });
-
 
379
    } else {
-
 
380
        alert("OTP not send .");
-
 
381
    }
-
 
382
 
369
 
-
 
370
function startResendCountdown(btn) {
-
 
371
    var remaining = 30;
-
 
372
    btn.prop('disabled', true).removeClass('btn-success').addClass('btn-warning');
-
 
373
    btn.text('Resend OTP (' + remaining + 's)');
-
 
374
    otpCountdownTimer = setInterval(function () {
-
 
375
        remaining--;
-
 
376
        if (remaining <= 0) {
-
 
377
            clearInterval(otpCountdownTimer);
-
 
378
            otpCountdownTimer = null;
-
 
379
            btn.text('Resend OTP').prop('disabled', false);
-
 
380
        } else {
-
 
381
            btn.text('Resend OTP (' + remaining + 's)');
-
 
382
        }
-
 
383
    }, 1000);
-
 
384
}
-
 
385
 
-
 
386
$(document).on('click', "#LOI_otp", function () {
-
 
387
    let btn = $(this);
-
 
388
    let loiId = btn.val();
-
 
389
    if (otpCountdownTimer) return;
-
 
390
    let isResend = btn.text().indexOf('Resend') >= 0;
-
 
391
    if (!isResend && !confirm("Are you sure to send OTP ?")) return;
-
 
392
    btn.prop('disabled', true).text('Sending...');
-
 
393
    doPostAjaxRequestHandler(`${context}/loiAcceptanceOtp?loiId=` + loiId,
-
 
394
        function (response) {
-
 
395
            $('#otp_status').show().text('OTP Sent Successfully!');
-
 
396
            startResendCountdown(btn);
-
 
397
        });
383
});
398
});
384
 
399
 
385
//confirmPayment
400
//confirmPayment
386
$(document).on('click', ".paymentConfirmBtn", function () {
401
$(document).on('click', ".paymentConfirmBtn", function () {
387
    let approval = $(this).data('approval');
402
    let approval = $(this).data('approval');