BookItem.vue 3.4 KB

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