Files
mzltMpfqGS e4a087e67e init
2026-04-15 19:45:16 +08:00

103 lines
3.9 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- pages/article-list/article-list.wxml -->
<!-- 文章列表视图 -->
<view class="article-list-container">
<!-- 搜索和筛选区域 -->
<view class="filter-bar">
<view class="search-box">
<input class="search-input" placeholder="搜索文章" bindinput="onSearchInput" value="{{keyword}}" />
<icon type="search" size="18" color="#999" bindtap="onSearch" />
</view>
</view>
<!-- 分类标签 -->
<scroll-view class="category-scroll" scroll-x="true">
<view class="category-list">
<view class="category-item {{!selectedCategory ? 'active' : ''}}" bindtap="onCategoryTap" data-id="{{null}}">
全部
</view>
<view
class="category-item {{selectedCategory && selectedCategory.id === item.id ? 'active' : ''}}"
wx:for="{{categoryList}}"
wx:key="id"
bindtap="onCategoryTap"
data-id="{{item}}"
>
{{item.name}}
</view>
</view>
</scroll-view>
<!-- 排序选项 -->
<view class="sort-bar">
<view class="sort-item {{sortBy === 'createTime' ? 'active' : ''}}" bindtap="onSortTap" data-sort="createTime">
最新
</view>
<view class="sort-item {{sortBy === 'viewCount' ? 'active' : ''}}" bindtap="onSortTap" data-sort="viewCount">
最热
</view>
<view class="sort-item {{sortBy === 'favoriteCount' ? 'active' : ''}}" bindtap="onSortTap" data-sort="favoriteCount">
收藏
</view>
</view>
<!-- 文章列表 -->
<view class="article-list">
<block wx:for="{{articleList}}" wx:key="id">
<view class="article-item" bindtap="goToDetail" data-id="{{item.id}}">
<view class="article-content">
<image class="article-cover" wx:if="{{item.coverImage}}" src="{{item.coverImage}}" mode="aspectFill" />
<view class="article-info">
<text class="article-title">{{item.title}}</text>
<text class="article-summary">{{item.summary}}</text>
<view class="article-meta">
<view class="meta-item">
<text class="iconfont icon-user"></text>
<text>{{item.authorName}}</text>
</view>
<view class="meta-item">
<text class="iconfont icon-view"></text>
<text>{{item.viewCount}}</text>
</view>
<view class="meta-item">
<text class="iconfont icon-favorite"></text>
<text>{{item.favoriteCount}}</text>
</view>
<view class="meta-item">
<text class="iconfont icon-comment"></text>
<text>{{item.commentCount}}</text>
</view>
</view>
<view class="article-tags" wx:if="{{item.tags && item.tags.length > 0}}">
<text class="tag" wx:for="{{item.tags}}" wx:for-item="tag" wx:key="id">{{tag.name}}</text>
</view>
</view>
</view>
<view class="article-actions">
<view class="action-btn" catchtap="onFavorite" data-id="{{item.id}}">
<text class="iconfont {{item.isFavorite ? 'icon-favorite-fill' : 'icon-favorite'}}"></text>
</view>
</view>
</view>
</block>
</view>
<!-- 加载状态 -->
<view class="loading-more" wx:if="{{loading}}">
<text>加载中...</text>
</view>
<view class="no-more" wx:if="{{!hasMore && articleList.length > 0}}">
<text>没有更多了</text>
</view>
<view class="empty-state" wx:if="{{!loading && articleList.length === 0}}">
<text class="iconfont icon-article empty-icon"></text>
<text class="empty-text">暂无文章</text>
</view>
</view>
/**
* @联系作者16768118056
* @描述:(此项目非免费分享)源码百分百可用,搞定毕设不发愁,支持远程调试安装、二次开发、定制、讲解、文档类。
* @访问https://www.notmaker.com/detail/8326a897119d4542896c863a69d7bbe7/gtt20260415查看完整运行演示。
*/