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

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