优化店务小程序个人中心界面

This commit is contained in:
2026-07-24 17:20:44 +08:00
parent 4f9962ec71
commit 32924f8e36
8 changed files with 1152 additions and 433 deletions
@@ -1,53 +1,26 @@
<view class="page no-tab profile-settings-page">
<view wx:if="{{loading}}" class="loading-state">个人资料加载中</view>
<block wx:else>
<view class="page-heading">
<text class="page-title">个人资料</text>
<text class="page-subtitle">把你的姓名、联系方式和头像整理成店内可识别的名片。</text>
</view>
<view class="portrait-card">
<view class="portrait-glow"></view>
<view class="portrait-main">
<view wx:if="{{profileForm.avatar}}" class="portrait-avatar image-avatar">
<view class="profile-hero">
<view class="hero-main">
<view wx:if="{{profileForm.avatar}}" class="hero-avatar image-avatar">
<image src="{{profileForm.avatar}}" mode="aspectFill"></image>
</view>
<view wx:else class="portrait-avatar portrait-empty">头像</view>
<view class="portrait-copy">
<text class="portrait-name">{{profileForm.nickname || userInfo.nickname || '个人头像'}}</text>
<text class="portrait-desc">{{roleText}} · {{shopName}}</text>
<view wx:else class="hero-avatar hero-avatar-empty">头像</view>
<view class="hero-copy">
<view class="hero-title-row">
<text class="hero-title">{{profileForm.nickname || userInfo.nickname || '个人资料'}}</text>
<text class="role-badge">{{roleText}}</text>
</view>
<text class="hero-shop">{{shopName}}</text>
<button class="avatar-change-btn" loading="{{avatarUploading}}" disabled="{{loading || avatarUploading || profileSaving}}" bindtap="chooseProfileAvatar">{{avatarUploading ? '上传中' : profileForm.avatar ? '更换头像' : '上传头像'}}</button>
</view>
</view>
<view class="portrait-actions">
<button class="avatar-btn" loading="{{avatarUploading}}" disabled="{{loading || avatarUploading || profileSaving}}" bindtap="chooseProfileAvatar">{{avatarUploading ? '上传中' : profileForm.avatar ? '更换头像' : '上传头像'}}</button>
<button wx:if="{{profileForm.avatar}}" class="avatar-remove" disabled="{{loading || avatarUploading || profileSaving}}" bindtap="removeProfileAvatar">移除</button>
</view>
<button wx:if="{{profileForm.avatar}}" class="avatar-remove" disabled="{{loading || avatarUploading || profileSaving}}" bindtap="removeProfileAvatar">移除头像</button>
</view>
<view class="info-grid">
<view class="info-tile">
<text>登录账号</text>
<view>{{userInfo.account || '未设置'}}</view>
</view>
<view class="info-tile">
<text>身份</text>
<view>{{roleText}}</view>
</view>
<view class="info-tile">
<text>登录手机号</text>
<view>{{userInfo.phone || '未绑定'}}</view>
</view>
<view class="info-tile">
<text>当前店铺</text>
<view>{{shopName}}</view>
</view>
</view>
<view class="card form-card">
<view class="form-header">
<text class="form-kicker">资料档案</text>
<text class="form-title">用于店内识别与客户沟通</text>
</view>
<view class="info-card">
<text class="card-title">基础资料</text>
<view class="profile-field">
<text class="field-label required-label">昵称</text>
<input value="{{profileForm.nickname}}" data-field="nickname" bindinput="onProfileInput" placeholder="请输入昵称" />
@@ -61,13 +34,33 @@
<input value="{{profileForm.wechatId}}" data-field="wechatId" bindinput="onProfileInput" placeholder="请输入微信号" />
</view>
<view class="profile-field signature-field">
<text class="field-label">签名</text>
<textarea value="{{profileForm.signature}}" data-field="signature" bindinput="onProfileInput" placeholder="请输入个人签名" />
<text class="field-label">个人简介</text>
<textarea value="{{profileForm.signature}}" data-field="signature" bindinput="onProfileInput" placeholder="请输入个人简介" />
</view>
</view>
<view class="info-card">
<text class="card-title">账号信息</text>
<view class="info-row">
<text class="row-label">登录账号</text>
<text class="row-value">{{userInfo.account || '未设置'}}</text>
</view>
<view class="info-row">
<text class="row-label">身份</text>
<text class="row-value">{{roleText}}</text>
</view>
<view class="info-row">
<text class="row-label">所属门店</text>
<text class="row-value">{{shopName}}</text>
</view>
<view class="info-row">
<text class="row-label">登录手机号</text>
<text class="row-value">{{userInfo.phone || '未绑定'}}</text>
</view>
</view>
</block>
<view class="fixed-bottom">
<button class="primary-btn" loading="{{profileSaving}}" disabled="{{loading || profileSaving || avatarUploading}}" bindtap="saveProfile">保存个人信息</button>
<button class="primary-btn" loading="{{profileSaving}}" disabled="{{loading || profileSaving || avatarUploading}}" bindtap="saveProfile">保存修改</button>
</view>
</view>