index.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox">
  6. <div class="ibox-title">
  7. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">添加模板消息</button>
  8. <div class="ibox-tools">
  9. </div>
  10. </div>
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="m-b m-l">
  14. <form action="" class="form-inline">
  15. <select name="status" aria-controls="editable" class="form-control input-sm">
  16. <option value="">是否有效</option>
  17. <option value="1" {eq name="where.status" value="1"}selected="selected"{/eq}>开启</option>
  18. <option value="0" {eq name="where.status" value="0"}selected="selected"{/eq}>关闭</option>
  19. </select>
  20. <div class="input-group">
  21. <input type="text" name="name" value="{$where.name}" placeholder="请输入模板名" class="input-sm form-control"> <span class="input-group-btn">
  22. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. <div class="row">
  28. <div class="m-b m-l">
  29. <p>主营行业:<span><?= isset($industry['primary_industry']) ? $industry['primary_industry']['first_class'].' | '.$industry['primary_industry']['second_class'] : '未选择' ?></span></p>
  30. <p>副营行业:<span><?= isset($industry['secondary_industry']) ? $industry['secondary_industry']['first_class'].' | '.$industry['secondary_industry']['second_class'] : '未选择' ?></span></p>
  31. </div>
  32. </div>
  33. <div class="table-responsive">
  34. <table class="table table-striped table-bordered">
  35. <thead>
  36. <tr>
  37. <th class="text-center">编号</th>
  38. <th class="text-center">模板编号</th>
  39. <th class="text-center">模板ID</th>
  40. <th class="text-center">模板名</th>
  41. <th class="text-center">回复内容</th>
  42. <th class="text-center">状态</th>
  43. <th class="text-center">添加时间</th>
  44. <th class="text-center">操作</th>
  45. </tr>
  46. </thead>
  47. <tbody class="">
  48. {volist name="list" id="vo"}
  49. <tr>
  50. <td class="text-center">
  51. {$vo.id}
  52. </td>
  53. <td class="text-center">
  54. {$vo.tempkey}
  55. </td>
  56. <td class="text-center">
  57. {$vo.tempid}
  58. </td>
  59. <td class="text-center">
  60. {$vo.name}
  61. </td>
  62. <td class="text-center">
  63. <pre>{$vo.content}</pre>
  64. </td>
  65. <td class="text-center">
  66. <i class="fa {eq name='vo.status' value='1'}fa-check text-navy{else/}fa-close text-danger{/eq}"></i>
  67. </td>
  68. <td class="text-center">
  69. {$vo.add_time|date='Y-m-d H:i:s'}
  70. </td>
  71. <td class="text-center">
  72. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('edit',array('id'=>$vo['id']))}',{h:400})"><i class="fa fa-edit"></i>编辑</button>
  73. <button class="btn btn-danger btn-xs" data-url="{:Url('delete',array('id'=>$vo['id']))}" type="button"><i class="fa fa-times"></i> 删除
  74. </button>
  75. </td>
  76. </tr>
  77. {/volist}
  78. </tbody>
  79. </table>
  80. </div>
  81. {include file="public/inner_page"}
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. {/block}
  87. {block name="script"}
  88. <script>
  89. $('.btn-danger').on('click',function(){
  90. window.t = $(this);
  91. var _this = $(this),url =_this.data('url');
  92. $eb.$swal('delete',function(){
  93. $eb.axios.get(url).then(function(res){
  94. console.log(res);
  95. if(res.status == 200 && res.data.code == 200) {
  96. $eb.$swal('success',res.data.msg);
  97. _this.parents('tr').remove();
  98. }else
  99. return Promise.reject(res.data.msg || '删除失败')
  100. }).catch(function(err){
  101. $eb.$swal('error',err);
  102. });
  103. });
  104. });
  105. $(".open_image").on('click',function (e) {
  106. var image = $(this).data('image');
  107. $eb.openImage(image);
  108. })
  109. </script>
  110. {/block}