| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <view class="user-page">
- <scroll-view class="user-scroll" scroll-y show-scrollbar="{{false}}">
- <view class="user-content">
- <profile-header
- nickname="{{nickname}}"
- avatar="{{avatar}}"
- logged-in="{{loggedIn}}"
- logging-in="{{loggingIn}}"
- bind:login="onRequestLogin"
- bind:editprofile="onEditProfile"
- />
- <button wx:if="{{loggedIn}}" class="user-edit-profile" hover-class="user-action--pressed" disabled="{{profileSaving}}" bindtap="onEditProfile">修改信息</button>
- <view class="user-actions">
- <view class="user-action user-action--favorites" hover-class="user-action--pressed" aria-role="button" aria-label="查看收藏" bindtap="onViewFavorites">
- <view class="user-action__icon">
- <svg-icon name="ph:heart" size="34px" color="#a83f2d" />
- </view>
- <view class="user-action__content">
- <text class="user-action__title">查看收藏</text>
- </view>
- <svg-icon name="ph:caret-right-bold" size="16px" color="#a69687" />
- </view>
- <view class="user-action user-action--about" hover-class="user-action--pressed" aria-role="button" aria-label="关于我们" bindtap="onAbout">
- <view class="user-action__icon">
- <svg-icon name="ph:info" size="31px" color="#493b31" />
- </view>
- <text class="user-action__title user-action__content">关于我们</text>
- <svg-icon name="ph:caret-right-bold" size="16px" color="#a69687" />
- </view>
- </view>
- <button wx:if="{{loggedIn}}" class="user-logout" hover-class="user-action--pressed" bindtap="onLogout">退出登录</button>
- </view>
- </scroll-view>
- <van-popup show="{{profileEditorOpen}}" z-index="{{10000}}" round close-on-click-overlay="{{!profileSaving}}" bind:close="onCloseProfile" custom-style="background: #fffaf7; width: 86%; max-width: 420px;">
- <form wx:if="{{profileEditorOpen}}" bindsubmit="onSaveProfile">
- <!-- 原生 form 的内部容器不参与外层 flex,布局交给 view。 -->
- <view class="profile-editor">
- <text class="profile-editor__title">{{profileFirstTime ? '完善资料' : '修改资料'}}</text>
- <button class="profile-editor__avatar" open-type="chooseAvatar" bindchooseavatar="onChooseAvatar" disabled="{{profileSaving}}" aria-label="选择头像">
- <image wx:if="{{draftAvatar && !draftAvatarFailed}}" class="profile-editor__image" src="{{draftAvatar}}" mode="aspectFill" binderror="onDraftAvatarError" />
- <svg-icon wx:else name="ph:user-fill" size="50px" color="#c6b7a6" />
- </button>
- <text class="profile-editor__avatar-label">头像</text>
- <view class="profile-editor__field">
- <text class="profile-editor__label">昵称</text>
- <input class="profile-editor__input" name="nickname" type="nickname" value="{{draftNickname}}" placeholder="请输入或选择微信昵称" maxlength="32" disabled="{{profileSaving}}" bindinput="onNicknameInput" bindblur="onNicknameInput" bindnicknamereview="onNicknameReview" />
- </view>
- <view class="profile-editor__actions">
- <button class="profile-editor__button profile-editor__button--cancel" disabled="{{profileSaving}}" bindtap="onCloseProfile">{{profileFirstTime ? '暂时跳过' : '取消'}}</button>
- <button class="profile-editor__button profile-editor__button--save" form-type="submit" loading="{{profileSaving}}" disabled="{{profileSaving}}">{{profileSaving ? '保存中' : '保存资料'}}</button>
- </view>
- </view>
- </form>
- </van-popup>
- <van-toast id="van-toast" />
- <van-dialog id="van-dialog" confirm-button-color="#a83f2d" />
- </view>
|