BookItem.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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">数量: {{ 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. <view class="quality mb-10">
  23. 品相: 良好({{ goodNum }}) 、 一般({{ item.averageNum || 0 }}) 、 <text
  24. :class="item.badNum > 0 ? 'color-red' : ''">极差({{ badNum }})</text>
  25. </view>
  26. <view class="color-red" v-if="reasons">原因:{{ reasons }}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script setup>
  32. import { defineProps, computed } from 'vue'
  33. const props = defineProps({
  34. item: Object,
  35. showClose: {
  36. type: Boolean,
  37. default: false
  38. }
  39. })
  40. //良好
  41. const goodNum = computed(() => {
  42. return props.item.auditCommentList?.filter(v => v.sts == 1).length || 0
  43. })
  44. //极差
  45. const badNum = computed(() => {
  46. return props.item.auditCommentList?.filter(v => v.sts == 3).length || 0
  47. })
  48. const reasons = computed(() => {
  49. let list = props.item.auditCommentList
  50. if (!list) return ''
  51. if (list.length > 0) {
  52. let poorList = list.filter(v => v.sts == 3)
  53. if (poorList.length == 0) return ''
  54. return poorList.map(v => v.com).join(';')
  55. }
  56. })
  57. </script>
  58. <style scoped>
  59. .card {
  60. padding: 12px;
  61. display: flex;
  62. align-items: center;
  63. margin-bottom: 6rpx;
  64. .card-content {
  65. display: flex;
  66. width: 100%;
  67. }
  68. .book-info {
  69. font-size: 26rpx;
  70. }
  71. .color-red {
  72. color: #bd3124;
  73. }
  74. }
  75. </style>