ali_tpl.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_message}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <div class="explanation" id="explanation">
  13. <div class="title" id="checkZoom">
  14. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  15. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  16. </div>
  17. <ul>
  18. <li>{$Think.lang.message_ali_tpl_help1}</li>
  19. <li>{$Think.lang.message_ali_tpl_help2}</li>
  20. <li>{$Think.lang.message_ali_tpl_help3}</li>
  21. </ul>
  22. </div>
  23. <table class="ds-default-table">
  24. <thead>
  25. <tr class="thead">
  26. <th class="w24">&nbsp;</th>
  27. <th>{$Think.lang.ali_template_name}</th>
  28. <th>{$Think.lang.ali_template_code}</th>
  29. <th>{$Think.lang.ali_template_content}</th>
  30. <th>{$Think.lang.ali_template_check}</th>
  31. <th>{$Think.lang.ali_template_state}</th>
  32. <th class="align-center">{$Think.lang.ds_handle}</th>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. {foreach name="mmtpl_list" item="v" key="k" }
  37. <tr class="hover" data-code='{$v.ali_template_code}'>
  38. <td class="w24"></td>
  39. <td>{$v.membermt_name}</td>
  40. <td>{$v.ali_template_code}</td>
  41. <td data-name='ali_template_content' data-content='{$v.membermt_short_content}'></td>
  42. <td data-name='ali_template_check'></td>
  43. <td data-name='ali_template_state'></td>
  44. <td class="w60 align-center"><a href="javascript:editCode('membermsgtpl','{$v.membermt_code}')" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a></td>
  45. </tr>
  46. {/foreach}
  47. {foreach name="mstpl_list" item="v" key="k" }
  48. <tr class="hover" data-code='{$v.ali_template_code}'>
  49. <td class="w24"></td>
  50. <td>{$v.storemt_name}</td>
  51. <td>{$v.ali_template_code}</td>
  52. <td data-name='ali_template_content' data-content='{$v.storemt_short_content}'></td>
  53. <td data-name='ali_template_check'></td>
  54. <td data-name='ali_template_state'></td>
  55. <td class="w60 align-center"><a href="javascript:editCode('storemsgtpl','{$v.storemt_code}')" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a></td>
  56. </tr>
  57. {/foreach}
  58. </tbody>
  59. </table>
  60. </div>
  61. <script>
  62. function editCode(type,name){
  63. layer.prompt({title: '{$Think.lang.ali_template_code}'}, function(code, index){
  64. if(code){
  65. $.getJSON("{:url('Message/ali_tpl_edit')}?type="+type+"&name="+name+"&code="+code,function(res){
  66. layer.close(index);
  67. if(res.code==10000){
  68. location.reload();
  69. }else{
  70. layer.alert(res.message);
  71. }
  72. })
  73. }
  74. });
  75. }
  76. $(function(){
  77. $('tr[data-code]').each(function(){
  78. var code=$(this).attr('data-code')
  79. var _this=$(this)
  80. if(code){
  81. $.getJSON("{:url('Message/ali_tpl_query')}?"+"code="+code,function(res){
  82. if(res.code==10000){
  83. var content=res.result.TemplateContent
  84. _this.find("td[data-name='ali_template_content']").text(content)
  85. var state=''
  86. switch(res.result.TemplateStatus){
  87. case 0:
  88. state='{$Think.lang.ali_template_state_text[0]}'
  89. break;
  90. case 1:
  91. state='{$Think.lang.ali_template_state_text[1]}'
  92. break;
  93. case 2:
  94. state='{$Think.lang.ali_template_state_text[2]}'
  95. break;
  96. }
  97. _this.find("td[data-name='ali_template_state']").text(state)
  98. if(content!=_this.find("td[data-name='ali_template_content']").attr('data-content')){
  99. _this.find("td[data-name='ali_template_check']").text('{$Think.lang.ali_template_check_not_same}')
  100. }else{
  101. _this.find("td[data-name='ali_template_check']").text('{$Think.lang.ali_template_check_same}')
  102. }
  103. }
  104. })
  105. }
  106. })
  107. })
  108. </script>