49 lines
3.0 KiB
Plaintext
49 lines
3.0 KiB
Plaintext
<view class="page">
|
||
<view class="circle-head">
|
||
<view>
|
||
<view class="circle-title">班级圈</view>
|
||
<view class="circle-subtitle">同学近况、照片和想法都在这里</view>
|
||
</view>
|
||
<view wx:if="{{timelineEnabled}}" class="circle-compose" bindtap="openCompose">发布</view>
|
||
</view>
|
||
|
||
<view wx:if="{{timelines.length}}" class="circle-list">
|
||
<view wx:for="{{timelines}}" wx:key="id" class="circle-post">
|
||
<view class="circle-avatar">{{item.author_initial}}</view>
|
||
<view class="circle-body">
|
||
<view class="circle-author" data-id="{{item.id}}" bindtap="openTimeline">{{item.author_name}}</view>
|
||
<view class="circle-post-title" data-id="{{item.id}}" bindtap="openTimeline">{{item.title}}</view>
|
||
<view wx:if="{{item.content}}" class="circle-content" data-id="{{item.id}}" bindtap="openTimeline">{{item.content}}</view>
|
||
<view wx:if="{{item.image_urls && item.image_urls.length}}" class="circle-images">
|
||
<image wx:for="{{item.image_urls}}" wx:for-item="img" wx:key="*this" src="{{img}}" mode="aspectFill" data-src="{{img}}" data-post-id="{{item.id}}" bindtap="previewImage" />
|
||
</view>
|
||
<view class="circle-meta">
|
||
<view>{{item.created_at_text}}</view>
|
||
<view class="circle-actions">
|
||
<view class="circle-action {{item.like_action_class}}" data-id="{{item.id}}" bindtap="toggleLike">{{item.like_action_text}} {{item.like_count}}</view>
|
||
<view class="circle-action" data-id="{{item.id}}" bindtap="openComment">评论 {{item.comment_count}}</view>
|
||
</view>
|
||
</view>
|
||
<view wx:if="{{item.like_count || item.comments.length}}" class="circle-feedback">
|
||
<view wx:if="{{item.like_count}}" class="circle-likes">赞 {{item.like_count}}</view>
|
||
<view wx:for="{{item.comments}}" wx:for-item="comment" wx:key="id" class="circle-comment" data-post-id="{{item.id}}" data-comment-id="{{comment.id}}" data-name="{{comment.author_name}}" data-can-delete="{{comment.can_delete}}" bindtap="replyComment">
|
||
<text class="circle-comment-name">{{comment.author_name}}</text>
|
||
<text>:{{comment.content}}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view wx:else class="empty">
|
||
<view class="muted">{{timelineEnabled ? "还没有动态,先发一条吧" : "当前班级未开放班级动态"}}</view>
|
||
<view wx:if="{{timelineEnabled}}" class="empty-action" bindtap="openCompose">发布动态</view>
|
||
</view>
|
||
|
||
<view wx:if="{{commentPostId}}" class="comment-mask {{keyboardOpen ? 'keyboard-open' : ''}}" catchtap="closeComment">
|
||
<view class="comment-bar" catchtap="noop">
|
||
<input value="{{commentText}}" bindinput="onCommentInput" bindfocus="onCommentFocus" bindblur="onCommentBlur" bindkeyboardheightchange="onKeyboardHeightChange" placeholder="{{commentPlaceholder}}" adjust-position="{{true}}" cursor-spacing="{{0}}" focus="{{commentInputFocus}}" hold-keyboard="{{true}}" />
|
||
<button loading="{{commenting}}" bindtap="submitComment">发送</button>
|
||
</view>
|
||
</view>
|
||
</view>
|