Files
Mycontent/miniprogram/pages/avatar-nickname/avatar-nickname.wxml
乘风 c78a0d531f feat: enhance login modal and avatar selection process
- Updated the login modal to include a user agreement section with clickable links to the user agreement and privacy policy.
- Improved button styling and layout for better user experience.
- Refactored avatar selection process to utilize local image paths, enhancing compatibility and reliability across different environments.
- Added utility functions for resolving avatar file paths and selecting images from the gallery or camera.

This update aims to streamline user interactions during login and avatar selection, ensuring a smoother experience.
2026-05-06 17:21:10 +08:00

63 lines
3.3 KiB
Plaintext

<!--卡若创业派对 - 头像与昵称设置页-->
<view class="page">
<view class="nav-bar" style="padding-top: {{statusBarHeight}}px;">
<view class="nav-back" bindtap="goBack"><icon name="chevron-left" size="44" color="rgba(255,255,255,0.8)" customClass="back-icon"></icon></view>
<text class="nav-title">头像与昵称</text>
<view class="nav-placeholder"></view>
</view>
<view style="height: {{statusBarHeight + 44}}px;"></view>
<view class="content">
<view class="guide-card">
<icon name="handshake" size="64" color="#00CED1" customClass="guide-icon"></icon>
<text class="guide-title">{{fromNewUser ? '欢迎加入,先完成基础信息' : '设置对外展示信息'}}</text>
<text class="guide-badge" wx:if="{{fromNewUser}}">新用户引导</text>
<text class="guide-desc" wx:if="{{uiFocus === 'avatar'}}">请先换一张清晰头像,伙伴更容易认出你。</text>
<text class="guide-desc" wx:elif="{{uiFocus === 'nickname'}}">请改一个真实好记的昵称,方便伙伴称呼你。</text>
<text class="guide-desc" wx:else>头像与昵称会出现在名片与匹配卡片上,方便伙伴认出你。</text>
<text class="guide-desc guide-desc-sub" wx:if="{{fromNewUser}}">完成后即可继续使用小程序。</text>
</view>
<!-- 头像:相册/相机选图后上传(避免开发者工具 chooseAvatar + http://tmp 渲染报错) -->
<view class="avatar-section {{uiFocus === 'avatar' ? 'section-focus' : ''}}">
<text class="form-label form-label-row" wx:if="{{fromNewUser}}">头像<text class="required-mark">*</text></text>
<view class="avatar-wrap-btn" hover-class="none" bindtap="onTapPickAvatar">
<view class="avatar-wrap">
<view class="avatar-inner">
<image wx:if="{{avatar}}" class="avatar-img" src="{{avatar}}" mode="aspectFill"/>
<view wx:if="{{!avatar}}" class="avatar-placeholder avatar-native-mask">?</view>
</view>
<view class="avatar-camera"><icon name="camera" size="48" color="#ffffff"></icon></view>
</view>
</view>
</view>
<!-- 昵称:隐私授权由 app.js onNeedPrivacyAuthorization 走 wx.requirePrivacyAuthorize 原生流程 -->
<view class="form-section {{uiFocus === 'nickname' ? 'section-focus' : ''}}">
<text class="form-label">昵称<text class="required-mark" wx:if="{{fromNewUser}}">*</text></text>
<view class="form-input-wrap" catchtouchstart="onNicknameAreaTouch">
<input
wx:if="{{nickInputReady}}"
class="form-input-inner"
type="text"
placeholder="请输入昵称"
value="{{nickname}}"
focus="{{nicknameInputFocus}}"
bindinput="onNicknameInput"
bindchange="onNicknameChange"
bindblur="onNicknameBlur"
maxlength="20"
confirm-type="done"
/>
</view>
<text class="input-tip" wx:if="{{fromNewUser}}">请填写对外展示昵称(勿使用默认系统占位词)</text>
<text class="input-tip" wx:else>可点击输入框自动填充昵称,或手动输入</text>
</view>
<view class="save-btn {{fromNewUser && !canSubmit ? 'save-btn-disabled' : ''}}" bindtap="saveProfile" disabled="{{saving}}">
{{saving ? '保存中...' : '完成'}}
</view>
</view>
</view>