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

241 lines
5.3 KiB

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