123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <!-- pages/community/community.wxml -->
- <view class="container" style="{{containerStyle}}">
- <!-- 签到区域 -->
- <view class="checkin-section" style="background-color: {{theme.bgColor}}">
- <view class="checkin-info">
- <text>连续签到:{{continuousDays}}天</text>
- <text>累计专注:{{totalDuration}}分钟</text>
- </view>
- <button
- class="checkin-btn"
- bindtap="checkIn"
- style="background-color: {{isChecked ? '#ccc' : theme.primaryColor}}; color: {{theme.textColor}}"
- >{{isChecked ? '今日已签到' : '立即签到'}}</button>
- </view>
- <!-- 发布区域 -->
- <view class="post-creator" style="background-color: {{theme.bgColor}}">
- <textarea
- placeholder="分享您的专注成果..."
- placeholder-class="placeholder"
- bindinput="onInputContent"
- value="{{postContent}}"
- style="color: {{theme.textColor}}"
- ></textarea>
- <view class="post-meta">
- <text class="duration-text">今日专注: {{todayDuration}}分钟</text>
- <button
- class="post-button"
- bindtap="createPost"
- style="background-color: {{theme.primaryColor}}; color: {{theme.textColor}}"
- >发布</button>
- </view>
- </view>
- <!-- 帖子列表 -->
- <view class="posts-list">
- <block wx:for="{{posts}}" wx:key="id">
- <view class="post-card" style="background-color: {{theme.bgColor}}">
- <!-- 用户信息 -->
- <view class="post-header">
- <image class="avatar" src="{{item.user.avatar}}"></image>
- <view class="user-info">
- <text class="username" style="color: {{theme.textColor}}">{{item.user.name}}</text>
- <text class="post-time" style="color: {{theme.textColor}}">{{item.time}}</text>
- </view>
- </view>
-
- <!-- 帖子内容 -->
- <view class="post-content" style="color: {{theme.textColor}}">
- {{item.content}}
- </view>
-
- <!-- 专注数据 -->
- <view class="focus-data" style="background-color: {{theme.primaryColor}}; opacity: 0.5">
- <text>专注时长: {{item.duration}}分钟</text>
- <text>完成于: {{item.focusTime}}</text>
- </view>
-
- <!-- 互动区域 -->
- <view class="post-actions">
- <view
- class="action like"
- bindtap="toggleLike"
- data-id="{{item.id}}"
- >
- <image src="{{item.isLiked ? '../../images/liked.png' : '../../images/like.png'}}"></image>
- <text style="color: {{item.isLiked ? theme.primaryColor : theme.textColor}}">{{item.likes}}</text>
- </view>
-
- <view
- class="action comment"
- bindtap="showComments"
- data-id="{{item.id}}"
- >
- <image src="../../images/comment.png"></image>
- <text style="color: {{theme.textColor}}">{{item.comments.length}}</text>
- </view>
- </view>
-
- <!-- 评论区域 -->
- <view class="comments-section" wx:if="{{showCommentId === item.id}}">
- <view class="comments-list">
- <block wx:for="{{item.comments}}" wx:key="id">
- <view class="comment-item">
- <text class="comment-user" style="color: {{theme.primaryColor}}">{{item.user}}:</text>
- <text class="comment-content" style="color: {{theme.textColor}}">{{item.content}}</text>
- </view>
- </block>
- </view>
-
- <view class="comment-input">
- <input
- placeholder="写评论..."
- placeholder-class="placeholder"
- bindinput="onCommentInput"
- data-id="{{item.id}}"
- style="color: {{theme.textColor}}"
- />
- <button
- class="send-button"
- bindtap="addComment"
- data-id="{{item.id}}"
- style="background-color: {{theme.primaryColor}}; color: {{theme.textColor}}"
- >发送</button>
- </view>
- </view>
- </view>
- </block>
- </view>
- </view>
|