my-index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <script>
  2. import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
  3. import {getTotalMoney} from "@/api/money";
  4. import {getTeamList} from "@/api/member";
  5. export default {
  6. name: "my-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. list:[],
  24. page:1,
  25. };
  26. },
  27. mounted() {
  28. this.getIconNum()
  29. this.getTotalMoney()
  30. this.getTeamList()
  31. },
  32. methods: {
  33. getTeamList(){
  34. getTeamList({'page':this.page}).then(res=>{
  35. if(res.code===1){
  36. ++this.page
  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. }
  47. })
  48. },
  49. async getIconNum(){
  50. if(this.address===''){
  51. return
  52. }
  53. this.coinNum= await tokenpocketBnb.getTokenBalance(this.address,0)
  54. console.log(this.coinNum,"icon-num----------------------")
  55. },
  56. goUrl() {
  57. uni.navigateTo({
  58. url: 'pages/my/inner-page/all_profit'
  59. });
  60. }
  61. },
  62. }
  63. </script>
  64. <template>
  65. <view>
  66. <view class="align-items-center mb-32">
  67. <view class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
  68. <view class="fs-28 fc-f">余额</view>
  69. <view class="fs-30 fc-f fw-b">
  70. {{coinNum}}
  71. </view>
  72. </view>
  73. <view class="h-80 b-rad-20 bg-two flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
  74. <view class="fs-28 fc-f">贡献</view>
  75. <view class="fs-30 fc-f fw-b">
  76. {{pledgeTotal}}
  77. </view>
  78. </view>
  79. <view @click="goUrl" class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center">
  80. <view class="fs-28 fc-f">总收益</view>
  81. <view class="fs-30 fc-f fw-b">
  82. {{revenueTotal}}
  83. </view>
  84. </view>
  85. </view>
  86. <view class="fs-34 fw-b mb-20">
  87. 我的团队
  88. </view>
  89. <view class="bgc-f p-10 box-sizing-border b-rad-20" v-for="item in list">
  90. <view class="pb-10 border-bottom-e5e5e5 fs-28 mb-20">
  91. {{item.address}}
  92. </view>
  93. <view class="align-items-start flex-justify-space pb-10">
  94. <view class="flex-1 left-box">
  95. <view class="fs-28 mb-4">注册时间: {{item.created_date}}</view>
  96. <view class="fs-28 mb-4">团队人数:{{item.clanNum}}</view>
  97. <view class="fs-28">直推人数:{{item.recomNum}}</view>
  98. </view>
  99. <!-- <view class="flex-1 pl-20 box-sizing-border">-->
  100. <!-- <view class="fs-28 mb-4">自身业绩:10000</view>-->
  101. <!-- <view class="fs-28">团队业绩:10000</view>-->
  102. <!-- </view>-->
  103. </view>
  104. </view>
  105. <view>
  106. </view>
  107. </view>
  108. </template>
  109. <style scoped lang="scss">
  110. .bg-one{
  111. background-image: linear-gradient(270deg, #2353db, #54c8ff);
  112. }
  113. .bg-two{
  114. background-image: linear-gradient(270deg, #ffc62c, #ffa954);
  115. }
  116. .h-80{
  117. height: 160rpx;
  118. }
  119. .left-box{
  120. border-right: 2rpx solid #ccc;
  121. }
  122. </style>