Files
doodle-mini/miniprogram/pages/profile/profile.wxml
T

229 lines
9.6 KiB
Plaintext

<view class="profile-page">
<nav-bar title="个人中心" />
<view class="profile-body">
<view class="profile-main">
<!-- 用户卡(Stitch:白底大圆角 + 顶条淡黄) -->
<view class="profile-hero">
<view class="profile-hero__tint"></view>
<view class="profile-hero__avatar-wrap">
<view class="profile-hero__avatar">
<image
class="profile-hero__avatar-img"
src="{{avatarUrl}}"
mode="aspectFill" />
</view>
<view
class="profile-hero__edit-badge"
bindtap="onOpenProfileEditor"
aria-role="button"
aria-label="编辑头像">
<van-icon name="edit" size="28rpx" color="#6c5a00" />
</view>
</view>
<text class="profile-hero__name">{{userName}}</text>
<view class="profile-hero__stats">
<view class="profile-hero__stat">
<text class="profile-hero__stat-num"
>{{printCount}}</text
>
<text class="profile-hero__stat-label">打印</text>
</view>
<view class="profile-hero__stat">
<text class="profile-hero__stat-num"
>{{favoriteCount}}</text
>
<text class="profile-hero__stat-label">收藏</text>
</view>
</view>
</view>
<!-- 双格入口 -->
<view class="profile-grid">
<view class="profile-grid__cell" bindtap="onGoToFavorites">
<view class="profile-grid__icon-wrap">
<van-icon name="like" size="44rpx" color="#6c5a00" />
</view>
<text class="profile-grid__title">我的收藏</text>
<text class="profile-grid__sub">已保存的练习题</text>
</view>
<view class="profile-grid__cell" bindtap="onGoToDownloads">
<view class="profile-grid__icon-wrap">
<van-icon name="down" size="44rpx" color="#6c5a00" />
</view>
<text class="profile-grid__title">下载历史</text>
<text class="profile-grid__sub">查看历史文件</text>
</view>
</view>
<!-- 圆角列表行 -->
<view class="profile-rows">
<view class="profile-row" bindtap="onGoToGuide">
<view class="profile-row__left">
<view class="profile-row__icon-bg">
<van-icon
name="printer"
size="40rpx"
color="#322e25" />
</view>
<text class="profile-row__label">打印指南</text>
</view>
<toy-icon
class="profile-row__chevron"
name="arrow-right"
size="40rpx"
color="#9a958b" />
</view>
<!-- <view class="profile-row" bindtap="onGoToFeedback">
<view class="profile-row__left">
<view class="profile-row__icon-bg">
<van-icon
name="chat-o"
size="40rpx"
color="#322e25" />
</view>
<text class="profile-row__label">提交反馈</text>
</view>
<toy-icon
class="profile-row__chevron"
name="arrow-right"
size="40rpx"
color="#9a958b" />
</view> -->
<view class="profile-row" bindtap="onGoToSettings">
<view class="profile-row__left">
<view class="profile-row__icon-bg">
<van-icon
name="setting-o"
size="40rpx"
color="#322e25" />
</view>
<text class="profile-row__label">设置</text>
</view>
<toy-icon
class="profile-row__chevron"
name="arrow-right"
size="40rpx"
color="#9a958b" />
</view>
<view
wx:if="{{isDevEnv}}"
class="profile-row"
bindtap="onGoToDebug">
<view class="profile-row__left">
<view class="profile-row__icon-bg">
<text class="profile-row__icon-emoji">🛠️</text>
</view>
<text class="profile-row__label">Debug 工具</text>
</view>
<toy-icon
class="profile-row__chevron"
name="arrow-right"
size="40rpx"
color="#9a958b" />
</view>
<!-- <view
class="profile-row profile-row--last"
bindtap="onGoToAbout">
<view class="profile-row__left">
<view class="profile-row__icon-bg">
<van-icon
name="info-o"
size="40rpx"
color="#322e25" />
</view>
<text class="profile-row__label">关于涂鸦丫</text>
</view>
<toy-icon
class="profile-row__chevron"
name="arrow-right"
size="40rpx"
color="#9a958b" />
</view> -->
</view>
<!-- 专业版推广(Stitch 深色卡) -->
<!-- <view class="profile-upsell" bindtap="onGoToPremium">
<van-icon
name="gem-o"
class="profile-upsell__deco"
size="200rpx"
color="rgba(255,255,255,0.12)" />
<view class="profile-upsell__body">
<text class="profile-upsell__title">升级专业版</text>
<text class="profile-upsell__desc"
>解锁 500+ 精选教育模板并获得优先体验。</text
>
<view class="profile-upsell__btn">立即升级</view>
</view>
</view> -->
<view class="profile-version">
<text class="profile-version__text">涂鸦丫 v{{version}}</text>
</view>
</view>
</view>
<van-popup
show="{{showProfileEditor}}"
position="bottom"
round
safe-area-inset-bottom="{{false}}"
custom-class="profile-editor-popup"
bind:close="onCloseProfileEditor">
<view class="profile-editor">
<view class="profile-editor__header">
<text class="profile-editor__title">完善资料</text>
<text class="profile-editor__desc"
>选择头像并填写昵称后保存</text
>
</view>
<view class="profile-editor__avatar-section">
<button
class="profile-editor__avatar-button"
open-type="chooseAvatar"
bindchooseavatar="onChooseAvatar">
<view class="profile-editor__avatar">
<text
class="profile-editor__avatar-placeholder"
wx:if="{{!draftAvatarUrl}}"
>选择头像</text
>
<image
wx:else
class="profile-editor__avatar-img"
src="{{draftAvatarUrl}}"
mode="aspectFill" />
</view>
</button>
</view>
<view class="profile-editor__field">
<text class="profile-editor__label">昵称</text>
<input
class="profile-editor__input"
type="nickname"
placeholder="请输入昵称"
maxlength="20"
value="{{draftNickName}}"
bindblur="onNicknameInput"
bindinput="onNicknameInput" />
</view>
<view class="profile-editor__actions">
<view
class="profile-editor__action profile-editor__action--ghost"
bindtap="onCloseProfileEditor">
取消
</view>
<view
class="profile-editor__action profile-editor__action--primary {{isSavingProfile ? 'profile-editor__action--disabled' : ''}}"
bindtap="onSubmitProfile">
{{isSavingProfile ? '保存中...' : '保存'}}
</view>
</view>
</view>
</van-popup>
</view>