powerSet.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="container">
  3. <!-- 头部分段选择器区域 -->
  4. <view class="control">
  5. <uni-segmented-control :current="current" :values="items" styleType="text" @clickItem="onClickItem"
  6. activeColor="#0082FC"></uni-segmented-control>
  7. </view>
  8. <!-- 选中人物区域 -->
  9. <view class="choose">
  10. <view class="box" v-for="item in chooseList" :key="item.id">
  11. <view class="name">
  12. {{item.name}}
  13. </view>
  14. <view class="icon" @click="handleDelete(item.id)">
  15. <img src="../../static/close.png">
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 人员展示区域 -->
  20. <view class="list">
  21. <!-- 每一个人员区域 -->
  22. <view class="item" v-for="item in list" :key="item.id">
  23. {{item.name}} - {{item.type}} - {{item.number}}
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. items: ['管理员', '子管理员'],
  33. current: 0,
  34. list: [{
  35. id: 1,
  36. name: "张三",
  37. number: 360730199525462589,
  38. type: "学生"
  39. },
  40. {
  41. id: 2,
  42. name: "李四",
  43. number: 360730199525462589,
  44. type: "老师"
  45. },
  46. {
  47. id: 3,
  48. name: "王五",
  49. number: 360730199525462589,
  50. type: "教职工"
  51. },
  52. ],
  53. chooseList: [{
  54. id: 1,
  55. name: "张三",
  56. },
  57. {
  58. id: 2,
  59. name: "李四",
  60. },
  61. {
  62. id: 3,
  63. name: "王五",
  64. },
  65. {
  66. id: 4,
  67. name: "李四",
  68. },
  69. {
  70. id: 5,
  71. name: "王五",
  72. },
  73. {
  74. id: 6,
  75. name: "李四",
  76. },
  77. {
  78. id: 7,
  79. name: "王五",
  80. },
  81. ]
  82. };
  83. },
  84. methods: {
  85. onClickItem(e) {
  86. console.log(e.currentIndex);
  87. // if (e.currentIndex == 0) {
  88. // this.list = this.list2
  89. // } else {
  90. // this.list = this.list3
  91. // }
  92. },
  93. handleDelete(id){
  94. console.log(id);
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .container {
  101. padding-top: 20rpx;
  102. .control {
  103. display: flex;
  104. flex-direction: column;
  105. justify-content: center;
  106. width: 750rpx;
  107. height: 86rpx;
  108. background-color: #fff;
  109. }
  110. .choose {
  111. display: flex;
  112. flex-wrap: wrap;
  113. justify-content: space-evenly;
  114. align-items: center;
  115. margin-top: 20rpx;
  116. padding: 30rpx;
  117. width: 690rpx;
  118. border-bottom: 1rpx solid #E5E5E5;
  119. background-color: #fff;
  120. .box {
  121. display: flex;
  122. align-items: center;
  123. width: 150rpx;
  124. height: 60rpx;
  125. .name {
  126. flex: 2;
  127. text-align: center;
  128. font-size: 28rpx;
  129. }
  130. .icon {
  131. flex: 1;
  132. display: flex;
  133. align-items: center;
  134. height: 50rpx;
  135. img {
  136. width: 30rpx;
  137. height: 30rpx;
  138. }
  139. }
  140. }
  141. }
  142. .list {
  143. display: flex;
  144. flex-direction: column;
  145. justify-content: space-evenly;
  146. padding-top: 22rpx;
  147. width: 750rpx;
  148. border-bottom: 1rpx solid #E5E5E5;
  149. background-color: #fff;
  150. .item {
  151. margin-bottom: 22rpx;
  152. margin-left: 65rpx;
  153. height: 41rpx;
  154. font-size: 28rpx;
  155. }
  156. }
  157. }
  158. </style>