user.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. {include file="public/header"}
  2. <form action="user" method="post" class="form-inline">
  3. <div class="form-group">
  4. <label>搜索</label>
  5. <select name="type" class="form-control" id="select_id">
  6. <option value="">全部</option>
  7. <option value="id">用户id</option>
  8. <option value="nickname">微信昵称</option>
  9. <option value="username">用户名字</option>
  10. <option value="telephone">手机号码</option>
  11. <option value="group">所属分组</option>
  12. <option value="region">所属区域</option>
  13. <option value="is_register">注册状态</option>
  14. <option value="is_check">审核状态</option>
  15. </select>
  16. </div>
  17. <div class="form-group">
  18. <input type="text" class="form-control" id="input" name="keyword" placeholder="搜索内容">
  19. <select name="is_register" id="is_register" hidden disabled>
  20. <option value="">请选择</option>
  21. <option value="0">未注册</option>
  22. <option value="1">已注册</option>
  23. </select>
  24. <select name="is_check" id="is_check" hidden disabled>
  25. <option value="">请选择</option>
  26. <option value="0">未审核</option>
  27. <option value="1">已审核</option>
  28. </select>
  29. <select name="group" id="group" hidden disabled>
  30. <option value="">请选择</option>
  31. {foreach $group as $v}
  32. <option value="{$v.id}">{$v.name}</option>
  33. {/foreach}
  34. </select>
  35. <select name="region" id="region" hidden disabled>
  36. <option value="">请选择</option>
  37. {foreach $region as $v}
  38. <option value="{$v.id}">{$v.username}</option>
  39. {/foreach}
  40. </select>
  41. </div>
  42. <button type="submit" class="btn btn-primary">搜索</button>
  43. <button type="button" class="btn btn-primary" id="adduser">添加用户</button>
  44. </form>
  45. <div class="table-responsive" style="padding-top: 10px;">
  46. <table class="table table-striped" border='1'>
  47. <thead>
  48. <tr>
  49. <th style="text-align: center;">用户id</th>
  50. <th style="text-align: center;">微信名称</th>
  51. <th style="text-align: center;">微信头像</th>
  52. <th style="text-align: center;">注册手机号</th>
  53. <th style="text-align: center;">用户名称</th>
  54. <th style="text-align: center;">所属分组</th>
  55. <th style="text-align: center;">地址</th>
  56. <th style="text-align: center;">身份</th>
  57. <th style="text-align: center;">添加时间</th>
  58. <th style="text-align: center;">是否注册</th>
  59. <th style="text-align: center;">是否审核</th>
  60. <th style="text-align: center;">操作</th>
  61. </tr>
  62. </thead>
  63. <tbody style="text-align: center;">
  64. {volist name="user_info" id="vo"}
  65. <tr>
  66. <td><b>{$vo.id}</b></td>
  67. <td>
  68. {if condition = "$vo.nickname eq null"}
  69. 暂无
  70. {else/}
  71. {$vo.nickname}
  72. {/if}
  73. </td>
  74. <td>
  75. {if condition = "$vo.headimgurl eq null"}
  76. 暂无
  77. {else/}
  78. <img src="{$vo.headimgurl}" alt="微信头像" style="width:30px;border-radius: 50%">
  79. {/if}
  80. </td>
  81. <td>
  82. {if condition = "$vo.telephone eq null"}
  83. 暂无
  84. {else/}
  85. {$vo.telephone}
  86. {/if}
  87. </td>
  88. <td>
  89. {if condition = "$vo.username eq null"}
  90. 暂无
  91. {else/}
  92. {$vo.username}
  93. {/if}
  94. </td>
  95. <td>
  96. {if condition = "$vo.group eq null"}
  97. 暂无
  98. {else/}
  99. {$vo.group}
  100. {/if}
  101. </td>
  102. <td>
  103. {if condition = "$vo.address eq null"}
  104. 暂无
  105. {else/}
  106. {$vo.address}
  107. {/if}
  108. </td>
  109. <td>
  110. {if condition = "$vo.identity eq 0"}
  111. 报修者
  112. {elseif condition = "$vo.identity eq 1" /}
  113. 维修者
  114. {elseif condition = "$vo.identity eq 2" /}
  115. 协管者
  116. {elseif condition = "$vo.identity eq 99" /}
  117. 管理员
  118. {else/}
  119. 暂无
  120. {/if}
  121. </td>
  122. <td>{$vo.addtime}</td>
  123. <td>
  124. {if condition = "$vo.is_register eq 0"}
  125. <font style="color:red;">未注册</font>
  126. {else /}
  127. <font style="color:green;">已注册</font>
  128. {/if}
  129. </td>
  130. <td>
  131. {if condition = "$vo.is_check eq 0"}
  132. <font style="color:red;">未审核</font>
  133. {else /}
  134. <font style="color:green;">已审核</font>
  135. {/if}
  136. </td>
  137. <td>
  138. <button data-userid="{$vo['id']}" class="btn btn-xs btn-info buttoninfo">查看</button>
  139. <button data-userid="{$vo['id']}" class="btn btn-xs btn-danger buttoneidt">编辑</button>
  140. </td>
  141. </tr>
  142. {/volist}
  143. </tbody>
  144. <thead>
  145. <tr>
  146. <th style="text-align: center;">用户id</th>
  147. <th style="text-align: center;">微信名称</th>
  148. <th style="text-align: center;">微信头像</th>
  149. <th style="text-align: center;">注册手机号</th>
  150. <th style="text-align: center;">用户名称</th>
  151. <th style="text-align: center;">所属分组</th>
  152. <th style="text-align: center;">地址</th>
  153. <th style="text-align: center;">身份</th>
  154. <th style="text-align: center;">添加时间</th>
  155. <th style="text-align: center;">是否注册</th>
  156. <th style="text-align: center;">是否审核</th>
  157. <th style="text-align: center;">操作</th>
  158. </tr>
  159. </thead>
  160. </table>
  161. </div>
  162. <!-- 分页的渲染函数 -->
  163. <div style="text-align:center;">
  164. {$user_info->render()}
  165. </div>
  166. <script src="__LOGIN__/js/jquery.min.js"></script>
  167. <!-- 补单函数的触发 -->
  168. <script>
  169. $(function () {
  170. $("#select_id").change(function(){
  171. var selected = $(this).children('option:selected').val();
  172. if(selected == "is_register"){
  173. $("#is_register").show();
  174. $("#is_register").removeAttr('disabled')
  175. $("#is_register").addClass('form-control')
  176. $("#is_check").hide();
  177. $("#is_check").attr("disabled",true)
  178. $("#group").hide();
  179. $("#group").attr("disabled",true)
  180. $("#region").hide();
  181. $("#region").attr("disabled",true)
  182. $('#input').hide();
  183. $('#input').attr("disabled",true);
  184. }else if(selected == "is_check"){
  185. $("#is_check").show();
  186. $("#is_check").removeAttr('disabled')
  187. $("#is_check").addClass('form-control')
  188. $("#is_register").hide();
  189. $("#is_register").attr("disabled",true)
  190. $("#group").hide();
  191. $("#group").attr("disabled",true)
  192. $("#region").hide();
  193. $("#region").attr("disabled",true)
  194. $('#input').hide();
  195. $('#input').attr("disabled",true);
  196. }else if(selected == "group"){
  197. $("#group").show();
  198. $("#group").removeAttr('disabled')
  199. $("#group").addClass('form-control')
  200. $("#is_check").hide();
  201. $("#is_check").attr("disabled",true)
  202. $("#is_register").hide();
  203. $("#is_register").attr("disabled",true)
  204. $("#region").hide();
  205. $("#region").attr("disabled",true)
  206. $('#input').hide();
  207. $('#input').attr("disabled",true);
  208. }else if (selected == "region"){
  209. $("#region").show();
  210. $("#region").removeAttr('disabled')
  211. $("#region").addClass('form-control')
  212. $("#is_check").hide();
  213. $("#is_check").attr("disabled",true)
  214. $("#is_register").hide();
  215. $("#is_register").attr("disabled",true)
  216. $("#group").hide();
  217. $("#group").attr("disabled",true)
  218. $('#input').hide();
  219. $('#input').attr("disabled",true);
  220. }else{
  221. $('#input').show();
  222. $("#input").removeAttr('disabled')
  223. $("#is_check").hide();
  224. $("#is_check").attr("disabled",true)
  225. $("#is_register").hide();
  226. $("#is_register").attr("disabled",true)
  227. $("#group").hide();
  228. $("#group").attr("disabled",true)
  229. $("#region").hide();
  230. $("#region").attr("disabled",true)
  231. }
  232. });
  233. $('.buttoninfo').click(function () {
  234. //获取当前用户id
  235. let userid = $(this).attr('data-userid');
  236. window.location.href = "__URL__/user_info?user_id=" + userid;
  237. });
  238. $('.buttoneidt').click(function () {
  239. //编辑当前用户
  240. let userid = $(this).attr('data-userid');
  241. window.location.href = "__URL__/edit_user_info?user_id=" + userid;
  242. });
  243. $('#adduser').click(function(){
  244. window.location.href = "__URL__/add_user"; //添加用户
  245. });
  246. });
  247. </script>