diff --git a/app/index/view/pc/product/detail.html b/app/index/view/pc/product/detail.html index 38cbe4b4..aee6899a 100644 --- a/app/index/view/pc/product/detail.html +++ b/app/index/view/pc/product/detail.html @@ -225,7 +225,7 @@ - + @@ -273,21 +273,12 @@ // 处理表单提交 modal.find("form").submit(function(e) { e.preventDefault(); + var form = $(this) var formData = $(this).serialize(); - // 这里可以添加代码将formData发送到服务器 - // 例如通过AJAX - console.log("提交的数据: " + formData); - // 提交成功后可以选择关闭模态框 - modal.hide(); - }); - - // 提交询盘 - $('#send').click(function() { - var form = $(this).parents('form'); $.ajax({ url: "{:url('product/inquiry')}", type: 'POST', - data: form.serialize(), + data: formData, success: function(r) { if (r.code == 0) { form[0].reset(); // 重置表单 @@ -297,6 +288,7 @@ }, error: function(e) { console.error(e); + modal.hide(); } }) });