communityorder.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. .img-40{width:40px;height:40px;}
  46. </style>
  47. </head>
  48. <body layadmin-themealias="default">
  49. <table id="demo" lay-filter="test"></table>
  50. <div class="layui-fluid">
  51. <div class="layui-card">
  52. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">收益明细</span></div>
  53. <div class="layui-card-body" style="padding:15px;">
  54. <form action="" method="get" class="form-horizontal form-search layui-form" role="form">
  55. <input type="hidden" name="c" value="distribution" />
  56. <input type="hidden" name="a" value="communityorder" />
  57. <input type="hidden" name="member_id" value="{$member_id}" />
  58. <div class="layui-form-item">
  59. <div class="layui-inline">
  60. <span class="layui-input-inline">
  61. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  62. <option value=''>不按时间</option>
  63. <option value='create_time' <?php if($_GPC['searchtime']=='create_time'){ ?>selected<?php } ?>>支付时间</option>
  64. </select>
  65. </span>
  66. <span class="layui-input-inline" style="width: 285px;">
  67. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  68. </span>
  69. <div class="layui-input-inline" >
  70. <select name='order_status' class='layui-input layui-unselect' style="width:80px;" >
  71. <option value=''>状态</option>
  72. <option value='0' <?php if( $_GPC['order_status']=='0' ){ ?>selected<?php } ?>>待结算</option>
  73. <option value='1' <?php if( $_GPC['order_status']=='1' ){ ?>selected<?php } ?>>已结算</option>
  74. <option value='2' <?php if( $_GPC['order_status']=='2' ){ ?>selected<?php } ?>>订单取消/退款</option>
  75. </select>
  76. </div>
  77. <div class="layui-input-inline">
  78. <button class="layui-btn layui-btn-sm" type="submit"> 搜索</button>
  79. <button type="submit" name="export" value="1" class="btn btn-success ">导出</button>
  80. </div>
  81. </div>
  82. </div>
  83. </form>
  84. <form action="" class="layui-form" lay-filter="example" method="post" >
  85. <div class="row">
  86. <div class="col-md-12">
  87. <div class="page-table-header">
  88. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  89. </div>
  90. <table class="table table-responsive" lay-even lay-skin="line" lay-size="lg">
  91. <thead>
  92. <tr>
  93. <th style="width:25px;"></th>
  94. <th style="width:160px;">订单编号</th>
  95. <th style="">商品标题</th>
  96. <th style="">订单金额</th>
  97. <th style='width:150px;'>佣金金额</th>
  98. <th style='width:150px;'>状态</th>
  99. <th style='width:150px;'>几级分佣</th>
  100. <th style='width:200px;'>下单时间</th>
  101. <th style="text-align: center;">操作</th>
  102. </tr>
  103. </thead>
  104. <tbody>
  105. <?php foreach($list as $row){ ?>
  106. <tr>
  107. <td style="position: relative; ">
  108. <input type='checkbox' name="item_checkbox" class="checkone" lay-skin="primary" value="{$row['order_id']}"/>
  109. </td>
  110. <td>
  111. {$row['order_num_alias']}
  112. </td>
  113. <td>
  114. {$row['name']}
  115. </td>
  116. <td>
  117. {$row['total']}
  118. </td>
  119. <td>
  120. {$row['money']}
  121. </td>
  122. <td>
  123. <?php if( $row['state'] == 0 ){ ?>
  124. <span class="layui-badge layui-bg-green">待结算</span>
  125. <?php }else if( $row['state'] == 1 ){ ?>
  126. <span class="layui-badge layui-bg-blue">已结算</span>
  127. <?php }else if( $row['state'] == 2 ){ ?>
  128. <span class="layui-badge layui-bg-gray">订单取消或退款</span>
  129. <?php } ?>
  130. </td>
  131. <td>
  132. {$row['level']}
  133. </td>
  134. <td>
  135. {$row['addtime']}
  136. </td>
  137. <td style="overflow:visible;text-align: center;">
  138. <div class="btn-group">
  139. <a class="layui-btn layui-btn-xs" lay-href="{:U('order/detail',array('id' => $row['order_id']));}" target='_blank'>
  140. 查看订单详情
  141. </a>
  142. </div>
  143. </td>
  144. </tr>
  145. <?php } ?>
  146. </tbody>
  147. <tfoot>
  148. <tr>
  149. <td colspan="2">
  150. <div class="page-table-header">
  151. <input type="checkbox" name="checkall" lay-skin="primary" lay-filter="checkboxall">
  152. </div>
  153. </td>
  154. <td colspan="6" style="text-align: right">
  155. {$pager}
  156. </td>
  157. </tr>
  158. </tfoot>
  159. </table>
  160. </div>
  161. </div>
  162. </form>
  163. </div>
  164. </div>
  165. </div>
  166. <script src="/layuiadmin/layui/layui.js"></script>
  167. <script>
  168. layui.config({
  169. base: '/layuiadmin/' //静态资源所在路径
  170. }).extend({
  171. index: 'lib/index' //主入口模块
  172. }).use('index');
  173. </script>
  174. <script>
  175. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  176. var layer = layui.layer;
  177. var $;
  178. layui.use(['jquery', 'layer','form'], function(){
  179. $ = layui.$;
  180. var form = layui.form;
  181. $('.deldom').click(function(){
  182. var s_url = $(this).attr('data-href');
  183. layer.confirm($(this).attr('data-confirm'), function(index){
  184. $.ajax({
  185. url:s_url,
  186. type:'post',
  187. dataType:'json',
  188. success:function(info){
  189. if(info.status == 0)
  190. {
  191. layer.msg(info.result.message,{icon: 1,time: 2000});
  192. }else if(info.status == 1){
  193. var go_url = location.href;
  194. if( info.result.hasOwnProperty("url") )
  195. {
  196. go_url = info.result.url;
  197. }
  198. layer.msg('操作成功',{time: 1000,
  199. end:function(){
  200. location.href = info.result.url;
  201. }
  202. });
  203. }
  204. }
  205. })
  206. });
  207. })
  208. $('.btn-operation').click(function(){
  209. var ids_arr = [];
  210. var obj = $(this);
  211. var s_toggle = $(this).attr('data-toggle');
  212. var s_url = $(this).attr('data-href');
  213. $("input[name=item_checkbox]").each(function() {
  214. if( $(this).prop('checked') )
  215. {
  216. ids_arr.push( $(this).val() );
  217. }
  218. })
  219. if(ids_arr.length < 1)
  220. {
  221. layer.msg('请选择要操作的内容');
  222. }else{
  223. var can_sub = true;
  224. if( s_toggle == 'batch-remove' )
  225. {
  226. can_sub = false;
  227. layer.confirm($(obj).attr('data-confirm'), function(index){
  228. $.ajax({
  229. url:s_url,
  230. type:'post',
  231. dataType:'json',
  232. data:{ids:ids_arr},
  233. success:function(info){
  234. if(info.status == 0)
  235. {
  236. layer.msg(info.result.message,{icon: 1,time: 2000});
  237. }else if(info.status == 1){
  238. var go_url = location.href;
  239. if( info.result.hasOwnProperty("url") )
  240. {
  241. go_url = info.result.url;
  242. }
  243. layer.msg('操作成功',{time: 1000,
  244. end:function(){
  245. location.href = info.result.url;
  246. }
  247. });
  248. }
  249. }
  250. })
  251. });
  252. }else{
  253. $.ajax({
  254. url:s_url,
  255. type:'post',
  256. dataType:'json',
  257. data:{ids:ids_arr},
  258. success:function(info){
  259. if(info.status == 0)
  260. {
  261. layer.msg(info.result.message,{icon: 1,time: 2000});
  262. }else if(info.status == 1){
  263. var go_url = location.href;
  264. if( info.result.hasOwnProperty("url") )
  265. {
  266. go_url = info.result.url;
  267. }
  268. layer.msg('操作成功',{time: 1000,
  269. end:function(){
  270. location.href = info.result.url;
  271. }
  272. });
  273. }
  274. }
  275. })
  276. }
  277. }
  278. })
  279. form.on('switch(statewsitch)', function(data){
  280. var s_url = $(this).attr('data-href')
  281. var s_value = 1;
  282. if(data.elem.checked)
  283. {
  284. s_value = 1;
  285. }else{
  286. s_value = 0;
  287. }
  288. $.ajax({
  289. url:s_url,
  290. type:'post',
  291. dataType:'json',
  292. data:{comsiss_state:s_value},
  293. success:function(info){
  294. if(info.status == 0)
  295. {
  296. layer.msg(info.result.message,{icon: 1,time: 2000});
  297. }else if(info.status == 1){
  298. var go_url = location.href;
  299. if( info.result.hasOwnProperty("url") )
  300. {
  301. go_url = info.result.url;
  302. }
  303. layer.msg('操作成功',{time: 1000,
  304. end:function(){
  305. location.href = info.result.url;
  306. }
  307. });
  308. }
  309. }
  310. })
  311. });
  312. form.on('checkbox(checkboxall)', function(data){
  313. if(data.elem.checked)
  314. {
  315. $("input[name=item_checkbox]").each(function() {
  316. $(this).prop("checked", true);
  317. });
  318. $("input[name=checkall]").each(function() {
  319. $(this).prop("checked", true);
  320. });
  321. }else{
  322. $("input[name=item_checkbox]").each(function() {
  323. $(this).prop("checked", false);
  324. });
  325. $("input[name=checkall]").each(function() {
  326. $(this).prop("checked", false);
  327. });
  328. }
  329. form.render('checkbox');
  330. });
  331. //监听提交
  332. form.on('submit(formDemo)', function(data){
  333. $.ajax({
  334. url: data.form.action,
  335. type: data.form.method,
  336. data: data.field,
  337. dataType:'json',
  338. success: function (info) {
  339. if(info.status == 0)
  340. {
  341. layer.msg(info.result.message,{icon: 1,time: 2000});
  342. }else if(info.status == 1){
  343. var go_url = location.href;
  344. if( info.result.hasOwnProperty("url") )
  345. {
  346. go_url = info.result.url;
  347. }
  348. layer.msg('操作成功',{time: 1000,
  349. end:function(){
  350. location.href = info.result.url;
  351. }
  352. });
  353. }
  354. }
  355. });
  356. return false;
  357. });
  358. })
  359. </script>
  360. </body>
  361. </html>