huahuazenmehua/pages/practice/practice.wxml

63 lines
2.1 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.

<view class="practice-page">
<!-- 顶部Banner -->
<view class="practice-banner">
<view class="banner-left">
<text class="banner-title">今日练习</text>
<text class="banner-sub">每天练一点,进步看得见</text>
</view>
<view class="banner-stats">
<text class="stats-num">{{completedCount}}</text>
<text class="stats-label">已完成</text>
</view>
</view>
<!-- 难度筛选 -->
<view class="filter-bar">
<view
class="filter-item {{activeDifficulty === item ? 'active' : ''}}"
wx:for="{{difficulties}}"
wx:key="*this"
data-diff="{{item}}"
bindtap="onDifficultySwitch"
>{{item}}</view>
</view>
<!-- 练习任务列表 -->
<scroll-view class="task-scroll" scroll-y>
<view class="task-list" wx:if="{{filteredTasks.length > 0}}">
<view
class="task-card {{item.done ? 'done' : ''}}"
wx:for="{{filteredTasks}}"
wx:key="id"
data-course-id="{{item.courseId}}"
data-step-index="{{item.stepIndex}}"
bindtap="onTaskTap"
>
<view class="task-icon-wrap" style="background:{{item.iconColor}}">
<text class="task-icon">{{item.icon}}</text>
</view>
<view class="task-info">
<view class="task-title-row">
<text class="task-title">{{item.title}}</text>
<view class="task-done-badge" wx:if="{{item.done}}">
<text>✓ 已完成</text>
</view>
</view>
<text class="task-type-badge">{{item.type}}</text>
<text class="task-desc">{{item.desc}}</text>
<view class="task-meta">
<text class="badge badge-{{item.difficulty === '入门' ? 'blue' : 'orange'}}">{{item.difficulty}}</text>
<text class="task-duration">⏱ {{item.duration}}</text>
</view>
</view>
<view class="task-arrow"></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>