人人商城

index.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. {template '_header'}
  2. <div class="page-heading"> <h2>会员概述</h2> </div>
  3. <div class="row">
  4. <div class="col-sm-4">
  5. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  6. <div class="ibox-title">
  7. <!--<span class="label label-success pull-right">月</span>-->
  8. <h5>今日新增会员</h5>
  9. </div>
  10. <div class="ibox-content">
  11. <h1 class="no-margins today-count">--</h1>
  12. <div class="stat-percent font-bold text-success"><span class="today-rate">--</span>%<i class="fa fa-level-up"></i>
  13. </div>
  14. <small>新增会员</small>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="col-sm-4">
  19. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  20. <div class="ibox-title">
  21. <!--<span class="label label-success pull-right">月</span>-->
  22. <h5>昨日新增会员</h5>
  23. </div>
  24. <div class="ibox-content">
  25. <h1 class="no-margins yesterday-count">--</h1>
  26. <div class="stat-percent font-bold text-info"><span class="yesterday-rate">--</span>% <i class="fa fa-level-up"></i>
  27. </div>
  28. <small>新增会员</small>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="col-sm-4">
  33. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  34. <div class="ibox-title">
  35. <!--<span class="label label-info pull-right">全年</span>-->
  36. <h5>过去七天新增会员</h5>
  37. </div>
  38. <div class="ibox-content">
  39. <h1 class="no-margins seven-count">--</h1>
  40. <div class="stat-percent font-bold text-warning"><span class="seven-rate">--</span>%<i class="fa fa-level-up"></i>
  41. </div>
  42. <small>新增会员</small>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="col-sm-6">
  47. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  48. <div class="ibox-title">
  49. <h5>会员性别分布</h5>
  50. </div>
  51. <div class="ibox-content">
  52. <div class="echarts" id="echarts-pie-chart" style="display: none"></div>
  53. <div class="spiner-example" id="echarts-pie-chart-loading">
  54. <div class="sk-spinner sk-spinner-wave">
  55. <div class="sk-rect1"></div>
  56. <div class="sk-rect2"></div>
  57. <div class="sk-rect3"></div>
  58. <div class="sk-rect4"></div>
  59. <div class="sk-rect5"></div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="col-sm-6">
  66. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  67. <div class="ibox-title">
  68. <h5>会员等级分布</h5>
  69. </div>
  70. <div class="ibox-content">
  71. <div class="echarts" id="echarts-pie-chart1" style="display: none"></div>
  72. <div class="spiner-example" id="echarts-pie-chart1-loading">
  73. <div class="sk-spinner sk-spinner-wave">
  74. <div class="sk-rect1"></div>
  75. <div class="sk-rect2"></div>
  76. <div class="sk-rect3"></div>
  77. <div class="sk-rect4"></div>
  78. <div class="sk-rect5"></div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="col-sm-12">
  85. <div class="ibox float-e-margins" style="border: 1px solid #e7eaec">
  86. <div class="ibox-title">
  87. <h5>会员区域分布</h5>
  88. </div>
  89. <div class="ibox-content">
  90. <div style="height:600px;display: none" id="echarts-map-chart" class="echarts" ></div>
  91. <div class="spiner-example" id="echarts-map-chart-loading">
  92. <div class="sk-spinner sk-spinner-wave">
  93. <div class="sk-rect1"></div>
  94. <div class="sk-rect2"></div>
  95. <div class="sk-rect3"></div>
  96. <div class="sk-rect4"></div>
  97. <div class="sk-rect5"></div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <script>
  105. myrequire(['echarts'], function () {
  106. $(function () {
  107. $.ajax({
  108. type: "GET",
  109. url: "{php echo webUrl('member/ajaxall')}",
  110. dataType: "json",
  111. success: function (json) {
  112. var pieChart = echarts.init(document.getElementById("echarts-pie-chart"));
  113. var pieoption = {
  114. title: {
  115. text: '男女会员分布',
  116. subtext: '',
  117. x: 'center'
  118. },
  119. tooltip: {
  120. trigger: 'item',
  121. formatter: "{a} <br/>{b} : {c} ({d}%)"
  122. },
  123. legend: {
  124. orient: 'vertical',
  125. x: 'right',
  126. data: ['男', '女', '未知']
  127. },
  128. calculable: true,
  129. series: [
  130. {
  131. name: '男女分布',
  132. type: 'pie',
  133. radius: '55%',
  134. center: ['50%', '60%'],
  135. data: [
  136. {value: json.ajaxmembergender[1], name: '男'},
  137. {value: json.ajaxmembergender[2], name: '女'},
  138. {value: json.ajaxmembergender[0], name: '未知'}
  139. ]
  140. }
  141. ]
  142. };
  143. $("#echarts-pie-chart-loading").hide()
  144. $("#echarts-pie-chart").show();
  145. pieChart.setOption(pieoption);
  146. pieChart.resize();
  147. var pieChart1 = echarts.init(document.getElementById("echarts-pie-chart1"));
  148. var pieoption1 = {
  149. title: {
  150. text: '会员等级分布',
  151. subtext: '',
  152. x: 'center'
  153. },
  154. tooltip: {
  155. trigger: 'item',
  156. formatter: "{a} <br/>{b} : {c} ({d}%)"
  157. },
  158. legend: {
  159. orient: 'vertical',
  160. x: 'right',
  161. data: json.ajaxmemberlevel.name
  162. },
  163. calculable: true,
  164. series: [
  165. {
  166. name: '等级分布',
  167. type: 'pie',
  168. radius: '55%',
  169. center: ['40%', '60%'],
  170. data: json.ajaxmemberlevel.data
  171. }
  172. ]
  173. };
  174. $("#echarts-pie-chart1-loading").hide();
  175. $("#echarts-pie-chart1").show();
  176. pieChart1.setOption(pieoption1);
  177. pieChart1.resize();
  178. var mapChart = echarts.init(document.getElementById("echarts-map-chart"));
  179. var mapoption = {
  180. title: {
  181. text: '会员分布区域',
  182. subtext: '',
  183. x: 'center'
  184. },
  185. tooltip: {
  186. trigger: 'item'
  187. },
  188. legend: {
  189. orient: 'vertical',
  190. x: 'left',
  191. data: ['会员分布区域']
  192. },
  193. dataRange: {
  194. min: 0,
  195. max: 100,
  196. x: 'left',
  197. y: 'bottom',
  198. text: ['人数'], // 文本,默认为数值文本
  199. calculable: true
  200. },
  201. toolbox: {
  202. show: true,
  203. orient: 'vertical',
  204. x: 'right',
  205. y: 'center',
  206. feature: {
  207. mark: {show: true},
  208. dataView: {show: true, readOnly: true},
  209. restore: {show: true},
  210. saveAsImage: {show: true}
  211. }
  212. },
  213. roamController: {
  214. show: false,
  215. x: 'right',
  216. mapTypeControl: {
  217. 'china': true
  218. }
  219. },
  220. series: [
  221. {
  222. name: '会员分布区域',
  223. type: 'map',
  224. mapType: 'china',
  225. roam: false,
  226. itemStyle: {
  227. normal: {label: {show: true}},
  228. emphasis: {label: {show: true}}
  229. },
  230. data: json.ajaxprovince
  231. }
  232. ]
  233. };
  234. $("#echarts-map-chart-loading").hide();
  235. $("#echarts-map-chart").show();
  236. mapChart.setOption(mapoption);
  237. mapChart.resize();
  238. $(".today-count").text(json.ajaxnewmember0.count);
  239. $(".today-rate").text(json.ajaxnewmember0.rate);
  240. $(".yesterday-count").text(json.ajaxnewmember1.count);
  241. $(".yesterday-rate").text(json.ajaxnewmember1.rate);
  242. $(".seven-count").text(json.ajaxnewmember7.count);
  243. $(".seven-rate").text(json.ajaxnewmember7.rate);
  244. }
  245. });
  246. });
  247. });
  248. </script>
  249. {template '_footer'}