myCalculation.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="container">
  3. <view class="list-cell" v-if="list.length > 0" v-for="(ls,index) in list" :key='index'>
  4. <view class="cell-title flex">
  5. <view class="cellTpl flex_item">
  6. <image :src="ls.machine.logo"></image>
  7. <view class="title">{{ls.machine.name}}</view>
  8. </view>
  9. <view class="status">{{ls.status == 0 ? '准备中' : ls.status == 1 ? '挖矿中' : '已到期'}}</view>
  10. </view>
  11. <view class="cell-tip">{{ls.machine.first_step_time + ls.machine.second_step_time + ls.machine.third_step_time}}天矿机</view>
  12. <view class="flex cell-tpl">
  13. <view class="tpl">
  14. <view class="">单价</view>
  15. <view class="">{{ls.machine.cost_money}}</view>
  16. </view>
  17. <view class="tpl">
  18. <view class="">有效算力</view>
  19. <view class="">{{ls.num * 1}}T</view>
  20. </view>
  21. <view class="tpl">
  22. <view class="">合约周期</view>
  23. <view class="">{{ls.machine.first_step_time + ls.machine.second_step_time + ls.machine.third_step_time}}天</view>
  24. </view>
  25. </view>
  26. <view class="cell-info flex">
  27. <view class="tip">到期时间:{{ls.mining_end_time}}</view>
  28. </view>
  29. <!-- <view class="cell-info flex">
  30. <view class="tip">正式挖矿时间:{{ls.mining_start_time}}</view>
  31. </view> -->
  32. <view class="list-tip">
  33. <rich-text :nodes="ls.machine.detail"></rich-text>
  34. </view>
  35. </view>
  36. <view class="empty-box" v-show="list.length === 0"><empty></empty></view>
  37. </view>
  38. </template>
  39. <script>
  40. import { mymining } from '@/api/calculation.js';
  41. import empty from '@/components/empty';
  42. export default {
  43. components: {
  44. empty
  45. },
  46. data() {
  47. return {
  48. list:'',
  49. };
  50. },
  51. onLoad(option){
  52. this.loadData();
  53. },
  54. onShow() {
  55. },
  56. //下拉刷新
  57. onPullDownRefresh() {
  58. this.loadData();
  59. },
  60. methods: {
  61. async loadData() {
  62. let obj = this;
  63. mymining({
  64. page:1,
  65. limit:1000,
  66. }).then(({ data }) => {
  67. console.log(data);
  68. obj.list = data.data;
  69. });
  70. },
  71. }
  72. };
  73. </script>
  74. <style lang="scss">
  75. page {
  76. min-height: 100%;
  77. background-color: #ffffff;
  78. .container {
  79. width: 100%;
  80. }
  81. }
  82. .list-cell{
  83. padding: 40rpx 40rpx;
  84. .cell-title{
  85. padding: 29rpx 38rpx;
  86. font-size: 30rpx;
  87. font-weight: bold;
  88. color: #333333;
  89. .cellTpl{
  90. image{
  91. width: 40rpx;
  92. height: 40rpx;
  93. margin-right: 15rpx;
  94. }
  95. }
  96. .status{
  97. color: #E51C23;
  98. }
  99. }
  100. .cell-tip{
  101. padding: 0rpx 38rpx;
  102. font-size: 24rpx;
  103. font-weight: bold;
  104. color: #0EC1A1;
  105. }
  106. .cell-tpl{
  107. padding: 40rpx 31rpx;
  108. font-size: 24rpx;
  109. font-weight: bold;
  110. color: #333333;
  111. line-height: 40rpx;
  112. }
  113. .cell-info{
  114. margin-bottom: 25rpx;
  115. .tip{
  116. font-size: 30rpx;
  117. font-weight: bold;
  118. color: #5771DF;
  119. }
  120. .zhiya-btn{
  121. background-color: #5771DF;
  122. padding: 12rpx 22rpx;
  123. font-size: 24rpx;
  124. border-radius: 50rpx;
  125. color: #FFFFFF;
  126. }
  127. }
  128. .list-tip{
  129. word-wrap:break-word;
  130. background-color: #BAC1EF !important;
  131. font-size: 24rpx;
  132. font-weight: 500;
  133. color: #333333;
  134. padding: 36rpx 32rpx;
  135. margin-top: 15rpx;
  136. border-bottom-left-radius:15rpx ;
  137. border-bottom-right-radius:15rpx ;
  138. }
  139. }
  140. .empty-box{
  141. margin-top: 100rpx;
  142. width: 100%;
  143. height: 500rpx;
  144. }
  145. </style>