feat: 任务和社区页面

This commit is contained in:
Blizzard
2026-02-06 17:27:35 +08:00
parent d42471e1d5
commit b800ea03b5
30 changed files with 1777 additions and 551 deletions
+32 -11
View File
@@ -22,9 +22,7 @@
<view wx:for="{{displayedPosts}}" wx:key="id" class="moment-post">
<!-- Avatar -->
<view class="post-avatar">
<view class="avatar-square">
<text>{{item.user[0]}}</text>
</view>
<image class="avatar-square" src="{{item.avatar}}" mode="aspectFill" />
</view>
<!-- Content -->
@@ -34,12 +32,11 @@
<!-- Image Grid -->
<view wx:if="{{item.images.length > 0}}" class="post-images-grid grid-{{item.images.length === 1 ? '1' : (item.images.length <= 4 ? '2' : '3')}}">
<view wx:for="{{item.images}}" wx:for-item="img" wx:key="*this" class="post-image-item" catchtap="previewImage" data-url="{{tools.resolvePath(img)}}" data-urls="{{item.images}}">
<t-image
src="{{tools.resolvePath(img)}}"
<view wx:for="{{item.images}}" wx:for-item="img" wx:key="*this" class="post-image-item" catchtap="previewImage" data-url="{{img}}" data-urls="{{item.images}}">
<image
src="{{img}}"
mode="aspectFill"
width="100%"
height="100%"
style="width: 100%; height: 100%; display: block;"
lazy-load
/>
</view>
@@ -76,7 +73,7 @@
<view wx:if="{{item.likes.length > 0 || item.comments.length > 0}}" class="likes-comments-box">
<!-- Likes -->
<view wx:if="{{item.likes.length > 0}}" class="likes-section">
<t-icon name="heart-filled" size="28rpx" color="#576b95" />
<t-icon name="heart-filled" size="28rpx" color="#FA5151" />
<view class="likes-list">
<text wx:for="{{item.likes}}" wx:for-item="liker" wx:key="*this" class="like-name">{{liker}}{{index < item.likes.length - 1 ? '' : ''}}</text>
</view>
@@ -87,10 +84,26 @@
<!-- Comments -->
<view wx:if="{{item.comments.length > 0}}" class="comments-section">
<view wx:for="{{item.comments}}" wx:for-item="comment" wx:key="id" class="comment-item">
<view
wx:for="{{item.comments}}"
wx:for-item="comment"
wx:key="id"
class="comment-item"
wx:if="{{index < 3 || item.isExpanded}}"
>
<text class="comment-user">{{comment.user}}</text>
<text class="comment-content">{{comment.content}}</text>
</view>
<!-- Expand/Collapse Button -->
<view
wx:if="{{item.comments.length > 3}}"
class="comment-expand-btn"
catchtap="toggleCommentExpand"
data-id="{{item.id}}"
>
<text>{{item.isExpanded ? '收起' : '展开更多'}}</text>
</view>
</view>
</view>
@@ -116,9 +129,16 @@
<t-icon name="add" size="48rpx" color="#fff" />
</view>
<!-- Comment Input Mask -->
<view
class="comment-input-mask"
wx:if="{{showCommentBar}}"
bindtap="hideCommentBar"
catchtouchmove="stopPropagation"
></view>
<!-- Comment Input Bar (WeChat Style) -->
<view class="comment-input-bar {{showCommentBar ? 'show' : ''}}">
<view class="comment-input-mask" bindtap="hideCommentBar"></view>
<view class="comment-input-content">
<input
class="comment-input"
@@ -129,6 +149,7 @@
focus="{{showCommentBar}}"
confirm-type="send"
adjust-position="{{true}}"
cursor-spacing="20"
/>
<view class="send-btn {{commentText ? 'active' : ''}}" bindtap="submitComment">
<text>发送</text>