contract-list.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="earning-box">
  3. <en-list ref="contractObj" @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" >
  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">
  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.money).toFixed(6)*1}}</view>
  27. </view>
  28. </view>
  29. <view class="item-line" >
  30. <view class="item-text">{{$t('index.index.list.item.status')}}</view>
  31. <view class="item-text text-two">
  32. <view class="status-img ">
  33. <image v-if="item.status===1" src="@/static/img/contract/send.png"></image>
  34. <image v-else-if="item.status===2" src="@/static/img/contract/ok.png"></image>
  35. <image v-else-if="item.status===3" src="@/static/img/contract/no.png"></image>
  36. <image v-else src="@/static/img/contract/end.png"></image>
  37. </view>
  38. <view class="text">{{item.statusName}}</view>
  39. </view>
  40. </view>
  41. <view class="item-line">
  42. <view class="item-text">{{$t('index.index.list.item.date')}}</view>
  43. <view class="item-text">{{item.created_at}}</view>
  44. </view>
  45. </view>
  46. <division class="division-item"></division>
  47. </view>
  48. </view>
  49. </template>
  50. </en-list>
  51. </view>
  52. </template>
  53. <script>
  54. import EnList from "@/components/en-list/en-list";
  55. import {getContractList, getEarnings} from "@/api/contract";
  56. import Division from "@/pages/index/components/division";
  57. export default {
  58. name: "contract-list",
  59. components: {Division, EnList},
  60. props: {},
  61. data() {
  62. return {}
  63. },
  64. watch: {},
  65. mounted() {
  66. },
  67. methods: {
  68. goToUrl(tx){
  69. window.location.href='https://bscscan.com/tx/'+tx
  70. },
  71. startList(){
  72. this.$refs.contractObj.startList()
  73. },
  74. getList(page) {
  75. getContractList({'page': page}).then((res) => {
  76. if (res.code === 1) {
  77. this.$refs.contractObj.setList(res.data.items, res.data.total)
  78. this.$emit('setTotal',res.data.total)
  79. }
  80. })
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .earning-box {
  87. .earning-list {
  88. .list-item {
  89. margin-top: 20rpx;
  90. .item-line {
  91. margin-bottom: 20rpx;
  92. display: flex;
  93. justify-content: space-between;
  94. .item-text {
  95. font-size: 26rpx;
  96. color: rgb(177, 177, 177);
  97. line-height: 42rpx;
  98. height: 42rpx;
  99. }
  100. .text-hash{
  101. max-width: 200rpx;
  102. overflow-x:hidden;
  103. text-overflow: ellipsis;
  104. }
  105. .text-two {
  106. display: flex;
  107. justify-content: right;
  108. .text-img {
  109. display: inline-block;
  110. padding: 6rpx;
  111. background: rgb(0, 87, 255);
  112. border-radius: 50%;
  113. height: 42rpx;
  114. width: 42rpx;
  115. box-sizing: border-box;
  116. margin-right: 10rpx;
  117. image {
  118. width: 30rpx;
  119. height: 30rpx;
  120. z-index: 100;
  121. }
  122. }
  123. .status-img{
  124. display: inline-block;
  125. border-radius: 50%;
  126. height: 42rpx;
  127. width: 42rpx;
  128. box-sizing: border-box;
  129. margin-right: 5rpx;
  130. image {
  131. width: 42rpx;
  132. height: 42rpx;
  133. z-index: 100;
  134. }
  135. }
  136. .text {
  137. font-size: 30rpx;
  138. }
  139. }
  140. }
  141. .line-text {
  142. margin-bottom: 40rpx;
  143. .item-text {
  144. font-weight: bold;
  145. font-size: 26rpx;
  146. color: #222;
  147. }
  148. }
  149. }
  150. .item:last-child {
  151. .division-item {
  152. display: none;
  153. }
  154. }
  155. }
  156. }
  157. </style>