home-index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <script>
  2. import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
  3. import {getTotalMoney} from "@/api/money";
  4. import {getDividendList} from "@/api/pledge";
  5. export default {
  6. name: "home-index",
  7. props:{
  8. address:{
  9. default:''
  10. }
  11. },
  12. components: {},
  13. watch:{
  14. 'address':function () {
  15. this.getIconNum()
  16. }
  17. },
  18. data() {
  19. return {
  20. coinNum:'',
  21. pledgeTotal:'',
  22. revenueTotal:'',
  23. price:'',
  24. page:1,
  25. list:[]
  26. };
  27. },
  28. mounted() {
  29. this.getIconNum()
  30. this.getTotalMoney()
  31. this.getDividendList()
  32. },
  33. methods: {
  34. getDividendList(){
  35. getDividendList({'page':this.page}).then(res=>{
  36. if(res.code===1){
  37. this.list.push(...res.data.items)
  38. }
  39. })
  40. },
  41. getTotalMoney(){
  42. getTotalMoney().then(res=>{
  43. if (res.code===1){
  44. this.pledgeTotal=res.data.pledgeTotal
  45. this.revenueTotal=res.data.revenueTotal
  46. this.price=res.data.price
  47. }
  48. })
  49. },
  50. async getIconNum(){
  51. if(this.address===''){
  52. return
  53. }
  54. setTimeout(async ()=>{
  55. this.coinNum= await tokenpocketBnb.getTokenBalance(this.address,0)
  56. console.log(this.coinNum,"icon-num----------------------")
  57. },100)
  58. },
  59. },
  60. }
  61. </script>
  62. <template>
  63. <view>
  64. <view class="bgc-f p-20 box-sizing-border b-rad-20 mb-40">
  65. <image
  66. class="head-img"
  67. :src="require('@/static/img/index/index/bannerhome.png')"
  68. mode="widthFix"
  69. ></image>
  70. </view>
  71. <view class="bgc-f p-20 box-sizing-border b-rad-20 mb-40">
  72. <view class="b-rad-20 h-80 align-items-center bgc-f1f9fe">
  73. <view class="flex-1 flex-direction-column align-items-center flex-justify-center">
  74. <view class="fs-28 mb-4">
  75. DAO價格($)
  76. </view>
  77. <view class="fs-28 fw-b">
  78. {{price}}
  79. </view>
  80. </view>
  81. <view class="flex-1 flex-direction-column align-items-center flex-justify-center">
  82. <view class="fs-28 mb-4">
  83. DAO餘額
  84. </view>
  85. <view class="fs-28 fw-b">
  86. {{coinNum}}
  87. </view>
  88. </view>
  89. <view class="flex-1 flex-direction-column align-items-center flex-justify-center">
  90. <view class="fs-28 mb-4">
  91. 贡献总额
  92. </view>
  93. <view class="fs-28 fw-b">
  94. {{pledgeTotal}}
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <view class="bgc-f p-20 box-sizing-border b-rad-20 mb-40">
  100. <view class="fs-28 pt-5 mb-4">
  101. 贡献收益记录
  102. </view>
  103. <view class="bgc-F6F7FA">
  104. <view class="item-box align-items-center flex-justify-space" v-for="item in 3" :key="item.id">
  105. <view>
  106. <view class="mb-4 fs-28 fw-b">贡献数量</view>
  107. <view class="fs-24">2025-01-10</view>
  108. </view>
  109. <view class="align-items-center">
  110. <view class="fs-24">奖励:</view>
  111. <view class="fs-28 fc-ED301D">2.5</view>
  112. </view>
  113. </view>
  114. <view class="h-50 text-align-center fs-28">
  115. ~暂无记录
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </template>
  121. <style scoped lang="scss">
  122. .head-img {
  123. width: 100%;
  124. // height: 128px;
  125. }
  126. .h-80{
  127. height: 160rpx;
  128. }
  129. .h-50{
  130. height: 100rpx;
  131. line-height: 100rpx;
  132. }
  133. .item-box{
  134. width: 100%;
  135. height: 120rpx;
  136. padding: 10rpx 20rpx;
  137. box-sizing: border-box;
  138. border-top: 2rpx solid #e5e5e5;
  139. }
  140. .item-box:first-child {
  141. border-top: none;
  142. }
  143. </style>