computer.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="container">
  3. <view class="list-cell">
  4. <view class="list-name">有效算力</view>
  5. <view class="list-tpl flex">
  6. <view class="tip"><input type="number" v-model="num" placeholder="请输入有效算力"></view>
  7. <view class="tpl">T</view>
  8. </view>
  9. </view>
  10. <view class="list-cell">
  11. <view class="list-name">XCH价格</view>
  12. <view class="list-tpl flex">
  13. <view class="tip">{{list.fli_usdt}}</view>
  14. <view class="tpl">USDT</view>
  15. </view>
  16. </view><view class="list-cell">
  17. <view class="list-name">算力单价</view>
  18. <view class="list-tpl flex">
  19. <view class="tip">{{list.machine_price}}</view>
  20. <view class="tpl">{{list.machine_price_type}}</view>
  21. </view>
  22. </view><view class="list-cell">
  23. <view class="list-name">算力收益</view>
  24. <view class="list-tpl flex">
  25. <view class="tip">{{list.machine_get}}</view>
  26. <view class="tpl">XCH/T</view>
  27. </view>
  28. </view><view class="list-cell">
  29. <view class="list-name">合约周期</view>
  30. <view class="list-tpl flex">
  31. <view class="tip">{{list.time}}</view>
  32. <view class="tpl">天</view>
  33. </view>
  34. </view>
  35. <view class="submit-box">
  36. <view class="submit" @click="jisuan">计算收益</view>
  37. </view>
  38. <view class="tips">计算结果仅供参考,具体以实际交易为准。</view>
  39. <view class="jisuan-box" v-show="infoShow == true">
  40. <view class="flex jisuan">
  41. <view>投入资金</view>
  42. <view>{{moeny}}</view>
  43. </view>
  44. <view class="flex jisuan">
  45. <view>有效算力</view>
  46. <view>{{suanli}}</view>
  47. </view>
  48. <view class="flex jisuan">
  49. <view>回本期</view>
  50. <view>{{huiben}}</view>
  51. </view>
  52. <view class="flex jisuan">
  53. <view>算力年华收益率</view>
  54. <view>{{year}}</view>
  55. </view>
  56. <view class="flex jisuan">
  57. <view>每月产币</view>
  58. <view>{{month}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import { calculator } from '@/api/calculation.js';
  65. export default {
  66. data() {
  67. return {
  68. list:'',
  69. num:'',
  70. moeny:'',
  71. suanli:'',
  72. huiben:'',
  73. year:'',
  74. month:'',
  75. infoShow:false
  76. };
  77. },
  78. onLoad(option){
  79. this.loadData();
  80. },
  81. onShow() {
  82. },
  83. methods: {
  84. async loadData(){
  85. let obj = this;
  86. calculator({}).then(({ data }) => {
  87. obj.list = data;
  88. });
  89. },
  90. jisuan(){
  91. if(this.num < 0 || this.num ==''){
  92. this.$api.msg('请输入大于或等于1的有效算力!');
  93. return;
  94. }
  95. this.moeny = (this.list.machine_price)*(this.num);
  96. this.suanli = this.num;
  97. this.huiben = (this.list.get_back)*(this.num);
  98. this.year = (this.list.year_get)*(this.num);
  99. this.month = (this.list.month_back)*(this.num);
  100. this.infoShow = true;
  101. },
  102. }
  103. };
  104. </script>
  105. <style lang="scss">
  106. page {
  107. min-height: 100%;
  108. background-color: #ffffff;
  109. .container {
  110. width: 100%;
  111. padding: 20rpx 50rpx;
  112. }
  113. }
  114. .list-cell{
  115. font-size: 28rpx;
  116. font-weight: bold;
  117. color: #333333;
  118. padding: 0rpx 32rpx;
  119. padding-top: 50rpx;
  120. .list-tpl{
  121. padding-top: 50rpx;
  122. }
  123. }
  124. .submit-box{
  125. padding: 54rpx 50rpx;
  126. .submit{
  127. background-color: #5771DF;
  128. color: #FFFFFF;
  129. font-size: 30rpx;
  130. padding: 26rpx 0rpx;
  131. border-radius: 50rpx;
  132. text-align: center;
  133. }
  134. }
  135. .tips{
  136. color: #FB3A2F;
  137. font-size: 24rpx;
  138. font-weight: 500;
  139. }
  140. .jisuan-box{
  141. margin: 80rpx 0rpx;
  142. .jisuan{
  143. padding-bottom: 50rpx;
  144. font-size: 26rpx;
  145. }
  146. }
  147. </style>