home-index.vue 2.9 KB

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