complain_talk.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <h3>{$Think.lang.talk_detail}</h3>
  2. <dl>
  3. <dt>{$Think.lang.talk_list}{$Think.lang.ds_colon}</dt>
  4. <dd>
  5. <div id="div_talk" class="dsm-complain-talk"> </div>
  6. </dd>
  7. </dl>
  8. {elt name="complain_info.complain_state" value="40"}
  9. <dl>
  10. <dt>{$Think.lang.talk_send}{$Think.lang.ds_colon}</dt>
  11. <dd>
  12. <textarea id="complain_talk" class="w400"></textarea>
  13. </dd>
  14. </dl>
  15. <dl>
  16. <dt>&nbsp;</dt>
  17. <dd>
  18. <input id="btn_publish" type="submit" class="submit fl mr10" value="{$Think.lang.talk_send}">
  19. <input id="btn_refresh" type="submit" class="submit fl mr10" value="{$Think.lang.talk_refresh}">
  20. <input id="btn_handle" type="submit" class="submit fl mr10" value="{$Think.lang.handle_submit}">
  21. </dd>
  22. </dl>
  23. <form action="{:url('Membercomplain/apply_handle')}" method="post" id="handle_form">
  24. <input name="input_complain_id" type="hidden" value="{$complain_info.complain_id}" />
  25. </form>
  26. {/elt}
  27. <script type="text/javascript">
  28. $(document).ready(function(){
  29. get_complain_talk();
  30. $("#btn_publish").click(function(){
  31. if($("#complain_talk").val()=='') {
  32. layer.msg("{$Think.lang.talk_null}");
  33. }
  34. else {
  35. publish_complain_talk();
  36. }
  37. });
  38. $("#btn_refresh").click(function(){
  39. get_complain_talk();
  40. });
  41. $("#btn_handle").click(function(){
  42. layer.confirm("{$Think.lang.handle_confirm_message}", {
  43. btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
  44. title: false,
  45. }, function () {
  46. ds_ajaxpost('handle_form','url','{:url('Membercomplain/index')}')
  47. });
  48. });
  49. });
  50. function get_complain_talk() {
  51. $("#div_talk").empty();
  52. $.ajax({
  53. type:'POST',
  54. url:"{:url('Membercomplain/get_complain_talk')}",
  55. cache:false,
  56. data:"complain_id={$complain_info.complain_id}",
  57. dataType:'json',
  58. error:function(){
  59. $("#div_talk").append("<p class='admin'>"+"{$Think.lang.talk_none}"+"</p>");
  60. },
  61. success:function(talk_list){
  62. if(talk_list.length >= 1) {
  63. for(var i = 0; i < talk_list.length; i++)
  64. {
  65. $("#div_talk").append("<p class='"+talk_list[i].css+"'>"+talk_list[i].talk+"</p>");
  66. }
  67. }
  68. else {
  69. $("#div_talk").append("<p class='admin'>"+"{$Think.lang.talk_none}"+"</p>");
  70. }
  71. }
  72. });
  73. }
  74. function publish_complain_talk() {
  75. $.ajax({
  76. type:'POST',
  77. url:"{:url('Membercomplain/publish_complain_talk')}",
  78. cache:false,
  79. data:"complain_id={$complain_info.complain_id}&complain_talk="+encodeURIComponent($("#complain_talk").val()),
  80. dataType:'json',
  81. error:function(){
  82. layer.msg("{$Think.lang.talk_send_fail}");
  83. },
  84. success:function(talk_list){
  85. if(talk_list == 'success') {
  86. $("#complain_talk").val('');
  87. get_complain_talk();
  88. layer.msg("{$Think.lang.talk_send_success}");
  89. }
  90. else {
  91. layer.msg("{$Think.lang.talk_send_fail}");
  92. }
  93. }
  94. });
  95. }
  96. </script>