59 lines
2.3 KiB
Plaintext
59 lines
2.3 KiB
Plaintext
<view class="page" wx:if="{{post}}">
|
|
<view class="hero">
|
|
<view class="eyebrow">CLASS FEED</view>
|
|
<view wx:if="{{canDelete}}" class="detail-more" bindtap="openActions">···</view>
|
|
<view class="hero-title">{{post.title}}</view>
|
|
<view class="hero-subtitle">{{post.author_name}} · {{post.created_at}}</view>
|
|
</view>
|
|
|
|
<view class="section">
|
|
<view class="card">
|
|
<view class="feed-content">{{post.content || "暂无正文"}}</view>
|
|
<view wx:if="{{post.image_urls && post.image_urls.length}}" class="feed-images detail-images">
|
|
<image wx:for="{{post.image_urls}}" wx:for-item="img" wx:key="*this" src="{{img}}" mode="aspectFill" data-src="{{img}}" bindtap="previewImage" />
|
|
</view>
|
|
<view class="detail-action-bar">
|
|
<view class="action-chip {{post.has_liked ? 'active' : ''}}" bindtap="toggleLike">
|
|
<text class="action-icon">赞</text>
|
|
<text>{{post.has_liked ? "已点赞" : "点赞"}} · {{post.like_count}}</text>
|
|
</view>
|
|
<view class="action-chip">
|
|
<text class="action-icon">评</text>
|
|
<text>评论 · {{comments.length}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="section">
|
|
<view class="section-head">
|
|
<view class="section-title">评论</view>
|
|
<view class="section-action">{{comments.length}} 条</view>
|
|
</view>
|
|
<view wx:for="{{comments}}" wx:key="id" class="comment-card">
|
|
<view class="list-row">
|
|
<view class="avatar">{{item.initial}}</view>
|
|
<view class="row-body">
|
|
<view class="comment-head">
|
|
<view class="card-title">{{item.author_name}}</view>
|
|
<view class="reply-link" data-name="{{item.author_name}}" bindtap="replyComment">回复</view>
|
|
</view>
|
|
<view class="comment-content">{{item.content}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{!comments.length}}" class="card">
|
|
<view class="muted">还没有评论</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{replyTo}}" class="replying-bar">
|
|
<view>正在回复 {{replyTo}}</view>
|
|
<view bindtap="cancelReply">取消</view>
|
|
</view>
|
|
<view class="comment-box">
|
|
<input value="{{commentText}}" bindinput="onCommentInput" placeholder="{{inputPlaceholder}}" />
|
|
<button loading="{{submitting}}" bindtap="submitComment">发送</button>
|
|
</view>
|
|
</view>
|