123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <!-- 顶部Tab栏 -->
- <view class="tab-container">
- <scroll-view class="tab-scroll" scroll-x scroll-with-animation scroll-left="{{scrollLeft}}">
- <view
- wx:for="{{tabs}}"
- wx:key="id"
- class="tab-item {{activeTab === item.id ? 'active' : ''}}"
- bindtap="switchTab"
- data-id="{{item.id}}"
- id="tab-{{item.id}}"
- >
- {{item.name}}
- </view>
- </scroll-view>
- </view>
- <!-- 内容区域 - 使用scroll-view替代swiper实现更好的卡片列表性能 -->
- <scroll-view
- class="content-container"
- scroll-y
- style="height: calc(100vh - {{tabHeight}}px)"
- >
- <!-- 卡片列表 -->
- <view class="card-list">
- <block wx:for="{{currentData}}" wx:key="id">
- <view class="card">
- <!-- 用户信息 -->
- <view class="user-info">
- <image class="avatar" src="{{item.user.avatar}}"></image>
- <text class="username">{{item.user.name}}</text>
- <text class="time">{{item.createTime}}</text>
- </view>
-
- <!-- 内容 -->
- <view class="content">
- <text class="title">{{item.title}}</text>
- <text class="desc">{{item.content}}</text>
- <view class="images" wx:if="{{item.images && item.images.length}}">
- <block wx:for="{{item.images}}" wx:key="*this">
- <image
- src="{{item}}"
- mode="aspectFill"
- class="image"
- bindtap="previewImage"
- data-urls="{{item.images}}"
- data-current="{{item}}"
- />
- </block>
- </view>
- </view>
-
- <!-- 操作区 -->
- <view class="actions">
- <!-- 点赞 -->
- <view class="action-item" bindtap="handleLike" data-id="{{item.id}}" data-index="{{index}}">
- <image
- src="{{item.isLiked ? '/images/like-fill.svg' : '/images/like.svg'}}"
- class="action-icon like-icon {{item.isLiked ? 'active' : ''}}"
- mode="widthFix"
- ></image>
- <text class="action-text">{{item.likeCount}}</text>
- </view>
-
- <!-- 评论 -->
- <view class="action-item" bindtap="handleComment" data-id="{{item.id}}">
- <image
- src="/images/comment.svg"
- class="action-icon comment-icon"
- mode="widthFix"
- ></image>
- <text class="action-text">{{item.commentCount}}</text>
- </view>
-
- <!-- 收藏 -->
- <view class="action-item" bindtap="handleCollect" data-id="{{item.id}}" data-index="{{index}}">
- <image
- src="{{item.isCollected ? '/images/star-fill.svg' : '/images/star.svg'}}"
- class="action-icon collect-icon {{item.isCollected ? 'active' : ''}}"
- mode="widthFix"
- ></image>
- <text class="action-text">{{item.collectCount}}</text>
- </view>
- </view>
- </view>
- </block>
-
- <!-- 加载更多 -->
- <view class="load-more" wx:if="{{hasMore}}">
- <text>{{loading ? '加载中...' : '上拉加载更多'}}</text>
- </view>
- <view class="no-more" wx:else>
- <text>没有更多内容了</text>
- </view>
- </view>
- </scroll-view>
- <!-- 页面内容... -->
- <view class="fab-container" bindtap="navigateToPublish">
- <view class="fab-button">
- <view class="fab-icon">+</view>
- <view class="fab-text">发布</view>
- </view>
- </view>
|