ten_tpl.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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_ten_tpl_help1}</li>
  19. <li>{$Think.lang.message_ten_tpl_help2}</li>
  20. <li>{$Think.lang.message_ten_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.ten_template_name}</th>
  28. <th>{$Think.lang.ten_template_code}</th>
  29. <th>{$Think.lang.ten_template_content}</th>
  30. <th>{$Think.lang.ten_template_check}</th>
  31. <th>{$Think.lang.ten_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.ten_template_code}'>
  38. <td class="w24"></td>
  39. <td>{$v.membermt_name}</td>
  40. <td>{$v.ten_template_code}</td>
  41. <td data-name='ten_template_content' data-content='{$v.membermt_short_content}'></td>
  42. <td data-name='ten_template_check'></td>
  43. <td data-name='ten_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.ten_template_code}'>
  49. <td class="w24"></td>
  50. <td>{$v.storemt_name}</td>
  51. <td>{$v.ten_template_code}</td>
  52. <td data-name='ten_template_content' data-content='{$v.storemt_short_content}'></td>
  53. <td data-name='ten_template_check'></td>
  54. <td data-name='ten_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. {foreach name="templates_list" item="v" key="k" }
  59. <tr class="hover" data-code='{$v.ten_template_code}'>
  60. <td class="w24"></td>
  61. <td>{$v.mailmt_name|raw}</td>
  62. <td>{$v.ten_template_code}</td>
  63. <td data-name='ten_template_content' data-content='{$v.mailmt_content}'></td>
  64. <td data-name='ten_template_check'></td>
  65. <td data-name='ten_template_state'></td>
  66. <td class="w60 align-center"><a href="javascript:editCode('mailmsgtemlates','{$v.mailmt_code}')" class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a></td>
  67. </tr>
  68. {/foreach}
  69. </tbody>
  70. </table>
  71. </div>
  72. <script>
  73. function editCode(type,name){
  74. layer.prompt({title: '{$Think.lang.ten_template_code}'}, function(code, index){
  75. if(code){
  76. $.getJSON("{:url('Message/ten_tpl_edit')}?type="+type+"&name="+name+"&code="+code,function(res){
  77. layer.close(index);
  78. if(res.code==10000){
  79. location.reload();
  80. }else{
  81. layer.alert(res.message);
  82. }
  83. })
  84. }
  85. });
  86. }
  87. $(function(){
  88. $('tr[data-code]').each(function(){
  89. var code=$(this).attr('data-code')
  90. var _this=$(this)
  91. if(code){
  92. $.getJSON("{:url('Message/ten_tpl_query')}?"+"code="+code,function(res){
  93. if(res.code==10000){
  94. var content=res.result.TemplateContent
  95. _this.find("td[data-name='ten_template_content']").text(content)
  96. var state=''
  97. switch(res.result.TemplateStatus){
  98. case 0:
  99. state='{$Think.lang.ten_template_state_text[0]}'
  100. break;
  101. case 1:
  102. state='{$Think.lang.ten_template_state_text[1]}'
  103. break;
  104. case 2:
  105. state='{$Think.lang.ten_template_state_text[2]}'
  106. break;
  107. }
  108. _this.find("td[data-name='ten_template_state']").text(state)
  109. if(content!=_this.find("td[data-name='ten_template_content']").attr('data-content')){
  110. _this.find("td[data-name='ten_template_check']").text('{$Think.lang.ten_template_check_not_same}')
  111. }else{
  112. _this.find("td[data-name='ten_template_check']").text('{$Think.lang.ten_template_check_same}')
  113. }
  114. }
  115. })
  116. }
  117. })
  118. })
  119. </script>