earning-list.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view class="earning-box">
  3. <en-list ref="earningObj" @getList="getList">
  4. <template v-slot:listInfo="{pagingData}">
  5. <view class="earning-list">
  6. <view v-for="item in pagingData" class="item">
  7. <view class="list-item">
  8. <view class="item-line">
  9. <view class="item-text">BNB</view>
  10. </view>
  11. <view class="item-line line-text">
  12. <view class="item-text">{{$t('index.index.list.item.title')}}</view>
  13. </view>
  14. <view class="item-line" v-if="item.hash">
  15. <view class="item-text">Hash</view>
  16. <view class="item-text text-hash" @click="goToUrl(item.hash)">
  17. {{item.hash}}
  18. </view>
  19. </view>
  20. <view class="item-line" v-if="item.nbn_money>0">
  21. <view class="item-text">BNB Number</view>
  22. <view class="item-text text-two">
  23. <view class="text-img">
  24. <image src="@/static/img/index/bnb2.png"></image>
  25. </view>
  26. <view class="text">{{(item.nbn_money).toFixed(6)*1}}</view>
  27. </view>
  28. </view>
  29. <view class="item-line" v-if="item.db_money>0">
  30. <view class="item-text">{{$t('index.index.list.item.integral')}}</view>
  31. <view class="item-text text-two">
  32. <view class="text-img">
  33. <image src="@/static/img/index/jf.svg"></image>
  34. </view>
  35. <view class="text">{{(item.db_money).toFixed(6)*1}}</view>
  36. </view>
  37. </view>
  38. <view class="item-line">
  39. <view class="item-text">{{$t('index.index.list.item.service')}}</view>
  40. <view class="item-text">{{(item.service_money).toFixed(6)*1}}</view>
  41. </view>
  42. <view class="item-line">
  43. <view class="item-text">{{$t('index.index.list.item.date')}}</view>
  44. <view class="item-text">{{item.created_at}}</view>
  45. </view>
  46. </view>
  47. <division class="division-item"></division>
  48. </view>
  49. </view>
  50. </template>
  51. </en-list>
  52. </view>
  53. </template>
  54. <script>
  55. import EnList from "@/components/en-list/en-list";
  56. import {getEarnings} from "@/api/contract";
  57. import Division from "@/pages/index/components/division";
  58. export default {
  59. name: "earning-list",
  60. components: {Division, EnList},
  61. props: {},
  62. data() {
  63. return {}
  64. },
  65. watch: {},
  66. mounted() {
  67. },
  68. methods: {
  69. goToUrl(tx){
  70. window.location.href='https://bscscan.com/tx/'+tx
  71. },
  72. getList(page) {
  73. let token=uni.getStorageSync('token')
  74. if(token){
  75. getEarnings({'page': page}).then((res) => {
  76. if (res.code === 1) {
  77. this.$refs.earningObj.setList(res.data.items, res.data.total)
  78. this.$emit('setTotal',res.data.total)
  79. }
  80. })
  81. }else {
  82. this.$refs.earningObj.setList([], 0)
  83. this.$emit('setTotal',0)
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .earning-box {
  91. .earning-list {
  92. .list-item {
  93. margin-top: 20rpx;
  94. .item-line {
  95. margin-bottom: 20rpx;
  96. display: flex;
  97. justify-content: space-between;
  98. .item-text {
  99. font-size: 26rpx;
  100. color: rgb(177, 177, 177);
  101. line-height: 42rpx;
  102. height: 42rpx;
  103. }
  104. .text-hash{
  105. max-width: 200rpx;
  106. overflow-x:hidden;
  107. text-overflow: ellipsis;
  108. }
  109. .text-two {
  110. display: flex;
  111. justify-content: right;
  112. .text-img {
  113. display: inline-block;
  114. padding: 6rpx;
  115. background: rgb(0, 87, 255);
  116. border-radius: 50%;
  117. height: 42rpx;
  118. width: 42rpx;
  119. box-sizing: border-box;
  120. image {
  121. width: 30rpx;
  122. height: 30rpx;
  123. z-index: 100;
  124. }
  125. }
  126. .text {
  127. margin-left: 10rpx;
  128. font-size: 30rpx;
  129. }
  130. }
  131. }
  132. .line-text {
  133. margin-bottom: 40rpx;
  134. .item-text {
  135. font-weight: bold;
  136. font-size: 26rpx;
  137. color: #222;
  138. }
  139. }
  140. }
  141. .item:last-child {
  142. .division-item {
  143. display: none;
  144. }
  145. }
  146. }
  147. }
  148. </style>