add.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.css">
  9. <script type="text/javascript" src="/static/jquery-2.2.4.min.js"></script>
  10. <script type="text/javascript" src="/static/layer/layer.js"></script>
  11. <link rel="stylesheet" href="/repair/style.css">
  12. <title>{$title}</title>
  13. </head>
  14. <body>
  15. <div class="container">
  16. <form method="post" action="{:url('add')}" class="form-horizontal" id="form">
  17. <input type="hidden" name="mode" value="{$mode}">
  18. <div class="add-content-box">
  19. <textarea name="content" id="" placeholder="请输入内容..." ></textarea>
  20. </div>
  21. <div class="add-img-box">
  22. <div class="upload-bx">
  23. {:widget_view('common/upimg',['name'=>'images','multi'=>9,'val'=>''])}
  24. </div>
  25. </div>
  26. <div class="add-contacts-info-box">
  27. <div class="header-box">联系人信息</div>
  28. <div class="add-form-group">
  29. <label class="control-label">姓名</label>
  30. <div class="input-right">
  31. <input type="text" name="name" value="" placeholder="请输入">
  32. </div>
  33. </div>
  34. <div class="add-form-group">
  35. <label class="control-label">电话</label>
  36. <div class="input-right">
  37. <input type="text" name="phone" value="" placeholder="请输入">
  38. </div>
  39. </div>
  40. </div>
  41. <!-- <button type="submit" target-form="form-horizontal" class="add-btn ajax-post" >提交</button>-->
  42. <div class="add-btn" id="addBtn">提交</div>
  43. </form>
  44. </div>
  45. {if $mode == 2}
  46. <div class="add-table-record-box">
  47. <table class="table table-bordered">
  48. <tbody>
  49. {if isset($list)}
  50. {foreach $list as $k=>$v}
  51. <tr>
  52. <td>{$v['create_time']}</td>
  53. <td>{$v['addrName']}</td>
  54. <td>{$v['content']}</td>
  55. <td>{$v['statusTxt']}({$v['userName']})</td>
  56. </tr>
  57. {/foreach}
  58. {/if}
  59. </tbody>
  60. </table>
  61. </div>
  62. {/if}
  63. </body>
  64. </html>
  65. <script>
  66. $('#addBtn').click(function (){
  67. $.ajax({
  68. type: "POST",
  69. dataType: "json",
  70. url: '{:url("repair/add")}' ,
  71. data: $('#form').serialize(),
  72. success: function (res) {
  73. if (res.code == 1) {
  74. layer.msg('操作成功',{time:2000},function (){
  75. window.location.href = "{:url('addSuccess')}";
  76. })
  77. }else{
  78. layer.msg(res.msg,{time:2000},)
  79. }
  80. },
  81. error : function() {
  82. layer.msg('网络异常')
  83. }
  84. });
  85. })
  86. </script>