complain_talk_info.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. {include file="public/header" /}
  2. <div class="page">
  3. <table class="ds-default-table">
  4. <thead class="thead">
  5. <tr class="space">
  6. <th>{$Think.lang.talk_detail}</th>
  7. </tr>
  8. </thead>
  9. <tbody>
  10. <tr>
  11. <th>{$Think.lang.talk_list}</th>
  12. </tr>
  13. <tr class="noborder">
  14. <td class="complain-content">
  15. <div id="div_talk" class="div_talk"></div>
  16. </td>
  17. </tr>
  18. {neq name="complain_info.complain_state" value="99"}
  19. <tr>
  20. <th>{$Think.lang.talk_send}</th>
  21. </tr>
  22. <tr class="noborder">
  23. <td>
  24. <textarea id="complain_talk" class="tarea"></textarea>
  25. </td>
  26. </tr>
  27. <tr>
  28. <td>
  29. <a href="JavaScript:void(0);" id="btn_refresh" class="btn"><span>{$Think.lang.talk_refresh}</span></a>
  30. <a href="JavaScript:void(0);" id="btn_publish" class="btn"><span>{$Think.lang.talk_send}</span></a></td>
  31. </tr>
  32. {/neq}
  33. </tbody>
  34. </table>
  35. </div>
  36. <script type="text/javascript">
  37. $(document).ready(function () {
  38. get_complain_talk();
  39. $("#btn_publish").click(function () {
  40. if ($("#complain_talk").val() == '') {
  41. layer.alert("{$Think.lang.talk_null}");
  42. }
  43. else {
  44. publish_complain_talk();
  45. }
  46. });
  47. $("#btn_refresh").click(function () {
  48. get_complain_talk();
  49. });
  50. });
  51. function get_complain_talk() {
  52. $("#div_talk").empty();
  53. $.ajax({
  54. type: 'GET',
  55. url: "{:url('Complain/get_complain_talk')}",
  56. cache: false,
  57. data: {complain_id:{$complain_info.complain_id}},
  58. dataType: 'json',
  59. error: function () {
  60. $("#div_talk").append("<p class='admin'>" + "{$Think.lang.talk_none}" + "</p>");
  61. },
  62. success: function (talk_list) {
  63. if (talk_list.length >= 1) {
  64. for (var i = 0; i < talk_list.length; i++) {
  65. var link = "<p class='" + talk_list[i].css + "'>" + talk_list[i].talk + "</p>";
  66. $("#div_talk").append(link);
  67. }
  68. }
  69. else {
  70. $("#div_talk").append("<p class='admin'>" + "{$Think.lang.talk_none}" + "</p>");
  71. }
  72. }
  73. })
  74. ;
  75. }
  76. function publish_complain_talk() {
  77. $.ajax({
  78. type: 'GET',
  79. url: "{:url('Complain/publish_complain_talk')}",
  80. cache: false,
  81. data: "complain_id={$complain_info.complain_id}&complain_talk=" + encodeURIComponent($("#complain_talk").val()),
  82. dataType: 'json',
  83. error: function () {
  84. layer.alert("{$Think.lang.talk_send_fail}");
  85. },
  86. success: function (talk_list) {
  87. if (talk_list == 'success') {
  88. $("#complain_talk").val('');
  89. get_complain_talk();
  90. layer.alert("{$Think.lang.talk_send_success}");
  91. }
  92. else {
  93. layer.alert("{$Think.lang.talk_send_fail}");
  94. }
  95. }
  96. });
  97. }
  98. function forbit_talk(talk_id) {
  99. $.ajax({
  100. type: 'POST',
  101. url: "{:url('Complain/forbit_talk')}",
  102. cache: false,
  103. data: {"talk_id":talk_id},
  104. dataType: 'json',
  105. error: function () {
  106. layer.alert("{$Think.lang.talk_forbit_fail}");
  107. },
  108. success: function (talk_list) {
  109. if (talk_list == 'success') {
  110. get_complain_talk();
  111. layer.alert("{$Think.lang.talk_forbit_success}");
  112. }
  113. else {
  114. layer.alert("{$Think.lang.talk_forbit_fail}");
  115. }
  116. }
  117. });
  118. }
  119. </script>