index.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <div id="app" v-cloak>
  2. <div style="background:#fff">
  3. <div class="chartheader">
  4. <div style="width:55%"><div ref="visit_chart" id="visit_chart" class="album_chart padding-top-xs flex-sub radius margin-top" style="width:100%;height:400px"></div></div>
  5. <div style="width:40%">
  6. <ul class="poolList">
  7. <li class="list-item" v-for="(item,index) in poolList">
  8. <p class="title">{{item.name}}:</p>
  9. <p class="content">{{item.num ?? 0}}</p>
  10. </li>
  11. </ul>
  12. </div>
  13. </div>
  14. <div >
  15. <el-table v-loading="listLoading" v-if="PoolDetail.list && PoolDetail.list.length > 0" :data="PoolDetail.list" fit stripe style="width: 100%;margin-top:10px;" >
  16. <el-table-column prop="release_num" label="释放期数" width="150">
  17. <template slot-scope="scope">
  18. 第{{ scope.row.release_num }}期
  19. </template>
  20. </el-table-column>
  21. <el-table-column prop="total_seed_num" label="种子金数量" ></el-table-column>
  22. <el-table-column prop="release_energy_pool" label="能量池能量" ></el-table-column>
  23. <el-table-column prop="unit_price" label="价值增长额" ></el-table-column>
  24. <el-table-column label="状态" >
  25. <template slot-scope="scope">
  26. <el-tag v-if="scope.row.release_status == 0">释放中</el-tag>
  27. <el-tag v-if="scope.row.release_status == 1" type="success">释放成功</el-tag>
  28. <el-tooltip v-if="scope.row.release_status == 2" class="item" effect="dark" :content="scope.row.reason" placement="top">
  29. <el-tag type="danger">释放失败</el-tag>
  30. </el-tooltip>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="释放时间">
  34. <template slot-scope="scope">
  35. <div flex>
  36. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
  37. </div>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. </div>
  43. </div>
  44. <script>
  45. const app = new Vue({
  46. el: '#app',
  47. data: {
  48. search:{
  49. user_id:'',
  50. mobile:'',
  51. },
  52. page:1,
  53. limit:20,
  54. list:[],
  55. listLoading: false,
  56. PoolDetail:{},
  57. poolList:{
  58. now_seed_num:{name:'当前种子金数量',num:0},
  59. total_energy_pool:{name:'当前能量池能量',num:0},
  60. today_release_num:{name:'今日能量池释放次数',num:0},
  61. week_release_num:{name:'本周能量池释放次数',num:0},
  62. release_energy_pool:{name:'能量池累计释放总额',num:0},
  63. release_num:{name:'能量池总计释放次数',num:0},
  64. }
  65. }
  66. ,
  67. mounted() {
  68. this.getPoolDetail();
  69. },
  70. methods: {
  71. initEcharts(){
  72. let that = this
  73. var myChart = echarts.init(document.getElementById('visit_chart'));
  74. myChart.setOption({
  75. tooltip: {
  76. trigger: 'axis',
  77. backgroundColor: '#fff',
  78. textStyle: {
  79. color: '#303133'
  80. },
  81. padding: 20,
  82. extraCssText: 'box-shadow: 0 0 4px rgba(0, 0, 0.1);'
  83. },
  84. grid: {
  85. // top: '10%',
  86. left: '2%',
  87. right: '2%',
  88. // bottom: '10%',
  89. containLabel: true
  90. },
  91. xAxis: {
  92. type: 'category',
  93. data: that.PoolDetail.chart.pool.keys
  94. },
  95. yAxis: {
  96. type: 'value',
  97. axisLine: {
  98. show: false
  99. },
  100. nameLocation: 'end',
  101. // name: '=种子金',
  102. // nameTextStyle: {
  103. // color: "rgba(0, 0, 0, 1)",
  104. // fontWeight: "bold",
  105. // fontSize: 16,
  106. // align: "right"
  107. // }
  108. },
  109. color: ['#62daab', '#6395f9','#fbd437'],
  110. series: [
  111. {
  112. name: '种子金数量',
  113. data: that.PoolDetail.chart.seed_num.values,
  114. type: 'bar',
  115. barGap: '1%',
  116. },
  117. {
  118. name: '能量',
  119. data: that.PoolDetail.chart.pool.values,
  120. type: 'bar',
  121. },
  122. {
  123. name: '价值增长额',
  124. data: that.PoolDetail.chart.price.values,
  125. type: 'bar',
  126. }
  127. ],
  128. legend: {
  129. data: ['种子金数量', '能量', '价值增长额'],
  130. },
  131. })
  132. },
  133. getPoolDetail() { //种子金用户记录
  134. let self = this;
  135. self.listLoading = true;
  136. request({
  137. method: 'get',
  138. params: {
  139. r: '/seed/pool/index',
  140. },
  141. data: {},
  142. }).then(e => {
  143. self.listLoading = false;
  144. self.PoolDetail = e.data.data
  145. for(k in self.poolList){
  146. self.poolList[k].num = self.PoolDetail[k]
  147. console.log(k,self.poolList)
  148. }
  149. self.initEcharts()
  150. }).catch(e => {
  151. console.log(e);
  152. });
  153. },
  154. pageChange(currentPage) {
  155. let self = this;
  156. self.page = currentPage;
  157. self.getList();
  158. },
  159. searchs(){
  160. this.page = 1;
  161. this.getList();
  162. }
  163. }
  164. });
  165. </script>
  166. <style>
  167. .album_chart {
  168. height: 340px;
  169. width: 1230px;
  170. }
  171. .chartheader{
  172. display: flex;
  173. justify-content: space-between;
  174. padding:20px;
  175. }
  176. .poolList{
  177. display: flex;
  178. flex-wrap: wrap;
  179. border-radius:10px;
  180. background:#f2f2f2;
  181. }
  182. .poolList li{
  183. width:320px;
  184. padding:25px 0;
  185. text-align:center;
  186. }
  187. .poolList li .title{
  188. color: #a59b9b;
  189. font-size: 15px;
  190. }
  191. .poolList li .content{
  192. //color: #a59b9b;
  193. font-size: 19px;
  194. font-weight:700;
  195. padding:5px 0;
  196. }
  197. </style>