| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="agreement"> |
| | | <radio class="radio" :checked="isAgreed" color="#C63520" @tap="isAgreed = !isAgreed" /> |
| | | <text class="agreement-text"> |
| | | <text @tap="isAgreed = !isAgreed">我已阅读并同意</text> |
| | | <text class="link" @tap="goProtocol('user')">《用户服务协议》</text> |
| | | <text class="link" @tap="goProtocol('privacy')">《隐私协议》</text> |
| | | </text> |
| | | </view> |
| | | |
| | | <view class="login-btn" @tap="handleLogin">{{ loading ? '登录中...' : '登录' }}</view> |
| | | |
| | | <view class="action-links" |
| | |
| | | const loginType = ref<'code' | 'password'>('code') |
| | | const phone = ref('') |
| | | const credential = ref('') |
| | | const isAgreed = ref(false) |
| | | const countdown = ref(0) |
| | | const loading = ref(false) |
| | | const inviteUserId = ref('') |
| | |
| | | } |
| | | |
| | | /** |
| | | * 打开协议详情页。 |
| | | */ |
| | | const goProtocol = (type : string) => { |
| | | uni.navigateTo({ |
| | | url: `/pages/protocol/protocol?type=${type}` |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 执行微信登录,优先将微信授权结果交给后端拉取昵称和头像。 |
| | | */ |
| | | const handleWechatLogin = async () => { |
| | | if (loading.value) { |
| | | return |
| | | } |
| | | if (!ensureAgreementAccepted()) { |
| | | return |
| | | } |
| | | // #ifdef APP-PLUS |
| | |
| | | */ |
| | | const handleAppleLogin = async () => { |
| | | if (loading.value) { |
| | | return |
| | | } |
| | | if (!ensureAgreementAccepted()) { |
| | | return |
| | | } |
| | | // #ifdef APP-PLUS |
| | |
| | | if (loading.value) { |
| | | return |
| | | } |
| | | if (!ensureAgreementAccepted()) { |
| | | return |
| | | } |
| | | const normalizedPhone = normalizePhone() |
| | | if (!normalizedPhone) { |
| | | return |
| | |
| | | return '' |
| | | } |
| | | return value.trim() |
| | | } |
| | | |
| | | /** |
| | | * 登录前校验是否已阅读并同意协议。 |
| | | */ |
| | | const ensureAgreementAccepted = () => { |
| | | if (isAgreed.value) { |
| | | return true |
| | | } |
| | | uni.showToast({ |
| | | title: '请先阅读并同意相关协议', |
| | | icon: 'none' |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | /** |
| | |
| | | margin-top: 48rpx; |
| | | } |
| | | |
| | | .agreement { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-top: 40rpx; |
| | | |
| | | .radio { |
| | | transform: scale(0.667); |
| | | margin-right: 6rpx; |
| | | } |
| | | |
| | | .agreement-text { |
| | | font-size: 24rpx; |
| | | color: #868686; |
| | | |
| | | .link { |
| | | color: #333333; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .action-links { |
| | | margin-top: 88rpx; |
| | | display: flex; |