168 lines
6.0 KiB
XML
168 lines
6.0 KiB
XML
<view class="col">
|
|
<view class="avatar-container">
|
|
<button
|
|
class="avatar-btn"
|
|
open-type="chooseAvatar"
|
|
bind:chooseavatar="onChooseAvatar"
|
|
disabled="{{!editable}}"
|
|
>
|
|
<block wx:if="{{avatar}}">
|
|
<l-avatar src="{{avatarUrl}}" />
|
|
</block>
|
|
<block wx:else>
|
|
<l-avatar icon="user" size="140" icon-size="80" />
|
|
</block>
|
|
</button>
|
|
</view>
|
|
<l-list
|
|
title="昵称"
|
|
bind:lintap="editNickname"
|
|
is-link="{{editAttr !== 'nickname'}}"
|
|
>
|
|
<block wx:if="{{editAttr==='nickname'}}">
|
|
<input
|
|
slot="right-section"
|
|
type="nickname"
|
|
value="{{nickname}}"
|
|
focus
|
|
placeholder="请输入昵称"
|
|
bindchange="changeNicknameMp"
|
|
bindconfirm="cancelEdit"
|
|
bindblur="cancelEdit"
|
|
disabled="{{!editable}}"
|
|
/>
|
|
</block>
|
|
<block wx:else>
|
|
<view slot="right-section" class="{{nnDirty ? 'value warning' : 'value'}}">{{nickname || '未设置'}}</view>
|
|
</block>
|
|
</l-list>
|
|
<!-- <button open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
|
|
</button> -->
|
|
<l-list
|
|
title="姓名"
|
|
bind:lintap="editName"
|
|
is-link="{{editAttr !== 'name'}}"
|
|
>
|
|
<block wx:if="{{editAttr==='name'}}">
|
|
<input
|
|
slot="right-section"
|
|
value="{{name}}"
|
|
focus
|
|
placeholder="请输入姓名"
|
|
bindchange="changeNameMp"
|
|
bindconfirm="cancelEdit"
|
|
bindblur="cancelEdit"
|
|
disabled="{{!editable}}"
|
|
/>
|
|
</block>
|
|
<block wx:else>
|
|
<view slot="right-section" class="{{nameDirty ? 'value warning' : 'value'}}">{{name || '未设置'}}</view>
|
|
</block>
|
|
</l-list>
|
|
<l-list
|
|
title="性别"
|
|
bind:lintap="editGender"
|
|
is-link="{{editAttr !== 'gender'}}"
|
|
>
|
|
<view slot="right-section" class="{{genderDirty ? 'value warning' : 'value'}}">{{genderStr || '未设置'}}</view>
|
|
</l-list>
|
|
<l-list
|
|
title="生日"
|
|
>
|
|
<view slot="right-section" class="{{birthDirty ? 'value warning' : 'value'}}">
|
|
<block wx:if="{{editable}}">
|
|
<picker mode="date" end="{{birthEnd}}" value="{{birthText}}" bind:change="changeBirthMp">
|
|
{{ birthText || '选择日期'}}
|
|
</picker>
|
|
</block>
|
|
</view>
|
|
</l-list>
|
|
<l-list title="手机号" bind:lintap="editMobile">
|
|
<view slot="right-section" class="value">{{mobile || '未绑定'}}</view>
|
|
</l-list>
|
|
<l-list title="密码" bind:lintap="editPassword">
|
|
<block wx:if="{{editAttr==='password'}}">
|
|
<input
|
|
slot="right-section"
|
|
value="{{password}}"
|
|
focus
|
|
password
|
|
placeholder="请输入密码"
|
|
bindchange="changePasswordMp"
|
|
bindconfirm="cancelEdit"
|
|
bindblur="cancelEdit"
|
|
disabled="{{!editable}}"
|
|
/>
|
|
</block>
|
|
<block wx:else>
|
|
<view slot="right-section" class="value">{{hasPassword ? '******' : '未设置'}}</view>
|
|
</block>
|
|
</l-list>
|
|
<l-list tag-position="right" is-link="{{false}}" title="用户状态">
|
|
<view slot="right-section" class="value">
|
|
<l-tag plain="{{true}}" font-color="{{userStateColor}}" shape="circle">
|
|
{{userStateStr || '未设置'}}
|
|
</l-tag>
|
|
</view>
|
|
</l-list>
|
|
<l-list tag-position="right" title="认证状态" bind:lintap="goAuthenticate">
|
|
<view slot="right-section" class="value">
|
|
<l-tag plain="{{true}}" font-color="{{idStateColor}}" shape="circle">
|
|
{{idStateStr || '未设置'}}
|
|
</l-tag>
|
|
</view>
|
|
</l-list>
|
|
<view style="flex:1" />
|
|
<block wx:if="{{executable === true}}">
|
|
<l-button
|
|
size="long"
|
|
bind:lintap="onConfirm"
|
|
>
|
|
{{t('common::action.confirm')}}
|
|
</l-button>
|
|
</block>
|
|
</view>
|
|
<l-popup
|
|
show="{{editAttr === 'gender' || editAttr === 'mobile'}}"
|
|
content-align="bottom"
|
|
bind:lintap="cancelEdit"
|
|
>
|
|
<view class='popup-content'>
|
|
<view class='popup-form'>
|
|
<block wx:if="{{editAttr === 'gender'}}">
|
|
<l-form-item label="性别" label-width="100rpx">
|
|
<l-radio-group
|
|
current="{{gender}}"
|
|
placement="row"
|
|
length="2"
|
|
bind:linchange="changeGenderMp"
|
|
l-class="radio-group"
|
|
>
|
|
<l-radio l-class="l-radio" wx:for="{{genderOptions}}" wx:key="id" key="{{item.value}}" placement="left">
|
|
{{item.label}}
|
|
</l-radio>
|
|
</l-radio-group>
|
|
</l-form-item>
|
|
</block>
|
|
<block wx:else>
|
|
<l-input
|
|
hide-label="{{true}}"
|
|
focus="{{true}}"
|
|
value="{{mobileInput || mobile}}"
|
|
placeholder="{{t('placeholder.mobile')}}"
|
|
bind:lininput="inputMobileMp"
|
|
type="number"
|
|
>
|
|
<l-button
|
|
slot="right"
|
|
size="mini"
|
|
bind:lintap="confirmMobileInputMp"
|
|
disabled="{{!mobileInputLegal}}"
|
|
>
|
|
{{t('common::confirm')}}
|
|
</l-button>
|
|
</l-input>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
</l-popup> |