BookItem.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="card">
  3. <view class="flex w100">
  4. <view class="flex-d">
  5. <image style="width: 70px;height: 90px;" :src="item.cover" mode="aspectFill"></image>
  6. <view class="quantity mt-24" v-if="!showClose && !type">数量: {{ item.num }}</view>
  7. </view>
  8. <view class="book-info ml-20 flex-1">
  9. <view class="common-title mb-20">{{ item.bookName }}</view>
  10. <view class="flex flex-j-b mb-10">
  11. <view class="isbn">ISBN: {{ item.isbn }}</view>
  12. <view class="set">套装: {{ item.suit == 1 ? '是' : '不是' }}</view>
  13. </view>
  14. <view class="flex flex-j-b mb-10">
  15. <view class="price">定价: {{ item.bookPrice }}</view>
  16. <view class="estimate">预估单价: {{ (item.recycleDiscount * item.bookPrice * 0.1).toFixed(2) }}</view>
  17. </view>
  18. <view class="flex flex-j-b mb-10">
  19. <view class="discount">回收折扣: {{ item.recycleDiscount }}</view>
  20. <view class="review">审核金额: <text class="color-red">{{ item.finalMoney || 0 }}</text></view>
  21. </view>
  22. <template v-if="type=='review'">
  23. <view class="">
  24. <view>不良原因: <text :class="item.auditComment?.sts == 3 ? 'color-red' : ''">{{
  25. item.auditComment?.com }}</text></view>
  26. <view v-if="item.auditReviewComment?.com">
  27. 复审结果:<text class="color-red">{{ item.auditReviewComment?.com }}</text>
  28. </view>
  29. </view>
  30. </template>
  31. <template v-else>
  32. <view class="quality mb-10">
  33. 品相: 良好({{ goodNum }}) 、 一般({{ item.averageNum || 0 }}) 、 <text
  34. :class="item.badNum > 0 ? 'color-red' : ''">极差({{ badNum }})</text>
  35. </view>
  36. <view class="color-red" v-if="reasons">原因:{{ reasons }}</view>
  37. </template>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script setup>
  43. import { defineProps, computed } from 'vue'
  44. const props = defineProps({
  45. item: Object,
  46. showClose: {
  47. type: Boolean,
  48. default: false
  49. },
  50. type: {
  51. type: String,
  52. default: ''
  53. }
  54. })
  55. //良好
  56. const goodNum = computed(() => {
  57. return props.item.auditCommentList?.filter(v => v.sts == 1).length || 0
  58. })
  59. //极差
  60. const badNum = computed(() => {
  61. return props.item.auditCommentList?.filter(v => v.sts == 3).length || 0
  62. })
  63. const reasons = computed(() => {
  64. let list = props.item.auditCommentList
  65. if (!list) return ''
  66. if (list.length > 0) {
  67. let poorList = list.filter(v => v.sts == 3)
  68. if (poorList.length == 0) return ''
  69. return poorList.map(v => v.com).join(';')
  70. }
  71. })
  72. </script>
  73. <style scoped>
  74. .card {
  75. padding: 12px;
  76. display: flex;
  77. align-items: center;
  78. margin-bottom: 6rpx;
  79. .card-content {
  80. display: flex;
  81. width: 100%;
  82. }
  83. .book-info {
  84. font-size: 26rpx;
  85. }
  86. .color-red {
  87. color: #bd3124;
  88. }
  89. }
  90. </style>