complain_talk_info.html 3.4 KB

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