index.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-row layui-col-space15" id="app">
  5. <div class="layui-col-md12">
  6. <div class="layui-card">
  7. <div class="layui-card-header">搜索条件</div>
  8. <div class="layui-card-body">
  9. <form class="layui-form layui-form-pane" action="">
  10. <div class="layui-form-item">
  11. <div class="layui-inline">
  12. <label class="layui-form-label">审核状态</label>
  13. <div class="layui-input-block">
  14. <select name="is_show">
  15. <option value="">审核状态</option>
  16. <option value="2">已通过</option>
  17. <option value="1">待审核</option>
  18. </select>
  19. </div>
  20. </div>
  21. <div class="layui-inline">
  22. <label class="layui-form-label">认证姓名</label>
  23. <div class="layui-input-block">
  24. <input type="text" name="title" class="layui-input" placeholder="请输入姓名">
  25. </div>
  26. </div>
  27. <div class="layui-inline">
  28. <div class="layui-input-inline">
  29. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  30. <i class="layui-icon layui-icon-search"></i>搜索</button>
  31. </div>
  32. </div>
  33. </div>
  34. </form>
  35. </div>
  36. </div>
  37. </div>
  38. <!--产品列表-->
  39. <div class="layui-col-md12">
  40. <div class="layui-card">
  41. <div class="layui-card-header">审核列表</div>
  42. <div class="layui-card-body">
  43. <table class="layui-hide" id="List" lay-filter="List"></table>
  44. <script type="text/html" id="icon">
  45. <img style="cursor: pointer;max-width: 50px;" lay-event='open_image' src="{{d.cidimg}}">
  46. </script>
  47. <script type="text/html" id="act">
  48. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span class="caret"></span></button>
  49. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  50. <li>
  51. <a lay-event='pass' href="javascript:void(0)">
  52. <i class="fa fa-check"></i>通过认证
  53. </a>
  54. </li>
  55. <li>
  56. <a href="javascript:void(0)"onclick="$eb.createModalFrame(this.innerText,'{:Url(\'create\')}?uid={{d.uid}}')">
  57. <i class="fa fa-times"></i>拒绝认证
  58. </a>
  59. </li>
  60. </ul>
  61. </script>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  68. {/block}
  69. {block name="script"}
  70. <script>
  71. //实例化form
  72. layList.form.render();
  73. //加载列表
  74. layList.tableList('List',"{:Url('get_system_user_list')}",function (){
  75. return [
  76. {field: 'uid', title: '编号', sort: true,event:'id',width:'6%',align:"center"},
  77. {field: 'cidimg', title: '身份证图片',templet:'#icon',align:"center",width:'10%'},
  78. {field: 'real_name', title: '姓名',edit:'real_name',width:'6%',align:"center"},
  79. {field: 'card_id', title: '身份证号',align:"center"},
  80. {field: 'is_auth', title: '认证状态',templet:'#is_auth',width:'8%',align:"center"},
  81. {field: 'off', title: '理由',templet:'#off',width:'8%',align:"center"},
  82. {field: 'right', title: '操作',align:'center',toolbar:'#act',width:'8%'},
  83. ];
  84. });
  85. //自定义方法
  86. var action= {
  87. set_value: function (field, id, value) {
  88. layList.baseGet(layList.Url({
  89. a: 'set_value',
  90. q: {field: field, id: id, value: value}
  91. }), function (res) {
  92. layList.msg(res.msg);
  93. });
  94. },
  95. }
  96. //查询
  97. layList.search('search',function(where){
  98. layList.reload(where,true);
  99. });
  100. layList.switch('is_show',function (odj,value) {
  101. if(odj.elem.checked==true){
  102. layList.baseGet(layList.Url({a:'set_show',p:{is_show:1,id:value}}),function (res) {
  103. layList.msg(res.msg);
  104. });
  105. }else{
  106. layList.baseGet(layList.Url({a:'set_show',p:{is_show:0,id:value}}),function (res) {
  107. layList.msg(res.msg);
  108. });
  109. }
  110. });
  111. //快速编辑
  112. layList.edit(function (obj) {
  113. var id=obj.data.id,value=obj.value;
  114. switch (obj.field) {
  115. case 'name':
  116. action.set_value('name',id,value);
  117. break;
  118. case 'grade':
  119. action.set_value('grade',id,value);
  120. break;
  121. case 'discount':
  122. action.set_value('discount',id,value);
  123. break;
  124. }
  125. });
  126. //监听并执行排序
  127. layList.sort(['id','sort'],true);
  128. //点击事件绑定
  129. layList.tool(function (event,data,obj) {
  130. switch (event) {
  131. case 'pass':
  132. var url=layList.U({a:'pass',q:{uid:data.uid}});
  133. $eb.axios.get(url).then(function(res){
  134. if(res.status == 200 && res.data.code == 200) {
  135. $eb.$swal('success',res.data.msg);
  136. layList.reload();
  137. }else
  138. return Promise.reject(res.data.msg || '审核失败')
  139. }).catch(function(err){
  140. $eb.$swal('error',err);
  141. });
  142. break;
  143. case 'open_image':
  144. $eb.openImage(data.cidimg);
  145. break;
  146. }
  147. })
  148. //下拉框
  149. $(document).click(function (e) {
  150. $('.layui-nav-child').hide();
  151. })
  152. function dropdown(that){
  153. var oEvent = arguments.callee.caller.arguments[0] || event;
  154. oEvent.stopPropagation();
  155. var offset = $(that).offset();
  156. var top=offset.top-$(window).scrollTop();
  157. var index = $(that).parents('tr').data('index');
  158. $('.layui-nav-child').each(function (key) {
  159. if (key != index) {
  160. $(this).hide();
  161. }
  162. })
  163. if($(document).height() < top+$(that).next('ul').height()){
  164. $(that).next('ul').css({
  165. 'padding': 10,
  166. 'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
  167. 'min-width': 'inherit',
  168. 'position': 'absolute'
  169. }).toggle();
  170. }else{
  171. $(that).next('ul').css({
  172. 'padding': 10,
  173. 'top':$(that).parent('td').height() / 2 + $(that).height(),
  174. 'min-width': 'inherit',
  175. 'position': 'absolute'
  176. }).toggle();
  177. }
  178. }
  179. </script>
  180. {/block}