6d3747d12327b7a737b81b743d7fc232.php 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  1. <?php /*a:6:{s:69:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\wechat\wechat_user\index.php";i:1595820902;s:61:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\container.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_head.php";i:1595820902;s:57:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\style.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\inner_page.php";i:1595820902;s:64:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
  8. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  9. <?php endif; ?>
  10. <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
  11. <link href="/system/css/layui-admin.css" rel="stylesheet">
  12. <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  13. <link href="/system/frame/css/animate.min.css" rel="stylesheet">
  14. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  15. <script src="/system/frame/js/jquery.min.js"></script>
  16. <script src="/system/frame/js/bootstrap.min.js"></script>
  17. <script src="/static/plug/layui/layui.all.js"></script>
  18. <script>
  19. $eb = parent._mpApi;
  20. window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
  21. window.module="<?php echo app('http')->getName();?>";
  22. </script>
  23. <title></title>
  24. <link href="/system/frame/css/plugins/iCheck/custom.css" rel="stylesheet">
  25. <script src="/static/plug/moment.js"></script>
  26. <link rel="stylesheet" href="/static/plug/daterangepicker/daterangepicker.css">
  27. <script src="/static/plug/daterangepicker/daterangepicker.js"></script>
  28. <script src="/system/frame/js/plugins/iCheck/icheck.min.js"></script>
  29. <link href="/system/frame/css/plugins/footable/footable.core.css" rel="stylesheet">
  30. <script src="/static/plug/sweetalert2/sweetalert2.all.min.js"></script>
  31. <script src="/system/frame/js/plugins/footable/footable.all.min.js"></script>
  32. <style>
  33. .on-tag{background-color: #eea91e;}
  34. .height-auto{height: 300px;}
  35. .tag{border: solid 1px #eee;}
  36. </style>
  37. <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
  38. <script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
  39. <?php /* <script type="text/javascript" src="/static/plug/requirejs/require-basket-load.js"></script> */ ?>
  40. <script>
  41. var hostname = location.hostname;
  42. if(location.port) hostname += ':' + location.port;
  43. requirejs.config({
  44. map: {
  45. '*': {
  46. 'css': '/static/plug/requirejs/require-css.js'
  47. }
  48. },
  49. shim:{
  50. 'iview':{
  51. deps:['css!iviewcss']
  52. },
  53. 'layer':{
  54. deps:['css!layercss']
  55. }
  56. },
  57. baseUrl:'//'+hostname+'/',
  58. paths: {
  59. 'static':'static',
  60. 'system':'system',
  61. 'vue':'static/plug/vue/dist/vue.min',
  62. 'axios':'static/plug/axios.min',
  63. 'iview':'static/plug/iview/dist/iview.min',
  64. 'iviewcss':'static/plug/iview/dist/styles/iview',
  65. 'lodash':'static/plug/lodash',
  66. 'layer':'static/plug/layer/layer',
  67. 'layercss':'static/plug/layer/theme/default/layer',
  68. 'jquery':'static/plug/jquery/jquery.min',
  69. 'moment':'static/plug/moment',
  70. 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
  71. 'formCreate':'/static/plug/form-create/form-create.min',
  72. },
  73. basket: {
  74. excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  75. // excludes:['system/util/mpFormBuilder','system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  76. }
  77. });
  78. </script>
  79. <script type="text/javascript" src="/system/util/mpFrame.js"></script>
  80. </head>
  81. <body class="gray-bg">
  82. <div class="wrapper wrapper-content">
  83. <div class="row">
  84. <div class="col-sm-12">
  85. <div class="ibox">
  86. <!--<div class="ibox-title">
  87. <button type="button" class="btn btn-w-m btn-primary grant">发放优惠券</button>
  88. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('store.storeCoupon/grant_subscribe'); ?>',{'w':800})">给关注的用户发放优惠券</button>
  89. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('store.storeCoupon/grant_all'); ?>',{'w':800})">给所有用户发放优惠券</button>
  90. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('store.storeCoupon/grant_group'); ?>',{'w':800})">给分组用户发放优惠券</button>
  91. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('store.storeCoupon/grant_tag'); ?>',{'w':800})">给标签用户发放优惠券</button>
  92. </div>-->
  93. <div class="ibox-content">
  94. <div class="row">
  95. <div class="m-b m-l">
  96. <form action="" class="form-inline" id="form" method="get">
  97. <div class="search-item" data-name="data">
  98. <span>选择时间:</span>
  99. <button type="button" class="btn btn-outline btn-link" data-value="">全部</button>
  100. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo htmlentities($limitTimeList['today']); ?>">今天</button>
  101. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo htmlentities($limitTimeList['week']); ?>">本周</button>
  102. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo htmlentities($limitTimeList['month']); ?>">本月</button>
  103. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo htmlentities($limitTimeList['quarter']); ?>">本季度</button>
  104. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo htmlentities($limitTimeList['year']); ?>">本年</button>
  105. <div class="datepicker" style="display: inline-block;">
  106. <button type="button" class="btn btn-outline btn-link" data-value="<?php echo !empty($where['data']) ? htmlentities($where['data']) : 'no'; ?>">自定义时间</button>
  107. </div>
  108. <input class="search-item-value" type="hidden" name="data" value="<?php echo htmlentities($where['data']); ?>" />
  109. <input class="search-item-value" type="hidden" name="groupid" value="<?php echo htmlentities($where['groupid']); ?>" />
  110. <input class="search-item-value" type="hidden" name="tagid_list" value="<?php echo htmlentities($where['tagid_list']); ?>" />
  111. <input class="search-item-value" type="hidden" name="sex" value="<?php echo htmlentities($where['sex']); ?>" />
  112. <input class="search-item-value" type="hidden" name="subscribe" value="<?php echo htmlentities($where['subscribe']); ?>" />
  113. <input class="search-item-value" type="hidden" name="stair" value="" />
  114. <input class="search-item-value" type="hidden" name="second" value="" />
  115. <input class="search-item-value" type="hidden" name="order_stair" value="" />
  116. <input class="search-item-value" type="hidden" name="order_second" value="" />
  117. <input class="search-item-value" type="hidden" name="now_money" value="" />
  118. <input class="search-item-value" type="hidden" id="batch" name="batch" value="" />
  119. </div>
  120. <hr>
  121. <div class="tag-item" data-name="tagid_list">
  122. <span>用户标签:</span>
  123. <?php if(is_array($tagList) || $tagList instanceof \think\Collection || $tagList instanceof \think\Paginator): $i = 0; $__LIST__ = $tagList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  124. <button type="button" class="btn btn-outline btn-link tag" data-value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['name']); ?></button>
  125. <?php endforeach; endif; else: echo "" ;endif; ?>
  126. <input class="tag-item-value" type="hidden" name="tagid_list" value="<?php echo htmlentities($where['tagid_list']); ?>" />
  127. </div>
  128. <hr>
  129. <div class="btn-group">
  130. <button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="padding: 5px 15px;"
  131. aria-expanded="false">批量操作
  132. <span class="caret"></span>
  133. </button>
  134. <ul class="dropdown-menu left">
  135. <li>
  136. <a class="save_mark grant" href="javascript:void(0);" >
  137. <i class="fa fa-space-shuttle"></i> 发放优惠券
  138. </a>
  139. </li>
  140. <li>
  141. <a class="save_mark news" href="javascript:void(0);" >
  142. <i class="fa fa-space-shuttle"></i> 发送消息
  143. </a>
  144. </li>
  145. </ul>
  146. </div>
  147. <div class="input-group" style="float: right">
  148. <input type="text" name="nickname" value="<?php echo htmlentities($where['nickname']); ?>" placeholder="请输入会员名称" class="input-sm form-control">
  149. <input type="hidden" name="export" value="<?php echo htmlentities($where['export']); ?>" />
  150. <span class="input-group-btn">
  151. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search"></i>搜索</button>
  152. <button style="margin: 0 16px" type="submit" id="export" class="btn btn-sm btn-info btn-outline"> <i class="fa fa-exchange" ></i> Excel导出</button>
  153. <script>
  154. $('#export').on('click',function(){
  155. $('input[name=export]').val(1);
  156. });
  157. $('#no_export').on('click',function(){
  158. $('input[name=export]').val(0);
  159. });
  160. </script>
  161. </span>
  162. </div>
  163. </form>
  164. </div>
  165. </div>
  166. <div class="table-responsive">
  167. <table class="table table-striped table-bordered" data-page-size="20">
  168. <thead>
  169. <tr>
  170. <th class="text-cente">
  171. <div class="btn-group">
  172. <button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="font-weight: bold;background-color: #f5f5f6;border: solid 0;"
  173. aria-expanded="false">
  174. 选择
  175. <span class="caret"></span>
  176. </button>
  177. <ul class="dropdown-menu left">
  178. <li class="this-page">
  179. <a class="save_mark" href="javascript:void(0);" >
  180. <i class="fa fa-check-square-o"></i>本页用户
  181. </a>
  182. </li>
  183. <li class="this-all">
  184. <a class="save_mark" href="javascript:void(0);">
  185. <i class="fa fa-check-square"></i>全部用户
  186. </a>
  187. </li>
  188. <li class="this-up">
  189. <a class="save_mark" href="javascript:void(0);">
  190. <i class="fa fa-square-o"></i>取消选择
  191. </a>
  192. </li>
  193. </ul>
  194. </div>
  195. </th>
  196. <th class="text-center">编号</th>
  197. <th class="text-center">微信用户名称</th>
  198. <th class="text-center">头像</th>
  199. <th class="text-center">
  200. <div class="btn-group">
  201. <button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="font-weight: bold;background-color: #f5f5f6;border: solid 0;"
  202. aria-expanded="false">性别
  203. <span class="caret"></span>
  204. </button>
  205. <ul class="dropdown-menu search-item" data-name="sex">
  206. <li data-value="">
  207. <a class="save_mark" href="javascript:void(0);" >
  208. <i class="fa fa-venus-mars"></i>全部
  209. </a>
  210. </li>
  211. <li data-value="1">
  212. <a class="save_mark" href="javascript:void(0);" >
  213. <i class="fa fa-mars"></i>男
  214. </a>
  215. </li>
  216. <li data-value="2">
  217. <a class="save_mark" href="javascript:void(0);">
  218. <i class="fa fa-venus"></i>女
  219. </a>
  220. </li>
  221. <li data-value="0">
  222. <a class="save_mark" href="javascript:void(0);">
  223. <i class="fa fa-transgender"></i>保密
  224. </a>
  225. </li>
  226. </ul>
  227. </div>
  228. </th>
  229. <th class="text-center no-sort">地区</th>
  230. <th class="text-center">
  231. <div class="btn-group">
  232. <button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="font-weight: bold;background-color: #f5f5f6;border: solid 0;"
  233. aria-expanded="false">是否关注公众号
  234. <span class="caret"></span>
  235. </button>
  236. <ul class="dropdown-menu search-item" data-name="subscribe">
  237. <li data-value="">
  238. <a class="save_mark" href="javascript:void(0);" >
  239. 全部
  240. </a>
  241. </li>
  242. <li data-value="1">
  243. <a class="save_mark" href="javascript:void(0);" >
  244. 关注
  245. </a>
  246. </li>
  247. <li data-value="0">
  248. <a class="save_mark" href="javascript:void(0);">
  249. 未关注
  250. </a>
  251. </li>
  252. </ul>
  253. </div>
  254. </th>
  255. <th class="text-center">
  256. <div class="btn-group">
  257. <button data-toggle="dropdown" class="btn btn-white btn-xs dropdown-toggle" style="font-weight: bold;padding: 6px 50px;background-color: #f5f5f6;border: solid 0;"
  258. aria-expanded="false">用户分组
  259. <span class="caret"></span>
  260. </button>
  261. <ul class="dropdown-menu search-item" data-name="groupid">
  262. <li data-value="-1">
  263. <a class="save_mark" href="javascript:void(0);" >
  264. 全部
  265. </a>
  266. </li>
  267. <?php if(is_array($groupList) || $groupList instanceof \think\Collection || $groupList instanceof \think\Paginator): $i = 0; $__LIST__ = $groupList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  268. <li data-value="<?php echo htmlentities($vo['id']); ?>">
  269. <a class="save_mark" href="javascript:void(0);" >
  270. <?php echo htmlentities($vo['name']); ?>
  271. </a>
  272. </li>
  273. <?php endforeach; endif; else: echo "" ;endif; ?>
  274. </ul>
  275. </div>
  276. </th>
  277. <th class="text-center">用户标签</th>
  278. <!-- <th class="text-center">首次关注时间</th>-->
  279. <th class="text-center">操作</th>
  280. </tr>
  281. </thead>
  282. <tbody>
  283. <?php $count = count($list); if($count): if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  284. <tr>
  285. <td class="text-center">
  286. <label class="checkbox-inline i-checks">
  287. <input type="checkbox" name="coupon[]" value="<?php echo htmlentities($vo['uid']); ?>">
  288. </label>
  289. </td>
  290. <td class="text-center">
  291. <?php echo htmlentities($vo['uid']); ?>
  292. </td>
  293. <td class="text-center">
  294. <?php echo htmlentities($vo['nickname']); ?>
  295. </td>
  296. <td class="text-center">
  297. <img src="<?php echo htmlentities($vo['headimgurl']); ?>" alt="<?php echo htmlentities($vo['nickname']); ?>" title="<?php echo htmlentities($vo['nickname']); ?>" style="width:50px;height: 50px;cursor: pointer;" class="head_image" data-image="<?php echo htmlentities($vo['headimgurl']); ?>">
  298. </td>
  299. <td class="text-center">
  300. <?php if($vo['sex'] == 1): ?>
  301. 男
  302. <?php elseif($vo['sex'] == 2): ?>
  303. 女
  304. <?php else: ?>
  305. 保密
  306. <?php endif; ?>
  307. </td>
  308. <td class="text-center">
  309. <?php echo htmlentities($vo['country']); ?><?php echo htmlentities($vo['province']); ?><?php echo htmlentities($vo['city']); ?>
  310. </td>
  311. <td class="text-center">
  312. <?php if($vo['subscribe']): ?>
  313. 关注
  314. <?php else: ?>
  315. 未关注
  316. <?php endif; ?>
  317. </td>
  318. <td class="text-center">
  319. <?php if(!is_array($groupList)){ ?>
  320. 无
  321. <?php }else{ if(!$groupList || $vo['groupid'] == 0 || !isset($groupList[$vo['groupid']])){ ?>
  322. 无
  323. <?php }else{ ?>
  324. <span class="badge badge-primary"><?php echo htmlentities($groupList[$vo['groupid']]['name']); ?></span>
  325. <?php } }?>
  326. </td>
  327. <td class="text-center">
  328. <?php if(!is_array($tagList)){ ?>
  329. 无
  330. <?php }else{ $tagId = explode(',',$vo['tagid_list']);
  331. if(!$tagList || $vo['tagid_list'] == ''|| !$tagId){ ?>
  332. 无
  333. <?php }else{ foreach($tagId as $tag){ if(isset($tagList[$tag])){?>
  334. <span class="badge badge-info"><?php echo htmlentities($tagList[$tag]['name']); ?></span>
  335. <?php }} } }?>
  336. </td>
  337. <!-- <td class="text-center">-->
  338. <!-- <?php echo htmlentities(date("Y-m-d H:i:s",!is_numeric($vo['add_time'])? strtotime($vo['add_time']) : $vo['add_time'])); ?>-->
  339. <!-- </td>-->
  340. <td class="text-center">
  341. <div class="btn-group">
  342. <button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
  343. aria-expanded="false">操作
  344. <span class="caret"></span>
  345. </button>
  346. <ul class="dropdown-menu">
  347. <?php if($vo['openid'] && $vo['subscribe'] == 1): ?>
  348. <li>
  349. <a class="save_mark" href="javascript:void(0);" onclick="$eb.createModalFrame('修改分组','<?php echo Url('edit_user_group',['openid'=>$vo['openid']]); ?>',{w:350,h:500})" >
  350. 修改分组
  351. </a>
  352. </li>
  353. <li>
  354. <a class="save_mark" href="javascript:void(0);" onclick="$eb.createModalFrame('修改标签','<?php echo Url('edit_user_tag',['openid'=>$vo['openid']]); ?>',{w:350,h:500})" >
  355. 修改标签
  356. </a>
  357. </li>
  358. <li>
  359. <a class="save_mark synchro" href="javascript:void(0);" data-url="<?php echo Url('synchro_tag',['openid'=>$vo['openid']]); ?>" >
  360. 同步标签
  361. </a>
  362. </li>
  363. <?php else: ?>
  364. <li>
  365. <a class="save_mark" href="javascript:void(0);">
  366. 无法操作
  367. </a>
  368. </li>
  369. <?php endif; ?>
  370. </ul>
  371. </div>
  372. </td>
  373. </tr>
  374. <?php endforeach; endif; else: echo "" ;endif; else: ?>
  375. <tr id="content" style="display:none;height:400px;"></tr>
  376. <?php endif; ?>
  377. </tbody>
  378. </table>
  379. </div>
  380. <link href="/system/frame/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
  381. <div class="row">
  382. <div class="col-sm-6">
  383. <div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">共 <?php echo htmlentities($total); ?> 项</div>
  384. </div>
  385. <div class="col-sm-6">
  386. <div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
  387. <?php echo $page;?>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <script>
  396. window.$list = <?php echo json_encode($list);?>;
  397. window.$uidAll = <?php echo json_encode($uidAll);?>;
  398. window.$where = <?php echo json_encode($where);?>;
  399. $('.this-page').on('click',function () {
  400. $('input[name="coupon[]"]').each(function(){
  401. $(this).checked = true;
  402. $(this).parent().addClass('checked');
  403. $('#batch').val(1);
  404. });
  405. })
  406. $('.this-all').on('click',function () {
  407. $('input[name="coupon[]"]').each(function(){
  408. $(this).checked = true;
  409. $(this).parent().addClass('checked');
  410. $('#batch').val(2);
  411. });
  412. })
  413. $('.this-up').on('click',function () {
  414. $('input[name="coupon[]"]').each(function(){
  415. $(this).checked = false;
  416. $(this).parent().removeClass('checked');
  417. $('#batch').val('');
  418. });
  419. })
  420. $(function init() {
  421. $('.search-item>.btn').on('click', function () {
  422. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents();
  423. form.find('input[name="' + name + '"]').val(value);
  424. $('input[name=export]').val(0);
  425. form.submit();
  426. });
  427. $('.tag-item>.btn').on('click', function () {
  428. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents(),list = $('input[name="' + name + '"]').val().split(',');
  429. var bool = 0;
  430. $.each(list,function (index,item) {
  431. if(item == value){
  432. bool = 1
  433. list.splice(index,1);
  434. }
  435. })
  436. if(!bool) list.push(''+value+'');
  437. form.find('input[name="' + name + '"]').val(list.join(','));
  438. $('input[name=export]').val(0);
  439. form.submit();
  440. });
  441. $('.search-item>li').on('click', function () {
  442. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = $('#form');
  443. form.find('input[name="' + name + '"]').val(value);
  444. $('input[name=export]').val(0);
  445. form.submit();
  446. });
  447. $('.search-item>li').each(function () {
  448. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name');
  449. if($where[name]) $('.'+name).css('color','#1ab394');
  450. });
  451. $('.search-item-value').each(function () {
  452. var that = $(this), name = that.attr('name'), value = that.val(), dom = $('.search-item[data-name="' + name + '"] .btn[data-value="' + value + '"]');
  453. dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
  454. .siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
  455. });
  456. $('.tag-item-value').each(function () {
  457. var that = $(this), name = that.attr('name'), value = that.val().split(',');
  458. dom = [];
  459. $.each(value,function (index,item) {
  460. dom.push($('.tag-item[data-name="' + name + '"] .btn[data-value="' + item + '"]'));
  461. })
  462. $.each(dom,function (index,item) {
  463. item.eq(0).removeClass('btn-outline btn-link tag').addClass('btn-primary btn-sm')
  464. })
  465. });
  466. })
  467. $('.i-checks').iCheck({
  468. checkboxClass: 'icheckbox_square-green',
  469. });
  470. $('.head_image').on('click',function (e) {
  471. var image = $(this).data('image');
  472. $eb.openImage(image);
  473. })
  474. var dateInput =$('.datepicker');
  475. dateInput.daterangepicker({
  476. autoUpdateInput: false,
  477. "opens": "center",
  478. "drops": "down",
  479. "ranges": {
  480. '今天': [moment(), moment().add(1, 'days')],
  481. '昨天': [moment().subtract(1, 'days'), moment()],
  482. '上周': [moment().subtract(6, 'days'), moment()],
  483. '前30天': [moment().subtract(29, 'days'), moment()],
  484. '本月': [moment().startOf('month'), moment().endOf('month')],
  485. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  486. },
  487. "locale" : {
  488. applyLabel : '确定',
  489. cancelLabel : '清空',
  490. fromLabel : '起始时间',
  491. toLabel : '结束时间',
  492. format : 'YYYY/MM/DD',
  493. customRangeLabel : '自定义',
  494. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  495. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  496. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  497. firstDay : 1
  498. }
  499. });
  500. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  501. $("#data").val('');
  502. });
  503. dateInput.on('apply.daterangepicker', function(ev, picker) {
  504. $("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  505. $('input[name=export]').val(0);
  506. $('#form').submit();
  507. });
  508. //发优惠券
  509. $('.grant').on('click',function (e) {
  510. var chk_value =[];
  511. var batch = $('#batch').val();
  512. if(batch == 1){
  513. $.each($list.data,function (index,item) {
  514. chk_value.push(item.uid);
  515. })
  516. }else if(batch == 2){
  517. chk_value = $uidAll;
  518. }else{
  519. $('input[name="coupon[]"]:checked').each(function(){
  520. chk_value.push($(this).val());
  521. str += $(this).val();
  522. });
  523. if(chk_value.length < 1){
  524. $eb.message('请选择要发放优惠券的用户');
  525. return false;
  526. }
  527. }
  528. var str = chk_value.join(',');
  529. // var url = "http://"+window.location.host+"/admin/ump.store_coupon/grant/id/"+str;
  530. var url = "<?php echo Url('ump.store_coupon/grant'); ?>?id="+str;
  531. $eb.createModalFrame(this.innerText,url,{'w':800});
  532. })
  533. $('.news').on('click',function (e) {
  534. var chk_value =[];
  535. var batch = $('#batch').val();
  536. if(batch == 1){
  537. $.each($list.data,function (index,item) {
  538. chk_value.push(item.uid);
  539. })
  540. }else if(batch == 2){
  541. chk_value = $uidAll;
  542. }else{
  543. $('input[name="coupon[]"]:checked').each(function(){
  544. chk_value.push($(this).val());
  545. str += $(this).val();
  546. });
  547. if(chk_value.length < 1){
  548. $eb.message('请选择要发消息的用户');
  549. return false;
  550. }
  551. }
  552. var str = chk_value.join(',');
  553. var url = "<?php echo Url('wechat.wechat_news_category/send_news'); ?>?id="+str;
  554. $eb.createModalFrame(this.innerText,url,{'w':800});
  555. })
  556. $('.synchro').on('click',function(){
  557. window.t = $(this);
  558. var _this = $(this),url =_this.data('url');
  559. $eb.$swal('delete',function(){
  560. $eb.axios.get(url).then(function(res){
  561. console.log(res);
  562. if(res.status == 200 && res.data.code == 200) {
  563. $eb.$swal('success',res.data.msg);
  564. }else
  565. return Promise.reject(res.data.msg || '同步失败')
  566. }).catch(function(err){
  567. $eb.$swal('error',err);
  568. });
  569. },{'title':'您确定要同步该用户的标签吗?','text':'请谨慎操作!','confirm':'是的,我要同步'})
  570. });
  571. </script>
  572. </div>
  573. </body>
  574. </html>