鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.0 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" bgColor="#FFFFFF" />
  4. <view class="main">
  5. <view class="tabs">
  6. <uv-tabs
  7. :list="tabs"
  8. :current="current"
  9. :scrollable="false"
  10. lineColor="#00A9FF"
  11. lineWidth="48rpx"
  12. lineHeight="4rpx"
  13. :activeStyle="{
  14. 'font-family': 'PingFang SC',
  15. 'font-weight': 500,
  16. 'font-size': '32rpx',
  17. 'line-height': 1.4,
  18. 'color': '#00A9FF',
  19. }"
  20. :inactiveStyle="{
  21. 'font-family': 'PingFang SC',
  22. 'font-weight': 400,
  23. 'font-size': '32rpx',
  24. 'line-height': 1.4,
  25. 'color': '#181818',
  26. }"
  27. @click="clickTabs"
  28. ></uv-tabs>
  29. </view>
  30. <view class="list">
  31. <view class="flex list-item" v-for="item in list" :key="item.id">
  32. <view class="avatar">
  33. <image class="img" :src="item.avatar" mode="scaleToFill"></image>
  34. </view>
  35. <view>{{ item.name }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import mixinsList from '@/mixins/list.js'
  43. export default {
  44. mixins: [mixinsList],
  45. data() {
  46. return {
  47. tabs: [
  48. { name: '直推用户列表' },
  49. { name: '间推用户列表' },
  50. ],
  51. current: 0,
  52. }
  53. },
  54. computed: {
  55. mixinsListApi() {
  56. return this.current == 0 ? 'queryDirectList' : 'queryIndirectList'
  57. }
  58. },
  59. onShow() {
  60. console.log('onShow')
  61. },
  62. onLoad(arg) {
  63. this.clickTabs({ index: arg.index || 0 })
  64. },
  65. methods: {
  66. //点击tab栏
  67. clickTabs({ index }) {
  68. console.log('clickTabs')
  69. this.current = index
  70. this.getData()
  71. },
  72. },
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .page__view {
  77. width: 100vw;
  78. min-height: 100vh;
  79. background: $uni-bg-color;
  80. position: relative;
  81. /deep/ .nav-bar__view {
  82. position: fixed;
  83. top: 0;
  84. left: 0;
  85. }
  86. }
  87. .main {
  88. padding: calc(var(--status-bar-height) + 244rpx) 32rpx 40rpx 32rpx;
  89. .tabs {
  90. position: fixed;
  91. top: calc(var(--status-bar-height) + 120rpx);
  92. left: 0;
  93. width: 100%;
  94. height: 84rpx;
  95. background: #FFFFFF;
  96. z-index: 1;
  97. /deep/ .uv-tabs__wrapper__nav__line {
  98. border-radius: 2rpx;
  99. }
  100. }
  101. }
  102. .list {
  103. background: #FFFFFF;
  104. border-radius: 32rpx;
  105. overflow: hidden;
  106. &-item {
  107. margin-top: 16rpx;
  108. padding: 16rpx 32rpx;
  109. font-size: 28rpx;
  110. color: #333333;
  111. background: #FFFFFF;
  112. border-bottom: 2rpx solid #F1F1F1;
  113. justify-content: flex-start;
  114. column-gap: 24rpx;
  115. &:last-child {
  116. border: none;
  117. }
  118. .avatar {
  119. width: 72rpx;
  120. height: 72rpx;
  121. border-radius: 50%;
  122. overflow: hidden;
  123. .img {
  124. width: 100%;
  125. height: 100%;
  126. }
  127. }
  128. }
  129. }
  130. </style>