detail.blade.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. @extends('wap-browser.template')
  2. @section('head')
  3. <link rel="stylesheet" href="/wapbrowser/web/component.css">
  4. <style>
  5. .book-detail-book {
  6. padding: .24rem;
  7. font-size: .24rem;
  8. line-height: .6rem;
  9. }
  10. .x-book__title{
  11. margin-bottom: 0;
  12. }
  13. .x-book__category,.x-book__count{
  14. color: #999;
  15. }
  16. .book-detail-handle__add {
  17. margin-right: .4rem;
  18. }
  19. .book-detail-handle {
  20. display: -webkit-box;
  21. display: -ms-flexbox;
  22. display: flex;
  23. -webkit-box-align: center;
  24. -ms-flex-align: center;
  25. align-items: center;
  26. -webkit-box-orient: horizontal;
  27. -webkit-box-direction: normal;
  28. -ms-flex-direction: row;
  29. flex-direction: row;
  30. -webkit-box-pack: start;
  31. -ms-flex-pack: start;
  32. justify-content: flex-start;
  33. }
  34. .book-detail-handle__btn {
  35. width: 1.8rem;
  36. height: .55rem;
  37. line-height: calc(.55rem - 2px);
  38. text-align: center;
  39. box-sizing: border-box;
  40. border: 1px solid #ff6060;
  41. color: #ff6060;
  42. border-radius: .06rem;
  43. }
  44. .book-detail-handle__read {
  45. background-color: #ff6060;
  46. color: #fff;
  47. }
  48. .book-detail-intro {
  49. padding: 0 .24rem .24rem;
  50. font-size: .26rem;
  51. color: #666;
  52. line-height: 1.8;
  53. }
  54. .book-detail-extend {
  55. color: #32a1ff;
  56. }
  57. .book-detail-lastest, .book-detail-more {
  58. padding: 0 .24rem;
  59. font-size: .26rem;
  60. height: .9rem;
  61. background-color: #f7f7f7;
  62. color: #32a1ff;
  63. overflow: hidden;
  64. text-overflow: ellipsis;
  65. white-space: nowrap;
  66. line-height: .9rem;
  67. }
  68. .book-detail-catalog,.similar__section-title,.similar__list{
  69. padding: 0 .24rem;
  70. margin: .24rem 0;
  71. }
  72. .book-catalog-total {
  73. font-size: .24rem;
  74. color: #999;
  75. position: absolute;
  76. right: .24rem;
  77. line-height: .42rem;
  78. }
  79. .catalogs-list{
  80. padding: 0 .24rem;
  81. }
  82. .similar__list{
  83. display: -webkit-box;
  84. display: -ms-flexbox;
  85. display: flex;
  86. -webkit-box-align: center;
  87. -ms-flex-align: center;
  88. align-items: center;
  89. -webkit-box-orient: horizontal;
  90. -webkit-box-direction: normal;
  91. -ms-flex-direction: row;
  92. flex-direction: row;
  93. -webkit-box-pack: justify;
  94. -ms-flex-pack: justify;
  95. justify-content: space-between;
  96. }
  97. </style>
  98. @endsection
  99. @section('body')
  100. @component('wap-browser.component.header',['name'=> $book->book_name])
  101. @endcomponent
  102. @component('wap-browser.component.bookdetail',['book'=> $book, 'multi'=> true, 'class'=>'book-detail-book', 'width'=> 1.8, 'prevent'=>true,'recom'=>false])
  103. <p class="x-book__title">{{$book->book_name}}</p>
  104. <p class="x-book__category">{{$book->book_category}}</p>
  105. <p class="x-book__count">字数:{{$book->book_word_count}}</p>
  106. <div class="book-detail-handle">
  107. {{--<div class="book-detail-handle__read book-detail-handle__btn">--}}
  108. {{--立即阅读--}}
  109. {{--</div>--}}
  110. </div>
  111. @endcomponent
  112. <div class="book-detail-intro">
  113. <span class="book-detail-text">{{str_limit($book->book_summary, 200)}}</span>
  114. @if(strlen($book->book_summary)>200)
  115. <span class="book-detail-extend">展开</span>
  116. @endif
  117. </div>
  118. <div class="book-detail-lastest">最新章节:{{$book->last_chapter}}</div>
  119. <div class="book-detail-catalog">
  120. <span class="section-title">目录</span>
  121. <span class="book-catalog-total">共{{$book->book_chapter_total}}章</span>
  122. </div>
  123. @component('wap-browser.component.catalogdetail',['catalogs'=> $catalog])
  124. @endcomponent
  125. <div class="book-detail-more" style="text-align: center" ><a href="/catalog?bid={{$book->book_id}}">更多目录 &gt; </a></div>
  126. <div class="similar">
  127. <div class="section-title similar__section-title"> 同款推荐 </div>
  128. <div class="similar__list">
  129. @foreach($recommend as $similar_item)
  130. @component('wap-browser.component.bookdetail',['book'=> $similar_item,'recom'=>true])
  131. @endcomponent
  132. @endforeach
  133. </div>
  134. </div>
  135. @endsection
  136. @section('foot')
  137. <script>
  138. @if(strlen($book->book_summary)>200)
  139. addEvent(document.querySelector('.book-detail-extend'),'click',function(e){
  140. document.querySelector('.book-detail-text').innerHTML = '{{$book->book_summary}}'
  141. e.target.style.display = 'none'
  142. })
  143. @endif
  144. </script>
  145. @endsection