message.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. {include file=comm/head.html}
  2. {include file=comm/top.html}
  3. <div class="container pages">
  4. {include file=comm/position.html}
  5. {pboot:if({page:rows}>0)}
  6. <h5 class="border-bottom border-info pb-2"><i class="fa fa-sliders" aria-hidden="true"></i> 留言记录</h5>
  7. {/pboot:if}
  8. <!-- 留言记录 -->
  9. {pboot:message num=2}
  10. <div class="media border-bottom pb-3 pt-3">
  11. <img class="mr-3" src="[message:headpic]" height="25">
  12. <div class="media-body">
  13. <h5 class="mt-0">[message:nickname]:</h5>
  14. <p>[message:content]</p>
  15. <p>
  16. <span class="badge badge-light text-secondary font-weight-normal">[message:os]</span>
  17. <span class="badge badge-light text-secondary font-weight-normal">[message:bs]</span>
  18. <span class="badge badge-light text-secondary font-weight-normal">[message:askdate]</span>
  19. </p>
  20. {pboot:if('[message:recontent]'!='')}
  21. <div class="media mt-3 border-top-dashed pt-3">
  22. <img class="mr-3" src="{pboot:sitetplpath}/images/user.png" height="25">
  23. <div class="media-body">
  24. <h5 class="mt-0">管理员回复:</h5>
  25. <p>[message:recontent]</p>
  26. <p><span class="badge badge-light text-secondary font-weight-normal">[message:replydate]</span></p>
  27. </div>
  28. </div>
  29. {/pboot:if}
  30. </div>
  31. </div>
  32. {/pboot:message}
  33. <!-- 分页 -->
  34. {pboot:if({page:rows}>0)}
  35. <nav aria-label="page navigation" class="my-4">
  36. <div class="pagination justify-content-center">
  37. <a class="page-item page-link" href="{page:index}">首页</a>
  38. <a class="page-item page-link" href="{page:pre}">上一页</a>
  39. {page:numbar}<!-- 数字条,小屏幕时自动隐藏-->
  40. <a class="page-item page-link" href="{page:next}">下一页</a>
  41. <a class="page-item page-link" href="{page:last}">尾页</a>
  42. </div>
  43. </nav>
  44. {/pboot:if}
  45. <!-- 留言表单 -->
  46. <div class="row">
  47. <div class="col-lg-3"></div>
  48. <div class="col-12 col-lg-6">
  49. <form class="my-4" onsubmit="return submsg(this);">
  50. <div class="form-group">
  51. <label for="contacts">联系人</label>
  52. <div>
  53. <input type="text" name="contacts" required id="contacts" class="form-control" placeholder="请输入联系人">
  54. </div>
  55. </div>
  56. <div class="form-group">
  57. <label for="mobile">手 机</label>
  58. <div>
  59. <input type="text" name="mobile" required id="mobile" class="form-control" placeholder="请输入联系人手机">
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label for="content" >内 容</label>
  64. <div>
  65. <textarea name="content" id="content" class="form-control" placeholder="请输入留言内容"></textarea>
  66. </div>
  67. </div>
  68. {pboot:if({pboot:msgcodestatus})}
  69. <div class="form-group">
  70. <label for="checkcode">验证码</label>
  71. <div class="row">
  72. <div class="col-6">
  73. <input type="text" name="checkcode" required id="checkcode" class="form-control" placeholder="请输入验证码">
  74. </div>
  75. <div class="col-6">
  76. <img title="点击刷新" class="codeimg" style="height:33px;" src="{pboot:checkcode}" onclick="this.src='{pboot:checkcode}?'+Math.round(Math.random()*10);" />
  77. </div>
  78. </div>
  79. </div>
  80. {/pboot:if}
  81. <div class="form-group">
  82. <button type="submit" class="btn btn-info mb-2">提交留言</button>
  83. </div>
  84. </form>
  85. </div>
  86. <div class="col-lg-3"></div>
  87. </div>
  88. </div>
  89. <script>
  90. //ajax提交留言
  91. function submsg(obj){
  92. var url='{pboot:msgaction}';
  93. var contacts=$(obj).find("#contacts").val();
  94. var mobile=$(obj).find("#mobile").val();
  95. var content=$(obj).find("#content").val();
  96. var checkcode=$(obj).find("#checkcode").val();
  97. $.ajax({
  98. type: 'POST',
  99. url: url,
  100. dataType: 'json',
  101. data: {
  102. contacts: contacts,
  103. mobile: mobile,
  104. content: content,
  105. checkcode: checkcode
  106. },
  107. success: function (response, status) {
  108. if(response.code){
  109. alert("谢谢您的反馈,我们会尽快联系您!");
  110. $(obj)[0].reset();
  111. }else{
  112. if(response.tourl!=""){
  113. if(confirm(response.data+'是否立即跳转登录?')){
  114. location.href=response.tourl;
  115. }
  116. }
  117. $('.codeimg').click();//更新验证码
  118. }
  119. },
  120. error:function(xhr,status,error){
  121. alert('返回数据异常!');
  122. }
  123. });
  124. return false;
  125. }
  126. </script>
  127. {include file=comm/foot.html}