index.blade.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. @extends('admin.layout')
  2. @section('content')
  3. <div class="wrapper wrapper-content animated fadeInRight">
  4. <div class="row">
  5. <div class="col-sm-12">
  6. <div class="ibox float-e-margins">
  7. <div class="ibox-title">
  8. <h5>用户管理</h5>
  9. <div class="ibox-tools">
  10. <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <div class="row">
  16. <form method="GET" action="" accept-charset="UTF-8">
  17. <div class="col-sm-4">
  18. <div class="input-group">
  19. <input type="text" value="{{Request::get('keyword')}}" placeholder="id/昵称" name="keyword"class="input-sm form-control">
  20. <span class="input-group-btn">
  21. <button type="submit" class="btn btn-sm btn-primary">搜索</button>
  22. </span>
  23. </div>
  24. </div>
  25. <div class="col-sm-4">
  26. <div class="input-group">
  27. <input type="text" name="msg" id="msg" class="input-sm form-control" placeholder="请再此编写系统消息...">
  28. <span class="input-group-btn">
  29. <button type="button" id="sendmsg" class="btn btn-sm btn-primary">发送消息</button>
  30. </span>
  31. </div>
  32. </div>
  33. </form>
  34. <div class="col-sm-3 pull-right">
  35. <a href="{{ U('User/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
  36. </div>
  37. </div>
  38. <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
  39. <thead>
  40. <tr>
  41. <th class="sorting" data-sort="id"> 用户ID </th>
  42. <th class="sorting" data-sort="nickname"> 昵称 </th>
  43. <th class="sorting" data-sort="avatar"> 头像 </th>
  44. <th class="sorting" data-sort="sex"> 性别 </th>
  45. <th class="sorting" data-sort="birthday"> 年龄 </th>
  46. <th class="sorting" data-sort="signture"> 个性签名 </th>
  47. <th class="sorting" data-sort="height"> 身高 </th>
  48. <th class="sorting" data-sort="work"> 职业 </th>
  49. <th class="sorting" data-sort="emotion"> 情感状态 </th>
  50. <th class="sorting" data-sort="city"> 所在城市 </th>
  51. <th class="sorting" data-sort="phone"> 手机号 </th>
  52. <th class="sorting" data-sort="coin"> 剩余梦想币 </th>
  53. <th class="sorting" data-sort="coin"> 发布梦想条数 </th>
  54. <th class="sorting" data-sort="coin"> 捐赠分数 </th>
  55. <th class="sorting" data-sort="coin"> 得到的梦想币 </th>
  56. <th class="sorting" data-sort="coin"> 状态 </th>
  57. <th width="22%">相关操作</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. @if(isset($list))
  62. @foreach($list as $key => $item)
  63. <tr>
  64. <td>{{ $item->id }}</td>
  65. <td>{{ $item->nickname }}</td>
  66. <td>
  67. <a href="{{ $item->avatar }}" target="_blank">
  68. <img style="width: 40%;height: 40%;" src="{{ $item->avatar }}" alt="">
  69. </a>
  70. </td>
  71. <td>{{ dict()->get('user_info','sex',$item->sex) }}</td>
  72. <td>{{ $item->birthday }}</td>
  73. <td>{{ $item->signture }}</td>
  74. <td>{{ $item->height }}cm</td>
  75. <td>{{ $item->work }}</td>
  76. <td>{{ dict()->get('user_info','emotion',$item->emotion) }}</td>
  77. <td>{{ $item->city }}</td>
  78. <td>{{ $item->phone }}</td>
  79. <td>{{ $item->coin }}</td>
  80. <td>{{ $item->dream_number }}</td>
  81. <td>{{ $item->sup_score }}</td>
  82. <td>{{ $item->get_coin }}</td>
  83. <td>{{ $item->status == 1 ? '正常' : '禁用' }}</td>
  84. <td>
  85. <div class="btn-group">
  86. <button data-toggle="dropdown"
  87. class="btn btn-warning btn-sm dropdown-toggle"
  88. aria-expanded="false">
  89. 操作 <span class="caret"></span>
  90. </button>
  91. <ul class="dropdown-menu">
  92. @if(role('User/Info/update'))
  93. <li><a href="{{ U('User/Info/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
  94. @endif
  95. @if(role('User/Info/destroy'))
  96. <li class="divider"></li>
  97. <li><a href="{{ U('User/Info/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
  98. @endif
  99. </ul>
  100. </div>
  101. @if(role('User/Info/view'))
  102. <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('User/Info/view',['id'=>$item->id])}}'});" class="btn btn-primary ">查看</button>
  103. @endif
  104. <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Account_logs/Info/index',['id'=>$item->id])}}'});" class="btn btn-primary ">充值记录</button>
  105. </td>
  106. </tr>
  107. @endforeach
  108. @endif
  109. </tbody>
  110. </table>
  111. <div class="row">
  112. <div class="col-sm-6">
  113. <div class="dataTables_info" id="DataTables_Table_0_info"
  114. role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
  115. </div>
  116. <div class="col-sm-6">
  117. <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
  118. {!! $list->setPath('')->appends(Request::all())->render() !!}
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. @endsection
  128. @section('footer')
  129. <script>
  130. $(document).ready(function(){
  131. $('#sendmsg').click(function(){
  132. if($('#msg').val()==''){
  133. alert("请填写消息内容!");
  134. return;
  135. }
  136. $.ajax({
  137. type:'get',
  138. url:'/admin/system/system_info',
  139. data:{
  140. msg:$('#msg').val(),
  141. },
  142. success:function(res){
  143. if(res == 200){
  144. alert('群发成功');
  145. }
  146. if(res == 500){
  147. alert('群发异常');
  148. }
  149. if (res == 404){
  150. alert("符合条件的用户不存在!");
  151. }
  152. },
  153. error:function(){
  154. alert('发送异常!');
  155. }
  156. });
  157. });
  158. });
  159. </script>
  160. @endsection