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

128 lines
2.6 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="切换档案" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />
  4. <view class="list">
  5. <uv-radio-group
  6. v-model="selectedId"
  7. placement="column"
  8. shape="circle"
  9. size="36rpx"
  10. iconSize="36rpx"
  11. activeColor="#00A9FF"
  12. >
  13. <view class="list-item" v-for="item in list" :key="item.id">
  14. <memberCard
  15. :data="item"
  16. :showRadio="true"
  17. ></memberCard>
  18. </view>
  19. </uv-radio-group>
  20. </view>
  21. <view class="bottom">
  22. <button class="btn" @click="onConfirm">确定切换</button>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { mapState } from 'vuex'
  28. import mixinsList from '@/mixins/list.js'
  29. import memberCard from './memberCard.vue'
  30. export default {
  31. mixins: [mixinsList],
  32. components: {
  33. memberCard,
  34. },
  35. data() {
  36. return {
  37. queryParams: {
  38. pageNo: 1,
  39. pageSize: 10,
  40. status: 1, // 绑定状态(status):0-确认中 1-已绑定 2-已拒绝
  41. },
  42. mixinsListApi: 'queryBindList',
  43. selectedId: null,
  44. }
  45. },
  46. computed: {
  47. ...mapState(['userInfo', 'memberInfo']),
  48. },
  49. onLoad(arg) {
  50. this.selectedId = this.memberInfo?.id || this.userInfo?.id
  51. this.getData()
  52. },
  53. methods: {
  54. getDataThen(records) {
  55. this.list = [{
  56. ...this.userInfo,
  57. user: this.userInfo,
  58. }].concat(records)
  59. },
  60. onConfirm() {
  61. const target = this.list.find(item => item.user.id === this.selectedId)?.user
  62. this.$store.commit('setMemberInfo', target)
  63. this.$utils.navigateBack()
  64. },
  65. },
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .page__view {
  70. width: 100vw;
  71. min-height: 100vh;
  72. background: $uni-bg-color;
  73. position: relative;
  74. }
  75. .list {
  76. padding: 32rpx 40rpx;
  77. padding-bottom: calc(env(safe-area-inset-bottom) + 198rpx);
  78. &-item {
  79. & + & {
  80. margin-top: 24rpx;
  81. }
  82. }
  83. }
  84. .bottom {
  85. position: fixed;
  86. left: 0;
  87. bottom: 0;
  88. width: 100vw;
  89. // height: 200rpx;
  90. padding: 32rpx 40rpx;
  91. padding-bottom: calc(env(safe-area-inset-bottom) + 32rpx);
  92. background: #FFFFFF;
  93. box-sizing: border-box;
  94. .btn {
  95. width: 100%;
  96. padding: 14rpx 0;
  97. box-sizing: border-box;
  98. font-family: PingFang SC;
  99. font-weight: 500;
  100. font-size: 36rpx;
  101. line-height: 1.4;
  102. color: #FFFFFF;
  103. background: linear-gradient(to right, #21FEEC, #019AF9);
  104. border: 2rpx solid #00A9FF;
  105. border-radius: 41rpx;
  106. }
  107. }
  108. </style>