detailExaminationItem.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view
  3. class="examine-item"
  4. @click="handleToDetail">
  5. <view class="content">
  6. {{ itemData.content || '' }}
  7. </view>
  8. <view class="time">
  9. {{ itemData.createTime }}
  10. </view>
  11. <view v-if="itemData.createUser" class="info">
  12. <wk-avatar
  13. :name="itemData.createUser.realname"
  14. :avatar="itemData.createUser.img"
  15. :size="12"
  16. class="avatar" />
  17. <view class="info-text">
  18. 由{{ itemData.createUser.realname }}提交的{{ itemData.categoryTitle }}
  19. </view>
  20. <view
  21. v-if="statusObj"
  22. :style="{
  23. backgroundColor: statusObj.bg,
  24. color: statusObj.color
  25. }"
  26. class="status">
  27. {{ statusObj.label }}
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import { mapGetters } from 'vuex'
  34. export default {
  35. name: 'DetailExaminationItem',
  36. props: {
  37. itemData: {
  38. type: Object,
  39. required: true
  40. }
  41. },
  42. computed: {
  43. ...mapGetters({
  44. calcStatus: 'base/calcStatus'
  45. }),
  46. statusObj() {
  47. return this.calcStatus(this.itemData.examineStatus)
  48. }
  49. },
  50. methods: {
  51. handleToDetail() {
  52. this.$Router.navigateTo({
  53. url: '/pages_examine/detail',
  54. query: {
  55. id: this.itemData.examineId,
  56. examineId: this.itemData.categoryId
  57. }
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. .examine-item {
  65. width: 100%;
  66. padding: 20rpx 32rpx;
  67. background-color: white;
  68. border-bottom: 1rpx solid $border-color;
  69. .content {
  70. font-size: $wk-font-large;
  71. color: $dark;
  72. }
  73. .time {
  74. font-size: $wk-font-sm;
  75. color: $light;
  76. margin-top: 10rpx;
  77. }
  78. .info {
  79. margin-top: 10rpx;
  80. @include left;
  81. .avatar {
  82. width: 60rpx;
  83. height: 60rpx;
  84. margin-right: 15rpx;
  85. }
  86. .info-text {
  87. font-size: $wk-font-sm;
  88. color: $gray;
  89. flex: 1;
  90. }
  91. .status {
  92. width: 130rpx;
  93. height: 40rpx;
  94. font-size: 26rpx;
  95. font-weight: 500;
  96. line-height: normal;
  97. border-radius: 4rpx;
  98. margin-left: 10rpx;
  99. @include center;
  100. }
  101. }
  102. }
  103. </style>