Files
edu_mp/pages/category/category.wxml
2025-12-05 15:41:32 +08:00

62 lines
1.7 KiB
Plaintext

<!--pages/category/category.wxml-->
<view class="container">
<!-- 分类标签 -->
<van-tabs
active="{{ activeTab }}"
bind:change="onTabChange"
sticky
swipeable
>
<van-tab
wx:for="{{ categoryList }}"
wx:key="id"
title="{{ item.name }}"
>
<!-- 信息列表 -->
<view class="info-list">
<view
class="info-item card"
wx:for="{{ infoList }}"
wx:for-item="info"
wx:key="id"
data-id="{{ info.id }}"
bindtap="onInfoTap"
>
<view class="info-content">
<view class="info-text">
<text class="info-title ellipsis-2">{{ info.title }}</text>
<text class="info-summary ellipsis">{{ info.summary }}</text>
<view class="info-meta">
<text class="info-time">{{ info.time }}</text>
<text class="info-views">{{ info.views }}阅读</text>
</view>
</view>
<van-image
wx:if="{{ info.image }}"
class="info-image"
width="180rpx"
height="120rpx"
fit="cover"
radius="8rpx"
src="{{ info.image }}"
/>
</view>
</view>
</view>
<!-- 加载状态 -->
<view class="loading-section" wx:if="{{ loading }}">
<van-loading size="24px">加载中...</van-loading>
</view>
<!-- 没有更多 -->
<view class="no-more" wx:if="{{ !hasMore && infoList.length > 0 }}">
<text>— 没有更多了 —</text>
</view>
<!-- 空状态 -->
<van-empty wx:if="{{ !loading && infoList.length === 0 }}" description="暂无信息" />
</van-tab>
</van-tabs>
</view>