bookdetails-bookInfo.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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__star">
  26. <uv-rate
  27. size="15"
  28. v-model="rate"
  29. :touchable="false"
  30. :allowHalf="true"
  31. inactiveColor="#333"
  32. gutter="0"
  33. ></uv-rate>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script setup lang="ts">
  42. import { ref } from 'vue';
  43. import { util } from '../../framework/util';
  44. const props = defineProps({
  45. book_data: Object,
  46. })
  47. let category_string = ref('')
  48. category_string.value = props.book_data.book_is_action==1?`完结`:`连载至${props.book_data.chapter_count}章`
  49. let rate = ref(props.book_data.book_score/2)
  50. </script>
  51. <style lang="scss">
  52. .bookInfo_content{
  53. display: flex;
  54. flex-direction: column;
  55. background-color: $uni-theme-color;
  56. .container{
  57. display: flex;
  58. flex-direction: row;
  59. padding: 40rpx 20rpx 30rpx 20rpx;
  60. &__book-cover{
  61. flex-shrink: 0;
  62. width: 200rpx;
  63. height: 250rpx;
  64. .image{
  65. width: 100%;
  66. height: 100%;
  67. }
  68. }
  69. &__info {
  70. display: flex;
  71. width: 100%;
  72. flex-direction: column;
  73. margin-left: 20rpx;
  74. // background-color: green;
  75. &__book-name {
  76. margin-top: 12rpx;
  77. font-size: 22px;
  78. }
  79. &__author-name {
  80. margin-top: 18rpx;
  81. font-size: 17px;
  82. color: #894D4D;
  83. }
  84. &__category-name {
  85. margin-top: 18rpx;
  86. font-size: 16px;
  87. color: #323232;
  88. }
  89. &__bottom-info{
  90. margin-top: 18rpx;
  91. display: flex;
  92. flex-direction: row;
  93. justify-content: space-between;
  94. &__read-number {
  95. font-size: 16px;
  96. color: #323232;
  97. }
  98. &__score {
  99. display: flex;
  100. flex-direction: row;
  101. justify-content: center;
  102. align-items: center;
  103. &__number {
  104. font-size: 16px;
  105. color: #323232;
  106. }
  107. &__star{
  108. margin-left: 5rpx;
  109. margin-top: 3rpx;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. </style>