data-statistics.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="data-statistics-box">
  3. <Navbar title="数据统计" color="#333"></Navbar>
  4. <view class="content">
  5. <view class="bk"></view>
  6. <view class="info">
  7. <view class="top">
  8. <view class="name">绿通总量池</view>
  9. <view class="num">{{info.totalGold}}</view>
  10. <!-- <view class="tip" @click="toPage('')">查询区块链</view> -->
  11. </view>
  12. <view class="bottom">
  13. <view class="title">
  14. 绿通兑换产品系数(1 : {{price}})
  15. </view>
  16. <view class="box">
  17. <view class="item">
  18. <text>{{info.released}}</text>
  19. 绿通释放池
  20. </view>
  21. <view class="item">
  22. <text>{{info.remained}}</text>
  23. 绿通剩余释放池
  24. </view>
  25. <view class="item">
  26. <text>{{info.totalDestroyed}}</text>
  27. 绿通总销毁值
  28. </view>
  29. <view class="item">
  30. <text>{{info.todayDestroyed}}</text>
  31. 今日绿通销毁值
  32. </view>
  33. <view class="item">
  34. <text>{{info.allIntegral}}</text>
  35. 全网已释放的绿值
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script lang='ts'>
  44. import {
  45. Component,
  46. Prop,
  47. Vue
  48. } from 'vue-property-decorator';
  49. @Component({
  50. filters: {
  51. moneyFormat(val: any) {
  52. if (!+val) return '0.000000000000000000';
  53. return (+val).toFixed(18);
  54. }
  55. }
  56. })
  57. export default class DataStatistics extends Vue {
  58. info: any = {};
  59. price: any = 0;
  60. balanceInfo: any = {};
  61. onShow() {
  62. this.getInfo();
  63. this.getGoldPrice();
  64. // this.getBalance();
  65. }
  66. getInfo() {
  67. this.$http
  68. .get({
  69. url: this.$api.getDataSum
  70. })
  71. .then((res: any) => {
  72. this.info = res;
  73. }, (err: any) => {
  74. console.log(err);
  75. });
  76. }
  77. toPage(url: any, data: any = {}) {
  78. if (!url) {
  79. uni.showToast({
  80. title: '敬请期待',
  81. icon: 'none'
  82. })
  83. return;
  84. }
  85. this.$Router.push({
  86. path: url,
  87. query: data
  88. })
  89. }
  90. getGoldPrice() {
  91. this.$http
  92. .get({
  93. url: this.$api.getGoldPrice
  94. })
  95. .then((res: any) => {
  96. this.price = res.goldOfficialPrice;
  97. }, (err: any) => {
  98. console.log(err);
  99. });
  100. }
  101. getBalance() {
  102. this.$http
  103. .get({
  104. url: this.$api.getBalance
  105. })
  106. .then((res: any) => {
  107. this.balanceInfo = res;
  108. }, (err: any) => {
  109. console.log(err);
  110. });
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .data-statistics-box {
  116. .content {
  117. @include flex-y();
  118. .bk {
  119. width: vw(800);
  120. height: vw(800);
  121. background: linear-gradient(90deg, rgba(24, 105, 171, 1) 0%, rgba(3, 86, 152, 1) 100%);
  122. border-radius: vw(300);
  123. position: absolute;
  124. left: 50%;
  125. transform: translateX(-50%);
  126. top: vw(-520);
  127. }
  128. .info {
  129. position: relative;
  130. z-index: 10;
  131. margin-top: vw(32);
  132. .top {
  133. @include flex-y();
  134. .name {
  135. @include word-vw(14, #fff);
  136. }
  137. .num {
  138. @include word-vw(24, #fff);
  139. margin-top: vw(8);
  140. }
  141. .tip {
  142. padding: 0 vw(10);
  143. height: vw(24);
  144. line-height: vw(24);
  145. box-sizing: border-box;
  146. background: rgba(255, 255, 255, 0.2);
  147. @include word-vw(14, #fff);
  148. border: vw(1) solid rgba(255, 255, 255, 0.5);
  149. border-radius: vw(12);
  150. margin-top: vw(16);
  151. }
  152. }
  153. .bottom {
  154. background: #fff;
  155. width: vw(355);
  156. border-radius: vw(10);
  157. margin-top: vw(32);
  158. overflow: hidden;
  159. .title {
  160. height: vw(36);
  161. line-height: vw(36);
  162. background: #F7F7F7;
  163. @include word-vw(12, #A8A8A8);
  164. text-align: center;
  165. }
  166. .box {
  167. @include flex-x();
  168. flex-wrap: wrap;
  169. .item {
  170. width: 100%;
  171. height: vw(100);
  172. @include flex-y(center);
  173. @include word-vw(14, #A8A8A8);
  174. text {
  175. @include word-vw(20, #333);
  176. font-weight: bold;
  177. margin-bottom: vw(5);
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. </style>