datastatics.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  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 src="/layuiadmin/lib/extend/echarts.min.js"></script>
  20. <script type="text/javascript">
  21. window.sysinfo = {
  22. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  23. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  24. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  25. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  26. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  27. 'siteroot': '{$_W['siteroot']}',
  28. 'siteurl': '{$_W['siteurl']}',
  29. 'attachurl': '{$_W['attachurl']}',
  30. 'attachurl_local': '{$_W['attachurl_local']}',
  31. 'attachurl_remote': '{$_W['attachurl_remote']}',
  32. 'module': {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  33. 'cookie': {'pre': ''},
  34. 'account': {:json_encode($_W['account'])},
  35. };
  36. </script>
  37. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  39. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  42. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  43. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  44. <link href="/static/css/snailfish.css" rel="stylesheet">
  45. <style>
  46. tbody tr td{
  47. position: relative;
  48. }
  49. tbody tr .icow-weibiaoti--{
  50. visibility: hidden;
  51. display: inline-block;
  52. color: #fff;
  53. height:18px;
  54. width:18px;
  55. background: #e0e0e0;
  56. text-align: center;
  57. line-height: 18px;
  58. vertical-align: middle;
  59. }
  60. tbody tr:hover .icow-weibiaoti--{
  61. visibility: visible;
  62. }
  63. tbody tr .icow-weibiaoti--.hidden{
  64. visibility: hidden !important;
  65. }
  66. .full .icow-weibiaoti--{
  67. margin-left:10px;
  68. }
  69. .full>span{
  70. display: -webkit-box;
  71. display: -webkit-flex;
  72. display: -ms-flexbox;
  73. display: flex;
  74. vertical-align: middle;
  75. align-items: center;
  76. }
  77. tbody tr .label{
  78. margin: 5px 0;
  79. }
  80. .goods_attribute a{
  81. cursor: pointer;
  82. }
  83. .newgoodsflag{
  84. width: 22px;height: 16px;
  85. background-color: #ff0000;
  86. color: #fff;
  87. text-align: center;
  88. position: absolute;
  89. bottom: 70px;
  90. left: 57px;
  91. font-size: 12px;
  92. }
  93. .a{cursor: pointer;}
  94. .img-40 {
  95. width: 40px;
  96. height: 40px;
  97. }
  98. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect{
  99. width:auto!important;
  100. }
  101. .div-inline{
  102. display:inline-block;
  103. text-align:left;
  104. height:94px;
  105. width:260px;
  106. margin-top: 15px;
  107. margin-left: 15px;
  108. margin-right: 35px;
  109. padding: 20px 0;
  110. box-sizing:border-box;
  111. border-width:1px;
  112. border-style:solid;
  113. border-color:rgba(121, 121, 121, 1);
  114. border-radius:0px;
  115. box-shadow:none;
  116. }
  117. .div-inline2{
  118. display:inline-block;
  119. text-align:center;
  120. height:25px;
  121. width:370px;
  122. }
  123. .span{
  124. margin-left: 20px;
  125. }
  126. .b{
  127. margin-left: 20px;
  128. display: block;
  129. text-align: left;
  130. font-weight: lighter;
  131. font-size: 27px;
  132. color: #128ff2;
  133. }
  134. .div-chart{
  135. display:inline-block;
  136. margin-top: 15px;
  137. margin-left: 15px;
  138. margin-right: 35px;
  139. left:0px;
  140. top:0px;
  141. width:1515px;
  142. height:413px;
  143. border-width:1px;
  144. border-style:solid;
  145. background:inherit;
  146. background-color:rgba(255, 255, 255, 1);
  147. box-sizing:border-box;
  148. border-color:rgba(121, 121, 121, 1);
  149. border-radius:0px;
  150. }
  151. .div-box{
  152. display:inline-block;
  153. margin-top: 15px;
  154. margin-left: 15px;
  155. margin-right: 35px;
  156. left:0px;
  157. top:0px;
  158. width:730px;
  159. height:517px;
  160. background:inherit;
  161. background-color:rgba(255, 255, 255, 1);
  162. box-sizing:border-box;
  163. border-color:rgba(121, 121, 121, 1);
  164. border-radius:0px;
  165. }
  166. .div-upper{
  167. width:730px;
  168. height:30px;
  169. border-width:1px;
  170. border-style:solid;
  171. }
  172. .div-lower{
  173. width:730px;
  174. height:487px;
  175. border-width:1px;
  176. border-style:solid;
  177. border-style:none solid solid solid;
  178. }
  179. .div-table1{
  180. display:inline-block;
  181. text-align:center;
  182. height:20px;
  183. }
  184. .div-table2{
  185. font-weight: normal;
  186. display:inline-block;
  187. text-align:center;
  188. height:46px;
  189. }
  190. .layadmin-backlog .layadmin-backlog-body {
  191. display: block;
  192. padding: 10px 15px;
  193. background-color: #f8f8f8;
  194. color: #999;
  195. border-radius: 2px;
  196. transition: all .3s;
  197. -webkit-transition: all .3s;
  198. }
  199. .layadmin-backlog-body h3 {
  200. padding-bottom: 12px;
  201. font-size: 14px;
  202. padding-top: 10px;
  203. color: #000;;
  204. }
  205. .layadmin-backlog-body p cite {
  206. font-style: normal;
  207. font-size: 30px;
  208. font-weight: 300;
  209. color: #009688;
  210. }
  211. .layui-carousel{background-color:#fff;}
  212. .h12{height:12px;clear:both;}
  213. .layui-col-xs25{width:20%;float:left;}
  214. .row-panel {
  215. margin-bottom: 24px;
  216. margin-top:10px;
  217. }
  218. .mypanel {
  219. position: relative;
  220. background-color: #fff;
  221. padding: 0 20px;
  222. box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.05);
  223. }
  224. .mypanel-heading {
  225. font-size: 15px;
  226. font-weight: 600;
  227. border-bottom: 1px solid #f0f0f0;
  228. height: 48px;
  229. line-height: 48px;
  230. width:100%;
  231. }
  232. .ht15{color:#000;font-weight:bold;font-size:15px;}
  233. .chat-box {
  234. width: 100%;
  235. height: 192px;
  236. }
  237. .mypanel-body{
  238. width:100%;
  239. margin-top:10px;
  240. height: 413px;
  241. }
  242. .hs th{color:#000;}
  243. </style>
  244. </head>
  245. <body layadmin-themealias="default">
  246. <table id="demo" lay-filter="test"></table>
  247. <div class="layui-fluid">
  248. <div class="layui-card">
  249. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">营业数据
  250. </div>
  251. <div class="layui-card-body" style="padding:15px;">
  252. <div class="layui-row layui-carousel layadmin-backlog">
  253. <span class="mypanel-heading">今日数据</span>
  254. <ul class=" layui-col-space12 layui-col-md12 layui-this">
  255. <li class="layui-col-xs25">
  256. <a href="javascript:;" class="layadmin-backlog-body">
  257. <h3>下单金额(元)</h3>
  258. <p><cite>{$sum_money}</cite></p>
  259. </a>
  260. </li>
  261. <li class="layui-col-xs25">
  262. <a href="javascript:;" class="layadmin-backlog-body">
  263. <h3>下单会员数</h3>
  264. <p><cite>{$sum_member}</cite></p>
  265. </a>
  266. </li>
  267. <li class="layui-col-xs25">
  268. <a href="javascript:;" class="layadmin-backlog-body">
  269. <h3>下单量</h3>
  270. <p><cite>{$sum_order}</cite></p>
  271. </a>
  272. </li>
  273. <li class="layui-col-xs25">
  274. <a href="javascript:;" class="layadmin-backlog-body">
  275. <h3>下单商品数</h3>
  276. <p><cite>{$sum_goods}</cite></p>
  277. </a>
  278. </li>
  279. <li class="layui-col-xs25">
  280. <a href="javascript:;" class="layadmin-backlog-body">
  281. <h3>平均价格</h3>
  282. <p><cite>{$ave_money}</cite></p>
  283. </a>
  284. </li>
  285. </ul>
  286. <div class="h12"></div>
  287. <ul class=" layui-col-space12 layui-col-md12 layui-this">
  288. <li class="layui-col-xs25">
  289. <a href="javascript:;" class="layadmin-backlog-body">
  290. <h3>新增会员</h3>
  291. <p><cite>{$add_member}</cite></p>
  292. </a>
  293. </li>
  294. <li class="layui-col-xs25">
  295. <a href="javascript:;" class="layadmin-backlog-body">
  296. <h3>会员总数</h3>
  297. <p><cite>{$member_num}</cite></p>
  298. </a>
  299. </li>
  300. <li class="layui-col-xs25">
  301. <a href="javascript:;" class="layadmin-backlog-body">
  302. <h3>新增供货商</h3>
  303. <p><cite>{$add_supplier}</cite></p>
  304. </a>
  305. </li>
  306. <li class="layui-col-xs25">
  307. <a href="javascript:;" class="layadmin-backlog-body">
  308. <h3>新增团长</h3>
  309. <p><cite>{$add_head}</cite></p>
  310. </a>
  311. </li>
  312. <li class="layui-col-xs25">
  313. <a href="javascript:;" class="layadmin-backlog-body">
  314. <h3>新增商品</h3>
  315. <p><cite>{$add_goods}</cite></p>
  316. </a>
  317. </li>
  318. </ul>
  319. </div>
  320. <div class="layui-row layui-carousel layadmin-backlog">
  321. <?php
  322. $today_sales = json_encode($today_sales);
  323. $yesterday_sales = json_encode($yesterday_sales);
  324. ?>
  325. <div class="row-panel">
  326. <div class="mypanel-heading">今日交易走势(下单金额)</div>
  327. <div class="mypanel-body">
  328. <div class="chat-box" id="main" style="-webkit-tap-highlight-color: transparent; user-select: none; position: relative;width:100%;height: 413px;">
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. <div class="layui-row layui-carousel layadmin-backlog">
  334. <div class="layui-col-sm6" style="margin-right:10px;">
  335. <div class="layui-card-header ht15">7日内团长销量top10</div>
  336. <table class="layui-table layuiadmin-page-table hs" lay-skin="line">
  337. <thead>
  338. <tr>
  339. <th style="color:#000;">名次</th>
  340. <th style="color:#000;">社区店名称</th>
  341. <th style="color:#000;">团长</th>
  342. <th style="color:#000;">订单数量</th>
  343. <th style="color:#000;">有效订单金额(元)</th>
  344. </tr>
  345. </thead>
  346. <tbody>
  347. <?php $i=1; foreach($sale_list as $k => $s){ ?>
  348. <?php
  349. if( $i>10 ) break;
  350. ?>
  351. <tr>
  352. <td><?php echo $i; ?></td>
  353. <td>{$s["community_name"]}</td>
  354. <td>{$s["head_name"]}</td>
  355. <td>{$s["count"]}</td>
  356. <td>{$s["sale_money"]}</td>
  357. </tr>
  358. <?php $i++; } ?>
  359. </tbody>
  360. </table>
  361. </div>
  362. <div class="layui-col-sm5 ">
  363. <div class="layui-card-header ht15">7日内商品销量top10</div>
  364. <table class="layui-table layuiadmin-page-table hs" lay-skin="line">
  365. <thead>
  366. <tr>
  367. <th style="color:#000;">名次</th>
  368. <th style="color:#000;">商品ID</th>
  369. <th style="color:#000;">商品名称</th>
  370. <th style="color:#000;">销量</th>
  371. </tr>
  372. </thead>
  373. <tbody>
  374. <?php $i=1; foreach($goods_statistic as $k => $g){ ?>
  375. <?php
  376. if( $i > 10 ) break;
  377. ?>
  378. <tr>
  379. <td><?php echo $i; ?></td>
  380. <td>{$g["goods_id"]}</td>
  381. <td>{$g["name"]}</td>
  382. <td>{$g["quantity"]}</td>
  383. </tr>
  384. <?php $i++; } ?>
  385. </tbody>
  386. </table>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. <script src="/layuiadmin/layui/layui.js"></script>
  393. <script>
  394. layui.config({
  395. base: '/layuiadmin/' //静态资源所在路径
  396. }).extend({
  397. index: 'lib/index' //主入口模块
  398. }).use('index');
  399. </script>
  400. <script>
  401. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  402. var layer = layui.layer;
  403. var $;
  404. layui.use(['jquery', 'layer','form'], function(){
  405. $ = layui.$;
  406. var form = layui.form;
  407. $('.deldom').click(function(){
  408. var s_url = $(this).attr('data-href');
  409. layer.confirm($(this).attr('data-confirm'), function(index){
  410. $.ajax({
  411. url:s_url,
  412. type:'post',
  413. dataType:'json',
  414. success:function(info){
  415. $('#ajaxModal').removeClass('in');
  416. $('.modal-backdrop').removeClass('in');
  417. if(info.status == 0)
  418. {
  419. layer.msg(info.result.message,{icon: 1,time: 2000});
  420. }else if(info.status == 1){
  421. var go_url = location.href;
  422. if( info.result.hasOwnProperty("url") )
  423. {
  424. go_url = info.result.url;
  425. }
  426. layer.msg('操作成功',{time: 1000,
  427. end:function(){
  428. location.href = info.result.url;
  429. }
  430. });
  431. }
  432. }
  433. })
  434. },function(){
  435. console.log(232323);
  436. $('#ajaxModal').removeClass('in');
  437. $('.modal-backdrop').removeClass('in');
  438. });
  439. return false;
  440. })
  441. $('.btn-operation').click(function(){
  442. var ids_arr = [];
  443. var obj = $(this);
  444. var s_toggle = $(this).attr('data-toggle');
  445. var s_url = $(this).attr('data-href');
  446. $("input[name=item_checkbox]").each(function() {
  447. if( $(this).prop('checked') )
  448. {
  449. ids_arr.push( $(this).val() );
  450. }
  451. })
  452. if(ids_arr.length < 1)
  453. {
  454. layer.msg('请选择要操作的内容');
  455. }else{
  456. var can_sub = true;
  457. if( s_toggle == 'batch-remove' )
  458. {
  459. can_sub = false;
  460. layer.confirm($(obj).attr('data-confirm'), function(index){
  461. $.ajax({
  462. url:s_url,
  463. type:'post',
  464. dataType:'json',
  465. data:{ids:ids_arr},
  466. success:function(info){
  467. if(info.status == 0)
  468. {
  469. layer.msg(info.result.message,{icon: 1,time: 2000});
  470. }else if(info.status == 1){
  471. var go_url = location.href;
  472. if( info.result.hasOwnProperty("url") )
  473. {
  474. go_url = info.result.url;
  475. }
  476. layer.msg('操作成功',{time: 1000,
  477. end:function(){
  478. location.href = info.result.url;
  479. }
  480. });
  481. }
  482. }
  483. })
  484. });
  485. }else{
  486. $.ajax({
  487. url:s_url,
  488. type:'post',
  489. dataType:'json',
  490. data:{ids:ids_arr},
  491. success:function(info){
  492. if(info.status == 0)
  493. {
  494. layer.msg(info.result.message,{icon: 1,time: 2000});
  495. }else if(info.status == 1){
  496. var go_url = location.href;
  497. if( info.result.hasOwnProperty("url") )
  498. {
  499. go_url = info.result.url;
  500. }
  501. layer.msg('操作成功',{time: 1000,
  502. end:function(){
  503. location.href = info.result.url;
  504. }
  505. });
  506. }
  507. }
  508. })
  509. }
  510. }
  511. })
  512. form.on('switch(restwsitch)', function(data){
  513. var s_url = $(this).attr('data-href')
  514. var rest = 1;
  515. if(data.elem.checked)
  516. {
  517. rest = 1;
  518. }else{
  519. rest = 0;
  520. }
  521. $.ajax({
  522. url:s_url,
  523. type:'post',
  524. dataType:'json',
  525. data:{rest:rest},
  526. success:function(info){
  527. if(info.status == 0)
  528. {
  529. layer.msg(info.result.message,{icon: 1,time: 2000});
  530. }else if(info.status == 1){
  531. var go_url = location.href;
  532. if( info.result.hasOwnProperty("url") )
  533. {
  534. go_url = info.result.url;
  535. }
  536. layer.msg('操作成功',{time: 1000,
  537. end:function(){
  538. location.href = info.result.url;
  539. }
  540. });
  541. }
  542. }
  543. })
  544. });
  545. form.on('switch(enablewsitch)', function(data){
  546. var s_url = $(this).attr('data-href')
  547. var enable = 1;
  548. if(data.elem.checked)
  549. {
  550. enable = 1;
  551. }else{
  552. enable = 0;
  553. }
  554. $.ajax({
  555. url:s_url,
  556. type:'post',
  557. dataType:'json',
  558. data:{enable:enable},
  559. success:function(info){
  560. if(info.status == 0)
  561. {
  562. layer.msg(info.result.message,{icon: 1,time: 2000});
  563. }else if(info.status == 1){
  564. var go_url = location.href;
  565. if( info.result.hasOwnProperty("url") )
  566. {
  567. go_url = info.result.url;
  568. }
  569. layer.msg('操作成功',{time: 1000,
  570. end:function(){
  571. location.href = info.result.url;
  572. }
  573. });
  574. }
  575. }
  576. })
  577. });
  578. form.on('switch(statewsitch)', function(data){
  579. var s_url = $(this).attr('data-href')
  580. var state = 1;
  581. if(data.elem.checked)
  582. {
  583. state = 1;
  584. }else{
  585. state = 0;
  586. }
  587. $.ajax({
  588. url:s_url,
  589. type:'post',
  590. dataType:'json',
  591. data:{state:state},
  592. success:function(info){
  593. if(info.status == 0)
  594. {
  595. layer.msg(info.result.message,{icon: 1,time: 2000});
  596. }else if(info.status == 1){
  597. var go_url = location.href;
  598. if( info.result.hasOwnProperty("url") )
  599. {
  600. go_url = info.result.url;
  601. }
  602. layer.msg('操作成功',{time: 1000,
  603. end:function(){
  604. location.href = info.result.url;
  605. }
  606. });
  607. }
  608. }
  609. })
  610. });
  611. form.on('checkbox(checkboxall)', function(data){
  612. if(data.elem.checked)
  613. {
  614. $("input[name=item_checkbox]").each(function() {
  615. $(this).prop("checked", true);
  616. });
  617. $("input[name=checkall]").each(function() {
  618. $(this).prop("checked", true);
  619. });
  620. }else{
  621. $("input[name=item_checkbox]").each(function() {
  622. $(this).prop("checked", false);
  623. });
  624. $("input[name=checkall]").each(function() {
  625. $(this).prop("checked", false);
  626. });
  627. }
  628. form.render('checkbox');
  629. });
  630. //监听提交
  631. form.on('submit(formDemo)', function(data){
  632. $.ajax({
  633. url: data.form.action,
  634. type: data.form.method,
  635. data: data.field,
  636. dataType:'json',
  637. success: function (info) {
  638. if(info.status == 0)
  639. {
  640. layer.msg(info.result.message,{icon: 1,time: 2000});
  641. }else if(info.status == 1){
  642. var go_url = location.href;
  643. if( info.result.hasOwnProperty("url") )
  644. {
  645. go_url = info.result.url;
  646. }
  647. layer.msg('操作成功',{time: 1000,
  648. end:function(){
  649. location.href = info.result.url;
  650. }
  651. });
  652. }
  653. }
  654. });
  655. return false;
  656. });
  657. })
  658. </script>
  659. <script>
  660. var ajax_url = "";
  661. $(function(){
  662. $("[data-toggle='ajaxModal']").click(function () {
  663. var s_url = $(this).attr('data-href');
  664. ajax_url = s_url;
  665. console.log(23);
  666. $.ajax({
  667. url:s_url,
  668. type:"get",
  669. success:function(shtml){
  670. $('#ajaxModal').html(shtml);
  671. $("#ajaxModal").modal();
  672. }
  673. })
  674. });
  675. $(document).delegate(".modal-footer .btn-primary","click",function(){
  676. var s_data = $('#ajaxModal form').serialize();
  677. $.ajax({
  678. url:ajax_url,
  679. type:'post',
  680. dataType:'json',
  681. data:s_data,
  682. success:function(info){
  683. if(info.status == 0)
  684. {
  685. layer.msg(info.result.message,{icon: 1,time: 2000});
  686. }else if(info.status == 1){
  687. var go_url = location.href;
  688. if( info.result.hasOwnProperty("url") )
  689. {
  690. go_url = info.result.url;
  691. }
  692. layer.msg('操作成功',{time: 1000,
  693. end:function(){
  694. location.href = info.result.url;
  695. }
  696. });
  697. }
  698. }
  699. })
  700. return false;
  701. })
  702. })
  703. </script>
  704. <div id="ajaxModal" class="modal fade" style="display: none;">
  705. </div>
  706. <script>
  707. //没有选中时间段不能导出
  708. $(function () {
  709. $('.btn-submit').click(function () {
  710. var e = $(this).data('export');
  711. if(e==1 ){
  712. if($('#keyword').val() !='' ){
  713. $('#export').val(1);
  714. $('#search').submit();
  715. }else if($('#searchtime').val()!=''){
  716. $('#export').val(1);
  717. $('#search').submit();
  718. }else{
  719. $('#export').val(1);
  720. $('#search').submit();
  721. return;
  722. }
  723. }else{
  724. $('#export').val(0);
  725. $('#search').submit();
  726. }
  727. })
  728. })
  729. </script>
  730. <script type="text/javascript">
  731. // 基于准备好的dom,初始化echarts实例
  732. var myChart = echarts.init(document.getElementById('main'));
  733. // 指定图表的配置项和数据
  734. var option = {
  735. backgroundColor: '#fff',
  736. title: {
  737. text: ''
  738. },
  739. tooltip: {
  740. trigger: 'axis'
  741. },
  742. legend: {
  743. data: ['昨天', '今天']
  744. },
  745. toolbox: {
  746. show : true,
  747. feature : {
  748. mark : {show: true},
  749. dataView : {show: true, readOnly: false},
  750. magicType : {show: true, type: ['line', 'bar']},
  751. restore : {show: true},
  752. saveAsImage : {show: true}
  753. }
  754. },
  755. calculable: true,
  756. xAxis: {
  757. type : 'category',
  758. boundaryGap : false,
  759. data: ["0-1","1-2","2-3","3-4","4-5","5-6","6-7","7-8","8-9","9-10","10-11","11-12","12-13","13-14","14-15","15-16","16-17","17-18","18-19","19-20","20-21","21-22","22-23","23-24"]
  760. },
  761. yAxis: {},
  762. series: [{
  763. name: '昨天',
  764. type: 'line',
  765. data: <?php echo $yesterday_sales; ?>
  766. },{
  767. name: '今天',
  768. type: 'line',
  769. color:['blue'],
  770. data: <?php echo $today_sales; ?>
  771. }]
  772. };
  773. // 使用刚指定的配置项和数据显示图表。
  774. myChart.setOption(option);
  775. </script>
  776. </body>
  777. </html>