BookItemOrder.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="book-item">
  3. <image class="book-image" :src="book.cover" mode="aspectFill" />
  4. <view class="book-info">
  5. <view class="book-title">
  6. <text>{{ book.bookName }}</text>
  7. <u-icon name="close" size="18" @click="removeBook" />
  8. </view>
  9. <view class="flex-a flex-1">
  10. <view class="book-details flex-d">
  11. <text>ISBN: {{ book.isbn }}</text>
  12. <text>定价: {{ book.price }}</text>
  13. <text>折扣: {{ book.recycleDiscount }}</text>
  14. </view>
  15. <view class="book-stats flex-d ml-20">
  16. <text>数量: {{ book.quantity }}</text>
  17. <text>预估单价: {{ book.expectPrice }}</text>
  18. <text style="color: #ff0000;">审核金额: {{ book.auditPrice }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script setup>
  25. const props = defineProps({
  26. book: Object,
  27. index: Number
  28. });
  29. const emit = defineEmits(['remove']);
  30. const removeBook = () => {
  31. emit('remove', { book: props.book, index: props.index });
  32. };
  33. </script>
  34. <style scoped>
  35. .book-item {
  36. display: flex;
  37. padding: 8px;
  38. background-color: #fff;
  39. border-radius: 8px;
  40. margin-bottom: 12px;
  41. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  42. }
  43. .book-image {
  44. width: 66px;
  45. height: 90px;
  46. border-radius: 4px;
  47. margin-right: 12px;
  48. }
  49. .book-info {
  50. flex: 1;
  51. }
  52. .book-title {
  53. display: flex;
  54. justify-content: space-between;
  55. align-items: center;
  56. font-weight: bold;
  57. margin-bottom: 8px;
  58. font-size: 32rpx;
  59. }
  60. .book-details,
  61. .book-stats,
  62. .book-rating {
  63. font-size: 28rpx;
  64. color: #666;
  65. line-height: 42rpx;
  66. justify-content: space-around;
  67. }
  68. .book-rating text {
  69. margin-right: 8px;
  70. }
  71. </style>