| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- <?php
- ?>
- <style>
- @media screen and (max-width: 1370px) {
- #stat_pay {
- min-width: 1131px;
- }
- }
- .order_stat {
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title {
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- }
- .order_stat>.title>.time {
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details {
- padding: 8px 0;
- display: flex;
- }
- .stat_details .order_module {
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module {
- display: flex;
- flex-direction: column;
- }
- .order_module:last-child {
- margin-right: 0;
- }
- .order_module:first-child {
- margin-left: 0;
- }
- .price {
- font-size: 22px;
- font-weight: bold;
- flex: 1;
- word-break: break-all;
- }
- .oirder_modul_title {
- font-size: 12px;
- margin: 10px 0;
- /* display: flex;
- align-items: center; */
- }
- .oirder_modul_title .text {
- margin-right: 10px;
- }
- .stat_icon {
- font-size: 19px;
- color: #BFBFBF;
- }
- .total {
- display: flex;
- margin-bottom: 10px;
- }
- .pay_total {
- flex: 1;
- flex-basis: 764px;
- background: #FFF;
- padding: 10px 10px 15px;
- }
- .pay_total:last-child {
- margin-left: 12px;
- }
- .el-date-editor .el-range-separator {
- padding: 0;
- }
- .pay_modules {
- margin-top: 20px;
- display: flex;
- flex-wrap: wrap;
- }
- .module {
- /* width: 350px; */
- width: 46%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module_two {
- width: 33%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module:nth-child(2n) {
- margin-left: 30px
- }
- .no_open {
- flex: 1;
- color: #2E8FF4;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- .pay_button {
- display: flex;
- border: 1px solid #2E8FF4;
- border-radius: 4px;
- color: #464646;
- }
- .pay_button div {
- background: #FFF;
- padding: 10px;
- font-size: 14px;
- font-weight: 500;
- width: 80px;
- height: 36px;
- border-radius: 4px;
- text-align: center;
- }
- .pay_button .pay_button_sel {
- background: #2E8FF4;
- color: #FFF;
- border-radius: 0;
- }
- .pay_img {
- width: 56px;
- height: 56px;
- margin-right: 20px;
- }
- .assets {
- color: #848484;
- }
- .data_chart {
- background: #FFF;
- padding: 10px 10px 15px;
- width: 100%;
- position: relative;
- /* display: flex; */
- }
- .data_chart_time {
- position: absolute;
- top: 10px;
- right: 50px;
- display: flex;
- font-size: 16px;
- }
- .sel_time {
- margin-right: 20px;
- padding-bottom: 5px;
- }
- .sel_time:hover {
- cursor: pointer
- }
- .sel_color {
- border-bottom: 2px solid #5ED9A9;
- }
- .stat_chart {
- height: 500px;
- /* width: 82rem; */
- width: 90%;
- }
- .top_title {
- display: flex;
- padding: 18px 0;
- background-color: white;
- margin: 10px 0;
- align-items: center;
- }
- .top_title div:nth-of-type(1) {
- padding: 0 30px 0 20px;
- font-weight: bold;
- font-size: 16px;
- }
- .div_text_center {
- text-align: center;
- }
- </style>
- <div id="stat_pay" v-cloak>
- <div class="top_title">
- <div>数据概况</div>
- <div class="time">更新时间:{{update_order_time}}</div>
- </div>
- <div class="order_stat">
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in dataOverview" :key="item.type">
- <div class="price div_text_center">
- {{item.value}}
- </div>
- <div class="oirder_modul_title">
- <div class="div_text_center">{{item.name}}</div>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="data_chart">-->
- <!-- <div ref="stat_chart" style="background: #FFF;" class="stat_chart"></div>-->
- <!-- <div class="data_chart_time">-->
- <!-- <div class="sel_time" :class="{sel_color: chartTimeType == 1}" style="margin-right: 20px;" @click="getChart(1)">近七天</div>-->
- <!-- <div class="sel_time" :class="{sel_color: chartTimeType == 2}" @click="getChart(2)">近一个月</div>-->
- <!-- </div>-->
- <!-- </div>-->
- <div style="height:30px;"></div>
- <el-row :gutter="20">
- <el-col :span="12">
- <div style="background-color:white;padding:10px 10px 6px 20px;border-bottom:1px solid gray;">
- <h3>嗨值排行榜</h3>
- </div>
- <div>
- <el-table :data="hi_value_data" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column type="index" label="排名" width="180" :index="indexMethod">
- </el-table-column>
- <el-table-column label="用户信息">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="hi_value" width="180" label="持有嗨值">
- </el-table-column>
- </el-table>
- </div>
- </el-col>
- <el-col :span="12">
- <div style="background-color:white;padding:10px 10px 6px 20px;border-bottom:1px solid gray;">
- <h3>嗨贝排行榜</h3>
- </div>
- <div>
- <el-table :data="hi_bei_data" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column type="index" label="排名" width="180" :index="indexMethod">
- </el-table-column>
- <el-table-column label="用户信息">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="hi_bei" width="180" label="持有嗨贝">
- </el-table-column>
- </el-table>
- </div>
- </el-col>
- </el-row>
- </div>
- <script>
- new Vue({
- el: '#stat_pay',
- data() {
- return {
- update_order_time: '',
- order_time: [],
- buttonType: 1,
- user_total: null,
- order_total: null,
- hi_value_data: [],
- hi_bei_data: [],
- user_trade_data: [],
- listLoading: false,
- dataOverview: {
- "total_issuance": {
- type: 'total_issuance',
- name: '发行总量(枚)',
- value: '0.00',
- },
- "airdrops_today": {
- type: 'airdrops_today',
- name: '今日空投数(枚)',
- value: '0.00',
- },
- "current_platform_account": {
- type: 'current_platform_account',
- name: '当前总量(枚)',
- value: '0.00',
- }
- },
- chartTimeType: 0,
- currencyInfo: [],
- chartTimeArr: [],
- paid_amount_arr: [],
- settle_income_arr: [],
- }
- },
- created() {
- this.getData();
- this.getChart();
- this.$nextTick(v => {
- this.statChart();
- })
- },
- methods: {
- indexMethod(index) {
- return index + 1;
- },
- getData() {
- let that = this;
- that.currencyInfo = [];
- //that.memberAssets = [];
- let params = {
- r: 'hi-go/data-overview/index'
- }
- // if (this.order_time) {
- // // date.start_date = this.order_time[0];
- // // date.end_date = this.order_time[1];
- // date.order_time = this.order_time;
- // }
- request({
- params: params,
- method: 'get',
- }).then(res => {
- if (res.data.code == 0) {
- this.hi_value_data = res.data.data.hi_value_data;
- this.hi_bei_data = res.data.data.hi_bei_data;
- this.dataOverview.total_issuance.value = res.data.data.total.hi_bei;
- this.dataOverview.airdrops_today.value = res.data.data.total.airdrops_today;
- this.dataOverview.current_platform_account.value = res.data.data.total.available_hi_bei;
- console.log(res.data.data, '9000-9099099090')
- that.update_order_time = res.data.data.update_time;
- that.order_time = res.data.data.date;
- //订单概况
- for (let field in this.orderTotalArr) {
- if (res.data.data.orderStatistics[field]) {
- this.orderTotalArr[field]['value'] = res.data.data.orderStatistics[field];
- } else {
- this.orderTotalArr[field]['value'] = '0.00';
- }
- }
- }
- }).catch(e => {
- });
- },
- //图表
- getChart(type = 1) {
- if (this.chartTimeType == type) {
- return;
- }
- this.chartTimeType = type;
- let that = this;
- that.chartTimeArr = [];
- that.paid_amount_arr = [];
- that.settle_income_arr = [];
- request({
- params: {
- r: '/mall/finance/income',
- date_type: this.chartTimeType
- },
- method: 'get',
- }).then(res => {
- if (res.data.code == 0) {
- res.data.data.forEach(v => {
- that.chartTimeArr.push(v.stat_date);
- that.paid_amount_arr.push(v.pay_money.toFixed(2));
- that.settle_income_arr.push(v.settled_commission_total.toFixed(2));
- });
- that.$nextTick(v => {
- that.statChart();
- })
- }
- })
- },
- statChart() {
- let echartStat = echarts.init(this.$refs.stat_chart);
- let option = {
- title: {
- text: '当前价值表'
- },
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- x: 'center', //可设定图例在左、右、居中
- y: 'bottom', //可设定图例在上、下、居中
- data: ['空投数', '销毁量']
- },
- grid: {
- left: '1%',
- right: '4%',
- bottom: '8%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: true, // false 不留白
- data: this.chartTimeArr
- },
- yAxis: {
- type: 'value',
- // name:'收支趋势'
- },
- series: [{
- name: '已结算佣金',
- type: 'line',
- stack: '总量',
- itemStyle: {
- normal: {
- color: '#5ED9A9',
- lineStyle: {
- color: '#5ED9A9'
- }
- }
- },
- data: this.settle_income_arr
- },
- {
- name: '佣金支出',
- type: 'line',
- stack: '总量',
- itemStyle: {
- normal: {
- color: '#5B8FF9',
- lineStyle: {
- color: '#5B8FF9'
- }
- }
- },
- data: this.paid_amount_arr
- }
- ]
- };
- echartStat.setOption(option)
- setTimeout(function() {
- window.onresize = function() {
- echartStat.resize();
- }
- }, 200)
- },
- updateOrderTime(v) {
- this.order_time = v;
- this.getData();
- },
- toFormatDate: function(date) {
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? ('0' + MM) : MM;
- let d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- return y + '-' + MM + '-' + d;
- }
- }
- })
- </script>
|