Files
zt-closet-wxmini-frontend/miniprogram/pages/profile/profile.wxml
T

168 lines
6.8 KiB
Plaintext

<view class="page page-flex">
<navigation-bar title="我的" back="{{false}}" scrolled="{{navScrolled}}" />
<scroll-view scroll-y class="scroll-body pb-tab" bindscroll="onNavScroll">
<!-- 页头 -->
<view class="head">
<view class="eyebrow">Profile</view>
</view>
<!-- 资料区:大号头像 + 衬线昵称 + 胶囊标签 -->
<view class="pf-hero">
<view class="pf-av">
<image wx:if="{{userInfo.avatar}}" class="pf-av-img" src="{{userInfo.avatar}}" mode="aspectFill" />
<view wx:else class="icon icon-user"></view>
</view>
<view class="pf-info">
<view class="pf-name">{{userInfo.username || '微信用户'}}</view>
<view class="pf-sub">
<text wx:if="{{userInfo.sex === 1}}" class="pill">男</text>
<text wx:elif="{{userInfo.sex === 2}}" class="pill">女</text>
<text wx:if="{{vipLabel}}" class="pill pill--ink">{{vipLabel}}</text>
<text wx:if="{{zodiac}}" class="pill pill--line">{{zodiac}}</text>
<text wx:else class="pill pill--line" bindtap="onEdit">设置生日</text>
</view>
</view>
<view class="pf-edit" bindtap="onEdit">
编辑资料
<view class="icon icon-chevron-right"></view>
</view>
</view>
<!-- 额度提醒 -->
<view wx:if="{{uploadRemain > 0 && uploadRemain <= 2}}" class="pf-warn" bindtap="onTapMall">
<view class="icon icon-info"></view>
<text class="pf-warn-t">你的上传额度仅剩 {{uploadRemain}} 次,点击购买额度包</text>
<view class="icon icon-chevron-right"></view>
</view>
<!-- 我的额度:四栏发丝线数字条 -->
<view class="pf-quota" bindtap="onTapMall">
<view class="pf-quota-hd">
<text class="eyebrow">Quota</text>
<text class="qk">我的额度</text>
<view class="icon icon-chevron-right"></view>
</view>
<view class="stats">
<view class="stat" wx:for="{{quotaStats}}" wx:key="key">
<view class="stat-n num">{{item.remain}}<text class="unit">/{{item.total}}</text></view>
<view class="stat-l">{{item.label}}</view>
</view>
</view>
</view>
<!-- 账户 -->
<view class="grp-hd pf-grp"><text class="gh-cn">账户</text><text class="gh-en">Account</text></view>
<view class="rows">
<view class="row" bindtap="onTapOrder">
<view class="icon row-ic icon-doc"></view>
<text class="row-lb">我的订单</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onTapNotification">
<view class="icon row-ic icon-bell"></view>
<text class="row-lb">通知</text>
<text wx:if="{{unread > 0}}" class="row-badge">{{unread > 99 ? '99+' : unread}}</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onTapCollect">
<view class="icon row-ic icon-star"></view>
<text class="row-lb">我的收藏</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onTapFlow">
<view class="icon row-ic icon-gauge"></view>
<text class="row-lb">额度明细</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
</view>
<!-- 设置 -->
<view class="grp-hd pf-grp"><text class="gh-cn">设置</text><text class="gh-en">Settings</text></view>
<view class="rows">
<view class="row" bindtap="onEdit">
<view class="icon row-ic icon-pencil"></view>
<text class="row-lb">编辑资料</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onEdit">
<view class="icon row-ic icon-calendar"></view>
<text class="row-lb">设置生日</text>
<text class="row-vl">{{birthDateStr || '未设置'}}</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onTapService">
<view class="icon row-ic icon-headphones"></view>
<text class="row-lb">客服与反馈</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
<view class="row" bindtap="onTapAbout">
<view class="icon row-ic icon-info"></view>
<text class="row-lb">关于纸条AI衣橱</text>
<view class="icon row-ch icon-chevron-right"></view>
</view>
</view>
<view class="pf-ver">v1.0.0</view>
<view class="gap-64"></view>
</scroll-view>
<!-- 编辑资料:底部玻璃抽屉 -->
<view wx:if="{{editVisible}}" class="scrim" bindtap="onCloseEdit"></view>
<view wx:if="{{editVisible}}" class="sheet-wrap">
<view class="sheet" catchtap="noop">
<view class="sheet-grab"></view>
<view class="sheet-hd">
<text class="sheet-t">编辑资料</text>
<text class="sheet-x" bindtap="onCloseEdit">取消</text>
</view>
<view class="sheet-body">
<view class="avatar-wrap">
<image wx:if="{{editForm.avatar}}" class="avatar-img" src="{{editForm.avatar}}" mode="aspectFill" />
<view wx:else class="icon icon-user avatar-placeholder"></view>
<button class="avatar-btn" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar"></button>
</view>
<view class="avatar-tip">点击更换头像</view>
<view class="form-field">
<text class="form-label">昵称</text>
<input
class="input form-input"
type="nickname"
value="{{editForm.username}}"
bindinput="onNameInput"
maxlength="32"
placeholder="请输入昵称"
placeholder-class="input-ph"
/>
</view>
<view class="form-field">
<text class="form-label">性别</text>
<view class="sex-pick">
<view class="sex-pill {{editForm.sex === 1 ? 'is-on' : ''}}" data-value="1" bindtap="onSexTap">男</view>
<view class="sex-pill {{editForm.sex === 2 ? 'is-on' : ''}}" data-value="2" bindtap="onSexTap">女</view>
</view>
</view>
<view class="form-field">
<text class="form-label">生日</text>
<picker mode="date" value="{{birthDateStr}}" end="{{today}}" bindchange="onBirthChange">
<view class="form-value">
<text class="{{birthDateStr ? '' : 'input-ph'}}">{{birthDateStr || '请选择生日'}}</text>
<view class="icon icon-chevron-right form-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="sheet-foot">
<view
class="btn btn--ink btn--block {{avatarUploading || saving ? 'is-off' : ''}}"
bindtap="onSaveProfile"
>{{avatarUploading ? '上传中…' : (saving ? '保存中…' : '保存')}}</view>
</view>
</view>
</view>
</view>