select-book-item.vue 6.0 KB

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