|
|
|
|
<view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="header">
|
|
|
|
|
<text class="title">蛋吧</text>
|
|
|
|
|
<text class="subtitle">欢迎来到蛋吧社区</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="section">
|
|
|
|
|
<view class="section-title">
|
|
|
|
|
<text class="title-text">热门话题</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="topic-list">
|
|
|
|
|
<view class="topic-item" wx:for="{{hotTopics}}" wx:key="id" bindtap="viewTopic" data-topic="{{item}}">
|
|
|
|
|
<view class="topic-rank">{{index + 1}}</view>
|
|
|
|
|
<view class="topic-info">
|
|
|
|
|
<text class="topic-name">{{item.name}}</text>
|
|
|
|
|
<text class="topic-count">{{item.count}}人讨论</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="section">
|
|
|
|
|
<view class="section-title">
|
|
|
|
|
<text class="title-text">最新动态</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="post-list">
|
|
|
|
|
<view class="post-item" wx:for="{{posts}}" wx:key="id" bindtap="viewPost" data-post="{{item}}">
|
|
|
|
|
<view class="post-header">
|
|
|
|
|
<image class="post-avatar" src="{{item.avatar}}" mode="aspectFill"></image>
|
|
|
|
|
<view class="post-user">
|
|
|
|
|
<text class="post-username">{{item.username}}</text>
|
|
|
|
|
<text class="post-time">{{item.time}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="post-content">
|
|
|
|
|
<text class="post-text">{{item.content}}</text>
|
|
|
|
|
<view class="post-images" wx:if="{{item.images && item.images.length > 0}}">
|
|
|
|
|
<image class="post-image" wx:for="{{item.images}}" wx:for-item="img" wx:key="index" src="{{img}}" mode="aspectFill"></image>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="post-footer">
|
|
|
|
|
<view class="post-action" bindtap="likePost" data-id="{{item.id}}" catchtap="true">
|
|
|
|
|
<text class="action-icon">{{item.liked ? '❤️' : '🤍'}}</text>
|
|
|
|
|
<text class="action-text">{{item.likes}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="post-action" bindtap="commentPost" data-id="{{item.id}}" catchtap="true">
|
|
|
|
|
<text class="action-icon">💬</text>
|
|
|
|
|
<text class="action-text">{{item.comments}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="post-action" bindtap="sharePost" data-id="{{item.id}}" catchtap="true">
|
|
|
|
|
<text class="action-icon">📤</text>
|
|
|
|
|
<text class="action-text">分享</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="loading" wx:if="{{loading}}">
|
|
|
|
|
<text>加载中...</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="no-more" wx:if="{{!hasMore && posts.length > 0}}">
|
|
|
|
|
<text>暂无更多动态</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="empty" wx:if="{{posts.length === 0 && !loading}}">
|
|
|
|
|
<text class="empty-icon">📭</text>
|
|
|
|
|
<text class="empty-text">暂无动态</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="fab-button" bindtap="createPost">
|
|
|
|
|
<text class="fab-icon">✏️</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|