user_create.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. {include file="public/frame_head"}
  2. <link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
  3. <script src="{__PLUG_PATH}moment.js"></script>
  4. <link rel="stylesheet" href="{__PLUG_PATH}daterangepicker/daterangepicker.css">
  5. <script src="{__PLUG_PATH}daterangepicker/daterangepicker.js"></script>
  6. <script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
  7. <style type="text/css">
  8. .form-inline .input-group{display: inline-table;vertical-align: middle;}
  9. .form-inline .input-group .input-group-btn{width: auto;}
  10. .form-add{position: fixed;left: 0;bottom: 0;width:100%;}
  11. .form-add .sub-btn{border-radius: 0;width: 49.5%;padding: 6px 0;font-size: 14px;outline: none;border: none;color: #fff;background-color: #2d8cf0;}
  12. .form-add .sub-btn:nth-child(1){float: left;}
  13. .form-add .sub-btn:nth-child(2){float: right;}
  14. </style>
  15. <div class="row">
  16. <div class="col-sm-12">
  17. <div class="ibox">
  18. <div class="ibox-content">
  19. <div class="row">
  20. <div class="m-b m-l">
  21. <form class="form-inline search" id="form" method="get">
  22. <div class="input-group datepicker">
  23. <input style="width: 200px;" type="text" id="data" class="input-sm form-control" name="data" value="{$where.data}" placeholder="请选择日期" >
  24. </div>
  25. <div class="input-group">
  26. <input style="width: 200px;" type="text" name="nickname" value="{$where.nickname}" placeholder="请输入微信用户名称" class="input-sm form-control"> <span class="input-group-btn">
  27. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search"></i>搜索</button> </span>
  28. </div>
  29. </form>
  30. </div>
  31. </div>
  32. <div class="table-responsive">
  33. <table class="table table-striped table-bordered">
  34. <thead>
  35. <tr>
  36. <th class="text-center"></th>
  37. <th class="text-center">编号</th>
  38. <th class="text-center">微信用户名称</th>
  39. <th class="text-center">头像</th>
  40. <th class="text-center">性别</th>
  41. <th class="text-center">地区</th>
  42. <th class="text-center">是否关注公众号</th>
  43. <th class="text-center">首次关注时间</th>
  44. </tr>
  45. </thead>
  46. <tbody class="">
  47. <form method="post" class="sub-save">
  48. {volist name="list" id="vo"}
  49. <tr>
  50. <td class="text-center">
  51. <label class="checkbox-inline i-checks">
  52. <input type="checkbox" name="ids[]" value="{$vo.uid}">
  53. </label>
  54. </td>
  55. <td class="text-center">
  56. {$vo.uid}
  57. </td>
  58. <td class="text-center">
  59. {$vo.nickname}
  60. </td>
  61. <td class="text-center">
  62. <img src="{$vo.headimgurl}" alt="{$vo.nickname}" title="{$vo.nickname}" style="width:50px;height: 50px;cursor: pointer;" class="head_image" data-image="{$vo.headimgurl}">
  63. </td>
  64. <td class="text-center">
  65. {if condition="$vo['sex'] eq 1"}
  66. {elseif condition="$vo['sex'] eq 2"/}
  67. {else/}
  68. 保密
  69. {/if}
  70. </td>
  71. <td class="text-center">
  72. {$vo.country}{$vo.province}{$vo.city}
  73. </td>
  74. <td class="text-center">
  75. {if condition="$vo['subscribe']"}
  76. 关注
  77. {else/}
  78. 取消
  79. {/if}
  80. </td>
  81. <td class="text-center">
  82. {$vo.add_time|date="Y-m-d H:i:s"}
  83. </td>
  84. </tr>
  85. {/volist}
  86. </form>
  87. </tbody>
  88. </table>
  89. </div>
  90. {include file="public/inner_page"}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="form-add">
  96. <button type="submit" class="sub-btn">提交选中</button>
  97. <button type="submit" class="sub-btn" sub-type="all">提交全部</button>
  98. </div>
  99. <script>
  100. $('.i-checks').iCheck({
  101. checkboxClass: 'icheckbox_square-green',
  102. });
  103. $('.head_image').on('click',function (e) {
  104. var image = $(this).data('image');
  105. $eb.openImage(image);
  106. })
  107. var dateInput =$('.datepicker');
  108. dateInput.daterangepicker({
  109. autoUpdateInput: false,
  110. "opens": "center",
  111. "drops": "down",
  112. "ranges": {
  113. '今天': [moment(), moment().add(1, 'days')],
  114. '昨天': [moment().subtract(1, 'days'), moment()],
  115. '上周': [moment().subtract(6, 'days'), moment()],
  116. '前30天': [moment().subtract(29, 'days'), moment()],
  117. '本月': [moment().startOf('month'), moment().endOf('month')],
  118. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  119. },
  120. "locale" : {
  121. applyLabel : '确定',
  122. cancelLabel : '清空',
  123. fromLabel : '起始时间',
  124. toLabel : '结束时间',
  125. format : 'YYYY/MM/DD',
  126. customRangeLabel : '自定义',
  127. daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
  128. monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',
  129. '七月', '八月', '九月', '十月', '十一月', '十二月' ],
  130. firstDay : 1
  131. }
  132. });
  133. dateInput.on('cancel.daterangepicker', function(ev, picker) {
  134. $("#data").val('');
  135. });
  136. dateInput.on('apply.daterangepicker', function(ev, picker) {
  137. $("#data").val(picker.startDate.format('YYYY/MM/DD') + ' - ' + picker.endDate.format('YYYY/MM/DD'));
  138. });
  139. $(".sub-btn").on("click",function(){
  140. var formData = {checked_menus:[]};
  141. $("input[name='ids[]']:checked").each(function(){
  142. formData.checked_menus.push($(this).val());
  143. });
  144. if($(this).attr("sub-type") == "all"){
  145. formData.search = {};
  146. formData.search.data = "{$where.data}";
  147. formData.search.nickname = "{$where.nickname}";
  148. }
  149. $eb.axios.post("{$save}",formData).then((res)=>{
  150. if(res.status && res.data.code == 200)
  151. return Promise.resolve(res.data);
  152. else
  153. return Promise.reject(res.data.msg || '添加失败,请稍候再试!');
  154. }).then((res)=>{
  155. $eb.message('success',res.msg || '操作成功!');
  156. $eb.closeModalFrame(window.name);
  157. }).catch((err)=>{
  158. this.loading=false;
  159. $eb.message('error',err);
  160. });
  161. })
  162. </script>
  163. {include file="public/inner_footer"}