view.blade.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. @extends('layouts.admin.app')
  2. @section('styles')
  3. <style type="text/css">
  4. .team-list {
  5. width: 100%;
  6. list-style-type: none;
  7. -webkit-padding-start: 0;
  8. }
  9. .team-list li::-webkit-scrollbar {
  10. width: 0;
  11. height: 0;
  12. }
  13. .team-list li {
  14. width: 100%;
  15. line-height: 40px;
  16. border: 1px solid #EEEEEE;
  17. border-top: 0;
  18. overflow: auto;
  19. }
  20. .team-list li.team-list-first {
  21. border-top-left-radius: 6px;
  22. background: #F2F2F2;
  23. border-top-right-radius: 6px;
  24. border-top: 1px solid #EEEEEE;
  25. }
  26. .team-list li:last-child {
  27. border-bottom-left-radius: 6px;
  28. border-bottom-right-radius: 6px;
  29. }
  30. .team-list li div {
  31. /*width: 12.5%;*/
  32. height: 41px;
  33. padding: 0 8px;
  34. float: left;
  35. overflow: hidden;
  36. border-left: 1px solid #EEEEEE;
  37. box-sizing: border-box;
  38. }
  39. .team-list li div.team-list-line {
  40. border-left: 0;
  41. }
  42. .team-list .team-list li {
  43. border-left: 0;
  44. }
  45. </style>
  46. @endsection
  47. @section('crumbs')
  48. <ol class="breadcrumb crumbs">
  49. <li><a href="{{ route('admin.index') }}#">后台导航</a></li>
  50. <li><a href="{{ route('admin.member.index') }}">后台会员首页</a></li>
  51. <li class="active">会员图</li>
  52. </ol>
  53. @endsection
  54. @section('content')
  55. <div class="row wrapper wrapper-content animated fadeInRight" id="app">
  56. <div class="col-sm-12">
  57. <div class="ibox float-e-margins">
  58. <div class="row ibox-title">
  59. <div class="form-group row">
  60. <div class="col-md-3">
  61. <input class="form-control" id="username" value="{{$member->mobile}}" placeholder="会员账号搜索" type="text" name="username">
  62. </div>
  63. <div class="col-md-2">
  64. <button type="button" id="auth-button" class="btn btn-primary">查询</button>
  65. </div>
  66. <div class="col-md-7">
  67. </div>
  68. </div>
  69. </div>
  70. <hr>
  71. <div class="ibox-title">
  72. <h5>团队基本信息</h5>
  73. <div class="ibox-tools">
  74. </div>
  75. </div>
  76. <!--新订单列表 商品信息-->
  77. <div class="panel panel-default">
  78. <div class="panel-body">
  79. <ul class="team-list" id="team_list">
  80. <li class="team-list-first li_x">
  81. <div style="width: 20%;" class="team-list-line">层级</div>
  82. <div style="width: 20%;">用户账号</div>
  83. <div style="width: 9%;">用户昵称</div>
  84. <div style="width: 9%;">会员级别</div>
  85. {{--<div style="width: 9%;">团队合约在持业绩</div>--}}
  86. <div style="width: 6%;">所在层数</div>
  87. </li>
  88. <div id="show-tx">
  89. </div>
  90. </ul>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. @endsection
  97. @section('scripts')
  98. <script>
  99. var is_ajax = false;
  100. var _depth = 0;
  101. $("#team_list").delegate(".li_x", "click", function (event) {
  102. if (is_ajax == true) {
  103. return false;
  104. }
  105. is_ajax = true;
  106. var obj = $(this);
  107. var is_show = obj.attr('is_show');
  108. var parent_num = obj.attr('parent_num');
  109. var m_id = obj.attr('m_id');
  110. var is_get_child = obj.attr('is_get_child');
  111. console.log(is_show);
  112. if (is_show == 2 && is_get_child == 2) {
  113. getChildList(m_id, parent_num, obj)
  114. } else if (is_show == 2) {
  115. obj.attr('is_show', 1);
  116. $('.child' + m_id).show();
  117. is_ajax = false;
  118. // obj.find('.bj').html('-');
  119. obj.children('div').eq(0).children('span').eq(0).html('-');
  120. } else {
  121. obj.attr('is_show', 2);
  122. $('.child' + m_id).hide();
  123. is_ajax = false;
  124. //console.log(obj.find('.bj'));
  125. // console.log(obj.find('.bj').text());
  126. obj.children('div').eq(0).children('span').eq(0).html('+');
  127. }
  128. });
  129. function getChildList(m_id, parent_num, obj) {
  130. $.ajax({
  131. type: 'post',
  132. url: '{{ route('admin.memberClan.view.next.phone') }}/'+m_id,
  133. data: {m_id: m_id, parent_num: parent_num, depth:_depth},
  134. dataType: 'json',
  135. success: function(data){
  136. is_ajax = false;
  137. if (data.code == 1) {
  138. console.log(data);
  139. obj.after(data.data.html);
  140. obj.attr('is_show', 1);
  141. obj.attr('is_get_child', 1);
  142. obj.children('div').eq(0).children('span').eq(0).html('-');
  143. }
  144. }
  145. });
  146. }
  147. $(document).on('click', '#auth-button', function () {
  148. var _username = $('#username').val();
  149. if( !_username ){
  150. layer.msg("搜索账号为空");
  151. return false;
  152. }
  153. $.ajax({
  154. type: 'post',
  155. url: '{{ route('admin.memberClan.view.phone') }}/'+_username,
  156. data: {m_id: _username},
  157. dataType: 'json',
  158. success: function(data){
  159. is_ajax = false;
  160. if (data.code == 1) {
  161. $('#show-tx').empty();
  162. $('#show-tx').html(data.data.html);
  163. _depth = data.data.depth;
  164. }else{
  165. layer.msg(data.msg);
  166. }
  167. }
  168. });
  169. });
  170. $(function () {
  171. $('#auth-button').trigger('click');
  172. $(document).delegate('a.view-sc','click', function (event) {
  173. var e = event || window.event;
  174. var _th = $(e.target);
  175. _th.closest('li').addClass('li_x');
  176. $.ajax({
  177. type: 'get',
  178. url: "{{ route('admin.memberClan.order.jh') }}/"+_th.data('id'),
  179. data: {},
  180. dataType: 'json',
  181. success: function (data) {
  182. if( data.code <= 0 ){
  183. var _xs = _th.closest('div');
  184. _xs.closest('div').empty();
  185. _xs.closest('div').html(data.count);
  186. }
  187. }
  188. });
  189. window.event? e.cancelBubble = true : e.stopPropagation();
  190. return false; // 阻止冒泡
  191. });
  192. //控制点击input以外的区域会触发input的blur事件
  193. $(document).mousedown(function (e) {
  194. var con = $("a.view-sc"); // 设置目标区域
  195. if (!(!con.is(e.target) && con.has(e.target).length === 0)) {
  196. // 取消指定属性
  197. $(e.target).closest('li').removeClass('li_x');
  198. }
  199. });
  200. });
  201. </script>
  202. @endsection