修复:收口小程序键盘遮挡适配
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
<view class="settings-page-root">
|
||||
<navigation-bar title="设置中心" color="#2d2430" background="#fff7f8" bindback="handleBack"></navigation-bar>
|
||||
|
||||
<scroll-view class="settings-scroll" scroll-y enable-flex enhanced show-scrollbar="false">
|
||||
<view class="page-shell settings-page-shell">
|
||||
<scroll-view
|
||||
class="settings-scroll"
|
||||
scroll-y
|
||||
enable-flex
|
||||
enhanced
|
||||
show-scrollbar="false"
|
||||
scroll-with-animation="{{true}}"
|
||||
scroll-into-view="{{keyboardAnchorId}}"
|
||||
>
|
||||
<view class="page-shell settings-page-shell {{keyboardVisible ? 'keyboard-active' : ''}}">
|
||||
<view class="page-content">
|
||||
<view wx:if="{{!isLoggedIn}}" class="page-card empty-card">
|
||||
<text class="empty-title">登录后进入设置中心</text>
|
||||
@@ -37,14 +45,38 @@
|
||||
当前账号未设置登录密码。
|
||||
</view>
|
||||
|
||||
<view class="field-block">
|
||||
<view id="settings-profile-nickname-anchor" class="field-block">
|
||||
<text class="field-label">昵称</text>
|
||||
<input class="field-input" placeholder="请输入昵称" placeholder-class="field-placeholder" value="{{form.nickname}}" data-field="nickname" bindinput="handleFormInput"></input>
|
||||
<input
|
||||
class="field-input"
|
||||
placeholder="请输入昵称"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{form.nickname}}"
|
||||
data-field="nickname"
|
||||
data-keyboard-anchor="settings-profile-nickname-anchor"
|
||||
bindinput="handleFormInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
</view>
|
||||
|
||||
<view class="field-block">
|
||||
<view id="settings-profile-signature-anchor" class="field-block">
|
||||
<text class="field-label">个性签名</text>
|
||||
<textarea class="field-textarea" placeholder="请输入个性签名" placeholder-class="field-placeholder" value="{{form.signature}}" data-field="signature" bindinput="handleFormInput"></textarea>
|
||||
<textarea
|
||||
class="field-textarea"
|
||||
placeholder="请输入个性签名"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{form.signature}}"
|
||||
data-field="signature"
|
||||
data-keyboard-anchor="settings-profile-signature-anchor"
|
||||
bindinput="handleFormInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></textarea>
|
||||
</view>
|
||||
|
||||
<view class="primary-btn save-btn" bindtap="handleSaveProfile">{{savingProfile ? '保存中...' : '保存资料'}}</view>
|
||||
@@ -87,14 +119,40 @@
|
||||
|
||||
<view wx:if="{{activeSecurityPanel === 'bindPhone'}}" class="security-panel">
|
||||
<view class="section-subtitle">输入后完成绑定</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-bind-phone-anchor" class="field-block">
|
||||
<text class="field-label">手机号</text>
|
||||
<input class="field-input" type="number" placeholder="请输入手机号" placeholder-class="field-placeholder" value="{{bindPhoneForm.phone}}" data-field="phone" bindinput="handleBindPhoneInput"></input>
|
||||
<input
|
||||
class="field-input"
|
||||
type="number"
|
||||
placeholder="请输入手机号"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{bindPhoneForm.phone}}"
|
||||
data-field="phone"
|
||||
data-keyboard-anchor="settings-bind-phone-anchor"
|
||||
bindinput="handleBindPhoneInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-bind-phone-code-anchor" class="field-block">
|
||||
<text class="field-label">验证码</text>
|
||||
<view class="code-row">
|
||||
<input class="field-input code-input" type="number" placeholder="请输入验证码" placeholder-class="field-placeholder" value="{{bindPhoneForm.verificationCode}}" data-field="verificationCode" bindinput="handleBindPhoneInput"></input>
|
||||
<input
|
||||
class="field-input code-input"
|
||||
type="number"
|
||||
placeholder="请输入验证码"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{bindPhoneForm.verificationCode}}"
|
||||
data-field="verificationCode"
|
||||
data-keyboard-anchor="settings-bind-phone-code-anchor"
|
||||
bindinput="handleBindPhoneInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
<view class="code-btn {{countdown > 0 ? 'disabled' : ''}}" bindtap="handleSendBindPhoneCode">{{countdown > 0 ? countdown + 's' : '发送验证码'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -110,14 +168,40 @@
|
||||
<text class="field-label">当前手机号</text>
|
||||
<view class="field-static">{{userInfo.phone}}</view>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-change-phone-anchor" class="field-block">
|
||||
<text class="field-label">新手机号</text>
|
||||
<input class="field-input" type="number" placeholder="请输入新的手机号" placeholder-class="field-placeholder" value="{{changePhoneForm.newPhone}}" data-field="newPhone" bindinput="handleChangePhoneInput"></input>
|
||||
<input
|
||||
class="field-input"
|
||||
type="number"
|
||||
placeholder="请输入新的手机号"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{changePhoneForm.newPhone}}"
|
||||
data-field="newPhone"
|
||||
data-keyboard-anchor="settings-change-phone-anchor"
|
||||
bindinput="handleChangePhoneInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-change-phone-code-anchor" class="field-block">
|
||||
<text class="field-label">验证码</text>
|
||||
<view class="code-row">
|
||||
<input class="field-input code-input" type="number" placeholder="请输入验证码" placeholder-class="field-placeholder" value="{{changePhoneForm.verificationCode}}" data-field="verificationCode" bindinput="handleChangePhoneInput"></input>
|
||||
<input
|
||||
class="field-input code-input"
|
||||
type="number"
|
||||
placeholder="请输入验证码"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{changePhoneForm.verificationCode}}"
|
||||
data-field="verificationCode"
|
||||
data-keyboard-anchor="settings-change-phone-code-anchor"
|
||||
bindinput="handleChangePhoneInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
<view class="code-btn {{countdown > 0 ? 'disabled' : ''}}" bindtap="handleSendChangePhoneCode">{{countdown > 0 ? countdown + 's' : '发送验证码'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -131,20 +215,59 @@
|
||||
<view wx:if="{{!userInfo.phone}}" class="hint-card password-hint">请先绑定手机号,再通过验证码设置或修改登录密码。</view>
|
||||
<block wx:else>
|
||||
<view class="section-subtitle">密码需包含字母和数字</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-password-code-anchor" class="field-block">
|
||||
<text class="field-label">验证码</text>
|
||||
<view class="code-row">
|
||||
<input class="field-input code-input" type="number" placeholder="请输入验证码" placeholder-class="field-placeholder" value="{{passwordForm.verificationCode}}" data-field="verificationCode" bindinput="handlePasswordInput"></input>
|
||||
<input
|
||||
class="field-input code-input"
|
||||
type="number"
|
||||
placeholder="请输入验证码"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{passwordForm.verificationCode}}"
|
||||
data-field="verificationCode"
|
||||
data-keyboard-anchor="settings-password-code-anchor"
|
||||
bindinput="handlePasswordInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
<view class="code-btn {{countdown > 0 ? 'disabled' : ''}}" bindtap="handleSendPasswordCode">{{countdown > 0 ? countdown + 's' : '发送验证码'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-password-anchor" class="field-block">
|
||||
<text class="field-label">新密码</text>
|
||||
<input class="field-input" password placeholder="请输入新密码" placeholder-class="field-placeholder" value="{{passwordForm.password}}" data-field="password" bindinput="handlePasswordInput"></input>
|
||||
<input
|
||||
class="field-input"
|
||||
password
|
||||
placeholder="请输入新密码"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{passwordForm.password}}"
|
||||
data-field="password"
|
||||
data-keyboard-anchor="settings-password-anchor"
|
||||
bindinput="handlePasswordInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
</view>
|
||||
<view class="field-block">
|
||||
<view id="settings-password-confirm-anchor" class="field-block">
|
||||
<text class="field-label">确认密码</text>
|
||||
<input class="field-input" password placeholder="请再次输入新密码" placeholder-class="field-placeholder" value="{{passwordForm.confirmPassword}}" data-field="confirmPassword" bindinput="handlePasswordInput"></input>
|
||||
<input
|
||||
class="field-input"
|
||||
password
|
||||
placeholder="请再次输入新密码"
|
||||
placeholder-class="field-placeholder"
|
||||
value="{{passwordForm.confirmPassword}}"
|
||||
data-field="confirmPassword"
|
||||
data-keyboard-anchor="settings-password-confirm-anchor"
|
||||
bindinput="handlePasswordInput"
|
||||
bindfocus="handleKeyboardFocus"
|
||||
bindblur="handleKeyboardBlur"
|
||||
adjust-position="false"
|
||||
cursor-spacing="{{keyboardCursorSpacing}}"
|
||||
></input>
|
||||
</view>
|
||||
<view class="panel-actions">
|
||||
<view class="secondary-btn panel-btn" bindtap="handleCloseSecurityPanel">取消</view>
|
||||
@@ -176,6 +299,8 @@
|
||||
<view class="logout-btn" bindtap="handleLogout">退出登录</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{keyboardVisible}}" class="keyboard-spacer" style="height: {{keyboardInsetRpx}}rpx;"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user