main.php 25 KB

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