Skip to content

Commit

Permalink
fix(PC): 动态列表超出3行的动态显示查看更多按钮
Browse files Browse the repository at this point in the history
issue #468
  • Loading branch information
mutoe committed Dec 4, 2018
1 parent 706ffc0 commit 8f7e314
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/zhiyicx-plus-pc/resources/assets/web/css/feed.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ to {-webkit-transform:rotate(360deg);transform:rotate(360deg);}
.feed_item .feed_title .pinned {float:right;margin-top:19px;color:#67b595;margin-right:10px;}
.feed_item .feed_body {text-align:left;word-wrap:break-word;word-break:break-all;}
.feed_item .feed_body .feed_text {font-size:14px;line-height:24px;display:-webkit-box;overflow:hidden;margin:15px 0;word-break:break-word;color:#666;-webkit-line-clamp:3;-webkit-box-orient:vertical;}
.feed_item .feed_body .feed_text a {color:#59b6d7;}
.feed_item .feed_body .feed_text .more {color:#59b6d7;}
.feed_item .feed_body .feed_pay_text {cursor:pointer;text-shadow:0 0 8px #000;color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
.feed_item .feed_body .feed_images {position:relative;margin-bottom:8px;}
.feed_item .feed_body .feed_images img {cursor:url(../images/big.cur),pointer;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@
</p>
@else
<a class="feed_text" href="{{ route('pc:feedread', ['feed' => $post['id']]) }}">
{!! formatContent($post['feed_content']) !!}
@php
$content = formatContent($post['feed_content']);
$has_more = mb_strlen($content, 'utf-8') > 100;
$content = mb_substr($content, 0, 100, 'utf-8');
@endphp
{!! $content !!}
<span class="more"> 查看更多</span>
</a>
@endif

Expand Down

0 comments on commit 8f7e314

Please sign in to comment.