You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
152 lines
5.5 KiB
152 lines
5.5 KiB
<view class="forum-page">
|
|
<!-- 帖子详情 -->
|
|
<scroll-view
|
|
class="post-detail-container"
|
|
scroll-y
|
|
scroll-with-animation
|
|
scroll-into-view="{{scrollToId}}"
|
|
bindscroll="onScroll"
|
|
>
|
|
|
|
<!-- 帖子主体 -->
|
|
<view class="post-main" id="post-main">
|
|
<!-- 帖子头部 -->
|
|
<view class="post-header">
|
|
<view class="user-info">
|
|
<image class="avatar" src="{{baseUrl+post.avatar}}" mode="aspectFill"></image>
|
|
<view class="user-detail">
|
|
<view class="username">{{post.nickName}}</view>
|
|
<view class="post-time">{{post.createdAt}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 帖子内容 -->
|
|
<view class="post-content">
|
|
<view class="post-title">{{post.title}}</view>
|
|
<view class="post-desc">{{post.content}}</view>
|
|
|
|
<!-- 帖子图片 -->
|
|
<view class="post-images" wx:if="{{post.images && post.images.length > 0}}">
|
|
<view class="images-container">
|
|
<block wx:for="{{images}}" wx:for-item="image" wx:for-index="imgIndex" wx:key="index">
|
|
<image
|
|
class="post-image"
|
|
src="{{baseUrl+image}}"
|
|
mode="aspectFill"
|
|
data-img-index="{{imgIndex}}"
|
|
bindtap="previewImage"
|
|
></image>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- 回复列表 -->
|
|
<view class="replies-section" id="replies-section">
|
|
<view class="section-title">
|
|
<text class="title-text">全部回复</text>
|
|
<text class="reply-count">{{postHf.length}}条</text>
|
|
</view>
|
|
|
|
<view class="reply-list" wx:if="{{postHf.length > 0}}">
|
|
<block wx:for="{{postHf}}" wx:key="id" wx:for-index="replyIndex">
|
|
<view class="reply-item" id="reply-{{item.id}}">
|
|
<view class="reply-user">
|
|
<image class="reply-avatar" src="{{baseUrl+item.avatar}}" mode="aspectFill"></image>
|
|
<view class="reply-user-info">
|
|
<view class="reply-username">{{item.nickName}}</view>
|
|
<view class="reply-time">{{item.createdAt}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="reply-content">{{item.content}}</view>
|
|
|
|
<!-- 回复操作 -->
|
|
<view class="reply-actions">
|
|
<view class="reply-action" bindtap="replyToUser" data-type="reply" data-index="{{replyIndex}}" data-username="{{item.nickName}}">
|
|
<image class="reply-action-icon" src="/pagesB/images/hf.png" mode="aspectFit"></image>
|
|
<text class="reply-action-text">回复</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 二级评论列表 -->
|
|
<view class="comment-list" wx:if="{{item.children.length > 0}}">
|
|
<block wx:for="{{item.children}}" wx:key="id" wx:for-index="commentIndex">
|
|
<view class="comment-item">
|
|
<view class="comment-user">
|
|
<image class="comment-avatar" src="{{baseUrl+item.avatar}}" mode="aspectFill"></image>
|
|
<view class="comment-user-info">
|
|
<view class="comment-username">{{item.nickName}}</view>
|
|
<view class="comment-time">{{item.createdAt}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="comment-content">
|
|
{{item.content}}
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
|
|
<!-- 空回复状态 -->
|
|
<view class="empty-replies" wx:else>
|
|
<view class="empty-reply-text">还没有回复,快来第一个回复吧!</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 底部占位 -->
|
|
<view class="bottom-placeholder" style="height: 160rpx;"></view>
|
|
</scroll-view>
|
|
|
|
<!-- 底部回复输入栏 -->
|
|
<view class="bottom-input-container" style="transform: translateY({{inputTransformY}});">
|
|
<view class="input-wrapper">
|
|
<input
|
|
class="reply-input"
|
|
placeholder="{{replyPlaceholder}}"
|
|
value="{{replyContent}}"
|
|
bindinput="onReplyInput"
|
|
bindfocus="onInputFocus"
|
|
bindblur="onInputBlur"
|
|
bindconfirm="submitReply"
|
|
adjust-position="{{false}}"
|
|
focus="{{isInputFocused}}"
|
|
maxlength="500"
|
|
/>
|
|
<button
|
|
class="send-btn"
|
|
bindtap="submitReply"
|
|
disabled="{{!replyContent}}"
|
|
>
|
|
{{isSubmitting ? '发送中...' : '发送'}}
|
|
</button>
|
|
</view>
|
|
|
|
<!-- 回复对象显示 -->
|
|
<view class="reply-target" wx:if="{{replyTarget.nickName}}">
|
|
<text class="target-text">回复 {{replyTarget.nickName}}</text>
|
|
<text class="clear-target" bindtap="clearReplyTarget">×</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 图片预览模态框 -->
|
|
<view class="preview-overlay" wx:if="{{showPreview}}" catchtap="hidePreview">
|
|
<swiper class="preview-swiper" current="{{previewIndex}}" bindchange="onSwiperChange">
|
|
<block wx:for="{{previewImages}}" wx:key="index">
|
|
<swiper-item>
|
|
<image class="preview-image" src="{{baseUrl+item}}" mode="aspectFit"></image>
|
|
</swiper-item>
|
|
</block>
|
|
</swiper>
|
|
<view class="preview-indicator">{{previewIndex + 1}}/{{previewImages.length}}</view>
|
|
</view>
|
|
|
|
<!-- 加载提示 -->
|
|
<view class="loading" wx:if="{{loading}}">
|
|
加载中...
|
|
</view>
|
|
</view>
|