common-list.vue 3.7 KB

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