index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <?php
  2. ?>
  3. <style>
  4. @media screen and (max-width: 1370px) {
  5. #stat_pay {
  6. min-width: 1131px;
  7. }
  8. }
  9. .order_stat {
  10. background: #FFF;
  11. padding: 10px 10px 0;
  12. margin-bottom: 10px;
  13. }
  14. .title {
  15. font-size: 18px;
  16. font-weight: bold;
  17. display: flex;
  18. align-items: center;
  19. height: 40px;
  20. }
  21. .order_stat>.title>.time {
  22. font-size: 13px;
  23. font-weight: 400;
  24. color: #BFBFBF;
  25. margin-left: 20px;
  26. flex: 1;
  27. }
  28. .order_stat .stat_details {
  29. padding: 8px 0;
  30. display: flex;
  31. }
  32. .stat_details .order_module {
  33. flex: 1;
  34. background: #F2F2F2;
  35. margin: 0 5px;
  36. padding: 20px 25px;
  37. }
  38. .order_module {
  39. display: flex;
  40. flex-direction: column;
  41. }
  42. .order_module:last-child {
  43. margin-right: 0;
  44. }
  45. .order_module:first-child {
  46. margin-left: 0;
  47. }
  48. .price {
  49. font-size: 22px;
  50. font-weight: bold;
  51. flex: 1;
  52. word-break: break-all;
  53. }
  54. .oirder_modul_title {
  55. font-size: 12px;
  56. margin: 10px 0;
  57. /* display: flex;
  58. align-items: center; */
  59. }
  60. .oirder_modul_title .text {
  61. margin-right: 10px;
  62. }
  63. .stat_icon {
  64. font-size: 19px;
  65. color: #BFBFBF;
  66. }
  67. .total {
  68. display: flex;
  69. margin-bottom: 10px;
  70. }
  71. .pay_total {
  72. flex: 1;
  73. flex-basis: 764px;
  74. background: #FFF;
  75. padding: 10px 10px 15px;
  76. }
  77. .pay_total:last-child {
  78. margin-left: 12px;
  79. }
  80. .el-date-editor .el-range-separator {
  81. padding: 0;
  82. }
  83. .pay_modules {
  84. margin-top: 20px;
  85. display: flex;
  86. flex-wrap: wrap;
  87. }
  88. .module {
  89. /* width: 350px; */
  90. width: 46%;
  91. background: #F7F7F7;
  92. padding: 20px 25px;
  93. margin-bottom: 15px;
  94. display: flex;
  95. }
  96. .module_two {
  97. width: 33%;
  98. background: #F7F7F7;
  99. padding: 20px 25px;
  100. margin-bottom: 15px;
  101. display: flex;
  102. }
  103. .module:nth-child(2n) {
  104. margin-left: 30px
  105. }
  106. .no_open {
  107. flex: 1;
  108. color: #2E8FF4;
  109. display: flex;
  110. align-items: center;
  111. justify-content: flex-end;
  112. }
  113. .pay_button {
  114. display: flex;
  115. border: 1px solid #2E8FF4;
  116. border-radius: 4px;
  117. color: #464646;
  118. }
  119. .pay_button div {
  120. background: #FFF;
  121. padding: 10px;
  122. font-size: 14px;
  123. font-weight: 500;
  124. width: 80px;
  125. height: 36px;
  126. border-radius: 4px;
  127. text-align: center;
  128. }
  129. .pay_button .pay_button_sel {
  130. background: #2E8FF4;
  131. color: #FFF;
  132. border-radius: 0;
  133. }
  134. .pay_img {
  135. width: 56px;
  136. height: 56px;
  137. margin-right: 20px;
  138. }
  139. .assets {
  140. color: #848484;
  141. }
  142. .data_chart {
  143. background: #FFF;
  144. padding: 10px 10px 15px;
  145. width: 100%;
  146. position: relative;
  147. /* display: flex; */
  148. }
  149. .data_chart_time {
  150. position: absolute;
  151. top: 10px;
  152. right: 50px;
  153. display: flex;
  154. font-size: 16px;
  155. }
  156. .sel_time {
  157. margin-right: 20px;
  158. padding-bottom: 5px;
  159. }
  160. .sel_time:hover {
  161. cursor: pointer
  162. }
  163. .sel_color {
  164. border-bottom: 2px solid #5ED9A9;
  165. }
  166. .stat_chart {
  167. height: 500px;
  168. /* width: 82rem; */
  169. width: 90%;
  170. }
  171. .top_title {
  172. display: flex;
  173. padding: 18px 0;
  174. background-color: white;
  175. margin: 10px 0;
  176. align-items: center;
  177. }
  178. .top_title div:nth-of-type(1) {
  179. padding: 0 30px 0 20px;
  180. font-weight: bold;
  181. font-size: 16px;
  182. }
  183. .div_text_center {
  184. text-align: center;
  185. }
  186. </style>
  187. <div id="stat_pay" v-cloak>
  188. <div class="top_title">
  189. <div>数据概况</div>
  190. <div class="time">更新时间:{{update_order_time}}</div>
  191. </div>
  192. <div class="order_stat">
  193. <div class="stat_details">
  194. <div class="order_module" v-for="(item,index) in dataOverview" :key="item.type">
  195. <div class="price div_text_center">
  196. {{item.value}}
  197. </div>
  198. <div class="oirder_modul_title">
  199. <div class="div_text_center">{{item.name}}</div>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. <!-- <div class="data_chart">-->
  205. <!-- <div ref="stat_chart" style="background: #FFF;" class="stat_chart"></div>-->
  206. <!-- <div class="data_chart_time">-->
  207. <!-- <div class="sel_time" :class="{sel_color: chartTimeType == 1}" style="margin-right: 20px;" @click="getChart(1)">近七天</div>-->
  208. <!-- <div class="sel_time" :class="{sel_color: chartTimeType == 2}" @click="getChart(2)">近一个月</div>-->
  209. <!-- </div>-->
  210. <!-- </div>-->
  211. <div style="height:30px;"></div>
  212. <el-row :gutter="20">
  213. <el-col :span="12">
  214. <div style="background-color:white;padding:10px 10px 6px 20px;border-bottom:1px solid gray;">
  215. <h3>嗨值排行榜</h3>
  216. </div>
  217. <div>
  218. <el-table :data="hi_value_data" stripe style="width: 100%" v-loading="listLoading">
  219. <el-table-column type="index" label="排名" width="180" :index="indexMethod">
  220. </el-table-column>
  221. <el-table-column label="用户信息">
  222. <template slot-scope="scope">
  223. <div class="table-info-img-text">
  224. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  225. <div slot="error" class="image-slot">
  226. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  227. </div>
  228. </el-image>
  229. <div class="table-info-text">
  230. <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  231. </div>
  232. </div>
  233. </template>
  234. </el-table-column>
  235. <el-table-column prop="hi_value" width="180" label="持有嗨值">
  236. </el-table-column>
  237. </el-table>
  238. </div>
  239. </el-col>
  240. <el-col :span="12">
  241. <div style="background-color:white;padding:10px 10px 6px 20px;border-bottom:1px solid gray;">
  242. <h3>嗨贝排行榜</h3>
  243. </div>
  244. <div>
  245. <el-table :data="hi_bei_data" stripe style="width: 100%" v-loading="listLoading">
  246. <el-table-column type="index" label="排名" width="180" :index="indexMethod">
  247. </el-table-column>
  248. <el-table-column label="用户信息">
  249. <template slot-scope="scope">
  250. <div class="table-info-img-text">
  251. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  252. <div slot="error" class="image-slot">
  253. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  254. </div>
  255. </el-image>
  256. <div class="table-info-text">
  257. <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
  258. </div>
  259. </div>
  260. </template>
  261. </el-table-column>
  262. <el-table-column prop="hi_bei" width="180" label="持有嗨贝">
  263. </el-table-column>
  264. </el-table>
  265. </div>
  266. </el-col>
  267. </el-row>
  268. </div>
  269. <script>
  270. new Vue({
  271. el: '#stat_pay',
  272. data() {
  273. return {
  274. update_order_time: '',
  275. order_time: [],
  276. buttonType: 1,
  277. user_total: null,
  278. order_total: null,
  279. hi_value_data: [],
  280. hi_bei_data: [],
  281. user_trade_data: [],
  282. listLoading: false,
  283. dataOverview: {
  284. "total_issuance": {
  285. type: 'total_issuance',
  286. name: '发行总量(枚)',
  287. value: '0.00',
  288. },
  289. "airdrops_today": {
  290. type: 'airdrops_today',
  291. name: '今日空投数(枚)',
  292. value: '0.00',
  293. },
  294. "current_platform_account": {
  295. type: 'current_platform_account',
  296. name: '当前总量(枚)',
  297. value: '0.00',
  298. }
  299. },
  300. chartTimeType: 0,
  301. currencyInfo: [],
  302. chartTimeArr: [],
  303. paid_amount_arr: [],
  304. settle_income_arr: [],
  305. }
  306. },
  307. created() {
  308. this.getData();
  309. this.getChart();
  310. this.$nextTick(v => {
  311. this.statChart();
  312. })
  313. },
  314. methods: {
  315. indexMethod(index) {
  316. return index + 1;
  317. },
  318. getData() {
  319. let that = this;
  320. that.currencyInfo = [];
  321. //that.memberAssets = [];
  322. let params = {
  323. r: 'hi-go/data-overview/index'
  324. }
  325. // if (this.order_time) {
  326. // // date.start_date = this.order_time[0];
  327. // // date.end_date = this.order_time[1];
  328. // date.order_time = this.order_time;
  329. // }
  330. request({
  331. params: params,
  332. method: 'get',
  333. }).then(res => {
  334. if (res.data.code == 0) {
  335. this.hi_value_data = res.data.data.hi_value_data;
  336. this.hi_bei_data = res.data.data.hi_bei_data;
  337. this.dataOverview.total_issuance.value = res.data.data.total.hi_bei;
  338. this.dataOverview.airdrops_today.value = res.data.data.total.airdrops_today;
  339. this.dataOverview.current_platform_account.value = res.data.data.total.available_hi_bei;
  340. console.log(res.data.data, '9000-9099099090')
  341. that.update_order_time = res.data.data.update_time;
  342. that.order_time = res.data.data.date;
  343. //订单概况
  344. for (let field in this.orderTotalArr) {
  345. if (res.data.data.orderStatistics[field]) {
  346. this.orderTotalArr[field]['value'] = res.data.data.orderStatistics[field];
  347. } else {
  348. this.orderTotalArr[field]['value'] = '0.00';
  349. }
  350. }
  351. }
  352. }).catch(e => {
  353. });
  354. },
  355. //图表
  356. getChart(type = 1) {
  357. if (this.chartTimeType == type) {
  358. return;
  359. }
  360. this.chartTimeType = type;
  361. let that = this;
  362. that.chartTimeArr = [];
  363. that.paid_amount_arr = [];
  364. that.settle_income_arr = [];
  365. request({
  366. params: {
  367. r: '/mall/finance/income',
  368. date_type: this.chartTimeType
  369. },
  370. method: 'get',
  371. }).then(res => {
  372. if (res.data.code == 0) {
  373. res.data.data.forEach(v => {
  374. that.chartTimeArr.push(v.stat_date);
  375. that.paid_amount_arr.push(v.pay_money.toFixed(2));
  376. that.settle_income_arr.push(v.settled_commission_total.toFixed(2));
  377. });
  378. that.$nextTick(v => {
  379. that.statChart();
  380. })
  381. }
  382. })
  383. },
  384. statChart() {
  385. let echartStat = echarts.init(this.$refs.stat_chart);
  386. let option = {
  387. title: {
  388. text: '当前价值表'
  389. },
  390. tooltip: {
  391. trigger: 'axis'
  392. },
  393. legend: {
  394. x: 'center', //可设定图例在左、右、居中
  395. y: 'bottom', //可设定图例在上、下、居中
  396. data: ['空投数', '销毁量']
  397. },
  398. grid: {
  399. left: '1%',
  400. right: '4%',
  401. bottom: '8%',
  402. containLabel: true
  403. },
  404. xAxis: {
  405. type: 'category',
  406. boundaryGap: true, // false 不留白
  407. data: this.chartTimeArr
  408. },
  409. yAxis: {
  410. type: 'value',
  411. // name:'收支趋势'
  412. },
  413. series: [{
  414. name: '已结算佣金',
  415. type: 'line',
  416. stack: '总量',
  417. itemStyle: {
  418. normal: {
  419. color: '#5ED9A9',
  420. lineStyle: {
  421. color: '#5ED9A9'
  422. }
  423. }
  424. },
  425. data: this.settle_income_arr
  426. },
  427. {
  428. name: '佣金支出',
  429. type: 'line',
  430. stack: '总量',
  431. itemStyle: {
  432. normal: {
  433. color: '#5B8FF9',
  434. lineStyle: {
  435. color: '#5B8FF9'
  436. }
  437. }
  438. },
  439. data: this.paid_amount_arr
  440. }
  441. ]
  442. };
  443. echartStat.setOption(option)
  444. setTimeout(function() {
  445. window.onresize = function() {
  446. echartStat.resize();
  447. }
  448. }, 200)
  449. },
  450. updateOrderTime(v) {
  451. this.order_time = v;
  452. this.getData();
  453. },
  454. toFormatDate: function(date) {
  455. let y = date.getFullYear();
  456. let MM = date.getMonth() + 1;
  457. MM = MM < 10 ? ('0' + MM) : MM;
  458. let d = date.getDate();
  459. d = d < 10 ? ('0' + d) : d;
  460. return y + '-' + MM + '-' + d;
  461. }
  462. }
  463. })
  464. </script>