index-d5c.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="dashboard-container">
  3. <header-container></header-container>
  4. <div class="d5cA-table">
  5. <el-row :gutter="10">
  6. <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="6">
  7. <div class="d5cA-table__pane">
  8. <p class="d5cA-table__title">充值金额(元)</p>
  9. <h2 class="d5cA-table__totalPrice">
  10. <count-to :startVal="0" :endVal="homeData.total_invest" :duration="3000" :decimals="2"></count-to>
  11. </h2>
  12. <p class="d5cA-table__projectPrice">
  13. 订单总额
  14. <span>
  15. <count-to :startVal="0" :endVal="homeData.total_project" :duration="3000" :decimals="2"></count-to>
  16. </span>
  17. </p>
  18. <div class="d5cA-table__people">
  19. <div class="wid borderRight">
  20. <p>小程序粉丝总数(人)</p>
  21. <h3><count-to :startVal="0" :endVal="homeData.platform_total_fans" :duration="2000"></count-to></h3>
  22. </div>
  23. <div class="wid">
  24. <p>注册总数(人)</p>
  25. <h3><count-to :startVal="0" :endVal="homeData.total_register" :duration="2000"></count-to></h3>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="d5cA-table__pane">
  30. <fanmap-chart></fanmap-chart>
  31. </div>
  32. </el-col>
  33. <el-col :xs="24" :sm="24" :md="24" :lg="16" :xl="18">
  34. <div>
  35. <el-row :gutter="0">
  36. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  37. <div class="d5cA-table__pane">
  38. <user-chart></user-chart>
  39. </div>
  40. </el-col>
  41. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  42. <div class="d5cA-table__pane">
  43. <fans-chart :fansData="fansChart"></fans-chart>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. </div>
  48. <div>
  49. <el-row :gutter="0">
  50. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  51. <div class="d5cA-table__pane">
  52. <invest-chart></invest-chart>
  53. </div>
  54. </el-col>
  55. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  56. <div class="d5cA-table__pane">
  57. <growth-chart :fansData="fansChart"></growth-chart>
  58. </div>
  59. </el-col>
  60. </el-row>
  61. </div>
  62. </el-col>
  63. </el-row>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import UserChart from './components/UserChart'
  69. import FansChart from './components/FansChart'
  70. import GrowthChart from './components/GrowthChart'
  71. import InvestChart from './components/InvestChart'
  72. import FanmapChart from './components/FanmapChart'
  73. import request from '@/utils/request'
  74. import CountTo from 'vue-count-to'
  75. import Screenfull from '@/components/Screenfull'
  76. import HeaderContainer from '@/components/HeaderContainer'
  77. import { mapGetters } from 'vuex'
  78. export default {
  79. name: 'dashboard',
  80. components: {
  81. UserChart,
  82. FansChart,
  83. GrowthChart,
  84. InvestChart,
  85. FanmapChart,
  86. Screenfull,
  87. CountTo,
  88. HeaderContainer
  89. },
  90. data() {
  91. return {
  92. homeData: {},
  93. fansChart: {}
  94. }
  95. },
  96. computed: {
  97. ...mapGetters(['user'])
  98. },
  99. methods: {
  100. getFansGrowth() {
  101. request({
  102. url: '/v1/fans_month_grouth',
  103. methods: 'get'
  104. }).then(response => {
  105. this.fansChart = response.data
  106. }).catch(error => {
  107. console.log(error)
  108. })
  109. },
  110. getHomeTotal() {
  111. request({
  112. url: '/v1/home_left_top_data',
  113. methods: 'get'
  114. }).then(response => {
  115. this.homeData = response.data
  116. }).catch(error => {
  117. console.log(error)
  118. })
  119. }
  120. },
  121. mounted() {
  122. // this.investChart()
  123. },
  124. created() {
  125. this.$store.dispatch('GetUserInfo')
  126. this.getHomeTotal()
  127. this.getFansGrowth()
  128. },
  129. watch: {
  130. 'user': function(val) {
  131. if (val) {
  132. console.log(val)
  133. }
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .dashboard-container {
  140. position: relative;
  141. background-color: #334051;
  142. min-height: 100%;
  143. }
  144. .d5cA {
  145. &-table {
  146. width: 94%;
  147. margin: 0 auto;
  148. }
  149. &-table__pane {
  150. width: 100%;
  151. background-color: #37475b;
  152. padding: 18px 20px;
  153. margin-top: 10px;
  154. }
  155. &-table__title {
  156. text-align: center;
  157. font-size: 16px;
  158. color: #808fa1;
  159. margin-top: 18px;
  160. }
  161. &-table__totalPrice {
  162. font-size: 42px;
  163. color: #fff;
  164. text-align: center;
  165. font-weight: bold;
  166. margin-top: 36px;
  167. }
  168. &-table__people {
  169. width: 100%;
  170. height: 150px;
  171. background-color: #344355;
  172. padding: 18px;
  173. box-sizing: border-box;
  174. margin-top: 40px;
  175. .wid {
  176. float: left;
  177. width: 50%;
  178. height: 114px;
  179. text-align: center;
  180. font-size: 16px;
  181. color: #808fa1;
  182. box-sizing: border-box;
  183. p {
  184. margin-top: 10px;
  185. }
  186. h3 {
  187. font-size: 24px;
  188. color: #fff;
  189. font-weight: bold;
  190. margin-top: 54px;
  191. }
  192. }
  193. .borderRight {
  194. border-right: 1px solid #223040;
  195. }
  196. }
  197. &-table__projectPrice {
  198. font-size: 16px;
  199. color: #808fa1;
  200. text-align: center;
  201. margin-top: 36px;
  202. span {
  203. color: #fff;
  204. }
  205. }
  206. }
  207. </style>