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

123 lines
2.5 KiB

  1. <template>
  2. <view>
  3. <uv-popup ref="popup" mode="bottom" bgColor="none" >
  4. <view class="popup__view">
  5. <view class="flex header">
  6. <view class="title">选择关联项目</view>
  7. <button class="btn" @click="onConfirm">确认</button>
  8. </view>
  9. <view class="content">
  10. <uv-radio-group
  11. v-model="selectedId"
  12. placement="column"
  13. shape="circle"
  14. size="36rpx"
  15. iconSize="36rpx"
  16. activeColor="#00A9FF"
  17. >
  18. <view class="flex option" v-for="item in options" :key="item.id">
  19. <view class="radio">
  20. <uv-radio :name="item.id"></uv-radio>
  21. </view>
  22. <view class="text-ellipsis">
  23. {{ item.name }}
  24. </view>
  25. </view>
  26. </uv-radio-group>
  27. </view>
  28. </view>
  29. </uv-popup>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. props: {
  35. options: {
  36. type: Array,
  37. default() {
  38. return []
  39. }
  40. },
  41. },
  42. data() {
  43. return {
  44. selectedId: null,
  45. }
  46. },
  47. onLoad() {},
  48. methods: {
  49. async open(projectId) {
  50. this.selectedId = projectId
  51. this.$refs.popup.open()
  52. },
  53. close() {
  54. this.$refs.popup.close()
  55. },
  56. onConfirm() {
  57. this.$emit('confirm', this.selectedId)
  58. this.close()
  59. },
  60. },
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .popup__view {
  65. width: 100vw;
  66. display: flex;
  67. flex-direction: column;
  68. box-sizing: border-box;
  69. background: #FFFFFF;
  70. border-top-left-radius: 32rpx;
  71. border-top-right-radius: 32rpx;
  72. }
  73. .header {
  74. position: relative;
  75. width: 100%;
  76. padding: 24rpx 0;
  77. box-sizing: border-box;
  78. border-bottom: 2rpx solid #EEEEEE;
  79. .title {
  80. font-family: PingFang SC;
  81. font-weight: 500;
  82. font-size: 34rpx;
  83. line-height: 1.4;
  84. color: #181818;
  85. }
  86. .btn {
  87. font-family: PingFang SC;
  88. font-weight: 500;
  89. font-size: 32rpx;
  90. line-height: 1.4;
  91. color: $uni-color;
  92. position: absolute;
  93. top: 26rpx;
  94. right: 40rpx;
  95. }
  96. }
  97. .content {
  98. max-height: 75vh;
  99. padding: 8rpx 40rpx;
  100. box-sizing: border-box;
  101. overflow-y: auto;
  102. }
  103. .option {
  104. justify-content: flex-start;
  105. column-gap: 16rpx;
  106. padding: 32rpx 0;
  107. font-family: PingFang SC;
  108. font-size: 32rpx;
  109. font-weight: 400;
  110. line-height: 1.4;
  111. color: #181818;
  112. border-bottom: 2rpx solid #EEEEEE;
  113. }
  114. </style>