index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. {extend name="../../admin/view/main"}
  2. {block name='content'}
  3. <div class="think-box-shadow portal-block-container notselect">
  4. <div class="layui-row layui-col-space15">
  5. <div class="layui-col-sm6 layui-col-md3">
  6. <div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#57bdbf,#2f9de2)">
  7. <div>商品总量</div>
  8. <div>{$goodsTotal|default='0'}</div>
  9. <div>当前商品总数量</div>
  10. </div>
  11. <i class="portal-block-icon layui-icon layui-icon-app"></i>
  12. </div>
  13. <div class="layui-col-sm6 layui-col-md3">
  14. <div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#ff7d7d,#fb2c95)">
  15. <div>用户总量</div>
  16. <div>{$usersTotal|default='0'}</div>
  17. <div>当前用户总数量</div>
  18. </div>
  19. <i class="portal-block-icon layui-icon layui-icon-user"></i>
  20. </div>
  21. <div class="layui-col-sm6 layui-col-md3">
  22. <div class="portal-block-item nowrap" style="background:linear-gradient(-113deg,#c543d8,#925cc3)">
  23. <div>订单总量</div>
  24. <div>{$orderTotal|default='0'}</div>
  25. <div>已付款订单总数</div>
  26. </div>
  27. <i class="portal-block-icon layui-icon layui-icon-form"></i>
  28. </div>
  29. <div class="layui-col-sm6 layui-col-md3">
  30. <div class="portal-block-item nowrap" style="background:linear-gradient(-141deg,#ecca1b,#f39526)">
  31. <div>交易金额</div>
  32. <div>{$amountTotal|default='0'}</div>
  33. <div>已成交金额总数</div>
  34. </div>
  35. <i class="portal-block-icon layui-icon layui-icon-rmb"></i>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="layui-row layui-col-space15 margin-top-10">
  40. <div class="layui-col-xs12 layui-col-md6">
  41. <div class="think-box-shadow">
  42. <div id="main2" style="width:100%;height:350px"></div>
  43. </div>
  44. </div>
  45. <div class="layui-col-xs12 layui-col-md6">
  46. <div class="think-box-shadow">
  47. <div id="main4" style="width:100%;height:350px"></div>
  48. </div>
  49. </div>
  50. <div class="layui-col-xs12 layui-col-md6">
  51. <div class="think-box-shadow">
  52. <div id="main5" style="width:100%;height:350px"></div>
  53. </div>
  54. </div>
  55. <div class="layui-col-xs12 layui-col-md6">
  56. <div class="think-box-shadow">
  57. <div id="main6" style="width:100%;height:350px"></div>
  58. </div>
  59. </div>
  60. <div class="layui-col-xs12 layui-col-md6">
  61. <div class="think-box-shadow">
  62. <div id="main3" style="width:100%;height:350px"></div>
  63. </div>
  64. </div>
  65. <div class="layui-col-xs12 layui-col-md6">
  66. <div class="think-box-shadow">
  67. <div id="main7" style="width:100%;height:350px"></div>
  68. </div>
  69. </div>
  70. </div>
  71. <label class="layui-hide">
  72. <textarea id="jsondata1">{$days|json_encode}</textarea>
  73. <textarea id="jsondata2">{$levels|json_encode}</textarea>
  74. </label>
  75. <script>
  76. require(['echarts'], function (echarts) {
  77. var data1 = JSON.parse($('#jsondata1').html());
  78. var days = data1.map(function (item) {
  79. return item['当天日期'];
  80. });
  81. var data2 = JSON.parse($('#jsondata2').html());
  82. var chart2 = echarts.init(document.getElementById('main2'));
  83. window.addEventListener("resize", function () {
  84. chart2.resize()
  85. });
  86. chart2.setOption({
  87. title: {text: '用户等级分布统计', left: 'center'},
  88. legend: {orient: 'vertical', left: 'left'},
  89. tooltip: {trigger: 'item', formatter: '{a} <br/>{b} : {c} 人 ( {d}% )'},
  90. series: [
  91. {
  92. name: '用户等级',
  93. type: 'pie',
  94. radius: '60%',
  95. center: ['50%', '55%'],
  96. data: data2.map(function (item) {
  97. return {name: item.name, value: item.count}
  98. }),
  99. emphasis: {
  100. itemStyle: {
  101. shadowBlur: 10,
  102. shadowOffsetX: 0,
  103. shadowColor: 'rgba(0, 0, 0, 0.5)'
  104. }
  105. }
  106. }
  107. ]
  108. });
  109. (function (charts) {
  110. window.addEventListener("resize", function () {
  111. charts.resize()
  112. });
  113. charts.setOption({
  114. title: [{left: 'center', text: '近十天代理收益统计'}],
  115. tooltip: {trigger: 'axis', show: true, axisPointer: {type: 'cross', label: {}}},
  116. xAxis: [{data: days, gridIndex: 0}],
  117. yAxis: [
  118. {
  119. splitLine: {show: true}, gridIndex: 0, type: 'value', axisLabel: {
  120. formatter: '{value} 元'
  121. }
  122. }
  123. ],
  124. grid: [{left: '10%', right: '3%', top: '25%'}],
  125. series: [
  126. {
  127. type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
  128. label: {normal: {position: 'top', formatter: '{c} 元', show: true}},
  129. data: data1.map(function (item) {
  130. return item['返利金额'];
  131. }),
  132. }
  133. ]
  134. });
  135. })(echarts.init(document.getElementById('main3')));
  136. (function (charts) {
  137. window.addEventListener("resize", function () {
  138. charts.resize()
  139. });
  140. charts.setOption({
  141. title: [{left: 'center', text: '近十天用户增涨趋势'}],
  142. tooltip: {trigger: 'axis', show: true, axisPointer: {type: 'cross', label: {}}},
  143. xAxis: [{data: days, gridIndex: 0}],
  144. yAxis: [
  145. {
  146. splitLine: {show: true}, gridIndex: 0, type: 'value', axisLabel: {
  147. formatter: '{value} 人'
  148. }
  149. }
  150. ],
  151. grid: [{left: '10%', right: '3%', top: '25%'}],
  152. series: [
  153. {
  154. type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
  155. label: {normal: {position: 'top', formatter: '{c} 人', show: true}},
  156. data: data1.map(function (item) {
  157. return item['增加用户'];
  158. }),
  159. }
  160. ]
  161. });
  162. })(echarts.init(document.getElementById('main4')));
  163. (function (charts) {
  164. window.addEventListener("resize", function () {
  165. charts.resize()
  166. });
  167. charts.setOption({
  168. title: [{left: 'center', text: '近十天订单数量趋势'}],
  169. tooltip: {trigger: 'axis', show: true, axisPointer: {type: 'cross', label: {}}},
  170. xAxis: [{data: days, gridIndex: 0}],
  171. yAxis: [
  172. {
  173. splitLine: {show: true}, gridIndex: 0, type: 'value', axisLabel: {
  174. formatter: '{value} 单'
  175. }
  176. }
  177. ],
  178. grid: [{left: '10%', right: '3%', top: '25%'}],
  179. series: [
  180. {
  181. type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
  182. label: {normal: {position: 'top', formatter: '{c} 单', show: true}},
  183. data: data1.map(function (item) {
  184. return item['订单数量'];
  185. }),
  186. }
  187. ]
  188. });
  189. })(echarts.init(document.getElementById('main5')));
  190. (function (charts) {
  191. window.addEventListener("resize", function () {
  192. charts.resize()
  193. });
  194. charts.setOption({
  195. title: [{left: 'center', text: '近十天交易金额趋势'}],
  196. grid: [{left: '10%', right: '3%', top: '25%'}],
  197. tooltip: {
  198. trigger: 'axis',
  199. },
  200. xAxis: [{data: days, gridIndex: 0}],
  201. yAxis: [{type: 'value', splitLine: {show: true}, gridIndex: 0, axisLabel: {formatter: '{value} 元'}}],
  202. series: [
  203. {
  204. type: 'line', showSymbol: true, xAxisIndex: 0, yAxisIndex: 0,
  205. label: {position: 'top', formatter: '{c} 元', show: true},
  206. data: data1.map(function (item) {
  207. return item['订单金额'];
  208. }),
  209. }
  210. ]
  211. });
  212. })(echarts.init(document.getElementById('main6')));
  213. (function (charts) {
  214. window.addEventListener("resize", function () {
  215. charts.resize()
  216. });
  217. charts.setOption({
  218. title: [{text: '近十天账户余额趋势'}],
  219. legend: {data: ['充值余额', '消费余额']},
  220. tooltip: {trigger: 'axis'},
  221. xAxis: [{data: days, gridIndex: 0}],
  222. yAxis: [{type: 'value', splitLine: {show: true}, gridIndex: 0, axisLabel: {formatter: '{value} 元'}}],
  223. series: [
  224. {
  225. name: '充值余额',
  226. type: 'line',
  227. label: {position: 'top', formatter: '{c} 元', show: true},
  228. data: data1.map(function (item) {
  229. return item['充值余额'];
  230. }),
  231. },
  232. {
  233. name: '消费余额',
  234. type: 'line',
  235. label: {formatter: '{c} 元', show: true},
  236. data: data1.map(function (item) {
  237. return item['消费余额'];
  238. }),
  239. },
  240. ]
  241. });
  242. })(echarts.init(document.getElementById('main7')));
  243. });
  244. </script>
  245. {/block}