9880952f3322a9c11557d8bdef363309.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?php /*a:5:{s:55:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\index\main.php";i:1595820902;s:61:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\container.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_head.php";i:1595820902;s:57:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\style.php";i:1595820902;s:64:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
  8. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  9. <?php endif; ?>
  10. <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
  11. <link href="/system/css/layui-admin.css" rel="stylesheet">
  12. <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  13. <link href="/system/frame/css/animate.min.css" rel="stylesheet">
  14. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  15. <script src="/system/frame/js/jquery.min.js"></script>
  16. <script src="/system/frame/js/bootstrap.min.js"></script>
  17. <script src="/static/plug/layui/layui.all.js"></script>
  18. <script>
  19. $eb = parent._mpApi;
  20. window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
  21. window.module="<?php echo app('http')->getName();?>";
  22. </script>
  23. <title></title>
  24. <!-- 全局js -->
  25. <script src="/static/plug/echarts/echarts.common.min.js"></script>
  26. <script src="/static/plug/echarts/theme/macarons.js"></script>
  27. <script src="/static/plug/echarts/theme/westeros.js"></script>
  28. <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
  29. <script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
  30. <?php /* <script type="text/javascript" src="/static/plug/requirejs/require-basket-load.js"></script> */ ?>
  31. <script>
  32. var hostname = location.hostname;
  33. if(location.port) hostname += ':' + location.port;
  34. requirejs.config({
  35. map: {
  36. '*': {
  37. 'css': '/static/plug/requirejs/require-css.js'
  38. }
  39. },
  40. shim:{
  41. 'iview':{
  42. deps:['css!iviewcss']
  43. },
  44. 'layer':{
  45. deps:['css!layercss']
  46. }
  47. },
  48. baseUrl:'//'+hostname+'/',
  49. paths: {
  50. 'static':'static',
  51. 'system':'system',
  52. 'vue':'static/plug/vue/dist/vue.min',
  53. 'axios':'static/plug/axios.min',
  54. 'iview':'static/plug/iview/dist/iview.min',
  55. 'iviewcss':'static/plug/iview/dist/styles/iview',
  56. 'lodash':'static/plug/lodash',
  57. 'layer':'static/plug/layer/layer',
  58. 'layercss':'static/plug/layer/theme/default/layer',
  59. 'jquery':'static/plug/jquery/jquery.min',
  60. 'moment':'static/plug/moment',
  61. 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
  62. 'formCreate':'/static/plug/form-create/form-create.min',
  63. },
  64. basket: {
  65. excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  66. // excludes:['system/util/mpFormBuilder','system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  67. }
  68. });
  69. </script>
  70. <script type="text/javascript" src="/system/util/mpFrame.js"></script>
  71. </head>
  72. <body class="gray-bg">
  73. <div class="wrapper wrapper-content">
  74. <div class="row">
  75. <div class="col-sm-3 ui-sortable">
  76. <div class="ibox float-e-margins">
  77. <div class="ibox-title">
  78. <span class="label label-danger pull-right">急</span>
  79. <h5>订单</h5>
  80. </div>
  81. <div class="ibox-content">
  82. <h1 class="no-margins"><?php echo htmlentities($topData['orderDeliveryNum']); ?></h1>
  83. <small><a href="javascript:;" class="opFrames" data-name="订单管理" data-href="<?php echo Url('order.store_order/index',['status'=>1]); ?>">待发货</a> </small>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="col-sm-3 ui-sortable">
  88. <div class="ibox float-e-margins">
  89. <div class="ibox-title">
  90. <span class="label label-info pull-right">待</span>
  91. <h5>订单</h5>
  92. </div>
  93. <div class="ibox-content">
  94. <h1 class="no-margins"><?php echo htmlentities($topData['orderRefundNum']); ?></h1>
  95. <small><a href="javascript:;" class="opFrames" data-name="订单管理" data-href="<?php echo Url('order.store_order/index',['status'=>-1]); ?>">退换货</a></small>
  96. </div>
  97. </div>
  98. </div>
  99. <div class="col-sm-3 ui-sortable" >
  100. <div class="ibox float-e-margins">
  101. <div class="ibox-title">
  102. <span class="label label-danger pull-right">急</span>
  103. <h5>商品</h5>
  104. </div>
  105. <div class="ibox-content">
  106. <h1 class="no-margins"><?php echo htmlentities($topData['stockProduct']); ?></h1>
  107. <small><a href="javascript:;" class="opFrames" data-name="商品管理" data-href="<?php echo Url('store.store_product/index',array('type'=>5)); ?>">库存预警</a></small>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="col-sm-3 ui-sortable">
  112. <div class="ibox float-e-margins">
  113. <div class="ibox-title">
  114. <span class="label label-danger pull-right">待</span>
  115. <h5>待提现</h5>
  116. </div>
  117. <div class="ibox-content">
  118. <h1 class="no-margins"><?php echo htmlentities($topData['treatedExtract']); ?></h1>
  119. <small><a href="javascript:;" class="opFrames" data-name="提现盛情" data-href="<?php echo Url('finance.user_extract/index'); ?>">待提现</a></small>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="col-sm-3 ui-sortable">
  124. <div class="ibox float-e-margins">
  125. <div class="ibox-title">
  126. <span class="label label-info pull-right">昨</span>
  127. <h5>订单</h5>
  128. </div>
  129. <div class="ibox-content">
  130. <h1 class="no-margins"><?php echo htmlentities($first_line['d_num']['data']); ?></h1>
  131. <div class="stat-percent font-bold text-navy">
  132. <?php echo htmlentities($first_line['d_num']['percent']); ?>%
  133. <?php if($first_line['d_num']['is_plus'] >= 0): ?><i class="fa <?php if($first_line['d_num']['is_plus'] == 1): ?>fa-level-up<?php else: ?>fa-level-down<?php endif; ?>"></i><?php endif; ?>
  134. </div>
  135. <small><a href="javascript:;" class="opFrames" data-name="订单管理" data-href="<?php echo Url('order.store_order/index'); ?>?data=yesterday">昨日支付订单数</a></small>
  136. </div>
  137. </div>
  138. </div>
  139. <div class="col-sm-3 ui-sortable">
  140. <div class="ibox float-e-margins">
  141. <div class="ibox-title">
  142. <span class="label label-info pull-right">昨</span>
  143. <h5>交易</h5>
  144. </div>
  145. <div class="ibox-content">
  146. <h1 class="no-margins"><?php echo htmlentities($first_line['d_price']['data']); ?></h1>
  147. <div class="stat-percent font-bold text-info">
  148. <?php echo htmlentities($first_line['d_price']['percent']); ?>%
  149. <?php if($first_line['d_price']['is_plus'] >= 0): ?><i class="fa <?php if($first_line['d_price']['is_plus'] == 1): ?>fa-level-up<?php else: ?>fa-level-down<?php endif; ?>"></i><?php endif; ?>
  150. </div>
  151. <small><a href="javascript:;" class="opFrames" data-name="订单管理" data-href="<?php echo Url('order.store_order/index'); ?>?data=yesterday">昨日交易额</a></small>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="col-sm-3 ui-sortable">
  156. <div class="ibox float-e-margins">
  157. <div class="ibox-title">
  158. <span class="label label-info pull-right">今</span>
  159. <h5>粉丝</h5>
  160. </div>
  161. <div class="ibox-content">
  162. <h1 class="no-margins"><?php echo htmlentities($first_line['day']['data']); ?></h1>
  163. <div class="stat-percent font-bold text-info">
  164. <?php echo htmlentities($first_line['day']['percent']); ?>%
  165. <?php if($first_line['day']['is_plus'] >= 0): ?><i class="fa <?php if($first_line['day']['is_plus'] == 1): ?>fa-level-up<?php else: ?>fa-level-down<?php endif; ?>"></i><?php endif; ?>
  166. </div>
  167. <small><a href="javascript:;" class="opFrames" data-name="会员管理" data-href="<?php echo Url('user.user/index'); ?>">今日新增粉丝</a></small>
  168. </div>
  169. </div>
  170. </div>
  171. <div class="col-sm-3 ui-sortable">
  172. <div class="ibox float-e-margins">
  173. <div class="ibox-title">
  174. <span class="label label-info pull-right">月</span>
  175. <h5>粉丝</h5>
  176. </div>
  177. <div class="ibox-content">
  178. <h1 class="no-margins"><?php echo htmlentities($first_line['month']['data']); ?></h1>
  179. <div class="stat-percent font-bold text-info">
  180. <?php echo htmlentities($first_line['month']['percent']); ?>%
  181. <?php if($first_line['month']['is_plus'] >= 0): ?><i class="fa <?php if($first_line['month']['is_plus'] == 1): ?>fa-level-up<?php else: ?>fa-level-down<?php endif; ?>"></i><?php endif; ?>
  182. </div>
  183. <small><a href="javascript:;" class="opFrames" data-name="会员管理" data-href="<?php echo Url('user.user/index'); ?>">本月新增粉丝</a></small>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. <div id="app">
  189. <div class="row">
  190. <div class="col-lg-12">
  191. <div class="ibox float-e-margins">
  192. <div class="ibox-title">
  193. <h5>订单</h5>
  194. <div class="pull-right">
  195. <div class="btn-group">
  196. <button type="button" class="btn btn-xs btn-white" :class="{'active': active == 'thirtyday'}" v-on:click="getlist('thirtyday')">30天</button>
  197. <button type="button" class="btn btn-xs btn-white" :class="{'active': active == 'week'}" v-on:click="getlist('week')">周</button>
  198. <button type="button" class="btn btn-xs btn-white" :class="{'active': active == 'month'}" v-on:click="getlist('month')">月</button>
  199. <button type="button" class="btn btn-xs btn-white" :class="{'active': active == 'year'}" v-on:click="getlist('year')">年</button>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="ibox-content">
  204. <div class="row">
  205. <div class="col-lg-9">
  206. <div class="flot-chart-content echarts" ref="order_echart" id="flot-dashboard-chart1"></div>
  207. </div>
  208. <div class="col-lg-3">
  209. <ul class="stat-list">
  210. <li>
  211. <h2 class="no-margins ">{{pre_cycleprice}}</h2>
  212. <small>{{precyclename}}销售额</small>
  213. </li>
  214. <li>
  215. <h2 class="no-margins ">{{cycleprice}}</h2>
  216. <small>{{cyclename}}销售额</small>
  217. <div class="stat-percent text-navy" v-if='cycleprice_is_plus ===1'>
  218. {{cycleprice_percent}}%
  219. <i class="fa fa-level-up"></i>
  220. </div>
  221. <div class="stat-percent text-danger" v-else-if='cycleprice_is_plus === -1'>
  222. {{cycleprice_percent}}%
  223. <i class="fa fa-level-down"></i>
  224. </div>
  225. <div class="stat-percent" v-else>
  226. {{cycleprice_percent}}%
  227. </div>
  228. <div class="progress progress-mini">
  229. <div :style="{width:cycleprice_percent+'%'}" class="progress-bar box"></div>
  230. </div>
  231. </li>
  232. <li>
  233. <h2 class="no-margins ">{{pre_cyclecount}}</h2>
  234. <small>{{precyclename}}订单总数</small>
  235. </li>
  236. <li>
  237. <h2 class="no-margins">{{cyclecount}}</h2>
  238. <small>{{cyclename}}订单总数</small>
  239. <div class="stat-percent text-navy" v-if='cyclecount_is_plus ===1'>
  240. {{cyclecount_percent}}%
  241. <i class="fa fa-level-up"></i>
  242. </div>
  243. <div class="stat-percent text-danger" v-else-if='cyclecount_is_plus === -1'>
  244. {{cyclecount_percent}}%
  245. <i class="fa fa-level-down"></i>
  246. </div>
  247. <div class="stat-percent " v-else>
  248. {{cyclecount_percent}}%
  249. </div>
  250. <div class="progress progress-mini">
  251. <div :style="{width:cyclecount_percent+'%'}" class="progress-bar box"></div>
  252. </div>
  253. </li>
  254. </ul>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <div class="row" >
  262. <div class="col-lg-12">
  263. <div class="ibox float-e-margins">
  264. <div class="ibox-title">
  265. <h5>用户</h5>
  266. </div>
  267. <div class="ibox-content">
  268. <div class="row">
  269. <div class="col-lg-12">
  270. <div class="flot-chart">
  271. <div class="flot-chart-content" ref="user_echart" id="flot-dashboard-chart2"></div>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. <style scoped>
  281. .box{width:0px;}
  282. </style>
  283. <script>
  284. require(['vue','axios','layer'],function(Vue,axios,layer){
  285. new Vue({
  286. el:"#app",
  287. data:{
  288. option:{},
  289. myChart:{},
  290. active:'thirtyday',
  291. cyclename:'最近30天',
  292. precyclename:'上个30天',
  293. cyclecount:0,
  294. cycleprice:0,
  295. cyclecount_percent:0,
  296. cycleprice_percent:0,
  297. cyclecount_is_plus:0,
  298. cycleprice_is_plus:0,
  299. pre_cyclecount:0,
  300. pre_cycleprice:0
  301. },
  302. methods:{
  303. info:function () {
  304. var that=this;
  305. axios.get("<?php echo Url('userchart'); ?>").then((res)=>{
  306. that.myChart.user_echart.setOption(that.userchartsetoption(res.data.data));
  307. });
  308. },
  309. getlist:function (e) {
  310. var that=this;
  311. var cycle = e!=null ? e :'thirtyday';
  312. axios.get("<?php echo Url('orderchart'); ?>?cycle="+cycle).then((res)=>{
  313. that.myChart.order_echart.clear();
  314. that.myChart.order_echart.setOption(that.orderchartsetoption(res.data.data));
  315. that.active = cycle;
  316. switch (cycle){
  317. case 'thirtyday':
  318. that.cyclename = '最近30天';
  319. that.precyclename = '上个30天';
  320. break;
  321. case 'week':
  322. that.precyclename = '上周';
  323. that.cyclename = '本周';
  324. break;
  325. case 'month':
  326. that.precyclename = '上月';
  327. that.cyclename = '本月';
  328. break;
  329. case 'year':
  330. that.cyclename = '去年';
  331. that.precyclename = '今年';
  332. break;
  333. default:
  334. break;
  335. }
  336. var data=res.data.data;
  337. if(data) {
  338. that.cyclecount = data.cycle.count.data;
  339. that.cyclecount_percent = data.cycle.count.percent;
  340. that.cyclecount_is_plus = data.cycle.count.is_plus;
  341. that.cycleprice = data.cycle.price.data;
  342. that.cycleprice_percent = data.cycle.price.percent;
  343. that.cycleprice_is_plus = data.cycle.price.is_plus;
  344. that.pre_cyclecount = data.pre_cycle.count.data;
  345. that.pre_cycleprice = data.pre_cycle.price.data;
  346. }
  347. });
  348. },
  349. orderchartsetoption:function(data){
  350. data = data == undefined ? {} : data;
  351. this.option = {
  352. tooltip: {
  353. trigger: 'axis',
  354. axisPointer: {
  355. type: 'cross',
  356. crossStyle: {
  357. color: '#999'
  358. }
  359. }
  360. },
  361. toolbox: {
  362. feature: {
  363. dataView: {show: true, readOnly: false},
  364. magicType: {show: true, type: ['line', 'bar']},
  365. restore: {show: false},
  366. saveAsImage: {show: true}
  367. }
  368. },
  369. legend: {
  370. data: data.legend || []
  371. },
  372. grid: {
  373. x: 70,
  374. x2: 50,
  375. y: 60,
  376. y2: 50
  377. },
  378. xAxis: [
  379. {
  380. type: 'category',
  381. data: data.xAxis,
  382. axisPointer: {
  383. type: 'shadow'
  384. },
  385. axisLabel:{
  386. interval: 0,
  387. rotate:40
  388. }
  389. }
  390. ],
  391. yAxis:[{type : 'value'}],
  392. // yAxis: [
  393. // {
  394. // type: 'value',
  395. // name: '',
  396. // min: 0,
  397. // max: data.yAxis.maxprice,
  398. //// interval: 0,
  399. // axisLabel: {
  400. // formatter: '{value} 元'
  401. // }
  402. // },
  403. // {
  404. // type: 'value',
  405. // name: '',
  406. // min: 0,
  407. // max: data.yAxis.maxnum,
  408. // interval: 5,
  409. // axisLabel: {
  410. // formatter: '{value} 个'
  411. // }
  412. // }
  413. // ],
  414. series: data.series
  415. };
  416. return this.option;
  417. },
  418. userchartsetoption:function(data){
  419. this.option = {
  420. tooltip: {
  421. trigger: 'axis',
  422. axisPointer: {
  423. type: 'cross',
  424. crossStyle: {
  425. color: '#999'
  426. }
  427. }
  428. },
  429. toolbox: {
  430. feature: {
  431. dataView: {show: false, readOnly: false},
  432. magicType: {show: true, type: ['line', 'bar']},
  433. restore: {show: false},
  434. saveAsImage: {show: false}
  435. }
  436. },
  437. legend: {
  438. data:data.legend
  439. },
  440. grid: {
  441. x: 70,
  442. x2: 50,
  443. y: 60,
  444. y2: 50
  445. },
  446. xAxis: [
  447. {
  448. type: 'category',
  449. data: data.xAxis,
  450. axisPointer: {
  451. type: 'shadow'
  452. }
  453. }
  454. ],
  455. yAxis: [
  456. {
  457. type: 'value',
  458. name: '人数',
  459. min: 0,
  460. max: data.yAxis.maxnum,
  461. interval: 5,
  462. axisLabel: {
  463. formatter: '{value} 人'
  464. }
  465. }
  466. ],
  467. // series: data.series
  468. series : [ {
  469. name : '人数',
  470. type : 'bar',
  471. barWidth : '50%',
  472. itemStyle: {
  473. normal: {
  474. label: {
  475. show: true, //开启显示
  476. position: 'top', //在上方显示
  477. textStyle: { //数值样式
  478. color: '#666',
  479. fontSize: 12
  480. }
  481. }
  482. }
  483. },
  484. data : data.series
  485. } ]
  486. };
  487. return this.option;
  488. },
  489. setChart:function(name,myChartname){
  490. this.myChart[myChartname] = echarts.init(name,'macarons');//初始化echart
  491. }
  492. },
  493. mounted:function () {
  494. const self = this;
  495. this.setChart(self.$refs.order_echart,'order_echart');//订单图表
  496. this.setChart(self.$refs.user_echart,'user_echart');//用户图表
  497. this.info();
  498. this.getlist();
  499. $('.opFrames').on('click',function () {
  500. parent.addframes($(this).data('href'),'',$(this).data('name'));
  501. });
  502. }
  503. });
  504. });
  505. </script>
  506. </div>
  507. </body>
  508. </html>