bookdetails-bookInfo.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="bookInfo_content">
  3. <view class="container">
  4. <view class="container__book-cover">
  5. <image class="image" :src="book_data.book_cover" mode="aspectFit"></image>
  6. </view>
  7. <view class="container__info">
  8. <view class="container__info__book-name">
  9. {{ book_data.book_name }}
  10. </view>
  11. <view class="container__info__author-name">
  12. {{ book_data.author_name }}
  13. </view>
  14. <view class="container__info__category-name">
  15. {{book_data.category_name + ' · '}}{{category_string}}
  16. </view>
  17. <view class="container__info__bottom-info">
  18. <view class="container__info__bottom-info__read-number">
  19. {{util.convertUnit(book_data.book_read_num)}}人在读
  20. </view>
  21. <view class="container__info__bottom-info__score">
  22. <view class="container__info__bottom-info__score__number">
  23. {{book_data.book_score}}
  24. </view>
  25. <view class="container__info__bottom-info__score__unit">分</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script setup lang="ts">
  33. import { ref } from 'vue';
  34. import { util } from '../../framework/util';
  35. const props = defineProps({
  36. book_data: Object,
  37. })
  38. let category_string = ref('')
  39. category_string.value = props.book_data.book_is_action==1?`完结`:`连载至${props.book_data.chapter_count}章`
  40. let rate = ref(props.book_data.book_score/2)
  41. </script>
  42. <style lang="scss">
  43. .bookInfo_content{
  44. display: flex;
  45. flex-direction: column;
  46. background-color: $uni-theme-color;
  47. .container{
  48. display: flex;
  49. flex-direction: row;
  50. padding: 40rpx 20rpx 30rpx 20rpx;
  51. &__book-cover{
  52. flex-shrink: 0;
  53. width: 200rpx;
  54. height: 250rpx;
  55. .image{
  56. width: 100%;
  57. height: 100%;
  58. }
  59. }
  60. &__info {
  61. display: flex;
  62. width: 100%;
  63. flex-direction: column;
  64. margin-left: 20rpx;
  65. // background-color: green;
  66. &__book-name {
  67. margin-top: 2rpx;
  68. font-size: 22px;
  69. }
  70. &__author-name {
  71. margin-top: 18rpx;
  72. font-size: 17px;
  73. color: #894D4D;
  74. }
  75. &__category-name {
  76. margin-top: 18rpx;
  77. font-size: 16px;
  78. color: #323232;
  79. }
  80. &__bottom-info{
  81. margin-top: 18rpx;
  82. display: flex;
  83. flex-direction: row;
  84. justify-content: space-between;
  85. align-items: center;
  86. // background-color: green;
  87. &__read-number {
  88. font-size: 16px;
  89. color: #323232;
  90. }
  91. &__score {
  92. display: flex;
  93. flex-direction: row;
  94. &__number {
  95. font-size: 22px;
  96. font-weight: 480;
  97. color: #323232;
  98. }
  99. &__unit{
  100. margin-top: 22rpx;
  101. margin-left: 5rpx;
  102. font-size: 11px;
  103. color: #323232;
  104. }
  105. }
  106. }
  107. }
  108. }
  109. }
  110. </style>