detail-book-item.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 class="flex flex-j-b flex-a-c mt-20">
  13. <view class="book-price">预估价: ¥{{ book.recycleMoney }}</view>
  14. </view>
  15. </view>
  16. <view v-if="isReturn" class="book-price">退回信息</view>
  17. <template v-else>
  18. <view class="book-price" v-if="book.auditList && book.auditList.length">审核信息</view>
  19. <view v-else class="book-price">暂无审核信息</view>
  20. </template>
  21. </view>
  22. <view class="delete-btn">
  23. <text>×{{ book.num }}</text>
  24. </view>
  25. </view>
  26. <view class="mt-10" style="padding-left: 150rpx;">
  27. <view class="audit-info" v-if="isReturn">
  28. <view class="audit-item" v-for="(audit, index) in book.auditList" :key="index">
  29. <view class="audit-reason" v-if="audit.auditReason">
  30. 原因:{{ audit.auditReason }}
  31. </view>
  32. </view>
  33. </view>
  34. <template v-else>
  35. <view class="audit-info" v-if="book.auditList && book.auditList.length">
  36. <view class="audit-item" v-for="(audit, index) in book.auditList" :key="index">
  37. <view class="flex-a w100">
  38. <view class="flex-a flex-1">
  39. <view class="common-text-2 mr-16">第{{ index + 1 }}本</view>
  40. <view class="audit-status"
  41. :class="audit.status === '良好' ? 'status-good' : 'status-bad'">
  42. {{ audit.status }}
  43. </view>
  44. </view>
  45. <view class="audit-price flex-1"><text class="common-text-2">审核:</text> ¥{{ audit.price }}
  46. </view>
  47. </view>
  48. <view class="audit-reason" v-if="audit.auditReason">
  49. 原因:{{ audit.auditReason }}
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. </view>
  55. <common-dialog ref="deleteDialog" title="温馨提示" @confirm="confirmDelete">
  56. <text>确定删除这本图书吗?</text>
  57. </common-dialog>
  58. </view>
  59. </template>
  60. <script>
  61. import commonDialog from '@/components/common-dialog.vue';
  62. export default {
  63. components: {
  64. commonDialog
  65. },
  66. props: {
  67. book: {
  68. type: Object,
  69. required: true
  70. },
  71. isReturn: {
  72. type: Boolean,
  73. default: false
  74. }
  75. },
  76. data() {
  77. return {}
  78. },
  79. methods: {
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .book-item {
  85. background: #FFFFFF;
  86. margin-bottom: 30rpx;
  87. border-radius: 10rpx;
  88. .tag-text {
  89. font-family: Source Han Sans CN;
  90. font-weight: 400;
  91. font-size: 24rpx;
  92. color: #FFFFFF;
  93. }
  94. .tzs {
  95. width: 91rpx;
  96. height: 30rpx;
  97. background: linear-gradient(263deg, #98E05F, #0DE3AC);
  98. border-radius: 2rpx;
  99. padding: 4rpx 10rpx;
  100. margin-right: 10rpx;
  101. }
  102. .kmdb {
  103. width: 117rpx;
  104. height: 30rpx;
  105. background: linear-gradient(263deg, #F7CB6B, #FBA980);
  106. border-radius: 2rpx;
  107. padding: 4rpx 10rpx;
  108. margin-right: 10rpx;
  109. }
  110. .book-info {
  111. display: flex;
  112. position: relative;
  113. .book-cover {
  114. width: 140rpx;
  115. height: 196rpx;
  116. border-radius: 8rpx;
  117. }
  118. .book-detail {
  119. flex: 1;
  120. margin-left: 20rpx;
  121. display: flex;
  122. flex-direction: column;
  123. justify-content: space-between;
  124. :v-deep .u-number-input {
  125. background: #F9F9F9 !important;
  126. border-radius: 6rpx;
  127. }
  128. .book-title {
  129. max-width: 400rpx;
  130. font-size: 28rpx;
  131. color: #333;
  132. line-height: 1.4;
  133. margin-bottom: 20rpx;
  134. display: -webkit-box;
  135. -webkit-box-orient: vertical;
  136. -webkit-line-clamp: 2;
  137. overflow: hidden;
  138. font-family: Source Han Sans CN;
  139. font-weight: 400;
  140. }
  141. .book-price {
  142. font-family: Source Han Sans CN;
  143. font-weight: 400;
  144. font-size: 24rpx;
  145. color: #999999;
  146. }
  147. }
  148. .delete-btn {
  149. position: absolute;
  150. right: 0;
  151. top: -10rpx;
  152. padding: 10rpx;
  153. }
  154. }
  155. .audit-info {
  156. min-height: 60rpx;
  157. background: #FAFAFA;
  158. border-radius: 10rpx;
  159. padding: 12rpx 20rpx;
  160. box-sizing: border-box;
  161. .audit-item {
  162. margin-bottom: 6rpx;
  163. font-size: 24rpx;
  164. line-height: 42rpx;
  165. }
  166. .audit-status {
  167. margin-right: 20rpx;
  168. &.status-good {
  169. color: #67C23A;
  170. }
  171. &.status-bad {
  172. color: #F56C6C;
  173. }
  174. }
  175. .audit-price {
  176. color: #F56C6C;
  177. }
  178. .audit-reason {
  179. font-size: 26rpx;
  180. color: #999;
  181. font-weight: 400;
  182. font-family: PingFang SC;
  183. margin-top: 6rpx;
  184. }
  185. }
  186. }
  187. </style>