create.php 7.8 KB

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