index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__PLUG_PATH}city.js"></script>
  4. <style>
  5. .layui-btn-xs{margin-left: 0px !important;}
  6. legend{
  7. width: auto;
  8. border: none;
  9. font-weight: 700 !important;
  10. }
  11. .site-demo-button{
  12. padding-bottom: 20px;
  13. padding-left: 10px;
  14. }
  15. .layui-form-label{
  16. width: auto;
  17. }
  18. .layui-input-block input{
  19. width: 50%;
  20. height: 34px;
  21. }
  22. .layui-form-item{
  23. margin-bottom: 0;
  24. }
  25. .layui-input-block .time-w{
  26. width: 200px;
  27. }
  28. .layui-table-body{overflow-x: hidden;}
  29. .layui-btn-group button i{
  30. line-height: 30px;
  31. margin-right: 3px;
  32. vertical-align: bottom;
  33. }
  34. .back-f8{
  35. background-color: #F8F8F8;
  36. }
  37. .layui-input-block button{
  38. border: 1px solid #e5e5e5;
  39. }
  40. .avatar{width: 50px;height: 50px;}
  41. .layui-table-body{
  42. overflow-x: unset;
  43. }
  44. </style>
  45. {/block}
  46. {block name="content"}
  47. <div class="row">
  48. <div class="col-sm-12">
  49. <div class="ibox float-e-margins">
  50. <div class="ibox-title">
  51. <h5>会员搜索</h5>
  52. <div class="ibox-tools">
  53. <a class="collapse-link">
  54. <i class="fa fa-chevron-up"></i>
  55. </a>
  56. </div>
  57. </div>
  58. <div class="ibox-content" style="display: block;">
  59. <form class="layui-form">
  60. <div class="layui-form-item">
  61. <div class="layui-inline">
  62. <label class="layui-form-label">姓名编号:</label>
  63. <div class="layui-input-inline">
  64. <input type="text" name="nickname" lay-verify="nickname" style="width: 100%" autocomplete="off" placeholder="请输入姓名、编号、手机号" class="layui-input">
  65. </div>
  66. </div>
  67. <div class="layui-inline">
  68. <label class="layui-form-label">状  态:</label>
  69. <div class="layui-input-inline">
  70. <select name="status" lay-verify="status">
  71. <option value="">全部</option>
  72. <option value="1">正常</option>
  73. <option value="0">锁定</option>
  74. </select>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label">
  80. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="search" >
  81. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索</button>
  82. </label>
  83. </div>
  84. </form>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="row">
  90. <div class="col-sm-12">
  91. <div class="ibox">
  92. <div class="ibox-content">
  93. <div class="table-responsive">
  94. <div class="layui-btn-group conrelTable">
  95. <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="refresh"><i class="layui-icon layui-icon-refresh" ></i>刷新</button>
  96. </div>
  97. <table class="layui-hide" id="userList" lay-filter="userList"></table>
  98. <script type="text/html" id="nickname">
  99. {{d.nickname}}
  100. {{# if(d.vip_name){ }}
  101. <p style="color:#dab176">{{d.vip_name}}</p>
  102. {{# } }}
  103. </script>
  104. <script type="text/html" id="company">
  105. {{d.all_stock_right}}/{{d.all_stock_right_bonus}}
  106. </script>
  107. <script type="text/html" id="stock">
  108. {{d.code_stock_right}}/{{d.code_stock_right_bonus}}
  109. </script>
  110. <script type="text/html" id="give">
  111. {{d.give_stock_right}}/{{d.give_stock_right_bonus}}
  112. </script>
  113. <script type="text/html" id="total">
  114. <div style="cursor: pointer">
  115. {{d.total_stock}}/{{d.total_sales}}
  116. </div>
  117. </script>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  124. <script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
  125. {/block}
  126. {block name="script"}
  127. <script>
  128. layList.form.render();
  129. layList.tableList('userList',"{:Url('get_user_list')}",function () {
  130. return [
  131. {type:'checkbox'},
  132. {field: 'uid', title: '编号',event:'uid',width:'4%',align:'center'},
  133. {field: 'avatar', title: '头像', event:'open_image', width: '6%',align:'center', templet: '<p lay-event="open_image"><img class="avatar" style="cursor: pointer" class="open_image" data-image="{{d.avatar}}" src="{{d.avatar}}" alt="{{d.nickname}}"></p>'},
  134. {field: 'nickname', title: '姓名',templet:'#nickname',align:'center'},
  135. {field: 'phone', title: '手机号',align:'center',width:'8%'},
  136. {field: 'now_money', title: '余额',sort:true,event:'now_money',align:'center'},
  137. {field: 'company', title: '公司股权/分红',align:'center',templet:"#company"},
  138. {field: 'code_stock_right', title: '全民股权/分红',align:'center',templet:"#stock"},
  139. {field: 'give', title: '赠送股权/分红',templet:"#give",align:'center'},
  140. {field: 'total_stock', title: '总库存/总销量',align:'center',event:'user_code',templet:"#total"},
  141. ];
  142. });
  143. //页面刷新时加载
  144. layui.use('layer',function(){
  145. var layer = layui.layer;
  146. layer.ready(function(){
  147. });
  148. });
  149. layList.date('last_time');
  150. layList.date('add_time');
  151. layList.date('user_time');
  152. layList.date('time');
  153. //监听并执行 uid 的排序
  154. layList.sort(function (obj) {
  155. var layEvent = obj.field;
  156. var type = obj.type;
  157. switch (layEvent){
  158. case 'uid':
  159. layList.reload({order: layList.order(type,'u.uid')},true,null,obj);
  160. break;
  161. case 'now_money':
  162. layList.reload({order: layList.order(type,'u.now_money')},true,null,obj);
  163. break;
  164. case 'integral':
  165. layList.reload({order: layList.order(type,'u.integral')},true,null,obj);
  166. break;
  167. }
  168. });
  169. //监听并执行 uid 的排序
  170. layList.tool(function (event,data,obj) {
  171. var layEvent = event;
  172. switch (layEvent){
  173. case 'open_image':
  174. $eb.openImage(data.avatar);
  175. break;
  176. case 'user_code':
  177. layList.layer.closeAll();
  178. $eb.createModalFrame(data.nickname+'-库存/销量详情',layList.Url({a:'see',p:{uid:data.uid}}));
  179. break;
  180. }
  181. });
  182. //layList.sort('uid');
  183. //监听并执行 now_money 的排序
  184. // layList.sort('now_money');
  185. //监听 checkbox 的状态
  186. layList.switch('status',function (odj,value,name) {
  187. if(odj.elem.checked==true){
  188. layList.baseGet(layList.Url({a:'set_status',p:{status:1,uid:value}}),function (res) {
  189. layList.msg(res.msg);
  190. });
  191. }else{
  192. layList.baseGet(layList.Url({a:'set_status',p:{status:0,uid:value}}),function (res) {
  193. layList.msg(res.msg);
  194. });
  195. }
  196. });
  197. layList.search('search',function(where){
  198. layList.reload(where,true);
  199. });
  200. var action={
  201. set_status_f:function () {
  202. var ids=layList.getCheckData().getIds('uid');
  203. if(ids.length){
  204. layList.basePost(layList.Url({a:'set_status',p:{is_echo:1,status:0}}),{uids:ids},function (res) {
  205. layList.msg(res.msg);
  206. layList.reload();
  207. });
  208. }else{
  209. layList.msg('请选择要封禁的会员');
  210. }
  211. },
  212. set_status_j:function () {
  213. var ids=layList.getCheckData().getIds('uid');
  214. if(ids.length){
  215. layList.basePost(layList.Url({a:'set_status',p:{is_echo:1,status:1}}),{uids:ids},function (res) {
  216. layList.msg(res.msg);
  217. layList.reload();
  218. });
  219. }else{
  220. layList.msg('请选择要解封的会员');
  221. }
  222. },
  223. set_grant:function () {
  224. var ids=layList.getCheckData().getIds('uid');
  225. if(ids.length){
  226. var str = ids.join(',');
  227. $eb.createModalFrame('发送优惠券',layList.Url({c:'ump.store_coupon',a:'grant',p:{id:str}}),{'w':800});
  228. }else{
  229. layList.msg('请选择要发送优惠券的会员');
  230. }
  231. },
  232. set_template:function () {
  233. var ids=layList.getCheckData().getIds('uid');
  234. if(ids.length){
  235. var str = ids.join(',');
  236. }else{
  237. layList.msg('请选择要发送模板消息的会员');
  238. }
  239. },
  240. set_info:function () {
  241. var ids=layList.getCheckData().getIds('uid');
  242. if(ids.length){
  243. var str = ids.join(',');
  244. $eb.createModalFrame('发送站内信息',layList.Url({c:'user.user_notice',a:'notice',p:{id:str}}),{'w':1200});
  245. }else{
  246. layList.msg('请选择要发送站内信息的会员');
  247. }
  248. },
  249. set_custom:function () {
  250. var ids=layList.getCheckData().getIds('uid');
  251. if(ids.length){
  252. var str = ids.join(',');
  253. $eb.createModalFrame('发送客服图文消息',layList.Url({c:'wechat.wechat_news_category',a:'send_news',p:{id:str,type:1}}),{'w':1200});
  254. }else{
  255. layList.msg('请选择要发送客服图文消息的会员');
  256. }
  257. },
  258. set_group:function () {
  259. var ids=layList.getCheckData().getIds('uid');
  260. if(ids.length){
  261. var str = ids.join(',');
  262. $eb.createModalFrame('批量设置分组',layList.Url({a:'set_group',p:{uid:str}}),{w:500,h:300});
  263. }else{
  264. layList.msg('请选择要批量设置分组的会员');
  265. }
  266. },
  267. refresh:function () {
  268. layList.reload();
  269. }
  270. };
  271. $('.conrelTable').find('button').each(function () {
  272. var type=$(this).data('type');
  273. $(this).on('click',function () {
  274. action[type] && action[type]();
  275. })
  276. })
  277. $(document).on('click',".open_image",function (e) {
  278. var image = $(this).data('image');
  279. $eb.openImage(image);
  280. })
  281. //下拉框
  282. $(document).click(function (e) {
  283. $('.layui-nav-child').hide();
  284. })
  285. function dropdown(that){
  286. var oEvent = arguments.callee.caller.arguments[0] || event;
  287. oEvent.stopPropagation();
  288. var offset = $(that).offset();
  289. var top=offset.top-$(window).scrollTop();
  290. var index = $(that).parents('tr').data('index');
  291. $('.layui-nav-child').each(function (key) {
  292. if (key != index) {
  293. $(this).hide();
  294. }
  295. })
  296. if($(document).height() < top+$(that).next('ul').height()){
  297. $(that).next('ul').css({
  298. 'padding': 10,
  299. 'top': - ($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height()/2),
  300. 'left':offset.left-$(that).parents('td').offset().left-20,
  301. 'min-width': 'inherit',
  302. 'position': 'absolute'
  303. }).toggle();
  304. }else{
  305. $(that).next('ul').css({
  306. 'padding': 10,
  307. 'top':$(that).parent('td').height() / 2 + $(that).height(),
  308. 'left':offset.left-$(that).parents('td').offset().left-20,
  309. 'min-width': 'inherit',
  310. 'position': 'absolute'
  311. }).toggle();
  312. }
  313. }
  314. </script>
  315. {/block}