huahuazenmehua/pages/category/category.wxml

52 lines
1.7 KiB
Plaintext

<view class="category-page">
<!-- 分类切换 Tab -->
<scroll-view class="tab-scroll" scroll-x scroll-with-animation>
<view class="tab-list">
<view
class="tab-item {{activeCategory === item ? 'active' : ''}}"
wx:for="{{categories}}"
wx:key="*this"
data-category="{{item}}"
bindtap="onCategorySwitch"
>
<text>{{item}}</text>
</view>
</view>
</scroll-view>
<!-- 关键词提示 -->
<view class="keyword-tip" wx:if="{{keyword}}">
<text>搜索"{{keyword}}"的结果,共{{courseList.length}}个课程</text>
</view>
<!-- 课程列表 -->
<scroll-view class="course-scroll" scroll-y>
<view class="course-grid" wx:if="{{courseList.length > 0}}">
<view
class="course-card"
wx:for="{{courseList}}"
wx:key="id"
data-course-id="{{item.id}}"
bindtap="onCourseTap"
>
<view class="course-cover" style="background:{{item.coverColor}}">
<text class="course-cover-emoji">{{item.coverEmoji}}</text>
</view>
<view class="course-info">
<text class="course-title">{{item.title}}</text>
<view class="course-meta">
<text class="badge badge-blue">{{item.difficulty}}</text>
<text class="course-lessons">{{item.lessons}}节课</text>
</view>
<text class="course-duration">⏱ {{item.duration}}</text>
</view>
</view>
</view>
<view class="empty-state" wx:else>
<text class="empty-icon">🔍</text>
<text class="empty-text">暂无该分类的课程</text>
</view>
<view style="height:40rpx"></view>
</scroll-view>
</view>