integral_flow.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. tbody tr td{
  46. position: relative;
  47. }
  48. tbody tr .icow-weibiaoti--{
  49. visibility: hidden;
  50. display: inline-block;
  51. color: #fff;
  52. height:18px;
  53. width:18px;
  54. background: #e0e0e0;
  55. text-align: center;
  56. line-height: 18px;
  57. vertical-align: middle;
  58. }
  59. tbody tr:hover .icow-weibiaoti--{
  60. visibility: visible;
  61. }
  62. tbody tr .icow-weibiaoti--.hidden{
  63. visibility: hidden !important;
  64. }
  65. .full .icow-weibiaoti--{
  66. margin-left:10px;
  67. }
  68. .full>span{
  69. display: -webkit-box;
  70. display: -webkit-flex;
  71. display: -ms-flexbox;
  72. display: flex;
  73. vertical-align: middle;
  74. align-items: center;
  75. }
  76. tbody tr .label{
  77. margin: 5px 0;
  78. }
  79. .goods_attribute a{
  80. cursor: pointer;
  81. }
  82. .newgoodsflag{
  83. width: 22px;height: 16px;
  84. background-color: #ff0000;
  85. color: #fff;
  86. text-align: center;
  87. position: absolute;
  88. bottom: 70px;
  89. left: 57px;
  90. font-size: 12px;
  91. }
  92. .a{cursor: pointer;}
  93. .img-40 {
  94. width: 40px;
  95. height: 40px;
  96. }
  97. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect{
  98. width:auto!important;
  99. }
  100. </style>
  101. </head>
  102. <body layadmin-themealias="default">
  103. <table id="demo" lay-filter="test"></table>
  104. <div class="layui-fluid">
  105. <div class="layui-card">
  106. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">积分流水列表</span></div>
  107. <div class="layui-card-body" style="padding:15px;">
  108. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  109. <input type="hidden" name="c" value="user" />
  110. <input type="hidden" name="a" value="recharge_flow" />
  111. </form>
  112. <form action="" class="layui-form" lay-filter="example" method="post" >
  113. <div class="row">
  114. <div class="col-md-12">
  115. <div class="page-table-header">
  116. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  117. </div>
  118. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  119. <thead>
  120. <tr>
  121. <th style="width:25px;"></th>
  122. <th style="width:60px;">ID</th>
  123. <th style="width: 250px;">交易类型</th>
  124. <th style="">订单号</th>
  125. <th style="">积分</th>
  126. <th >所剩积分</th>
  127. <th >备注</th>
  128. <th style="">操作时间</th>
  129. </tr>
  130. </thead>
  131. <tbody>
  132. <?php foreach($list as $row){ ?>
  133. <tr>
  134. <td style="position: relative; ">
  135. <input type='checkbox' lay-skin="primary" value="{$row['id']}" class="checkone"/>
  136. </td>
  137. <td>
  138. {$row['id']}
  139. </td>
  140. <td>
  141. <?php
  142. if( $row['type'] == 'goodsbuy' ){
  143. ?>
  144. <span class="line-text">购买商品赠送积分</span>
  145. <?php }else if( $row['type'] == 'refundorder' ){ ?>
  146. 购买商品赠送积分
  147. <?php }else if( $row['type'] == 'system_add' ){ ?>
  148. <span class="line-text">后台增加积分</span>
  149. <?php }else if( $row['type'] == 'system_del' ){ ?>
  150. <span class="line-text">后台减少积分</span>
  151. <?php }else if( $row['type'] == 'integral_exchange' ){ ?>
  152. <span class="line-text">积分兑换商品</span>
  153. <?php }else if( $row['type'] == 'signin_send' ){ ?>
  154. <span class="line-text">签到送积分</span>
  155. <?php }else if( $row['type'] == 'orderbuy' ){ ?>
  156. 下单扣除积分
  157. <?php }else if( $row['type'] == 'goodscomment' ){ ?>
  158. <span class="line-text">好评赠送积分</span>
  159. <?php }else if( $row['type'] == 'invitegift' ){ ?>
  160. <span class="line-text">邀新有礼</span>
  161. <?php }else if( $row['type'] == 'invitegift_new' ){ ?>
  162. <span class="line-text">邀新有礼</span>
  163. <?php }else if( $row['type'] == 'pintuan_rebate' ){ ?>
  164. <span class="line-text">拼团返利</span>
  165. <?php } ?>
  166. </td>
  167. <td>
  168. {$row['order_id']}
  169. </td>
  170. <td>
  171. <?php
  172. if( $row['in_out'] == 'in' ){
  173. ?>
  174. <span class="line-text">+{$row['score']}</span>
  175. <?php }else if( $row['in_out'] == 'out' ){ ?>
  176. -{$row['score']}
  177. <?php } ?>
  178. </td>
  179. <td>
  180. {$row['after_operate_score']}
  181. </td>
  182. <td>
  183. {$row['remark']}
  184. </td>
  185. <td>{:date("Y-m-d",$row['addtime'])}<br/>{:date("H:i:s",$row['addtime'])}</td>
  186. <td style="overflow:visible;text-align: center;">
  187. <div class="btn-group">
  188. </div>
  189. </td>
  190. </tr>
  191. <?php } ?>
  192. </tbody>
  193. <tfoot>
  194. <tr>
  195. <td colspan="3">
  196. </td>
  197. <td colspan="5" style="text-align: right">
  198. {$pager}
  199. </td>
  200. </tr>
  201. </tfoot>
  202. </table>
  203. </div>
  204. </div>
  205. </form>
  206. </div>
  207. </div>
  208. </div>
  209. <script src="/layuiadmin/layui/layui.js"></script>
  210. <script>
  211. layui.config({
  212. base: '/layuiadmin/' //静态资源所在路径
  213. }).extend({
  214. index: 'lib/index' //主入口模块
  215. }).use('index');
  216. </script>
  217. <script>
  218. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  219. var layer = layui.layer;
  220. var $;
  221. layui.use(['jquery', 'layer','form'], function(){
  222. $ = layui.$;
  223. var form = layui.form;
  224. $('.deldom').click(function(){
  225. var s_url = $(this).attr('data-href');
  226. layer.confirm($(this).attr('data-confirm'), function(index){
  227. $.ajax({
  228. url:s_url,
  229. type:'post',
  230. dataType:'json',
  231. success:function(info){
  232. if(info.status == 0)
  233. {
  234. layer.msg(info.result.message,{icon: 1,time: 2000});
  235. }else if(info.status == 1){
  236. var go_url = location.href;
  237. if( info.result.hasOwnProperty("url") )
  238. {
  239. go_url = info.result.url;
  240. }
  241. layer.msg('操作成功',{time: 1000,
  242. end:function(){
  243. location.href = info.result.url;
  244. }
  245. });
  246. }
  247. }
  248. })
  249. });
  250. })
  251. $('.btn-operation').click(function(){
  252. var ids_arr = [];
  253. var obj = $(this);
  254. var s_toggle = $(this).attr('data-toggle');
  255. var s_url = $(this).attr('data-href');
  256. $("input[name=item_checkbox]").each(function() {
  257. if( $(this).prop('checked') )
  258. {
  259. ids_arr.push( $(this).val() );
  260. }
  261. })
  262. if(ids_arr.length < 1)
  263. {
  264. layer.msg('请选择要操作的内容');
  265. }else{
  266. var can_sub = true;
  267. if( s_toggle == 'batch-remove' )
  268. {
  269. can_sub = false;
  270. layer.confirm($(obj).attr('data-confirm'), function(index){
  271. $.ajax({
  272. url:s_url,
  273. type:'post',
  274. dataType:'json',
  275. data:{ids:ids_arr},
  276. success:function(info){
  277. if(info.status == 0)
  278. {
  279. layer.msg(info.result.message,{icon: 1,time: 2000});
  280. }else if(info.status == 1){
  281. var go_url = location.href;
  282. if( info.result.hasOwnProperty("url") )
  283. {
  284. go_url = info.result.url;
  285. }
  286. layer.msg('操作成功',{time: 1000,
  287. end:function(){
  288. location.href = info.result.url;
  289. }
  290. });
  291. }
  292. }
  293. })
  294. });
  295. }else{
  296. $.ajax({
  297. url:s_url,
  298. type:'post',
  299. dataType:'json',
  300. data:{ids:ids_arr},
  301. success:function(info){
  302. if(info.status == 0)
  303. {
  304. layer.msg(info.result.message,{icon: 1,time: 2000});
  305. }else if(info.status == 1){
  306. var go_url = location.href;
  307. if( info.result.hasOwnProperty("url") )
  308. {
  309. go_url = info.result.url;
  310. }
  311. layer.msg('操作成功',{time: 1000,
  312. end:function(){
  313. location.href = info.result.url;
  314. }
  315. });
  316. }
  317. }
  318. })
  319. }
  320. }
  321. })
  322. form.on('switch(restwsitch)', function(data){
  323. var s_url = $(this).attr('data-href')
  324. var rest = 1;
  325. if(data.elem.checked)
  326. {
  327. rest = 1;
  328. }else{
  329. rest = 0;
  330. }
  331. $.ajax({
  332. url:s_url,
  333. type:'post',
  334. dataType:'json',
  335. data:{rest:rest},
  336. success:function(info){
  337. if(info.status == 0)
  338. {
  339. layer.msg(info.result.message,{icon: 1,time: 2000});
  340. }else if(info.status == 1){
  341. var go_url = location.href;
  342. if( info.result.hasOwnProperty("url") )
  343. {
  344. go_url = info.result.url;
  345. }
  346. layer.msg('操作成功',{time: 1000,
  347. end:function(){
  348. location.href = info.result.url;
  349. }
  350. });
  351. }
  352. }
  353. })
  354. });
  355. form.on('switch(enablewsitch)', function(data){
  356. var s_url = $(this).attr('data-href')
  357. var enable = 1;
  358. if(data.elem.checked)
  359. {
  360. enable = 1;
  361. }else{
  362. enable = 0;
  363. }
  364. $.ajax({
  365. url:s_url,
  366. type:'post',
  367. dataType:'json',
  368. data:{enable:enable},
  369. success:function(info){
  370. if(info.status == 0)
  371. {
  372. layer.msg(info.result.message,{icon: 1,time: 2000});
  373. }else if(info.status == 1){
  374. var go_url = location.href;
  375. if( info.result.hasOwnProperty("url") )
  376. {
  377. go_url = info.result.url;
  378. }
  379. layer.msg('操作成功',{time: 1000,
  380. end:function(){
  381. location.href = info.result.url;
  382. }
  383. });
  384. }
  385. }
  386. })
  387. });
  388. form.on('switch(statewsitch)', function(data){
  389. var s_url = $(this).attr('data-href')
  390. var state = 1;
  391. if(data.elem.checked)
  392. {
  393. state = 1;
  394. }else{
  395. state = 0;
  396. }
  397. $.ajax({
  398. url:s_url,
  399. type:'post',
  400. dataType:'json',
  401. data:{state:state},
  402. success:function(info){
  403. if(info.status == 0)
  404. {
  405. layer.msg(info.result.message,{icon: 1,time: 2000});
  406. }else if(info.status == 1){
  407. var go_url = location.href;
  408. if( info.result.hasOwnProperty("url") )
  409. {
  410. go_url = info.result.url;
  411. }
  412. layer.msg('操作成功',{time: 1000,
  413. end:function(){
  414. location.href = info.result.url;
  415. }
  416. });
  417. }
  418. }
  419. })
  420. });
  421. form.on('checkbox(checkboxall)', function(data){
  422. if(data.elem.checked)
  423. {
  424. $("input[name=item_checkbox]").each(function() {
  425. $(this).prop("checked", true);
  426. });
  427. $("input[name=checkall]").each(function() {
  428. $(this).prop("checked", true);
  429. });
  430. }else{
  431. $("input[name=item_checkbox]").each(function() {
  432. $(this).prop("checked", false);
  433. });
  434. $("input[name=checkall]").each(function() {
  435. $(this).prop("checked", false);
  436. });
  437. }
  438. form.render('checkbox');
  439. });
  440. //监听提交
  441. form.on('submit(formDemo)', function(data){
  442. $.ajax({
  443. url: data.form.action,
  444. type: data.form.method,
  445. data: data.field,
  446. dataType:'json',
  447. success: function (info) {
  448. if(info.status == 0)
  449. {
  450. layer.msg(info.result.message,{icon: 1,time: 2000});
  451. }else if(info.status == 1){
  452. var go_url = location.href;
  453. if( info.result.hasOwnProperty("url") )
  454. {
  455. go_url = info.result.url;
  456. }
  457. layer.msg('操作成功',{time: 1000,
  458. end:function(){
  459. location.href = info.result.url;
  460. }
  461. });
  462. }
  463. }
  464. });
  465. return false;
  466. });
  467. })
  468. </script>
  469. <div id="modal-change" class="modal fade form-horizontal" tabindex="-1">
  470. <div class="modal-dialog">
  471. <div class="modal-content">
  472. <div class="modal-header">
  473. <button data-dismiss="modal" class="close" type="button">×</button>
  474. <h4 class="modal-title">{if !empty($group['id'])}编辑{else}添加{/if}标签组</h4>
  475. </div>
  476. <div class="modal-body">
  477. <div class="form-group batch-level" style="display: none;">
  478. <label class="col-sm-2 control-label must">团长等级</label>
  479. <div class="col-sm-9 col-xs-12">
  480. <select name="batch-level" class="form-control">
  481. <option value="0">普通等级</option>
  482. {loop $level_list $level}
  483. <option value="{$level['id']}">{$level['levelname']}</option>
  484. {/loop}
  485. </select>
  486. </div>
  487. </div>
  488. <div class="form-group batch-group" style="display: none;">
  489. <label class="col-sm-2 control-label must">会员分组</label>
  490. <div class="col-sm-9 col-xs-12">
  491. <select name="batch-group[]" class="form-control " placeholder="会员会被加入指定的分组中">
  492. <option value="0">默认分组</option>
  493. {loop $group_list $group}
  494. <option value="{$group['id']}">{$group['groupname']}</option>
  495. {/loop}
  496. </select>
  497. </div>
  498. </div>
  499. </div>
  500. <div class="modal-footer">
  501. <button class="btn btn-primary" type="submit" id="modal-change-btn">提交</button>
  502. <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
  503. </div>
  504. </div>
  505. </div>
  506. </div>
  507. <script language="javascript">
  508. var modify_url = '';
  509. $("[data-toggle='batch-group'], [data-toggle='batch-level']").click(function () {
  510. var toggle = $(this).data('toggle');
  511. modify_url = $(this).attr('data-href');
  512. $("#modal-change .modal-title").text(toggle=='batch-group'?"批量修改分组":"批量修改会员等级");
  513. $("#modal-change").find("."+toggle).show().siblings().hide();
  514. $("#modal-change-btn").attr('data-toggle', toggle=='batch-group'?'group':'level');
  515. $("#modal-change").modal();
  516. });
  517. $("#modal-change-btn").click(function () {
  518. var _this = $(this);
  519. if(_this.attr('stop')){
  520. return;
  521. }
  522. var toggle = $(this).data('toggle');
  523. var ids = [];
  524. $(".checkone").each(function () {
  525. var checked = $(this).is(":checked");
  526. var id = $(this).val();
  527. if(checked && id){
  528. ids.push(id);
  529. }
  530. });
  531. if(ids.length<1){
  532. alert("请选择要批量操作的团长");
  533. return;
  534. }
  535. var option = $("#modal-change .batch-"+toggle+" option:selected");
  536. level = '';
  537. if (toggle=='group'){
  538. for(i=0;i<option.length;i++){
  539. if (level == ''){
  540. level += $(option[i]).val();
  541. }else{
  542. level += ','+$(option[i]).val();
  543. }
  544. }
  545. }else{
  546. var level = option.val();
  547. }
  548. var levelname = option.text();
  549. console.log(modify_url);
  550. if( confirm("确定要将选中会员移动到 "+levelname+" 吗?") )
  551. {
  552. console.log(modify_url);
  553. $.ajax({
  554. url:modify_url,
  555. type:"post",
  556. dataType:'json',
  557. data:{
  558. level: level,
  559. ids: ids,
  560. toggle: toggle
  561. },
  562. success:function(ret){
  563. $("#modal-change").modal('hide');
  564. if(ret.status==1){
  565. alert("操作成功");
  566. setTimeout(function () {
  567. location.reload();
  568. },1000);
  569. }else{
  570. alert(ret.result.message);
  571. }
  572. }
  573. })
  574. }
  575. });
  576. </script>
  577. </body>