arrival-reminder-item.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <view class="arrival-reminder-item">
  3. <image class="book-cover" :src="info.cover || defaultCover" mode="aspectFill" />
  4. <view class="info-box">
  5. <view class="book-title">{{ info.title || info.bookName }}</view>
  6. <view class="action-box">
  7. <view class="btn-cancel" @click="onCancel">取消到货提醒</view>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: "arrival-reminder-item",
  15. props: {
  16. info: {
  17. type: Object,
  18. default: () => ({})
  19. }
  20. },
  21. data() {
  22. return {
  23. defaultCover: 'https://shuhi.oss-cn-qingdao.aliyuncs.com/mini/default-book.png' // Placeholder
  24. };
  25. },
  26. methods: {
  27. onCancel() {
  28. this.$emit('cancel', this.info);
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .arrival-reminder-item {
  35. display: flex;
  36. background-color: #ffffff;
  37. padding: 30rpx;
  38. border-bottom: 1rpx solid #f5f5f5; // Separator
  39. // If it's card style with margin
  40. // margin: 20rpx;
  41. // border-radius: 12rpx;
  42. // Based on the image, it looks like a list with white background items, possibly separated by small gap or just lines.
  43. // The image shows items with some spacing between them or just a clean white list.
  44. // Let's assume white background list items.
  45. background-color: #fff;
  46. margin-bottom: 20rpx; // Space between items as seen in the image (gray background showing through)
  47. .book-cover {
  48. width: 140rpx;
  49. height: 190rpx; // Approx aspect ratio
  50. border-radius: 8rpx;
  51. flex-shrink: 0;
  52. margin-right: 24rpx;
  53. background-color: #eee;
  54. }
  55. .info-box {
  56. flex: 1;
  57. display: flex;
  58. flex-direction: column;
  59. justify-content: space-between;
  60. .book-title {
  61. font-size: 30rpx;
  62. color: #333;
  63. line-height: 1.4;
  64. font-weight: 500;
  65. display: -webkit-box;
  66. -webkit-box-orient: vertical;
  67. -webkit-line-clamp: 3;
  68. overflow: hidden;
  69. }
  70. .action-box {
  71. display: flex;
  72. justify-content: flex-end;
  73. margin-top: 20rpx; // Ensure spacing if title is short
  74. .btn-cancel {
  75. font-size: 24rpx;
  76. color: #fff;
  77. background-color: $app-theme-color;
  78. padding: 12rpx 24rpx;
  79. border-radius: 30rpx;
  80. line-height: 1;
  81. }
  82. }
  83. }
  84. }
  85. </style>