communityorder.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  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="communityhead" />
  110. <input type="hidden" name="a" value="communityorder" />
  111. <input type="hidden" name="head_id" value="{$head_id}" />
  112. <div class="layui-form-item">
  113. <div class="layui-inline">
  114. <span class="layui-input-inline">
  115. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  116. <option value=''>不按时间</option>
  117. <option value='create_time' {if $_GPC['searchtime']=='create_time'}selected{/if}>支付时间</option>
  118. </select>
  119. </span>
  120. <span class="layui-input-inline" style="width: 285px;">
  121. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  122. </span>
  123. <div class="layui-input-inline" >
  124. <select name='order_status' class='layui-input layui-unselect' style="width:80px;" >
  125. <option value=''>状态</option>
  126. <option value='0' {if $_GPC['order_status']=='0'}selected{/if}>待结算</option>
  127. <option value='1' {if $_GPC['order_status']=='1'}selected{/if}>已结算</option>
  128. <option value='2' {if $_GPC['order_status']=='2'}selected{/if}>订单取消/退款</option>
  129. </select>
  130. </div>
  131. <div class="layui-input-inline">
  132. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  133. <button type="submit" name="export" value="1" class="btn btn-success ">导出</button>
  134. </div>
  135. </div>
  136. </div>
  137. </form>
  138. <form action="" class="layui-form" lay-filter="example" method="post" >
  139. <div class="row">
  140. <div class="col-md-12">
  141. <div class="page-table-header">
  142. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  143. </div>
  144. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  145. <thead>
  146. <tr>
  147. <th style="width:25px;"></th>
  148. <th style="width:160px;">订单编号</th>
  149. <th style="">商品标题</th>
  150. <th style="">订单金额</th>
  151. <th style="">佣金类型</th>
  152. <th style='width:150px;'>佣金金额</th>
  153. <th style='width:150px;'>状态</th>
  154. <th style='width:200px;'>下单时间</th>
  155. <th style="text-align: center;">操作</th>
  156. </tr>
  157. </thead>
  158. <tbody>
  159. <?php foreach($list as $row){ ?>
  160. <tr>
  161. <td style="position: relative; ">
  162. <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$row['order_id']}"/>
  163. </td>
  164. <td>
  165. {$row['order_num_alias']}
  166. </td>
  167. <td>
  168. {$row['name']}
  169. </td>
  170. <td>
  171. <?php if(!empty($row['order_id'])){ ?>
  172. {$row['total']}
  173. <?php } ?>
  174. </td>
  175. <td>
  176. <?php if( $row['type'] == 'orderbuy' ){ ?>
  177. 会员下单佣金
  178. <?php }else if( $row['type'] == 'commiss' ){ ?>
  179. 团长分销佣金
  180. <?php }else if( $row['type'] == 'tuijian' ){ ?>
  181. 推荐团长现金奖励
  182. <?php } ?>
  183. </td>
  184. <td>
  185. {$row['money']}
  186. </td>
  187. <td>
  188. <?php if( $row['state'] == 0 ){ ?>
  189. <?php if( $row['is_refund_state'] == 0 ){ ?>
  190. <span class="layui-badge layui-bg-green">待结算</span>
  191. <?php }else{ ?>
  192. <span class="layui-badge layui-bg-gray">已失效</span>
  193. <?php } ?>
  194. <?php }else if( $row['state'] == 1 ){ ?>
  195. <span class="layui-badge layui-bg-blue">已结算</span>
  196. <?php }else if( $row['state'] == 2 ){ ?>
  197. <span class="layui-badge layui-bg-gray">订单取消或退款</span>
  198. <?php } ?>
  199. </td>
  200. <td>
  201. {$row['addtime']}
  202. </td>
  203. <td style="overflow:visible;text-align: center;">
  204. <div class="btn-group">
  205. <?php if(!empty($row['order_id'])){ ?>
  206. <a class="layui-btn layui-btn-xs" href="{:U('order/detail',array('id' => $row['order_id']));}" target='_blank'>
  207. 查看订单详情
  208. </a>
  209. <?php } ?>
  210. </div>
  211. </td>
  212. </tr>
  213. <?php } ?>
  214. </tbody>
  215. <tfoot>
  216. <tr>
  217. <td colspan="2">
  218. <div class="page-table-header">
  219. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  220. </div>
  221. </td>
  222. <td colspan="6" style="text-align: right">
  223. {$pager}
  224. </td>
  225. </tr>
  226. </tfoot>
  227. </table>
  228. </div>
  229. </div>
  230. </form>
  231. </div>
  232. </div>
  233. </div>
  234. <script src="/layuiadmin/layui/layui.js"></script>
  235. <script>
  236. layui.config({
  237. base: '/layuiadmin/' //静态资源所在路径
  238. }).extend({
  239. index: 'lib/index' //主入口模块
  240. }).use('index');
  241. </script>
  242. <script>
  243. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  244. var layer = layui.layer;
  245. var $;
  246. layui.use(['jquery', 'layer','form'], function(){
  247. $ = layui.$;
  248. var form = layui.form;
  249. $('.deldom').click(function(){
  250. var s_url = $(this).attr('data-href');
  251. layer.confirm($(this).attr('data-confirm'), function(index){
  252. $.ajax({
  253. url:s_url,
  254. type:'post',
  255. dataType:'json',
  256. success:function(info){
  257. if(info.status == 0)
  258. {
  259. layer.msg(info.result.message,{icon: 1,time: 2000});
  260. }else if(info.status == 1){
  261. var go_url = location.href;
  262. if( info.result.hasOwnProperty("url") )
  263. {
  264. go_url = info.result.url;
  265. }
  266. layer.msg('操作成功',{time: 1000,
  267. end:function(){
  268. location.href = info.result.url;
  269. }
  270. });
  271. }
  272. }
  273. })
  274. });
  275. })
  276. $('.btn-operation').click(function(){
  277. var ids_arr = [];
  278. var obj = $(this);
  279. var s_toggle = $(this).attr('data-toggle');
  280. var s_url = $(this).attr('data-href');
  281. $("input[name=item_checkbox]").each(function() {
  282. if( $(this).prop('checked') )
  283. {
  284. ids_arr.push( $(this).val() );
  285. }
  286. })
  287. if(ids_arr.length < 1)
  288. {
  289. layer.msg('请选择要操作的内容');
  290. }else{
  291. var can_sub = true;
  292. if( s_toggle == 'batch-remove' )
  293. {
  294. can_sub = false;
  295. layer.confirm($(obj).attr('data-confirm'), function(index){
  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. }else{
  321. $.ajax({
  322. url:s_url,
  323. type:'post',
  324. dataType:'json',
  325. data:{ids:ids_arr},
  326. success:function(info){
  327. if(info.status == 0)
  328. {
  329. layer.msg(info.result.message,{icon: 1,time: 2000});
  330. }else if(info.status == 1){
  331. var go_url = location.href;
  332. if( info.result.hasOwnProperty("url") )
  333. {
  334. go_url = info.result.url;
  335. }
  336. layer.msg('操作成功',{time: 1000,
  337. end:function(){
  338. location.href = info.result.url;
  339. }
  340. });
  341. }
  342. }
  343. })
  344. }
  345. }
  346. })
  347. form.on('switch(restwsitch)', function(data){
  348. var s_url = $(this).attr('data-href')
  349. var rest = 1;
  350. if(data.elem.checked)
  351. {
  352. rest = 1;
  353. }else{
  354. rest = 0;
  355. }
  356. $.ajax({
  357. url:s_url,
  358. type:'post',
  359. dataType:'json',
  360. data:{rest:rest},
  361. success:function(info){
  362. if(info.status == 0)
  363. {
  364. layer.msg(info.result.message,{icon: 1,time: 2000});
  365. }else if(info.status == 1){
  366. var go_url = location.href;
  367. if( info.result.hasOwnProperty("url") )
  368. {
  369. go_url = info.result.url;
  370. }
  371. layer.msg('操作成功',{time: 1000,
  372. end:function(){
  373. location.href = info.result.url;
  374. }
  375. });
  376. }
  377. }
  378. })
  379. });
  380. form.on('switch(enablewsitch)', function(data){
  381. var s_url = $(this).attr('data-href')
  382. var enable = 1;
  383. if(data.elem.checked)
  384. {
  385. enable = 1;
  386. }else{
  387. enable = 0;
  388. }
  389. $.ajax({
  390. url:s_url,
  391. type:'post',
  392. dataType:'json',
  393. data:{enable:enable},
  394. success:function(info){
  395. if(info.status == 0)
  396. {
  397. layer.msg(info.result.message,{icon: 1,time: 2000});
  398. }else if(info.status == 1){
  399. var go_url = location.href;
  400. if( info.result.hasOwnProperty("url") )
  401. {
  402. go_url = info.result.url;
  403. }
  404. layer.msg('操作成功',{time: 1000,
  405. end:function(){
  406. location.href = info.result.url;
  407. }
  408. });
  409. }
  410. }
  411. })
  412. });
  413. form.on('switch(statewsitch)', function(data){
  414. var s_url = $(this).attr('data-href')
  415. var state = 1;
  416. if(data.elem.checked)
  417. {
  418. state = 1;
  419. }else{
  420. state = 0;
  421. }
  422. $.ajax({
  423. url:s_url,
  424. type:'post',
  425. dataType:'json',
  426. data:{state:state},
  427. success:function(info){
  428. if(info.status == 0)
  429. {
  430. layer.msg(info.result.message,{icon: 1,time: 2000});
  431. }else if(info.status == 1){
  432. var go_url = location.href;
  433. if( info.result.hasOwnProperty("url") )
  434. {
  435. go_url = info.result.url;
  436. }
  437. layer.msg('操作成功',{time: 1000,
  438. end:function(){
  439. location.href = info.result.url;
  440. }
  441. });
  442. }
  443. }
  444. })
  445. });
  446. form.on('checkbox(checkboxall)', function(data){
  447. if(data.elem.checked)
  448. {
  449. $("input[name=item_checkbox]").each(function() {
  450. $(this).prop("checked", true);
  451. });
  452. $("input[name=checkall]").each(function() {
  453. $(this).prop("checked", true);
  454. });
  455. }else{
  456. $("input[name=item_checkbox]").each(function() {
  457. $(this).prop("checked", false);
  458. });
  459. $("input[name=checkall]").each(function() {
  460. $(this).prop("checked", false);
  461. });
  462. }
  463. form.render('checkbox');
  464. });
  465. //监听提交
  466. form.on('submit(formDemo)', function(data){
  467. $.ajax({
  468. url: data.form.action,
  469. type: data.form.method,
  470. data: data.field,
  471. dataType:'json',
  472. success: function (info) {
  473. if(info.status == 0)
  474. {
  475. layer.msg(info.result.message,{icon: 1,time: 2000});
  476. }else if(info.status == 1){
  477. var go_url = location.href;
  478. if( info.result.hasOwnProperty("url") )
  479. {
  480. go_url = info.result.url;
  481. }
  482. layer.msg('操作成功',{time: 1000,
  483. end:function(){
  484. location.href = info.result.url;
  485. }
  486. });
  487. }
  488. }
  489. });
  490. return false;
  491. });
  492. })
  493. </script>
  494. <div id="modal-change" class="modal fade form-horizontal" tabindex="-1">
  495. <div class="modal-dialog">
  496. <div class="modal-content">
  497. <div class="modal-header">
  498. <button data-dismiss="modal" class="close" type="button">×</button>
  499. <h4 class="modal-title"><?php if( !empty($group['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>标签组</h4>
  500. </div>
  501. <div class="modal-body">
  502. <div class="form-group batch-level" style="display: none;">
  503. <label class="col-sm-2 control-label must">团长等级</label>
  504. <div class="col-sm-9 col-xs-12">
  505. <select name="batch-level" class="form-control">
  506. <?php foreach( $community_head_level as $level ){ ?>
  507. <option value="{$level['id']}">{$level['levelname']}</option>
  508. <?php } ?>
  509. </select>
  510. </div>
  511. </div>
  512. <div class="form-group batch-group" style="display: none;">
  513. <label class="col-sm-2 control-label must">团长分组</label>
  514. <div class="col-sm-9 col-xs-12">
  515. <select name="batch-group[]" class="form-control select2" placeholder="会员会被加入指定的分组中" style="position:absolute;">
  516. <option value="0">默认分组</option>
  517. <?php foreach( $group_list as $group ){ ?>
  518. <option value="{$group['id']}">{$group['groupname']}</option>
  519. <?php } ?>
  520. </select>
  521. </div>
  522. </div>
  523. </div>
  524. <div class="modal-footer">
  525. <button class="btn btn-primary" type="submit" id="modal-change-btn">提交</button>
  526. <button data-dismiss="modal" class="btn btn-default" type="button">取消</button>
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. <script language="javascript">
  532. $("[data-toggle='batch-group'], [data-toggle='batch-level']").click(function () {
  533. var toggle = $(this).data('toggle');
  534. $("#modal-change .modal-title").text(toggle=='batch-group'?"批量修改分组":"批量修改会员等级");
  535. $("#modal-change").find("."+toggle).show().siblings().hide();
  536. $("#modal-change-btn").attr('data-toggle', toggle=='batch-group'?'group':'level');
  537. $("#modal-change").modal();
  538. });
  539. $("#modal-change-btn").click(function () {
  540. var _this = $(this);
  541. if(_this.attr('stop')){
  542. return;
  543. }
  544. var toggle = $(this).data('toggle');
  545. var ids = [];
  546. $(".checkone").each(function () {
  547. var checked = $(this).is(":checked");
  548. var id = $(this).val();
  549. if(checked && id){
  550. ids.push(id);
  551. }
  552. });
  553. if(ids.length<1){
  554. alert("请选择要批量操作的团长");
  555. return;
  556. }
  557. var option = $("#modal-change .batch-"+toggle+" option:selected");
  558. level = '';
  559. if (toggle=='group'){
  560. for(i=0;i<option.length;i++){
  561. if (level == ''){
  562. level += $(option[i]).val();
  563. }else{
  564. level += ','+$(option[i]).val();
  565. }
  566. }
  567. }else{
  568. var level = option.val();
  569. }
  570. var levelname = option.text();
  571. if( confirm("确定要将选中团长移动到 "+levelname+" 吗?") )
  572. {
  573. _this.attr('stop', 1).text("操作中...");
  574. $.ajax({
  575. url:"{:U('communityhead/changelevel')}",
  576. type:"post",
  577. dataType:'json',
  578. data:{
  579. level: level,
  580. ids: ids,
  581. toggle: toggle
  582. },
  583. success:function(ret){
  584. $("#modal-change").modal('hide');
  585. if(ret.status==1){
  586. alert("操作成功");
  587. setTimeout(function () {
  588. location.reload();
  589. },1000);
  590. }else{
  591. alert(ret.result.message);
  592. }
  593. }
  594. })
  595. }
  596. });
  597. </script>
  598. </body>