my-index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. coinText:'',
  22. pledgeTotal:'',
  23. revenueTotal:'',
  24. list:[],
  25. page:1,
  26. };
  27. },
  28. mounted() {
  29. this.getIconNum()
  30. this.getTotalMoney()
  31. this.getTeamList()
  32. },
  33. methods: {
  34. abbreviateString(str ){
  35. let startLength=4;
  36. let endLength=4;
  37. if (str.length <= startLength + endLength + 1) {
  38. return str; // 如果字符串长度不足以被截断,则返回原字符串
  39. }
  40. return str.slice(0, startLength) + '...' + str.slice(-endLength);
  41. },
  42. getTeamList(){
  43. getTeamList({'page':this.page}).then(res=>{
  44. if(res.code===1){
  45. ++this.page
  46. this.list.push(...res.data.items)
  47. }
  48. })
  49. },
  50. getTotalMoney(){
  51. getTotalMoney().then(res=>{
  52. if (res.code===1){
  53. this.pledgeTotal=res.data.pledgeTotal
  54. this.revenueTotal=res.data.revenueTotal
  55. }
  56. })
  57. },
  58. getIconNum(){
  59. this.address=tokenpocketBnb.getMyAddress()
  60. if(this.address===''){
  61. return
  62. }
  63. tokenpocketBnb.getTokenBalance(this.address,0).then(coinNum=>{
  64. this.coinNum=coinNum
  65. })
  66. },
  67. goUrl() {
  68. uni.navigateTo({
  69. url: 'pages/my/inner-page/all_profit'
  70. });
  71. }
  72. },
  73. }
  74. </script>
  75. <template>
  76. <view>
  77. <view class="align-items-center mb-32">
  78. <view class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
  79. <view class="fs-28 fc-f">余额</view>
  80. <view class="fs-30 fc-f fw-b">
  81. {{coinNum}}
  82. </view>
  83. </view>
  84. <view class="h-80 b-rad-20 bg-two flex-1 flex-direction-column align-items-center flex-justify-center mr-20">
  85. <view class="fs-28 fc-f">贡献</view>
  86. <view class="fs-30 fc-f fw-b">
  87. {{pledgeTotal}}
  88. </view>
  89. </view>
  90. <view @click="goUrl" class="h-80 b-rad-20 bg-one flex-1 flex-direction-column align-items-center flex-justify-center">
  91. <view class="fs-28 fc-f">总收益</view>
  92. <view class="fs-30 fc-f fw-b">
  93. {{revenueTotal}}
  94. </view>
  95. </view>
  96. </view>
  97. <view class="fs-34 fw-b mb-20">
  98. 我的团队
  99. </view>
  100. <view class="bgc-f p-10 box-sizing-border b-rad-20" v-for="item in list">
  101. <view class="pb-10 border-bottom-e5e5e5 fs-28 mb-20">
  102. {{abbreviateString(item.address,6)}}
  103. </view>
  104. <view class="align-items-start flex-justify-space pb-10">
  105. <view class="flex-1 left-box">
  106. <view class="fs-28 mb-4">注册时间: {{item.created_date}}</view>
  107. <view class="fs-28 mb-4">团队人数:{{item.clanNum}}</view>
  108. <view class="fs-28">直推人数:{{item.recomNum}}</view>
  109. </view>
  110. <!-- <view class="flex-1 pl-20 box-sizing-border">-->
  111. <!-- <view class="fs-28 mb-4">自身业绩:10000</view>-->
  112. <!-- <view class="fs-28">团队业绩:10000</view>-->
  113. <!-- </view>-->
  114. </view>
  115. </view>
  116. <view>
  117. </view>
  118. </view>
  119. </template>
  120. <style scoped lang="scss">
  121. .bg-one{
  122. background-image: linear-gradient(270deg, #2353db, #54c8ff);
  123. }
  124. .bg-two{
  125. background-image: linear-gradient(270deg, #ffc62c, #ffa954);
  126. }
  127. .h-80{
  128. height: 160rpx;
  129. }
  130. .left-box{
  131. border-right: 2rpx solid #ccc;
  132. }
  133. </style>