feedback.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /* @var $this yii\web\View */
  3. use yii\helpers\Url;
  4. use yii\widgets\ActiveForm;
  5. use common\models\UploadForm;
  6. $this->title = '设置';
  7. ?>
  8. <div class="feedback">
  9. <textarea placeholder="请输入您的意见和建议" class="content"></textarea>
  10. <input type="email" class="contact" placeholder="请输入您的邮箱">
  11. </div>
  12. <a href="#" class="weui-btn weui-btn_plain-default submit-btn">提交</a>
  13. <script>
  14. $('.submit-btn').click(function(){
  15. var content = $('.content').val();
  16. var contact = $('.contact').val();
  17. if(content == ""){
  18. $.alert('请填写建议或意见');
  19. return false;
  20. }else if(contact == ""){
  21. $.alert('请输入您的邮箱');
  22. return false;
  23. }else{
  24. $.ajax({
  25. url:'<?=Url::toRoute(['user/feedback']);?>',
  26. type:'GET',
  27. dataType:'json',
  28. data:{content:content,contact:contact},
  29. success:function(data){
  30. if(data.sign==1){
  31. $.alert(data.msg, "提示", function() {
  32. window.location.href="<?=Url::toRoute(['user/setting'])?>";
  33. });
  34. }else{
  35. $.alert(data.msg);
  36. }
  37. }
  38. });
  39. }
  40. });
  41. </script>