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. <?php elseif($vo['sex'] == 2): ?>
  302. <?php else: ?>
  303. 保密
  304. <?php endif; ?>
  305. </td>
  306. <td class="text-center">
  307. <?php echo htmlentities($vo['country']); ?><?php echo htmlentities($vo['province']); ?><?php echo htmlentities($vo['city']); ?>
  308. </td>
  309. <td class="text-center">
  310. <?php if($vo['subscribe']): ?>
  311. 关注
  312. <?php else: ?>
  313. 未关注
  314. <?php endif; ?>
  315. </td>
  316. <td class="text-center">
  317. <?php if(!is_array($groupList)){ ?>
  318. <?php }else{ if(!$groupList || $vo['groupid'] == 0 || !isset($groupList[$vo['groupid']])){ ?>
  319. <?php }else{ ?>
  320. <span class="badge badge-primary"><?php echo htmlentities($groupList[$vo['groupid']]['name']); ?></span>
  321. <?php } }?>
  322. </td>
  323. <td class="text-center">
  324. <?php if(!is_array($tagList)){ ?>
  325. <?php }else{ $tagId = explode(',',$vo['tagid_list']);
  326. if(!$tagList || $vo['tagid_list'] == ''|| !$tagId){ ?>
  327. <?php }else{ foreach($tagId as $tag){ if(isset($tagList[$tag])){?>
  328. <span class="badge badge-info"><?php echo htmlentities($tagList[$tag]['name']); ?></span>
  329. <?php }} } }?>
  330. </td>
  331. <!-- <td class="text-center">-->
  332. <!-- <?php echo htmlentities(date("Y-m-d H:i:s",!is_numeric($vo['add_time'])? strtotime($vo['add_time']) : $vo['add_time'])); ?>-->
  333. <!-- </td>-->
  334. <td class="text-center">
  335. <div class="btn-group">
  336. <button data-toggle="dropdown" class="btn btn-warning btn-xs dropdown-toggle"
  337. aria-expanded="false">操作
  338. <span class="caret"></span>
  339. </button>
  340. <ul class="dropdown-menu">
  341. <?php if($vo['openid'] && $vo['subscribe'] == 1): ?>
  342. <li>
  343. <a class="save_mark" href="javascript:void(0);" onclick="$eb.createModalFrame('修改分组','<?php echo Url('edit_user_group',['openid'=>$vo['openid']]); ?>',{w:350,h:500})" >
  344. 修改分组
  345. </a>
  346. </li>
  347. <li>
  348. <a class="save_mark" href="javascript:void(0);" onclick="$eb.createModalFrame('修改标签','<?php echo Url('edit_user_tag',['openid'=>$vo['openid']]); ?>',{w:350,h:500})" >
  349. 修改标签
  350. </a>
  351. </li>
  352. <li>
  353. <a class="save_mark synchro" href="javascript:void(0);" data-url="<?php echo Url('synchro_tag',['openid'=>$vo['openid']]); ?>" >
  354. 同步标签
  355. </a>
  356. </li>
  357. <?php else: ?>
  358. <li>
  359. <a class="save_mark" href="javascript:void(0);">
  360. 无法操作
  361. </a>
  362. </li>
  363. <?php endif; ?>
  364. </ul>
  365. </div>
  366. </td>
  367. </tr>
  368. <?php endforeach; endif; else: echo "" ;endif; else: ?>
  369. <tr id="content" style="display:none;height:400px;"></tr>
  370. <?php endif; ?>
  371. </tbody>
  372. </table>
  373. </div>
  374. <link href="/system/frame/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
  375. <div class="row">
  376. <div class="col-sm-6">
  377. <div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">共 <?php echo htmlentities($total); ?> 项</div>
  378. </div>
  379. <div class="col-sm-6">
  380. <div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
  381. <?php echo $page;?>
  382. </div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. <script>
  390. window.$list = <?php echo json_encode($list);?>;
  391. window.$uidAll = <?php echo json_encode($uidAll);?>;
  392. window.$where = <?php echo json_encode($where);?>;
  393. $('.this-page').on('click',function () {
  394. $('input[name="coupon[]"]').each(function(){
  395. $(this).checked = true;
  396. $(this).parent().addClass('checked');
  397. $('#batch').val(1);
  398. });
  399. })
  400. $('.this-all').on('click',function () {
  401. $('input[name="coupon[]"]').each(function(){
  402. $(this).checked = true;
  403. $(this).parent().addClass('checked');
  404. $('#batch').val(2);
  405. });
  406. })
  407. $('.this-up').on('click',function () {
  408. $('input[name="coupon[]"]').each(function(){
  409. $(this).checked = false;
  410. $(this).parent().removeClass('checked');
  411. $('#batch').val('');
  412. });
  413. })
  414. $(function init() {
  415. $('.search-item>.btn').on('click', function () {
  416. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents();
  417. form.find('input[name="' + name + '"]').val(value);
  418. $('input[name=export]').val(0);
  419. form.submit();
  420. });
  421. $('.tag-item>.btn').on('click', function () {
  422. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = p.parents(),list = $('input[name="' + name + '"]').val().split(',');
  423. var bool = 0;
  424. $.each(list,function (index,item) {
  425. if(item == value){
  426. bool = 1
  427. list.splice(index,1);
  428. }
  429. })
  430. if(!bool) list.push(''+value+'');
  431. form.find('input[name="' + name + '"]').val(list.join(','));
  432. $('input[name=export]').val(0);
  433. form.submit();
  434. });
  435. $('.search-item>li').on('click', function () {
  436. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name'), form = $('#form');
  437. form.find('input[name="' + name + '"]').val(value);
  438. $('input[name=export]').val(0);
  439. form.submit();
  440. });
  441. $('.search-item>li').each(function () {
  442. var that = $(this), value = that.data('value'), p = that.parent(), name = p.data('name');
  443. if($where[name]) $('.'+name).css('color','#1ab394');
  444. });
  445. $('.search-item-value').each(function () {
  446. var that = $(this), name = that.attr('name'), value = that.val(), dom = $('.search-item[data-name="' + name + '"] .btn[data-value="' + value + '"]');
  447. dom.eq(0).removeClass('btn-outline btn-link').addClass('btn-primary btn-sm')
  448. .siblings().addClass('btn-outline btn-link').removeClass('btn-primary btn-sm')
  449. });
  450. $('.tag-item-value').each(function () {
  451. var that = $(this), name = that.attr('name'), value = that.val().split(',');
  452. dom = [];
  453. $.each(value,function (index,item) {
  454. dom.push($('.tag-item[data-name="' + name + '"] .btn[data-value="' + item + '"]'));
  455. })
  456. $.each(dom,function (index,item) {
  457. item.eq(0).removeClass('btn-outline btn-link tag').addClass('btn-primary btn-sm')
  458. })
  459. });
  460. })
  461. $('.i-checks').iCheck({
  462. checkboxClass: 'icheckbox_square-green',
  463. });
  464. $('.head_image').on('click',function (e) {
  465. var image = $(this).data('image');
  466. $eb.openImage(image);
  467. })
  468. var dateInput =$('.datepicker');
  469. dateInput.daterangepicker({
  470. autoUpdateInput: false,
  471. "opens": "center",
  472. "drops": "down",
  473. "ranges": {
  474. '今天': [moment(), moment().add(1, 'days')],
  475. '昨天': [moment().subtract(1, 'days'), moment()],
  476. '上周': [moment().subtract(6, 'days'), moment()],
  477. '前30天': [moment().subtract(29, 'days'), moment()],
  478. '本月': [moment().startOf('month'), moment().endOf('month')],
  479. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  480. },
  481. "locale" : {
  482. applyLabel : '确定',
  483. cancelLabel : '清空',
  484. fromLabel : '起始时间',
  485. toLabel : '结束时间',
  486. format : 'YYYY/MM/DD',
  487. customRangeLabel : '自定义',
  488. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  489. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  490. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  491. firstDay : 1
  492. }
  493. });
  494. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  495. $("#data").val('');
  496. });
  497. dateInput.on('apply.daterangepicker', function(ev, picker) {
  498. $("input[name=data]").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  499. $('input[name=export]').val(0);
  500. $('#form').submit();
  501. });
  502. //发优惠券
  503. $('.grant').on('click',function (e) {
  504. var chk_value =[];
  505. var batch = $('#batch').val();
  506. if(batch == 1){
  507. $.each($list.data,function (index,item) {
  508. chk_value.push(item.uid);
  509. })
  510. }else if(batch == 2){
  511. chk_value = $uidAll;
  512. }else{
  513. $('input[name="coupon[]"]:checked').each(function(){
  514. chk_value.push($(this).val());
  515. str += $(this).val();
  516. });
  517. if(chk_value.length < 1){
  518. $eb.message('请选择要发放优惠券的用户');
  519. return false;
  520. }
  521. }
  522. var str = chk_value.join(',');
  523. // var url = "http://"+window.location.host+"/admin/ump.store_coupon/grant/id/"+str;
  524. var url = "<?php echo Url('ump.store_coupon/grant'); ?>?id="+str;
  525. $eb.createModalFrame(this.innerText,url,{'w':800});
  526. })
  527. $('.news').on('click',function (e) {
  528. var chk_value =[];
  529. var batch = $('#batch').val();
  530. if(batch == 1){
  531. $.each($list.data,function (index,item) {
  532. chk_value.push(item.uid);
  533. })
  534. }else if(batch == 2){
  535. chk_value = $uidAll;
  536. }else{
  537. $('input[name="coupon[]"]:checked').each(function(){
  538. chk_value.push($(this).val());
  539. str += $(this).val();
  540. });
  541. if(chk_value.length < 1){
  542. $eb.message('请选择要发消息的用户');
  543. return false;
  544. }
  545. }
  546. var str = chk_value.join(',');
  547. var url = "<?php echo Url('wechat.wechat_news_category/send_news'); ?>?id="+str;
  548. $eb.createModalFrame(this.innerText,url,{'w':800});
  549. })
  550. $('.synchro').on('click',function(){
  551. window.t = $(this);
  552. var _this = $(this),url =_this.data('url');
  553. $eb.$swal('delete',function(){
  554. $eb.axios.get(url).then(function(res){
  555. console.log(res);
  556. if(res.status == 200 && res.data.code == 200) {
  557. $eb.$swal('success',res.data.msg);
  558. }else
  559. return Promise.reject(res.data.msg || '同步失败')
  560. }).catch(function(err){
  561. $eb.$swal('error',err);
  562. });
  563. },{'title':'您确定要同步该用户的标签吗?','text':'请谨慎操作!','confirm':'是的,我要同步'})
  564. });
  565. </script>
  566. </div>
  567. </body>
  568. </html>