123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- <template>
- <view class="data-statistics-box">
- <Navbar title="数据统计" color="#333"></Navbar>
- <view class="content">
- <view class="bk"></view>
- <view class="info">
- <view class="top">
- <view class="name">绿通总量池</view>
- <view class="num">{{info.totalGold}}</view>
- <!-- <view class="tip" @click="toPage('')">查询区块链</view> -->
- </view>
- <view class="bottom">
- <view class="title">
- 绿通兑换产品系数(1 : {{price}})
- </view>
- <view class="box">
- <view class="item">
- <text>{{info.released}}</text>
- 绿通释放池
- </view>
- <view class="item">
- <text>{{info.remained}}</text>
- 绿通剩余释放池
- </view>
- <view class="item">
- <text>{{info.totalDestroyed}}</text>
- 绿通总销毁值
- </view>
- <view class="item">
- <text>{{info.todayDestroyed}}</text>
- 今日绿通销毁值
- </view>
- <view class="item">
- <text>{{info.allIntegral}}</text>
- 全网已释放的绿值
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script lang='ts'>
- import {
- Component,
- Prop,
- Vue
- } from 'vue-property-decorator';
- @Component({
- filters: {
- moneyFormat(val: any) {
- if (!+val) return '0.000000000000000000';
- return (+val).toFixed(18);
- }
- }
- })
- export default class DataStatistics extends Vue {
- info: any = {};
- price: any = 0;
- balanceInfo: any = {};
- onShow() {
- this.getInfo();
- this.getGoldPrice();
- // this.getBalance();
- }
- getInfo() {
- this.$http
- .get({
- url: this.$api.getDataSum
- })
- .then((res: any) => {
- this.info = res;
- }, (err: any) => {
- console.log(err);
- });
- }
-
- toPage(url: any, data: any = {}) {
- if (!url) {
- uni.showToast({
- title: '敬请期待',
- icon: 'none'
- })
- return;
- }
- this.$Router.push({
- path: url,
- query: data
- })
- }
- getGoldPrice() {
- this.$http
- .get({
- url: this.$api.getGoldPrice
- })
- .then((res: any) => {
- this.price = res.goldOfficialPrice;
- }, (err: any) => {
- console.log(err);
- });
- }
- getBalance() {
- this.$http
- .get({
- url: this.$api.getBalance
- })
- .then((res: any) => {
- this.balanceInfo = res;
- }, (err: any) => {
- console.log(err);
- });
- }
- }
- </script>
- <style lang="scss" scoped>
- .data-statistics-box {
- .content {
- @include flex-y();
- .bk {
- width: vw(800);
- height: vw(800);
- background: linear-gradient(90deg, rgba(24, 105, 171, 1) 0%, rgba(3, 86, 152, 1) 100%);
- border-radius: vw(300);
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- top: vw(-520);
- }
- .info {
- position: relative;
- z-index: 10;
- margin-top: vw(32);
- .top {
- @include flex-y();
- .name {
- @include word-vw(14, #fff);
- }
- .num {
- @include word-vw(24, #fff);
- margin-top: vw(8);
- }
- .tip {
- padding: 0 vw(10);
- height: vw(24);
- line-height: vw(24);
- box-sizing: border-box;
- background: rgba(255, 255, 255, 0.2);
- @include word-vw(14, #fff);
- border: vw(1) solid rgba(255, 255, 255, 0.5);
- border-radius: vw(12);
- margin-top: vw(16);
- }
- }
- .bottom {
- background: #fff;
- width: vw(355);
- border-radius: vw(10);
- margin-top: vw(32);
- overflow: hidden;
- .title {
- height: vw(36);
- line-height: vw(36);
- background: #F7F7F7;
- @include word-vw(12, #A8A8A8);
- text-align: center;
- }
- .box {
- @include flex-x();
- flex-wrap: wrap;
- .item {
- width: 100%;
- height: vw(100);
- @include flex-y(center);
- @include word-vw(14, #A8A8A8);
- text {
- @include word-vw(20, #333);
- font-weight: bold;
- margin-bottom: vw(5);
- }
- }
- }
- }
- }
- }
- }
- </style>
|