diff --git a/public/themes/website/1/zh/demo/contact.html b/public/themes/website/1/zh/demo/contact.html index 7430c8b..5f6b302 100644 --- a/public/themes/website/1/zh/demo/contact.html +++ b/public/themes/website/1/zh/demo/contact.html @@ -230,6 +230,7 @@ $(function () { success: function (res) { if (res.code === 0 || res.code === 200) { $form[0].reset(); + showFormToast('提交成功,我们会尽快与您联系!'); } else { alert(res.msg || '提交失败,请稍后重试'); } @@ -245,8 +246,62 @@ $(function () { return false; }); + + // 表单提交成功提示 + var $toast = null; + var toastTimer = null; + function showFormToast(msg) { + if (!$toast) { + $toast = $( + '
' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + ); + $('body').append($toast); + } + $toast.find('.form-toast__text').text(msg); + $toast.addClass('form-toast--show'); + clearTimeout(toastTimer); + toastTimer = setTimeout(function () { + $toast.removeClass('form-toast--show'); + }, 3000); + } }); +