platformlist.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title></title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <meta name="robots" content="all,follow">
  10. <!-- Bootstrap CSS-->
  11. <link rel="stylesheet" href="__VENDOR__/bootstrap/css/bootstrap.min.css">
  12. <!-- Font Awesome CSS-->
  13. <link rel="stylesheet" href="__VENDOR__/font-awesome/css/font-awesome.min.css">
  14. <!-- Fontastic Custom icon font-->
  15. <!--<link rel="stylesheet" href="__CSS__/fontastic.css">-->
  16. <link rel="stylesheet" href="__CSS__/iconfont.css">
  17. <!-- Google fonts - Poppins -->
  18. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">
  19. <!-- theme stylesheet-->
  20. <link rel="stylesheet" href="__CSS__/style.default.css" id="theme-stylesheet">
  21. <!-- Custom stylesheet - for your changes-->
  22. <link rel="stylesheet" href="__CSS__/custom.css">
  23. <!-- Favicon-->
  24. <link rel="shortcut icon" href="__IMG__/favicon.ico">
  25. <!-- Tweaks for older IEs--><!--[if lt IE 9]>
  26. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  27. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
  28. </head>
  29. <body>
  30. <div class="page">
  31. <!-- Main Navbar-->
  32. {include file="layout/header" /}
  33. <div class="page-content d-flex align-items-stretch">
  34. <!-- Side Navbar -->
  35. {include file="layout/navigation" /}
  36. <div class="content-inner">
  37. <!-- Page Header-->
  38. <header class="page-header">
  39. <div class="container-fluid">
  40. <h2 class="no-margin-bottom">平台列表</h2>
  41. </div>
  42. </header>
  43. <!-- Breadcrumb-->
  44. <div class="breadcrumb-holder container-fluid">
  45. <ul class="breadcrumb">
  46. <li class="breadcrumb-item">平台管理</li>
  47. <li class="breadcrumb-item active">平台列表</li>
  48. </ul>
  49. </div>
  50. <section class="tables">
  51. <div class="container-fluid">
  52. <div class="row">
  53. <div class="col-lg-12">
  54. <div class="card">
  55. <!--<div class="card-close">
  56. <div class="dropdown">
  57. <button type="button" id="closeCard1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle"><i class="fa fa-ellipsis-v"></i></button>
  58. <div aria-labelledby="closeCard1" class="dropdown-menu dropdown-menu-right has-shadow"><a href="#" class="dropdown-item remove"> <i class="fa fa-times"></i>Close</a><a href="#" class="dropdown-item edit"> <i class="fa fa-gear"></i>Edit</a></div>
  59. </div>
  60. </div>-->
  61. <div class="card-header d-flex align-items-center">
  62. <h3 class="h4">平台列表</h3>
  63. </div>
  64. <div class="card-body">
  65. <div class="form-group col-lg-4" style="float: left;">
  66. <div class="input-group">
  67. <a class="btn btn-primary" href="{:url('admin/index/addPlatform')}" style="background-color: #169bd5; border-color: #169bd5; color: #fff">新增</a>
  68. </div>
  69. </div>
  70. <div class="form-group col-lg-6" style="float: right;">
  71. <div class="input-group">
  72. <span style="line-height: 2; font-size: 18px; margin-right: 5px;">平台名</span>
  73. <input type="text" id="platformName" class="form-control">
  74. <div class="input-group-append">
  75. <button type="button" onclick="onSearch()" class="btn btn-primary">查询</button>
  76. </div>
  77. <div class="input-group-append" style="margin-left: 20px;">
  78. <button type="button" onclick="ondelete()" class="btn btn-primary">删除</button>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="table-responsive">
  83. <table class="table table-striped">
  84. <thead>
  85. <tr>
  86. <th><input type="checkbox" lay-filter="checkeds" lay-skin="primary" class="checkall" onclick="oncheck()"></th>
  87. <th>序号</th>
  88. <th>图标</th>
  89. <th>平台名</th>
  90. <!--<th>CODE</th>-->
  91. <th>注册时间</th>
  92. <th>注册IP</th>
  93. <!-- <th>验证网址</th>-->
  94. <th>邮箱</th>
  95. <th>电话</th>
  96. <!-- <th>备注</th> -->
  97. <th>状态</th>
  98. <th>操作</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <?php foreach ($platformList as $k => $v): ?>
  103. <tr>
  104. <td class="check-mail">
  105. <input type="checkbox" class="checkone" value="{$k+1}" name="ids" lay-skin="primary">
  106. </td>
  107. <th scope="row">{$k+1}</th>
  108. <td><img src="{$v['platform_img']}" style="width: 30px;height: 30px"></td>
  109. <td>{$v['platform_name']}</td>
  110. <!--<td>{$v['platform_code']}</td>-->
  111. <td><?php echo date('Y-m-d H:i',$v['platform_register_time']); ?></td>
  112. <td>{$v['platform_register_ip']}</td>
  113. <!-- <td>
  114. <?php
  115. $platformUrl = json_decode($v['platform_url']);
  116. foreach ($platformUrl as $va):
  117. ?>
  118. <p style="margin-bottom: 0px; width: 230px">
  119. <?php
  120. if (strlen($va) <= 30) {echo $va;}
  121. else {echo mb_strcut($va, 0, 30, 'utf-8').'...';}
  122. ?>
  123. </p>
  124. <?php endforeach; ?>
  125. </td> -->
  126. <td>{$v['platform_email']}</td>
  127. <td>{$v['platform_phone']}</td>
  128. <!-- <td>
  129. <?php
  130. if (strlen($v['platform_remark']) <= 40) {echo $v['platform_remark'];}
  131. else {echo mb_strcut($v['platform_remark'], 0, 40, 'utf-8').'...';}
  132. ?>
  133. </td> -->
  134. <td>
  135. <?php if ($v['platform_status'] == 1): ?>
  136. <span style="color: #26ce16;">启用</span>
  137. <?php else: ?>
  138. <span style="color: red;">禁用</span>
  139. <?php endif; ?></td>
  140. <td>
  141. <a href="{:url('admin/index/updatePlatform',['id'=>$v['platform_id']])}" class="icon iconfont icon-edit-square" title="编辑" style="text-decoration: none; color: #666; cursor:pointer"></a>
  142. <span onclick="platformUser({$v['platform_id']})" class="icon iconfont icon-user" title="查看" style="text-decoration: none; color: #666; cursor:pointer"></span>
  143. </td>
  144. </tr>
  145. <?php endforeach; ?>
  146. </tbody>
  147. </table>
  148. <ul class="list-unstyled" style="display: flex; justify-content: end;">
  149. <?php if (count($page) > 1): ?>
  150. <?php foreach ($page as $k => $v): ?>
  151. <li>
  152. <a onclick="changePage({$v})" style="{$currentPage == $v ? 'pointer-events:none;' : ''}" class="btn btn-xs {$currentPage == $v ? 'btn-secondary' : ''}">{$v}</a>
  153. </li>
  154. <?php endforeach; ?>
  155. <?php endif; ?>
  156. </ul>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </section>
  164. <!-- Page Footer-->
  165. {include file="layout/footer" /}
  166. </div>
  167. </div>
  168. </div>
  169. <!-- JavaScript files-->
  170. <script src="__VENDOR__/jquery/jquery.min.js"></script>
  171. <script src="__VENDOR__/popper.js/umd/popper.min.js"> </script>
  172. <script src="__VENDOR__/bootstrap/js/bootstrap.min.js"></script>
  173. <script src="__VENDOR__/jquery.cookie/jquery.cookie.js"> </script>
  174. <script src="__VENDOR__/chart.js/Chart.min.js"></script>
  175. <script src="__VENDOR__/jquery-validation/jquery.validate.min.js"></script>
  176. <script src="__JS__/jquery.form.js"></script>
  177. <script src="__JS__/plugins/layer/layer.min.js"></script>
  178. <!-- Main File-->
  179. <script src="__JS__/front.js"></script>
  180. <script>
  181. function platformUser(id) {
  182. let urlParam = "{:url('admin/index/platformUser')}"+"?id="+id;
  183. window.location.href = urlParam;
  184. }
  185. function onSearch() {
  186. let platformName = $("#platformName").val();
  187. let urlParam = "{:url('admin/index/platformlist')}"+"?platformName="+platformName;
  188. window.location.href = urlParam;
  189. }
  190. function oncheck() {
  191. if($('.checkall').is(':checked')==true){
  192. $('.checkone').prop('checked',true);
  193. }else{
  194. $('.checkone').prop('checked',false);
  195. }
  196. }
  197. function ondelete() {
  198. let msg = '确认删除所选平台';
  199. layer.confirm(msg, {icon: 3, title:'提示'}, function(index){
  200. var ids = [];
  201. $("input[name='ids']:checked").each(function(i){
  202. ids.push($(this).val())
  203. })
  204. if(ids==''){
  205. layer.msg('未选中任何平台'); return false;
  206. }
  207. //console.log(ids);
  208. $.getJSON("{:url('admin/index/delPlatform')}", {'ids' : ids}, function(res){
  209. //console.log(res);
  210. if(1 == res.code){
  211. layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
  212. location.reload();
  213. });
  214. }else if(111 == res.code){
  215. window.location.reload();
  216. }else{
  217. layer.alert(res.msg, {title: '友情提示', icon: 2});
  218. }
  219. });
  220. layer.close(index);
  221. })
  222. }
  223. function checkStatus(id, getStatus) {
  224. let msg = '确认禁用此用户';
  225. if (getStatus != 1) {
  226. msg = '确认启用此用户';
  227. }
  228. let status = getStatus == 1 ? 2 : 1;
  229. layer.confirm(msg, {icon: 3, title:'提示'}, function(index){
  230. $.getJSON("{:url('admin/index/updatePlatform')}", {'id' : id, status: status}, function(res){
  231. if(1 == res.code){
  232. layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
  233. location.reload();
  234. });
  235. }else if(111 == res.code){
  236. window.location.reload();
  237. }else{
  238. layer.alert(res.msg, {title: '友情提示', icon: 2});
  239. }
  240. });
  241. layer.close(index);
  242. })
  243. }
  244. function changePage(page) {
  245. let param = getQueryString();
  246. param.currentPage = page;
  247. let urlParam = "{:url('admin/index/platformList')}"+"?"+putUrlParam(param);
  248. window.location.href = urlParam;
  249. }
  250. // 获取URL参数.
  251. function getQueryString() {
  252. var qs = location.search.substr(1), // 获取url中"?"符后的字串
  253. args = {}, // 保存参数数据的对象
  254. items = qs.length ? qs.split("&") : [], // 取得每一个参数项
  255. item = null,
  256. len = items.length;
  257. for(var i = 0; i < len; i++) {
  258. item = items[i].split("=");
  259. var name = decodeURIComponent(item[0]),
  260. value = decodeURIComponent(item[1]);
  261. if(name) {
  262. args[name] = value;
  263. }
  264. }
  265. return args;
  266. }
  267. // 对象转URL参数
  268. function putUrlParam(param) {
  269. let urlParam = '';
  270. let n = 1;
  271. for(let key in param){
  272. if (n === 1) {
  273. urlParam = key+'='+param[key];
  274. } else {
  275. urlParam += '&'+key+'='+param[key];
  276. }
  277. n++;
  278. }
  279. return urlParam;
  280. }
  281. </script>
  282. </body>
  283. </html>