diff --git a/public/themes/simpleboot3/user/center/evaluate.html b/public/themes/simpleboot3/user/center/evaluate.html index 462e7b9..df40ffb 100644 --- a/public/themes/simpleboot3/user/center/evaluate.html +++ b/public/themes/simpleboot3/user/center/evaluate.html @@ -292,29 +292,35 @@ //ajax如何传数组对象? $(".publish").click(function () { - console.log(more); - var data = { - oid:'{$oid}', - content:$("#write_evalute").val(), - more:more, - rank:$(".active").attr('data-rank') - } - console.log(data); - $.ajax({ - url:"", - data: data, - type:"POST", - dataType:"JSON", + var content = $("#write_evalute").val(); + content = $.trim(content); + if(content == '') { + alert('评价内容不能为空') + return false; + }else { + var data = { + oid: '{$oid}', + content: $("#write_evalute").val(), + more: more, + rank: $(".active").attr('data-rank') + } + console.log(data); + $.ajax({ + url: "", + data: data, + type: "POST", + dataType: "JSON", - success: function (data) { - if(data.data === true) { - alert(data.msg); - window.location.href=data.url; - }else { - alert(data.msg); + success: function (data) { + if (data.data === true) { + alert(data.msg); + window.location.href = data.url; + } else { + alert(data.msg); + } } - } - }) + }) + } }) </script> </html>