huahuazenmehua/pages/profile/profile.wxml

112 lines
3.7 KiB
Plaintext
Raw 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.

<scroll-view class="profile-page" scroll-y>
<!-- 顶部用户信息 -->
<view class="profile-header">
<view class="avatar-wrap">
<text class="avatar-emoji">🎨</text>
</view>
<view class="user-info">
<text class="user-name">{{settings ? settings.nickname : '学画的你'}}</text>
<view class="user-days">
<text class="days-num">{{settings ? settings.joinDays : 1}}</text>
<text class="days-label">天</text>
<text class="days-text">坚持学习</text>
</view>
</view>
</view>
<!-- 数据统计 -->
<view class="stats-section card">
<view class="stats-item">
<text class="stats-value">{{completedCount}}</text>
<text class="stats-key">已学课程</text>
</view>
<view class="stats-divider"></view>
<view class="stats-item">
<text class="stats-value">{{practiceCount}}</text>
<text class="stats-key">完成练习</text>
</view>
<view class="stats-divider"></view>
<view class="stats-item">
<text class="stats-value">{{favoriteCourses.length}}</text>
<text class="stats-key">收藏课程</text>
</view>
</view>
<!-- 收藏课程 -->
<view class="section">
<view class="section-header">
<text class="section-title">收藏课程</text>
</view>
<view class="fav-list" wx:if="{{favoriteCourses.length > 0}}">
<view
class="fav-card"
wx:for="{{favoriteCourses}}"
wx:key="id"
data-course-id="{{item.id}}"
bindtap="onFavCourseTap"
>
<view class="fav-cover" style="background:{{item.coverColor}}">
<text class="fav-emoji">{{item.coverEmoji}}</text>
</view>
<text class="fav-title">{{item.title}}</text>
</view>
</view>
<view class="empty-tip" wx:else>
<text>暂无收藏,去课程详情页收藏你喜欢的课程吧</text>
</view>
</view>
<!-- 最近作品 -->
<view class="section" wx:if="{{recentWorks.length > 0}}">
<view class="section-header">
<text class="section-title">最近作品</text>
</view>
<scroll-view class="works-scroll" scroll-x>
<view class="works-list">
<view
class="work-thumb"
wx:for="{{recentWorks}}"
wx:key="id"
data-image-path="{{item.imagePath}}"
bindtap="onWorkTap"
>
<image class="work-thumb-img" src="{{item.imagePath}}" mode="aspectFill" />
<text class="work-thumb-title">{{item.courseTitle}}</text>
</view>
</view>
</scroll-view>
</view>
<!-- 设置入口 -->
<view class="settings-section">
<view class="settings-item" bindtap="onToggleReminder">
<view class="settings-left">
<text class="settings-icon">🔔</text>
<text class="settings-label">学习提醒</text>
</view>
<view class="settings-right">
<text class="settings-value">{{settings && settings.reminderEnabled ? '已开启' : '已关闭'}}</text>
<text class="settings-arrow"></text>
</view>
</view>
<view class="divider"></view>
<view class="settings-item" bindtap="onHelpTap">
<view class="settings-left">
<text class="settings-icon">❓</text>
<text class="settings-label">帮助说明</text>
</view>
<text class="settings-arrow"></text>
</view>
<view class="divider"></view>
<view class="settings-item" bindtap="onPrivacyTap">
<view class="settings-left">
<text class="settings-icon">🔒</text>
<text class="settings-label">隐私说明</text>
</view>
<text class="settings-arrow"></text>
</view>
</view>
<view style="height:40rpx"></view>
</scroll-view>