鸿宇研学生前端代码
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.

242 lines
5.3 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" />
  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. // todo
  52. mixinsListApi: '',
  53. current: 0,
  54. }
  55. },
  56. onShow() {
  57. console.log('onShow')
  58. },
  59. onLoad(arg) {
  60. this.clickTabs({ index: arg.index || 0 })
  61. },
  62. methods: {
  63. // todo: delete
  64. getData() {
  65. this.list = [
  66. {
  67. id: '001',
  68. avatar: '/static/image/temp-30.png',
  69. name: '李世海',
  70. price: 10,
  71. createTime: '2025-07-15',
  72. },
  73. {
  74. id: '002',
  75. avatar: '/static/image/temp-30.png',
  76. name: '周静',
  77. price: 10,
  78. createTime: '2025-07-15',
  79. },
  80. {
  81. id: '003',
  82. avatar: '/static/image/temp-30.png',
  83. name: '周海',
  84. price: 10,
  85. createTime: '2025-07-15',
  86. },
  87. {
  88. id: '004',
  89. avatar: '/static/image/temp-30.png',
  90. name: '冯启彬',
  91. price: 10,
  92. createTime: '2025-07-15',
  93. },
  94. {
  95. id: '005',
  96. avatar: '/static/image/temp-30.png',
  97. name: '李娉',
  98. price: 10,
  99. createTime: '2025-07-15',
  100. },
  101. {
  102. id: '006',
  103. avatar: '/static/image/temp-30.png',
  104. name: '李书萍',
  105. price: 10,
  106. createTime: '2025-07-15',
  107. },
  108. {
  109. id: '007',
  110. avatar: '/static/image/temp-30.png',
  111. name: '李世海',
  112. price: 10,
  113. createTime: '2025-07-15',
  114. },
  115. {
  116. id: '008',
  117. avatar: '/static/image/temp-30.png',
  118. name: '周静',
  119. price: 10,
  120. createTime: '2025-07-15',
  121. },
  122. {
  123. id: '009',
  124. avatar: '/static/image/temp-30.png',
  125. name: '周海',
  126. price: 10,
  127. createTime: '2025-07-15',
  128. },
  129. {
  130. id: '010',
  131. avatar: '/static/image/temp-30.png',
  132. name: '冯启彬',
  133. price: 10,
  134. createTime: '2025-07-15',
  135. },
  136. {
  137. id: '011',
  138. avatar: '/static/image/temp-30.png',
  139. name: '李娉',
  140. price: 10,
  141. createTime: '2025-07-15',
  142. },
  143. {
  144. id: '012',
  145. avatar: '/static/image/temp-30.png',
  146. name: '李书萍',
  147. price: 10,
  148. createTime: '2025-07-15',
  149. },
  150. ]
  151. },
  152. //点击tab栏
  153. clickTabs({ index }) {
  154. console.log('clickTabs')
  155. this.current = index
  156. if (index == 0) {
  157. delete this.queryParams.status
  158. } else {
  159. this.queryParams.status = index - 1
  160. }
  161. this.getData()
  162. },
  163. },
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .page__view {
  168. width: 100vw;
  169. min-height: 100vh;
  170. background-color: $uni-bg-color;
  171. position: relative;
  172. /deep/ .nav-bar__view {
  173. position: fixed;
  174. top: 0;
  175. left: 0;
  176. }
  177. }
  178. .main {
  179. padding: calc(var(--status-bar-height) + 244rpx) 32rpx 40rpx 32rpx;
  180. .tabs {
  181. position: fixed;
  182. top: calc(var(--status-bar-height) + 120rpx);
  183. left: 0;
  184. width: 100%;
  185. height: 84rpx;
  186. background: #FFFFFF;
  187. z-index: 1;
  188. /deep/ .uv-tabs__wrapper__nav__line {
  189. border-radius: 2rpx;
  190. }
  191. }
  192. }
  193. .list {
  194. background: #FFFFFF;
  195. border-radius: 32rpx;
  196. overflow: hidden;
  197. &-item {
  198. margin-top: 16rpx;
  199. padding: 16rpx 32rpx;
  200. font-size: 28rpx;
  201. color: #333333;
  202. background: #FFFFFF;
  203. border-bottom: 2rpx solid #F1F1F1;
  204. justify-content: flex-start;
  205. column-gap: 24rpx;
  206. &:last-child {
  207. border: none;
  208. }
  209. .avatar {
  210. width: 72rpx;
  211. height: 72rpx;
  212. border-radius: 50%;
  213. overflow: hidden;
  214. .img {
  215. width: 100%;
  216. height: 100%;
  217. }
  218. }
  219. }
  220. }
  221. </style>