bookdetail.blade.php 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. @php
  2. $w = "width: ". (isset($width) ? $width : 2) ."rem";
  3. $w2 = "width: calc(100% - " . (isset($width) ? $width : 2) ."rem)";
  4. $h = "height: ". ((isset($width) ? $width : 2) / 3 * 4) ."rem";
  5. @endphp
  6. @if(!$recom)
  7. <dl class="x-book x-book--multi {{$class or ''}}">
  8. <dt class="x-book__coverbox" style="{{$w.';'.$h}}">
  9. @if ($book->cover_url)
  10. <img src="{{ $book->cover_url }}" class="x-book__cover" style="{{$w.';'.$h}}">
  11. @else
  12. <img src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/book/cover/loading.png" class="x-book__cover" style="{{$w.';'.$h}}">
  13. @endif
  14. </dt>
  15. <dd class="x-book__text--multi" style="{{$w2.';'.$h}}">
  16. {{ $slot }}
  17. </dd>
  18. </dl>
  19. @else
  20. <a href="/detail?bid={{ $book['book_id']}}">
  21. <dl class="x-book {{$class or ''}}" style="{{$w}}">
  22. <dt class="x-book__coverbox">
  23. @if ($book['cover_url'])
  24. <img src="{{ $book['cover_url'] }}" class="x-book__cover" style="{{$w.';'.$h}}">
  25. @else
  26. <img src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/book/cover/loading.png" class="x-book__cover" style="{{$w.';'.$h}}">
  27. @endif
  28. </dt>
  29. <dd class="x-book__text--normal">{{ $book['book_name'] }}</dd>
  30. </dl>
  31. </a>
  32. @endif