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

60 lines
1.2 KiB

  1. <template>
  2. <view class="flex card">
  3. <view class="radio" v-if="showRadio">
  4. <uv-radio :name="data.id"></uv-radio>
  5. </view>
  6. <view class="info">
  7. <view class="title">{{ typeDesc }}</view>
  8. <view class="row">
  9. <view class="row-label">绑定人</view>
  10. <view class="row-content">{{ data.name }}</view>
  11. </view>
  12. <view class="row">
  13. <view class="row-label">申请人ID</view>
  14. <view class="row-content">{{ data.userId }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. const TYPE_AND_DESC_MAPPING = {
  21. 0: '学生',
  22. 1: '家长',
  23. }
  24. export default {
  25. props: {
  26. data: {
  27. type: Object,
  28. default() {
  29. return {}
  30. }
  31. },
  32. value: {
  33. type: String,
  34. default: null,
  35. },
  36. showRadio: {
  37. type: Boolean,
  38. default: false
  39. },
  40. },
  41. data() {
  42. return {
  43. }
  44. },
  45. computed: {
  46. typeDesc() {
  47. const { type } = this.data
  48. return TYPE_AND_DESC_MAPPING[type] || ''
  49. },
  50. },
  51. methods: {
  52. },
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. @import './card.scss';
  57. </style>