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.
This commit is contained in:
@@ -5,17 +5,7 @@
|
||||
<view class="login-icon"><icon name="lock" size="80" color="#00CED1"></icon></view>
|
||||
<text class="login-title">登录 卡若创业派对</text>
|
||||
<text class="login-desc">{{desc}}</text>
|
||||
|
||||
<button id="agree-phone-btn" class="btn-login {{agreeProtocol ? '' : 'btn-login-disabled'}}" open-type="getPhoneNumber|agreePrivacyAuthorization" bindgetphonenumber="onPhoneLogin" bindagreeprivacyauthorization="onAgreePrivacy" disabled="{{isLoggingIn || !agreeProtocol}}" hover-class="btn-login-hover">
|
||||
<text class="btn-login-icon">📱</text>
|
||||
<text>{{isLoggingIn ? '登录中...' : '手机号快捷登录'}}</text>
|
||||
</button>
|
||||
|
||||
<view class="privacy-wechat-row" wx:if="{{showPrivacyModal}}">
|
||||
<text class="privacy-wechat-desc">为获取手机号,请先同意《用户隐私保护指引》</text>
|
||||
<button id="agree-privacy-btn" class="privacy-agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onAgreePrivacy" hover-class="privacy-agree-btn-hover">同意</button>
|
||||
</view>
|
||||
<view class="login-modal-cancel" wx:if="{{showCancel}}" bindtap="onClose">取消</view>
|
||||
|
||||
<view class="login-agree-row" catchtap="onToggleAgree">
|
||||
<view class="agree-checkbox {{agreeProtocol ? 'agree-checked' : ''}}"><icon wx:if="{{agreeProtocol}}" name="check" size="24" color="#34C759"></icon></view>
|
||||
<text class="agree-text">我已阅读并同意</text>
|
||||
@@ -23,5 +13,16 @@
|
||||
<text class="agree-text">和</text>
|
||||
<text class="agree-link" catchtap="onOpenPrivacy">《隐私政策》</text>
|
||||
</view>
|
||||
|
||||
<button id="agree-phone-btn" class="btn-login {{agreeProtocol ? '' : 'btn-login-disabled'}}" open-type="getPhoneNumber|agreePrivacyAuthorization" bindgetphonenumber="onPhoneLogin" bindagreeprivacyauthorization="onAgreePrivacy" disabled="{{isLoggingIn || !agreeProtocol}}" hover-class="btn-login-hover">
|
||||
<icon class="btn-login-icon" name="smartphone" size="36" color="#ffffff"></icon>
|
||||
<text>{{isLoggingIn ? '登录中...' : '手机号快捷登录'}}</text>
|
||||
</button>
|
||||
|
||||
<view class="privacy-wechat-row" wx:if="{{showPrivacyModal}}">
|
||||
<text class="privacy-wechat-desc">为获取手机号,请先同意《用户隐私保护指引》</text>
|
||||
<button id="agree-privacy-btn" class="privacy-agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="onAgreePrivacy" hover-class="privacy-agree-btn-hover">同意</button>
|
||||
</view>
|
||||
<view class="login-modal-cancel" wx:if="{{showCancel}}" bindtap="onClose">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
padding: 48rpx;
|
||||
}
|
||||
.modal-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
max-width: 560rpx;
|
||||
background: #1c1c1e;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
@@ -25,6 +26,10 @@
|
||||
right: 24rpx;
|
||||
z-index: 1;
|
||||
padding: 16rpx;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
line-height: 0;
|
||||
}
|
||||
.login-modal {
|
||||
padding: 48rpx 32rpx;
|
||||
@@ -41,18 +46,30 @@
|
||||
color: #ffffff;
|
||||
display: block;
|
||||
margin-bottom: 16rpx;
|
||||
text-shadow: none;
|
||||
-webkit-text-fill-color: #ffffff;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.login-desc {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
display: block;
|
||||
margin-bottom: 48rpx;
|
||||
margin-bottom: 32rpx;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-login {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 28rpx;
|
||||
background: linear-gradient(135deg, #00CED1, #00B4D8);
|
||||
color: #ffffff;
|
||||
@@ -61,19 +78,31 @@
|
||||
border-radius: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border: none;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.btn-login::after { border: none; }
|
||||
.btn-login-icon {
|
||||
font-size: 36rpx;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.btn-login-disabled { opacity: 0.55; }
|
||||
.btn-login[disabled] {
|
||||
opacity: 0.55;
|
||||
}
|
||||
.btn-login-disabled { opacity: 0.6; }
|
||||
.login-modal-cancel {
|
||||
margin-top: 24rpx;
|
||||
padding: 24rpx;
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 8rpx;
|
||||
padding: 20rpx 24rpx 8rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
}
|
||||
.privacy-wechat-row {
|
||||
margin: 24rpx 0;
|
||||
@@ -100,11 +129,16 @@
|
||||
.login-agree-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 32rpx;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-top: 0;
|
||||
margin-bottom: 32rpx;
|
||||
padding: 0 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-align: left;
|
||||
}
|
||||
.agree-checkbox {
|
||||
width: 32rpx;
|
||||
@@ -127,6 +161,11 @@
|
||||
color: #00CED1;
|
||||
text-decoration: underline;
|
||||
padding: 0 4rpx;
|
||||
margin: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* 显式 hover 类名,避免基础库 3.x 报 hoverClass / hoverClassDisable 类型非法 */
|
||||
|
||||
Reference in New Issue
Block a user