BookItem.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="book-item">
  3. <image class="book-image"
  4. src="https://img20.360buyimg.com/da/jfs/t1/141592/25/8861/261559/5f68d8c1E33ed78ab/698ad655bfcfbaed.png"
  5. mode="aspectFill" />
  6. <view class="book-info">
  7. <view class="book-title">
  8. <text>{{ book.title }}</text>
  9. <u-icon name="close" size="18" @click="removeBook" />
  10. </view>
  11. <view class="flex-a">
  12. <view class="book-details flex-d">
  13. <text>ISBN: {{ book.isbn }}</text>
  14. <text>定价: {{ book.price }}</text>
  15. <text>折扣: {{ book.discount }}</text>
  16. </view>
  17. <view class="book-stats flex-d ml-20">
  18. <text>数量: {{ book.quantity }}</text>
  19. <text>预估单价: {{ book.estimatedPrice }}</text>
  20. <text>审核金额: {{ book.reviewAmount }}</text>
  21. </view>
  22. </view>
  23. <view class="book-rating flex-a flex-j-b mt-6">
  24. <text>良好 ({{ book.good }})</text>
  25. <text>一般 ({{ book.average }})</text>
  26. <text>极差 ({{ book.poor }})</text>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script setup>
  32. const props = defineProps({
  33. book: Object
  34. });
  35. const emit = defineEmits(['remove']);
  36. const removeBook = () => {
  37. emit('remove', props.book);
  38. };
  39. </script>
  40. <style scoped>
  41. .book-item {
  42. display: flex;
  43. padding: 8px;
  44. background-color: #fff;
  45. border-radius: 8px;
  46. margin-bottom: 12px;
  47. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  48. }
  49. .book-image {
  50. width: 80px;
  51. height: 100px;
  52. border-radius: 4px;
  53. margin-right: 12px;
  54. }
  55. .book-info {
  56. flex: 1;
  57. }
  58. .book-title {
  59. display: flex;
  60. justify-content: space-between;
  61. align-items: center;
  62. font-weight: bold;
  63. margin-bottom: 8px;
  64. }
  65. .book-details,
  66. .book-stats,
  67. .book-rating {
  68. font-size: 26rpx;
  69. color: #666;
  70. line-height: 36rpx;
  71. }
  72. .book-rating text {
  73. margin-right: 8px;
  74. }
  75. </style>