BookItem2.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="card" :class="{ 'card-close': showClose }">
  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.price }}</view>
  16. <view class="estimate">预估单价: {{ item.expectMoney || 0 }}</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.review || 0 }}</text></view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="quantity-icon mt-24" v-if="showClose">
  25. <u-icon name="close-circle-fill" size="18" color="#999" @click="handleClose"></u-icon>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import { defineProps, computed } from 'vue'
  31. const props = defineProps({
  32. item: Object,
  33. showClose: {
  34. type: Boolean,
  35. default: false
  36. }
  37. })
  38. const emit = defineEmits(['close'])
  39. const handleClose = () => {
  40. emit('close', props.item.isbn)
  41. }
  42. </script>
  43. <style scoped>
  44. .card {
  45. padding: 12px;
  46. display: flex;
  47. align-items: center;
  48. margin-bottom: 20rpx;
  49. position: relative;
  50. .quantity-icon {
  51. position: absolute;
  52. right: 10px;
  53. top: 0;
  54. }
  55. &.card-close {
  56. background-color: #ffffff;
  57. border-radius: 6px;
  58. }
  59. .card-content {
  60. display: flex;
  61. width: 100%;
  62. }
  63. .book-info {
  64. font-size: 26rpx;
  65. }
  66. .color-red {
  67. color: #bd3124;
  68. }
  69. }
  70. </style>