list.blade.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. @extends('layouts.base')
  2. @section('title', '微店管理')
  3. @section('content')
  4. <link href="{{static_url('yunshop/css/member.css')}}" media="all" rel="stylesheet" type="text/css"/>
  5. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/goods.css')}}"/>
  6. <script type="text/javascript" src="./resource/js/lib/jquery-ui-1.10.3.min.js"></script>
  7. <div class="w1200 m0a">
  8. <div class="rightlist">
  9. <!-- 新增加右侧顶部三级菜单 -->
  10. <div class="right-titpos">
  11. <ul class="add-snav">
  12. <li class="active">微店管理</li>
  13. </ul>
  14. </div>
  15. <!-- 新增加右侧顶部三级菜单结束 -->
  16. <div class="panel panel-info"><!--
  17. <div class="panel-heading">筛选</div>-->
  18. <div class="panel-body">
  19. <form action="" method="post" class="form-horizontal" role="form" id="form1">
  20. <input type="hidden" name="route" value="plugin.micro.backend.controllers.MicroShop.list" id="route" />
  21. <div class="form-group col-xs-12 col-sm-2 col-md-2 col-lg-2">
  22. <!-- <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  23. <div class="">
  24. <input type="text" class="form-control" name="search[member_id]" value="{{$request['member_id']}}" placeholder="可搜索会员ID"/>
  25. </div>
  26. </div>
  27. <div class="form-group col-xs-12 col-sm-2 col-md-2 col-lg-2">
  28. <!-- <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">会员信息</label>-->
  29. <div class="">
  30. <input type="text" class="form-control" name="search[member]" value="{{$request['member']}}" placeholder="可搜索昵称/姓名/手机号"/>
  31. </div>
  32. </div>
  33. <div class="form-group col-xs-12 col-sm-2 col-md-2 col-lg-2">
  34. {{--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">微店名称</label>--}}
  35. <div class="">
  36. <input type="text" class="form-control" name="search[shop_name]" value="{{$request['shop_name']}}" placeholder="可搜索微店名称"/>
  37. </div>
  38. </div>
  39. <div class="form-group col-xs-12 col-sm-2 col-md-2 col-lg-2">
  40. {{--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">微店等级</label>--}}
  41. <div class="">
  42. <select name='search[level_id]' class='form-control'>
  43. <option value=''>等级不限</option>
  44. @foreach($levels as $level)
  45. <option value='{{$level->id}}'
  46. @if($request['level_id'] == $level->id)
  47. selected
  48. @endif
  49. >{{$level->level_name}}</option>
  50. @endforeach
  51. </select>
  52. </div>
  53. </div>
  54. <div class="form-group col-xs-12 col-sm-7 col-lg-4">
  55. <!--<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label"></label>-->
  56. <div class="">
  57. <button type="button" name="export" value="1" id="export" class="btn btn-default excel back ">导出 Excel</button>
  58. <button class="btn btn-success "><i class="fa fa-search"></i> 搜索</button>
  59. </div>
  60. </div>
  61. </form>
  62. </div>
  63. <div class='panel-footer'>
  64. <a class='btn btn-info' href="{{yzWebUrl('plugin.micro.backend.controllers.MicroShop.create.index')}}"><i class='fa fa-plus'></i> 添加微店</a>
  65. </div>
  66. </div><div class="clearfix">
  67. <div class="panel panel-default">
  68. <div class="panel-heading">总数:{{$list->total()}} </div>
  69. <div class="panel-body" style="margin-bottom:200px">
  70. <table class="table table-hover" style="overflow:visible">
  71. <thead class="navbar-inner">
  72. <tr>
  73. <th style='width:14%;text-align: center;'>开店时间</th>
  74. <th style='width:8%;text-align: center;'>微店名称</th>
  75. <th style='width:10%;text-align: center;'>店主</th>
  76. <th style='width:8%;'>店主等级</th>
  77. <th style='width:6%;text-align: center;'>下级微店店主总数</th>
  78. <th style='width:12%;text-align: center;'>微店消费总金额</th>
  79. <th style='width:8%;text-align: center;'>已结算分红</th>
  80. <th style='width:8%;text-align: center;'>累计分红</th>
  81. <th style='width:6%;'>禁用</th>
  82. <th style='width:12%;text-align: center;'>二维码/链接</th>
  83. </tr>
  84. </thead>
  85. <tbody>
  86. @foreach($list as $row)
  87. <tr>
  88. <td style="text-align: center;"> {{$row->created_at}}</td>
  89. <td style="text-align: center;">{{$row->shop_name}}</td>
  90. <td style="text-align: center;">
  91. <img src='{{$row->hasOneMember->avatar}}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc' />
  92. <br/>
  93. <a href="{!! yzWebUrl($member_detail_url,['id' => $row->hasOneMember->uid])!!}">@if ($row->hasOneMember->nickname) {{$row->hasOneMember->nickname}} @else {{$row->hasOneMember->mobile}} @endif</a>
  94. </td>
  95. <td title="{{$row->hasOneMicroShopLevel->level_name}}" class='tdedit' width="26%">
  96. <span class=' fa-edit-item' style='cursor:pointer'>
  97. <span class="title">{{$row->hasOneMicroShopLevel->level_name}}</span>
  98. <i class='fa fa-pencil' style="display:none"></i>
  99. </span>
  100. <div class="input-group level" style="display:none">
  101. <select class="form-control tpl-agent-level" name="level_id" data-agencyid="{{$row['id']}}">
  102. @foreach($levels as $value)
  103. <option value="{{$value->id}}"
  104. @if($row['level_id']==$value->id)
  105. selected
  106. @endif
  107. >{{$value->level_name}}</option>
  108. @endforeach
  109. </select>
  110. </div>
  111. </td>
  112. <td style="text-align: center;">{{$row->lower_total}}</td>
  113. <td style="text-align: center;">
  114. <label class="label label-info">{!! number_format($row->money_total, 2) !!}元</label>
  115. </td>
  116. <td style="text-align: center;">
  117. <label class="label label-info">{!! number_format($row->ok_total, 2) !!}元</label>
  118. <td style="text-align: center;">
  119. <label class="label label-info">{!! number_format($row->sum_total, 2) !!}元</label>
  120. </td>
  121. <td style="overflow:visible;text-align: center;">
  122. <div class="col-sm-2 col-xs-6">
  123. <input class="mui-switch " id="ban{{$row->id}}" type="checkbox" style="overflow: auto"
  124. @if($row->is_ban== 1))
  125. checked
  126. @endif
  127. onclick="ban({{$row->id}})"/>
  128. </div>
  129. </td>
  130. <td style="text-align: center;position: relative;overflow: visible;">
  131. <a class="btn btn-sm btn-default umphp" title="微店二维码"
  132. data-url="{{yzAppFullUrl('microShopShare/home/'.$row->id) . '&shop_id=' . $row->id}}"
  133. data-goodsid="{{$row->id}}"
  134. style="z-index:99;"
  135. >
  136. <div class="img">
  137. {!! QrCode::size(120)->generate(yzAppFullUrl('microShopShare/home/'.$row->id) . '&shop_id=' . $row->id) !!}
  138. </div>
  139. <i class="fa fa-qrcode"></i>
  140. </a>
  141. <a href="javascript:;"
  142. title="复制连接" class="btn btn-default btn-sm fuzhi{{$row->id}} btns{{$row->id}}" url="{{yzAppFullUrl('microShopShare/home/'.$row->id) . '&shop_id=' . $row->id}}"><i class="fa fa-link"></i></a>
  143. <script type="text/javascript">
  144. var content{{$row->id}} = $(".fuzhi{{$row->id}}").attr('url');
  145. var clipboard = new Clipboard('.btns{{$row->id}}', {
  146. text: function() {
  147. return content{{$row->id}};
  148. }
  149. });
  150. clipboard.on('success', function(e) {
  151. alert("复制成功");
  152. });
  153. clipboard.on('error', function(e) {
  154. console.log(e);
  155. });
  156. </script>
  157. </td>
  158. </tr>
  159. @endforeach
  160. </tbody>
  161. </table>
  162. {!!$pager!!}
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <script language='javascript'>
  169. $('.tdedit').mouseover(function () {
  170. $(this).find('.fa-pencil').show();
  171. }).mouseout(function () {
  172. $(this).find('.fa-pencil').hide();
  173. });
  174. $('.fa-edit-item').click(function () {
  175. $(this).closest('span').hide();
  176. $(this).next('.level').show();
  177. });
  178. $('.tpl-agent-level').change(function () {
  179. var agencyId = $(this).data('agencyid');
  180. var levelId = $(this).val();
  181. fastChange(agencyId, levelId);
  182. });
  183. function ban(id) {
  184. var url_open = "{!! yzWebUrl('plugin.micro.backend.controllers.MicroShop.list.ban') !!}"
  185. var url_close = "{!! yzWebUrl('plugin.micro.backend.controllers.MicroShop.list.cancel-ban') !!}"
  186. var postdata = {
  187. id: id,
  188. };
  189. var ban = "#ban" + id;
  190. if ($(ban).is(':checked')) {
  191. //开
  192. $.post(url_open,postdata,function(data){
  193. if (data.result == 1) {
  194. $(ban).attr("checked",true);
  195. showPopover($(ban),"禁用成功")
  196. } else {
  197. showPopover($(ban),"禁用失败")
  198. $(ban).attr("checked",false);
  199. }
  200. }, "json");
  201. } else {
  202. //关
  203. $.post(url_close,postdata,function(data){
  204. showPopover($(ban),"取消成功")
  205. }, "json");
  206. }
  207. }
  208. function showPopover(target, msg) {
  209. target.attr("data-original-title", msg);
  210. $('[data-toggle="tooltip"]').tooltip();
  211. target.tooltip('show');
  212. target.focus();
  213. //2秒后消失提示框
  214. setTimeout(function () {
  215. target.attr("data-original-title", "");
  216. target.tooltip('hide');
  217. }, 2000
  218. );
  219. }
  220. function fastChange(id, value) {
  221. $.ajax({
  222. url: "{!! yzWebUrl('plugin.micro.backend.controllers.MicroShop.list.change') !!}",
  223. type: "post",
  224. data: {id: id, value: value},
  225. cache: false,
  226. success: function ($data) {
  227. console.log($data);
  228. location.reload();
  229. }
  230. })
  231. }
  232. $('.umphp').hover(function () {
  233. var url = $(this).attr('data-url');
  234. $(this).addClass("selected");
  235. },
  236. function () {
  237. $(this).removeClass("selected");
  238. })
  239. $(function () {
  240. $('#export').click(function(){
  241. $('#route').val("plugin.micro.backend.controllers.MicroShop.list.export");
  242. $('#form1').submit();
  243. $('#route').val("plugin.micro.backend.controllers.MicroShop.list");
  244. });
  245. });
  246. </script>
  247. @endsection