BookItem.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="book-item">
  3. <view class="book-info">
  4. <image class="book-cover" :src="book.cover" mode="aspectFill" />
  5. <view class="book-detail">
  6. <view class="top-info">
  7. <view class="book-title">{{ book.bookName }}</view>
  8. <view class="book-tags">
  9. <text class="tzs tag-text" v-if="book.suit==1">套装书</text>
  10. <text class="kmdb tag-text" v-if="book.maxNum>1">可卖多本</text>
  11. </view>
  12. </view>
  13. <view class="flex flex-j-b flex-a-c">
  14. <view class="book-price">预估价: ¥{{ book.recycleMoney }}</view>
  15. </view>
  16. </view>
  17. <view class="delete-btn">
  18. <text>×{{book.num}}</text>
  19. </view>
  20. </view>
  21. <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
  22. <text>确定删除这本图书吗?</text>
  23. </common-dialog>
  24. </view>
  25. </template>
  26. <script>
  27. import commonDialog from '@/components/common-dialog.vue';
  28. export default {
  29. components: {
  30. commonDialog
  31. },
  32. props: {
  33. book: {
  34. type: Object,
  35. required: true
  36. }
  37. },
  38. data() {
  39. return {}
  40. },
  41. methods: {
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .book-item {
  47. background: #FFFFFF;
  48. padding: 20rpx;
  49. margin-top: 20rpx;
  50. border-radius: 10rpx;
  51. .tag-text {
  52. font-family: Source Han Sans CN;
  53. font-weight: 400;
  54. font-size: 24rpx;
  55. color: #FFFFFF;
  56. }
  57. .tzs {
  58. width: 91rpx;
  59. height: 30rpx;
  60. background: linear-gradient(263deg, #98E05F, #0DE3AC);
  61. border-radius: 2rpx;
  62. padding: 4rpx 10rpx;
  63. margin-right: 10rpx;
  64. }
  65. .kmdb {
  66. width: 117rpx;
  67. height: 30rpx;
  68. background: linear-gradient(263deg, #F7CB6B, #FBA980);
  69. border-radius: 2rpx;
  70. padding: 4rpx 10rpx;
  71. margin-right: 10rpx;
  72. }
  73. .book-info {
  74. display: flex;
  75. position: relative;
  76. .book-cover {
  77. width: 140rpx;
  78. height: 196rpx;
  79. border-radius: 8rpx;
  80. }
  81. .book-detail {
  82. flex: 1;
  83. margin-left: 20rpx;
  84. display: flex;
  85. flex-direction: column;
  86. justify-content: space-between;
  87. :v-deep .u-number-input {
  88. background: #F9F9F9 !important;
  89. border-radius: 6rpx;
  90. }
  91. .book-title {
  92. max-width: 400rpx;
  93. font-size: 28rpx;
  94. color: #333;
  95. line-height: 1.4;
  96. margin-bottom: 20rpx;
  97. display: -webkit-box;
  98. -webkit-box-orient: vertical;
  99. -webkit-line-clamp: 2;
  100. overflow: hidden;
  101. font-family: Source Han Sans CN;
  102. font-weight: 400;
  103. }
  104. .book-price {
  105. font-family: Source Han Sans CN;
  106. font-weight: 400;
  107. font-size: 24rpx;
  108. color: #999999;
  109. }
  110. }
  111. .delete-btn {
  112. position: absolute;
  113. right: 0;
  114. top: -10rpx;
  115. padding: 10rpx;
  116. }
  117. }
  118. }
  119. </style>