BookItem.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="book-item" :class="{ disabled: book.status != 1 }">
  3. <view class="book-info">
  4. <view class="book-image-container">
  5. <image class="book-cover" :src="book.cover" mode="aspectFill" />
  6. <view class="no-recycle" v-if="book.status != 1">
  7. <text>已收满</text>
  8. </view>
  9. </view>
  10. <view class="book-detail">
  11. <view class="top-info">
  12. <view class="book-title">{{ book.bookName }}</view>
  13. <view class="upsell-info">
  14. <view class="book-tags">
  15. <text class="tzs tag-text" v-if="book.suit == 1">套装书</text>
  16. <text class="kmdb tag-text" v-if="book.maxNum > 1">可卖多本</text>
  17. </view>
  18. <text class="has-upsell" v-if="book.currUpsellMoney">限时加价 {{ book.currUpsellMoney }} 元
  19. <image
  20. src="/static/img/activity/up3.png"
  21. mode="aspectFill"
  22. style="width: 22rpx; height: 16rpx; margin-left: 6rpx"
  23. />
  24. </text>
  25. </view>
  26. </view>
  27. <view class="flex flex-j-b flex-a-c">
  28. <view class="book-price">预估价: ¥{{ book.recycleMoney }}</view>
  29. </view>
  30. </view>
  31. <view class="delete-btn">
  32. <text>×{{ book.num }}</text>
  33. </view>
  34. </view>
  35. <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
  36. <text>确定删除这本图书吗?</text>
  37. </common-dialog>
  38. </view>
  39. </template>
  40. <script>
  41. import commonDialog from "@/components/common-dialog.vue";
  42. export default {
  43. components: {
  44. commonDialog,
  45. },
  46. props: {
  47. book: {
  48. type: Object,
  49. required: true,
  50. },
  51. },
  52. data() {
  53. return {};
  54. },
  55. methods: {},
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .book-item {
  60. background: #ffffff;
  61. padding: 20rpx;
  62. margin-top: 20rpx;
  63. border-radius: 10rpx;
  64. &.disabled {
  65. background: #f9ccc9;
  66. }
  67. .tag-text {
  68. font-family: Source Han Sans CN;
  69. font-weight: 400;
  70. font-size: 24rpx;
  71. color: #ffffff;
  72. }
  73. .tzs {
  74. width: 91rpx;
  75. height: 30rpx;
  76. background: linear-gradient(263deg, #98e05f, #0de3ac);
  77. border-radius: 2rpx;
  78. padding: 4rpx 10rpx;
  79. margin-right: 10rpx;
  80. }
  81. .kmdb {
  82. width: 117rpx;
  83. height: 30rpx;
  84. background: linear-gradient(263deg, #f7cb6b, #fba980);
  85. border-radius: 2rpx;
  86. padding: 4rpx 10rpx;
  87. margin-right: 10rpx;
  88. }
  89. .book-info {
  90. display: flex;
  91. position: relative;
  92. .book-image-container {
  93. position: relative;
  94. .book-cover {
  95. width: 140rpx;
  96. height: 196rpx;
  97. border-radius: 8rpx;
  98. }
  99. .no-recycle {
  100. position: absolute;
  101. bottom: 0;
  102. left: 50%;
  103. transform: translateX(-50%);
  104. background-color: #ff5252;
  105. color: #ffffff;
  106. padding: 4rpx 10rpx;
  107. border-radius: 4rpx 4rpx 0 0;
  108. font-size: 24rpx;
  109. text-align: center;
  110. width: 100%;
  111. }
  112. }
  113. .book-detail {
  114. flex: 1;
  115. margin-left: 20rpx;
  116. display: flex;
  117. flex-direction: column;
  118. justify-content: space-between;
  119. :v-deep .u-number-input {
  120. background: #f9f9f9 !important;
  121. border-radius: 6rpx;
  122. }
  123. .upsell-info{
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. }
  128. .has-upsell {
  129. font-size: 22rpx;
  130. padding: 2rpx 10rpx;
  131. border-radius: 4rpx;
  132. margin-right: 10rpx;
  133. display: inline-flex;
  134. align-items: center;
  135. color: #276f1e;
  136. background-color: #a8dda2;
  137. }
  138. .book-title {
  139. max-width: 400rpx;
  140. font-size: 28rpx;
  141. color: #333;
  142. line-height: 1.4;
  143. margin-bottom: 20rpx;
  144. display: -webkit-box;
  145. -webkit-box-orient: vertical;
  146. -webkit-line-clamp: 2;
  147. overflow: hidden;
  148. font-family: Source Han Sans CN;
  149. font-weight: 400;
  150. }
  151. .book-price {
  152. font-family: Source Han Sans CN;
  153. font-weight: 400;
  154. font-size: 24rpx;
  155. color: #999999;
  156. }
  157. }
  158. .delete-btn {
  159. position: absolute;
  160. right: 0;
  161. top: -10rpx;
  162. padding: 10rpx;
  163. }
  164. }
  165. }
  166. </style>