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

207 lines
4.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. <template v-if="current == 0">
  31. <view class="list">
  32. <view class="flex list-item" v-for="item in list" :key="item.id">
  33. <memberApplyCard :data="item" @submitted="getData"></memberApplyCard>
  34. </view>
  35. </view>
  36. </template>
  37. <template v-else>
  38. <view class="list">
  39. <view class="flex list-item" v-for="item in list" :key="item.id">
  40. <memberCard :data="item" ></memberCard>
  41. </view>
  42. </view>
  43. </template>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import mixinsList from '@/mixins/list.js'
  49. import memberCard from './memberCard.vue'
  50. import memberApplyCard from './memberApplyCard.vue'
  51. export default {
  52. mixins: [mixinsList],
  53. components: {
  54. memberCard,
  55. memberApplyCard,
  56. },
  57. data() {
  58. return {
  59. tabs: [
  60. { name: '绑定申请' },
  61. { name: '已绑定' },
  62. ],
  63. // todo
  64. mixinsListApi: '',
  65. current: 0,
  66. }
  67. },
  68. onShow() {
  69. console.log('onShow')
  70. },
  71. onLoad(arg) {
  72. this.clickTabs({ index: arg.index || 0 })
  73. },
  74. methods: {
  75. // todo: delete
  76. getData() {
  77. this.list = [
  78. {
  79. id: '001',
  80. name: '周小艺',
  81. userId: '15558661691',
  82. type: 0,
  83. createTime: '2025-04-28 08:14',
  84. },
  85. {
  86. id: '002',
  87. name: '周小艺',
  88. userId: '15558661691',
  89. type: 0,
  90. createTime: '2025-04-28 08:14',
  91. },
  92. {
  93. id: '003',
  94. name: '周小艺',
  95. userId: '15558661691',
  96. type: 1,
  97. createTime: '2025-04-28 08:14',
  98. },
  99. {
  100. id: '004',
  101. name: '周小艺',
  102. userId: '15558661691',
  103. type: 0,
  104. createTime: '2025-04-28 08:14',
  105. },
  106. {
  107. id: '005',
  108. name: '周小艺',
  109. userId: '15558661691',
  110. type: 0,
  111. createTime: '2025-04-28 08:14',
  112. },
  113. ]
  114. },
  115. //点击tab栏
  116. clickTabs({ index }) {
  117. console.log('clickTabs')
  118. this.current = index
  119. if (index == 0) {
  120. delete this.queryParams.status
  121. } else {
  122. this.queryParams.status = index - 1
  123. }
  124. this.getData()
  125. },
  126. },
  127. }
  128. </script>
  129. <style scoped lang="scss">
  130. .page__view {
  131. width: 100vw;
  132. min-height: 100vh;
  133. background-color: $uni-bg-color;
  134. position: relative;
  135. /deep/ .nav-bar__view {
  136. position: fixed;
  137. top: 0;
  138. left: 0;
  139. }
  140. }
  141. .main {
  142. padding: calc(var(--status-bar-height) + 244rpx) 32rpx 40rpx 32rpx;
  143. .tabs {
  144. position: fixed;
  145. top: calc(var(--status-bar-height) + 120rpx);
  146. left: 0;
  147. width: 100%;
  148. height: 84rpx;
  149. background: #FFFFFF;
  150. z-index: 1;
  151. /deep/ .uv-tabs__wrapper__nav__line {
  152. border-radius: 2rpx;
  153. }
  154. }
  155. }
  156. .list {
  157. background: #FFFFFF;
  158. border-radius: 32rpx;
  159. overflow: hidden;
  160. &-item {
  161. margin-top: 16rpx;
  162. padding: 16rpx 32rpx;
  163. font-size: 28rpx;
  164. color: #333333;
  165. background: #FFFFFF;
  166. border-bottom: 2rpx solid #F1F1F1;
  167. justify-content: flex-start;
  168. column-gap: 24rpx;
  169. &:last-child {
  170. border: none;
  171. }
  172. .avatar {
  173. width: 72rpx;
  174. height: 72rpx;
  175. border-radius: 50%;
  176. overflow: hidden;
  177. .img {
  178. width: 100%;
  179. height: 100%;
  180. }
  181. }
  182. }
  183. }
  184. </style>