main.php 24 KB

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