examineItem.vue 2.1 KB

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