Files
JayuCloud/JY-Salon-WeChat/pages/profile-settings/index.wxml
T

67 lines
3.2 KiB
Plaintext

<view class="page no-tab profile-settings-page">
<view wx:if="{{loading}}" class="loading-state">个人资料加载中</view>
<block wx:else>
<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="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>
<button wx:if="{{profileForm.avatar}}" class="avatar-remove" disabled="{{loading || avatarUploading || profileSaving}}" bindtap="removeProfileAvatar">移除头像</button>
</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="请输入昵称" />
</view>
<view class="profile-field">
<text class="field-label">联系电话</text>
<input value="{{profileForm.contactPhone}}" data-field="contactPhone" bindinput="onProfileInput" type="number" placeholder="请输入联系电话" />
</view>
<view class="profile-field">
<text class="field-label">微信号</text>
<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="请输入个人简介" />
</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>
</view>
</view>