invite-proxy.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="invite-proxy">
  3. <custom-nav ref="ltm" :title="title"></custom-nav>
  4. <view class="content">
  5. <view class="top">
  6. <image class="imagebg" src="../../static/icon/invite-proxy.png" mode="scaleToFill"></image>
  7. <view class="invite-code">
  8. <view class="text">我的邀请码</view>
  9. <text class="code">{{ invite_code }}</text>
  10. <text class="copy" @tap="copy">复制</text>
  11. </view>
  12. </view>
  13. <view class="bottom">
  14. <view class="item border-right">
  15. <view class="item-top">
  16. <text>{{ invite_num }}</text>人
  17. </view>
  18. <view class="item-bot">我的邀请</view>
  19. </view>
  20. <view class="item">
  21. <view class="item-top">
  22. <text>{{ team_num }}</text>人
  23. </view>
  24. <view class="item-bot">我的团队</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { _API_InviteCode } from '@/apis/team.js'
  32. export default {
  33. data() {
  34. return {
  35. title: '邀请代理',
  36. invite_code: '',
  37. invite_num: 0,
  38. team_num: 0
  39. }
  40. },
  41. mounted() {
  42. this.$refs.ltm.loading()
  43. _API_InviteCode().then(res => {
  44. this.invite_code = res.data.invite_code
  45. this.invite_num = res.data.invite_num
  46. this.team_num = res.data.team_num
  47. })
  48. },
  49. methods: {
  50. copy() {
  51. uni.setClipboardData({ data: this.invite_code }).then(() => {
  52. uni.hideToast()
  53. this.$refs.ltm.toast('邀请码已复制到剪切板')
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. .invite-proxy {
  61. @include page();
  62. .content {
  63. @include flex(column);
  64. justify-content: space-between;
  65. .top {
  66. width: 100%;
  67. height: 820rpx;
  68. position: relative;
  69. image {
  70. width: 100%;
  71. height: 100%;
  72. }
  73. .invite-code {
  74. @include flex(column);
  75. left: 50%;
  76. top: 383rpx;
  77. position: absolute;
  78. transform: translateX(-50%);
  79. .text {
  80. font-size: 27rpx;
  81. }
  82. .code {
  83. font-size: 41rpx;
  84. letter-spacing: 8rpx;
  85. margin: 50rpx 0 30rpx;
  86. }
  87. .copy {
  88. @include flex();
  89. width: 120rpx;
  90. height: 56rpx;
  91. font-size: 32rpx;
  92. border-radius: 28rpx;
  93. color: $app-base-color;
  94. border: 1rpx solid $app-base-color;
  95. }
  96. }
  97. }
  98. .bottom {
  99. @include flex();
  100. width: 690rpx;
  101. height: 230rpx;
  102. background: #FFFFFF;
  103. margin-bottom: 21rpx;
  104. border-radius:10rpx 10rpx 0rpx 0rpx;
  105. .item {
  106. @include flex(column);
  107. flex: 1;
  108. height: 200rpx;
  109. .item-top {
  110. text {
  111. font-size: 70rpx;
  112. color: $app-base-color;
  113. }
  114. }
  115. .item-bot {
  116. margin-top: 26rpx;
  117. }
  118. }
  119. }
  120. }
  121. }
  122. </style>