home-index.vue 3.2 KB

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